Jump to content
  • 0

How to make chance below 1% with this script?


AHMADSHIDQI

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   1
  • Joined:  02/18/12
  • Last Seen:  

function	script	gacha1	{
	setarray .i1[1],909,908,521,575,512,531,558,533,514; // Common Items
	set .i1rand,rand(1,9); // Randomize Common Items; just change max amount if you add items
	setarray .i2[1],40740,40929,40777,40786,40776,40785,40517,40590; // Rare Items
	set .i2rand,rand(1,8); // Randomize Rare Items; just change max amount if you add items
	setarray .i3[1],41161,41156,20500,20727,40591; // Super Rare Items
	set .i3rand,rand(1,5); //Randomize Super Rare Items; just change max amount if you add items
	setarray .i4[1],24004,24010; // Hyper Rare Items
	set .i4rand,rand(1,2); //Randomize Super Rare Items; just change max amount if you add items
	set .chance, rand(100);


		// Hyper Rare Item
		if (.chance < 1){
		getitem .i4[.i4rand],1;
		announce "["+strcharinfo(0)+"] won a ["+getitemname(.i4[.i4rand])+"] super rare.",0;
		end;
		} 

		// Super Rare Item
		else if (.chance < 4){
		getitem .i3[.i3rand],1;
		announce "["+strcharinfo(0)+"] won a ["+getitemname(.i3[.i3rand])+"] rare.",0;
		end;
		} 

		// Rare Item
		else if (.chance < 15){
		getitem .i2[.i2rand],1;
		announce "["+strcharinfo(0)+"] won a ["+getitemname(.i2[.i2rand])+"] ga begitu rare.",0;
		end;
		} 

		// Common Items
		else {
		getitem .i1[.i1rand],1;
		end; 
		}
}

I want to make the "Hyper Rare Item" become 0,5% chance.
how can i make it like that?
please help, thanks a lot

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  171
  • Reputation:   68
  • Joined:  10/25/20
  • Last Seen:  

function	script	gacha1	{
	setarray .i1[1],909,908,521,575,512,531,558,533,514; // Common Items
	set .i1rand,rand(1,9); // Randomize Common Items; just change max amount if you add items
	setarray .i2[1],40740,40929,40777,40786,40776,40785,40517,40590; // Rare Items
	set .i2rand,rand(1,8); // Randomize Rare Items; just change max amount if you add items
	setarray .i3[1],41161,41156,20500,20727,40591; // Super Rare Items
	set .i3rand,rand(1,5); //Randomize Super Rare Items; just change max amount if you add items
	setarray .i4[1],24004,24010; // Hyper Rare Items
	set .i4rand,rand(1,2); //Randomize Super Rare Items; just change max amount if you add items
	set .chance, rand(100);


		// Hyper Rare Item
		if (rand(1000) < 5){
		getitem .i4[.i4rand],1;
		announce "["+strcharinfo(0)+"] won a ["+getitemname(.i4[.i4rand])+"] super rare.",0;
		end;
		} 

		// Super Rare Item
		else if (.chance < 4){
		getitem .i3[.i3rand],1;
		announce "["+strcharinfo(0)+"] won a ["+getitemname(.i3[.i3rand])+"] rare.",0;
		end;
		} 

		// Rare Item
		else if (.chance < 15){
		getitem .i2[.i2rand],1;
		announce "["+strcharinfo(0)+"] won a ["+getitemname(.i2[.i2rand])+"] ga begitu rare.",0;
		end;
		} 

		// Common Items
		else {
		getitem .i1[.i1rand],1;
		end; 
		}
}

 

changes

if (.chance < 1){

to

if (rand(1000) < 5){

 

if (rand(1000) < 5) = 0.50%

if (rand(1000) < 1) = 0.10%

if (rand(1000) < 10) = 1.00%
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...