Jump to content
  • 0
MuffinEater

R>Randomize

Question

NPC Stats Randomizer that requirements red pots and 10mil zeny that can give Random value  upto 200 of at random combination of (str,agi,vit,int,dex,luk) and low chance 5% for all stats 100 upto 500 with corresponding icon buff of this  

Quote

image.png.8b5099c359013f996e5e78586384d625.png

 

TIA.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

something like this ?

prontera,155,181,5	script	Sample	757,{
	mes "You need 20 "+getitemname(501);
	mes "You need "+F_InsertComma(10000000)+" Zeny";
	if (select("Confirm", "Cancel") == 1) {
		if (countitem(501) >= 20 && Zeny >= 10000000) {
			delitem 501, 20;
			Zeny -= 10000000;
			// random assign 200 stats
			for ([email protected] = 0; [email protected] <= 200; [email protected]++) {
				[email protected] = rand(bStr, bLuk);
				[email protected][[email protected] - bStr]++;
			}
			// 5% to get 100 stats each.
			for ([email protected] = bStr; [email protected] <= bLuk; [email protected]++) {
				if (rand(100) < 5)
					[email protected][[email protected] - bStr] = 100;
			}
			for ([email protected] = bStr; [email protected] <= bLuk; [email protected]++)
				sc_start (SC_STRFOOD + [email protected] - 1), 1200000, [email protected][[email protected] - bStr];
		}
	}
	close;
}

 

Link to comment
Share on other sites

  • 0

 

 is there a way to be an item doing this function? example: a Potion.

Link to comment
Share on other sites

  • 0
1 hour ago, Krampus said:

 

 is there a way to be an item doing this function? example: a Potion.

item_db.yml:

  - Id: 1234567
    AegisName: MUFFIN_EATER
    Name: Muffin Eater
    Type: Healing
    Weight: 10
    Script: |
     callfunc "Func_Randomizer";

Function Script:

function	script	Func_Randomizer	{
	for([email protected] = 0; [email protected] <= 200; [email protected]++) {
		[email protected] = rand(bStr, bLuk);
		[email protected][[email protected] - bStr]++;
	}
	for([email protected] = bStr; [email protected] <= bLuk; [email protected]++) {
		if (rand(100) < 5) // 5% Chances
			[email protected][[email protected] - bStr] = 100;
	}
	for( [email protected] = bStr; [email protected] <= bLuk; [email protected]++ ) {
		sc_start (SC_STRFOOD + [email protected] - 1), 1200000, [email protected][[email protected] - bStr];
	}
	end;
}

Credits to Above

Didn't test, try it for yourself.

Link to comment
Share on other sites

  • 0
Posted (edited)
On 5/1/2022 at 1:28 PM, Emistry said:

something like this ?

prontera,155,181,5	script	Sample	757,{
	mes "You need 20 "+getitemname(501);
	mes "You need "+F_InsertComma(10000000)+" Zeny";
	if (select("Confirm", "Cancel") == 1) {
		if (countitem(501) >= 20 && Zeny >= 10000000) {
			delitem 501, 20;
			Zeny -= 10000000;
			// random assign 200 stats
			for ([email protected] = 0; [email protected] <= 200; [email protected]++) {
				[email protected] = rand(bStr, bLuk);
				[email protected][[email protected] - bStr]++;
			}
			// 5% to get 100 stats each.
			for ([email protected] = bStr; [email protected] <= bLuk; [email protected]++) {
				if (rand(100) < 5)
					[email protected][[email protected] - bStr] = 100;
			}
			for ([email protected] = bStr; [email protected] <= bLuk; [email protected]++)
				sc_start (SC_STRFOOD + [email protected] - 1), 1200000, [email protected][[email protected] - bStr];
		}
	}
	close;
}

 

the stats are not working and the stats icon is different

Untitled.jpg

Quote

image.png.7dc58b906e0130a93f80eb2b10b966e5.png into this

 

 

Edited by MuffinEater
Link to comment
Share on other sites

  • 0
sc_start (SC_STRFOOD + [email protected] - 1), 1200000, [email protected][[email protected] - bStr];

change to

sc_start (SC_STRFOOD + [email protected] - 1 - bStr), 1200000, [email protected][[email protected] - bStr];

 

Link to comment
Share on other sites

  • 0
On 06/05/2022 at 00:04, RikuTzy said:

item_db.yml:

Script de função:


			

Credits to Above

Não testei, experimente você mesmo.

thanks
I will test it when I get back from work

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.