Reborn Posted April 19, 2019 Group: Members Topic Count: 104 Topics Per Day: 0.02 Content Count: 290 Reputation: 3 Joined: 09/29/13 Last Seen: December 28, 2024 Share Posted April 19, 2019 Hello everyone. Can anyone help me make this script? What I need to do is this. The player will require item ID 501 for them to play this npc. setarray .itemReward[0], ItemID, ItemChance, ... setarray .itemReward[0],501,10,502,20,503,30,504,40,505,50; The player will get one item reward depending on the chances that they will get. Rare item will have small chance only. Quote Link to comment Share on other sites More sharing options...
0 HD Scripts Posted April 19, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 184 Reputation: 15 Joined: 06/10/12 Last Seen: 9 hours ago Share Posted April 19, 2019 try this https://rathena.org/board/topic/117555-item-x-or-item-y-receive-item-z/ Quote Link to comment Share on other sites More sharing options...
0 Sakurada Posted April 19, 2019 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 148 Reputation: 18 Joined: 03/03/19 Last Seen: December 12, 2024 Share Posted April 19, 2019 (edited) prontera,156,187,2 script Valkyrie#1 4_F_LGTGIRL,{ if (countitem(501) >= 1) { delitem 501,1; @chancezz = rand(1, 100); mes "ok lets see"; if (@chancezz <= 50) { mes "You got the common prize!"; getitem 501, 2; close; end; } if (@chancezz >= 80) { mes "You got the rare prize!"; getitem 501, 12; close; end; } if (@chancezz >= 51) { mes "You got the uncommon prize!"; getitem 501, 5; close; end; } } mes "Sorry no potions, no items"; close; end; } Well i tried my best It works at least https://github.com/rathena/rathena/blob/master/npc/other/comodo_gambling.txt Edited April 19, 2019 by Sakurada Quote Link to comment Share on other sites More sharing options...
0 Royr Posted April 19, 2019 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 90 Reputation: 34 Joined: 10/01/18 Last Seen: January 9, 2023 Share Posted April 19, 2019 5 hours ago, neXus said: Hello everyone. Can anyone help me make this script? What I need to do is this. The player will require item ID 501 for them to play this npc. setarray .itemReward[0], ItemID, ItemChance, ... setarray .itemReward[0],501,10,502,20,503,30,504,40,505,50; The player will get one item reward depending on the chances that they will get. Rare item will have small chance only. Raw Script:Lucky Gambler prontera.gat, 155, 185, 5 script Lucky Gambler 757,{ /* Note: Calculations: 100/50 = 2 so 2 is 50% */ // Required Item .@item_ID = 501; // .@item_List[0],<rates>,<item_id>,......... setarray .@item_List[0], 2,5738, 20,5443, 25,2294, 30,5509, 50,5150 ; setarray .@item_Ann[0], 5738, 5443, 2294, 5509, 5150 ; mes "Do you want to use your "+getitemname( .@item_ID )+" to try and get something valuable items."; next; if( select("- Yes:- No")-1 ) close; if( !countitem( .@item_ID ) ) { mes "You don't have any "+getitemname( .@item_ID )+"."; mes "Please come back to me if you have it already."; } else { delitem .@item_ID,1; for( .@j = 0; .@j < getarraysize(.@item_List); .@j+= 2 ) { if( rand(.@item_List[.@j]) == 1 ) { getitem( .@item_List[.@j+1] ),1; mes "Congratulations!"; for( .@i = 0; .@i < getarraysize(.@item_List); .@i++ ) { if( .@item_List[.@j+1] == .@item_Ann[.@i] ) { announce "[ Lucky Gambler ]: Player " + strcharinfo(0) +" has obtained "+ ((.@item_List[.@j]>=50)?"'Low'":"'High'") +" "+getitemname( .@item_List[.@j+1] )+" with ["+ (100/.@item_List[.@j]) +"%] Chance.",bc_all,0xBA55D3; } } specialeffect 154; close; } } specialeffect 155; mes "It's failed, sorry."; } close; } Quote Link to comment Share on other sites More sharing options...
0 Skorm Posted April 20, 2019 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted April 20, 2019 14 hours ago, neXus said: Hello everyone. Can anyone help me make this script? What I need to do is this. The player will require item ID 501 for them to play this npc. setarray .itemReward[0], ItemID, ItemChance, ... setarray .itemReward[0],501,10,502,20,503,30,504,40,505,50; The player will get one item reward depending on the chances that they will get. Rare item will have small chance only. @AnnieRuru Made a fantastic post with three excellent ways on how to do this already... Quote Link to comment Share on other sites More sharing options...
Question
Reborn
Hello everyone. Can anyone help me make this script?
What I need to do is this.
The player will require item ID 501 for them to play this npc.
setarray .itemReward[0], ItemID, ItemChance, ...
setarray .itemReward[0],501,10,502,20,503,30,504,40,505,50;
The player will get one item reward depending on the chances that they will get. Rare item will have small chance only.
Link to comment
Share on other sites
4 answers 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.