Jump to content
  • 0

Random item npc


icegrave01

Question


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   2
  • Joined:  05/29/12
  • Last Seen:  

can i request a script for random item npc,

-it has a 24hrs cooldown

-random item like apple

-1 item per day

-10 to 50% chance of getting a item

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

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

prontera,155,181,5	script	Random Item	4_F_KAFRA1,{
	
	if ( #COOLDOWN > gettimetick(2) ) {
		mes "Come back again after 24 hours.";
	}
	else {
		if ( rand(100) < 50 ) {
			setarray .@item, 501,502,503,504,505;
			setarray .@amount, 10,20,30,40,50;
			.@index = rand( getarraysize( .@item ) );
			getitem .@item[.@index],.@amount[.@index];
			mes "Gained "+.@amount[.@index]+"x "+getitemname( .@item[.@index] )+".";
		}
		else {
			mes "Failed to get any items.";
		}
		#COOLDOWN = gettimetick(2) + ( 24 * 3600 );
	}
	close;
}

Please clearly describe what you want and how it should work in the first post, and not keep demand for new changes when one already posted a solution prior to your original post request.

 

Link to comment
Share on other sites

  • 0

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

prontera,155,181,5	script	Random Item	4_F_KAFRA1,{
	
	if ( #COOLDOWN > gettimetick(2) ) {
		mes "Come back again after 24 hours.";
	}
	else {
		if ( rand(100) < 50 ) {
			.@item = F_Rand( 501,502,503,504,505 );
			getitem .@item,1;
			mes "Gained "+getitemname( .@item )+".";
		}
		else {
			mes "Failed to get any items.";
		}
		#COOLDOWN = gettimetick(2) + ( 24 * 3600 );
	}
	close;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   2
  • Joined:  05/29/12
  • Last Seen:  

On 3/11/2017 at 8:18 PM, Emistry said:

prontera,155,181,5	script	Random Item	4_F_KAFRA1,{
	
	if ( #COOLDOWN > gettimetick(2) ) {
		mes "Come back again after 24 hours.";
	}
	else {
		if ( rand(100) < 50 ) {
			.@item = F_Rand( 501,502,503,504,505 );
			getitem .@item,1;
			mes "Gained "+getitemname( .@item )+".";
		}
		else {
			mes "Failed to get any items.";
		}
		#COOLDOWN = gettimetick(2) + ( 24 * 3600 );
	}
	close;
}

 

Edit : Problem. i can't get the item when i click the npc. it should get any item 

How to add reward amount in this script? for example i got 5pcs from 501 item? Thank you Emistry!

Edited by icegrave01
Link to comment
Share on other sites

  • -3

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  09/06/15
  • Last Seen:  

On 3/11/2017 at 2:18 PM, Emistry said:

prontera,155,181,5	script	Random Item	4_F_KAFRA1,{
	
	if ( #COOLDOWN > gettimetick(2) ) {
		mes "Come back again after 24 hours.";
	}
	else {
		if ( rand(100) < 50 ) {
			.@item = F_Rand( 501,502,503,504,505 );
			getitem .@item,1;
			mes "Gained "+getitemname( .@item )+".";
		}
		else {
			mes "Failed to get any items.";
		}
		#COOLDOWN = gettimetick(2) + ( 24 * 3600 );
	}
	close;
}

 

Can you make it a prize each IP
Only 1 acc from ip

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