uDe Posted March 18, 2014 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
Emistry Posted March 18, 2014 Posted March 18, 2014 http://rathena.org/board/topic/78263-scripting-faqtipstricks/ this topic show a way for you to calculate rate.. Quote
Phenomena Posted March 18, 2014 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
uDe Posted March 18, 2014 Author 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
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 uDe3 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.