Jump to content
  • 0

Assistance on this lotti like script


Gouki

Question


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.06
  • Content Count:  241
  • Reputation:   11
  • Joined:  08/12/20
  • Last Seen:  

Hi,

This script works perfectly well, kudos to the owner of this script, I forgot who I apologize but just wondering if we can make the Default prize  on random as well?
For example:
Set default prize on random of red, yellow, white potion. instead of 1 default prize of red potion only.

Gotta make     setarray .@Default[0],19578,1;  random, not just the 19578.

function	script	Get_MysteryBox	{
	set .@Total,7;
	//<%>,<ItemID>,<Amount>
	setarray .@P1[0],50,19543,1;
	setarray .@P2[0],90,19525,1;
	setarray .@P3[0],90,31171,1;
	setarray .@P4[0],90,19620,1;
	setarray .@P5[0],90,19527,1;
	setarray .@P6[0],90,19733,1;
	setarray .@P7[0],90,20057,1;
	setarray .@Default[0],19578,1;
	set .@i, rand(1,.@Total);
	if (rand(1,100) > getd(".@P"+.@i+"[0]"))
	{
		for(set .@j,0; .@j<getarraysize(.@Default); set .@j,.@j+2)
		{
			getitem .@Default[.@j], .@Default[.@j+1];
			if(!.@k[0])
				setarray .@k[0], .@Default[.@j], .@Default[.@j+1];
		}
	}
	else{
		for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2)
		{
			getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]");
			if (!.@k[0])
			{
				set .@gz,.@i;
				setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]");
				break;
			}
		}
	}
	if(1<=.@gz&&.@gz<=1)
		announce "Congratulations! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from the Mystery Costume Box!",0;
	specialeffect2 248;
	close;
}

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

	setarray .@P1[0],50,501,1;
	setarray .@P2[0],90,501,1;
	setarray .@P3[0],90,501,1;
	setarray .@P4[0],90,501,1;
	setarray .@P5[0],90,501,1;
	setarray .@P6[0],90,501,1;
	setarray .@P7[0],90,501,1;
	setarray .@Default[0],502,1,503,1,504,1,505,1;

when it hit .@Default, this line will give me a whole set of item ID 502,503,504,505 ...  4 items

if you want random then go F_Rand as usual

setarray .@Default[0],F_Rand(502,503,504,505),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...