Jump to content
  • 0

How to make chance below 1% with this script?


Question

Posted
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

1 answer to this question

Recommended Posts

  • 0
Posted
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%

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