Jump to content
  • 0

R>Randomize


MuffinEater

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  38
  • Reputation:   0
  • Joined:  03/15/16
  • Last Seen:  

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

7 answers to this question

Recommended Posts

  • 0

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

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 (.@i = 0; .@i <= 200; .@i++) {
				.@stat = rand(bStr, bLuk);
				.@stats[.@stat - bStr]++;
			}
			// 5% to get 100 stats each.
			for (.@i = bStr; .@i <= bLuk; .@i++) {
				if (rand(100) < 5)
					.@stats[.@stat - bStr] = 100;
			}
			for (.@i = bStr; .@i <= bLuk; .@i++)
				sc_start (SC_STRFOOD + .@i - 1), 1200000, .@stats[.@stat - bStr];
		}
	}
	close;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   8
  • Joined:  12/04/12
  • Last Seen:  

 

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  22
  • Reputation:   6
  • Joined:  03/17/21
  • Last Seen:  

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(.@i = 0; .@i <= 200; .@i++) {
		.@stat = rand(bStr, bLuk);
		.@stats[.@stat - bStr]++;
	}
	for(.@i = bStr; .@i <= bLuk; .@i++) {
		if (rand(100) < 5) // 5% Chances
			.@stats[.@stat - bStr] = 100;
	}
	for( .@i = bStr; .@i <= bLuk; .@i++ ) {
		sc_start (SC_STRFOOD + .@i - 1), 1200000, .@stats[.@stat - bStr];
	}
	end;
}

Credits to Above

Didn't test, try it for yourself.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  38
  • Reputation:   0
  • Joined:  03/15/16
  • Last Seen:  

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 (.@i = 0; .@i <= 200; .@i++) {
				.@stat = rand(bStr, bLuk);
				.@stats[.@stat - bStr]++;
			}
			// 5% to get 100 stats each.
			for (.@i = bStr; .@i <= bLuk; .@i++) {
				if (rand(100) < 5)
					.@stats[.@stat - bStr] = 100;
			}
			for (.@i = bStr; .@i <= bLuk; .@i++)
				sc_start (SC_STRFOOD + .@i - 1), 1200000, .@stats[.@stat - 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

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

sc_start (SC_STRFOOD + .@i - 1), 1200000, .@stats[.@stat - bStr];

change to

sc_start (SC_STRFOOD + .@i - 1 - bStr), 1200000, .@stats[.@stat - bStr];

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   8
  • Joined:  12/04/12
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  38
  • Reputation:   0
  • Joined:  03/15/16
  • Last Seen:  

On 5/7/2022 at 9:18 PM, Emistry said:
sc_start (SC_STRFOOD + .@i - 1), 1200000, .@stats[.@stat - bStr];

change to

sc_start (SC_STRFOOD + .@i - 1 - bStr), 1200000, .@stats[.@stat - bStr];

 

 

1st there is a timer for all stats ( How to make it permanent )

2nd once you get stats and talk again she will take the required item and zeny but wont give you stats. 

3rd there is no Luk on allstats

4th how to do this like this if random 1 stats either  1 of this "str,agi,vit,int,dex,luk" the stats you will get is random 1 to 100  and the allstats is only 100 or 200

thanks a lot

Quote

Untitled.thumb.jpg.49b86afc65dbc75c77f96698c48c0350.jpg

 

 

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