uDe Posted March 18, 2014 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 400 Reputation: 5 Joined: 12/05/11 Last Seen: September 27, 2015 Share Posted March 18, 2014 (edited) Hello guys.. Can you guys help me with this script.. function script CustomBox { setarray .BoxItems[0], 31799, 31823, set .Random, rand( getarraysize( .BoxItems ) ); getitem .BoxItems[ .Random ], 1; announce "Congratulations ["+strcharinfo(0)+"] for getting ["+getitemname(.BoxItems[ .Random ])+"] from Gift Box!!",0; end; } I need to add rate for getting those item.. Example : Item 31799 had 20% chance to get it; and Item 31823 had 70% chance to get it. EDIT : I'm using eAthena 3ceAM. Edited March 18, 2014 by uDe Quote Link to comment Share on other sites More sharing options...
Emistry Posted March 18, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 1 hour ago Share Posted March 18, 2014 http://rathena.org/board/topic/78263-scripting-faqtipstricks/ this topic show a way for you to calculate rate.. Quote Link to comment Share on other sites More sharing options...
Phenomena Posted March 18, 2014 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 94 Reputation: 4 Joined: 10/31/12 Last Seen: February 13, 2022 Share Posted March 18, 2014 (edited) Try use this: set .Random, rand(1,100); if( .Random <= 20 ) { getitem 31799, 1; announce "Congratulations ["+strcharinfo(0)+"] for getting ["+getitemname(31799)+"] from Gift Box!!",0; end; } if( .Random > 20 ) { getitem 31823, 1; announce "Congratulations ["+strcharinfo(0)+"] for getting ["+getitemname(31823)+"] from Gift Box!!",0; end; } Edited March 18, 2014 by Phenomena Quote Link to comment Share on other sites More sharing options...
uDe Posted March 18, 2014 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 400 Reputation: 5 Joined: 12/05/11 Last Seen: September 27, 2015 Author Share Posted March 18, 2014 http://rathena.org/board/topic/78263-scripting-faqtipstricks/ this topic show a way for you to calculate rate.. I'm using eAthena.. Can I refer that tutorial also? Try use this: set .Random, rand(1,100); if( .Random <= 20 ) { getitem 31799, 1; announce "Congratulations ["+strcharinfo(0)+"] for getting ["+getitemname(31799)+"] from Gift Box!!",0; end; } if( .Random > 20 ) { getitem 31823, 1; announce "Congratulations ["+strcharinfo(0)+"] for getting ["+getitemname(31799)+"] from Gift Box!!",0; end; } Thank you. I will try this also.. 1 Quote Link to comment Share on other sites More sharing options...
Question
uDe
Hello guys..
Can you guys help me with this script..
I need to add rate for getting those item..
Example :
Item 31799 had 20% chance to get it; and Item 31823 had 70% chance to get it.
EDIT : I'm using eAthena 3ceAM.
Edited by uDeLink to comment
Share on other sites
3 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.