Jump to content
  • 0

Custom Box Script Rate


uDe

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

http://rathena.org/board/topic/78263-scripting-faqtipstricks/

this topic show a way for you to calculate rate..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  10/31/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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
Link to comment
Share on other sites

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.

×
×
  • Create New...