Smiley33 Posted May 17, 2024 Group: Members Topic Count: 8 Topics Per Day: 0.02 Content Count: 18 Reputation: 0 Joined: 02/21/24 Last Seen: June 18, 2024 Share Posted May 17, 2024 NPC that gives random cards for amount of 1m per roll normal monster 100% chance and 10% chance for mini monster cards that i can add or remove cards thanks in advance Quote Link to comment Share on other sites More sharing options...
0 Poring King Posted June 1, 2024 Group: Members Topic Count: 63 Topics Per Day: 0.02 Content Count: 1016 Reputation: 191 Joined: 11/27/14 Last Seen: February 15 Share Posted June 1, 2024 I go that to my github. but here is your request i added a boss chance too . The code is user friendly so you can customize it with your desire . If it helps make sure to up my response so other player will know that the post is solve prontera,155,185,5 script Random Card NPC 100,{ .@zeny_cost = 1000000; // Zeny cost per roll .@normal_chance = 89; // Normal monster card chance (89%) .@mini_chance = 10; // Mini monster card chance (10%) .@boss_chance = 1; // Boss card chance (1%) menu "Welcome to the Random Card NPC! What would you like to do?", "Roll for a random card (" + .@zeny_cost + " Zeny)", Roll, "Nevermind", Quit; OnInit: setarray .@normal_cards, 4001, 4002, 4003; // Example normal monster card IDs (You can add or remove as needed) setarray .@mini_cards, 4004, 4005, 4006; // Example mini monster card IDs (You can add or remove as needed) setarray .@boss_cards, 4007, 4008, 4009; // Example boss monster card IDs (You can add or remove as needed) end; Roll: if (countitem(zeny) < .@zeny_cost) { mes "[Random Card NPC]"; mes "You don't have enough Zeny."; close; } delitem zeny, .@zeny_cost; .@roll = rand(100); // Roll a random number between 0 and 99 if (.@roll < .@normal_chance) { // Player gets a normal monster card .@card_id = .@normal_cards[rand(getarraysize(.@normal_cards))]; getitem .@card_id, 1; mes "[Random Card NPC]"; mes "Congratulations! You got a normal monster card."; close; } else if (.@roll < .@normal_chance + .@mini_chance) { // Player gets a mini monster card .@card_id = .@mini_cards[rand(getarraysize(.@mini_cards))]; getitem .@card_id, 1; mes "[Random Card NPC]"; mes "Congratulations! You got a mini monster card."; close; } else if (.@roll < .@normal_chance + .@mini_chance + .@boss_chance) { // Player gets a boss monster card .@card_id = .@boss_cards[rand(getarraysize(.@boss_cards))]; getitem .@card_id, 1; mes "[Random Card NPC]"; mes "Congratulations! You got a boss monster card."; close; } else { // Player gets nothing mes "[Random Card NPC]"; mes "Sorry, you didn't get any card this time."; close; } Quit: mes "[Random Card NPC]"; mes "Come back anytime if you want to try your luck again!"; close; } Quote Link to comment Share on other sites More sharing options...
Question
Smiley33
NPC that gives random cards for amount of 1m per roll normal monster 100% chance and 10% chance for mini monster cards that i can add or remove cards thanks in advance
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.