Jump to content
  • 0

Random Items at Random Prices


SovietBR

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  12/10/22
  • Last Seen:  

Hi, I'm really really new at programing, and I was wonder if anyone could help me with this:
I'm looking to make an NPC who sell 10 random items at random prices, but I want to chose all itens he can sell and the range price for every item. And he reset the sells every 12h and announce that are new itens available for the server. Something like:
 

Item pool: 

itemID/zeny (random at range):

756 /  500z - 1,000z

1260/ 1,000,000z - 2,500,000z

 2609/ 1,000z - 1,500z

4110/ 2,000,000z - 2,300,000z

13404/ 3,000,000z - 3,200,000z

4435/ 5,000,000z - 7,000,000z

 

And then the NPC sell:

itemID/Zeny

756/ 650z

13404/ 3,119,020z

2609/ 2,956,126z

 

Thanks in advance for anyone who look at this!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1

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


*npcshopadditem "<name>",<item id>,<price>{,<item id>,<price>{,<item id>,<price>{,...}}};
*npcshopadditem "<name>",<item id>,<price>,<stock>{,<item id>,<price>,<stock>{,<item id>,<price>,<stock>{,...}}};

This command will add more items at the end of the selling list for the
specified NPC shop or cashshop. If you specify an item already for sell, that item will
appear twice on the sell list.

The function returns 1 if shop was updated successfully, or 0 if not found.

NOTES:
 - That you cannot use -1 to specify default selling price!
 - If attached shop type is market shop, need an extra param after price, it's <stock>
   and make sure don't add duplication item! For unlimited stock use -1.
OnHour00:
	// reset the shop item list
	npcshopitem "shop_name", 909, 1;
	npcshopdelitem "shop_name", 909;
	
	// add item with random price
	npcshopadditem "shop_name", 756, rand(500, 1000);
	npcshopadditem "shop_name", 1260, rand(1000000, 2500000);
	npcshopadditem "shop_name", 2609, rand(1000, 1500);
	npcshopadditem "shop_name", 4110, rand(2000000, 2300000);
	npcshopadditem "shop_name", 13404, rand(3000000, 3200000);
	npcshopadditem "shop_name", 4435, rand(5000000, 7000000);
	end;
	

 

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