Jump to content
  • 0

Custom Box Script Rate


Question

Posted (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 by uDe

3 answers to this question

Recommended Posts

Posted (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 by Phenomena
Posted

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..

  • Love 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...