HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item Stock question.

11-07-2007, 09:07 PM#1
cohadar
How can I make items to not replenish their stock.

For example I want to have only 3 swords in shop,
and once they are sold that is it, no more.
11-07-2007, 09:20 PM#2
TheDamien
Collapse JASS:
native AddItemToStock takes unit whichUnit, integer itemId, integer currentStock, integer stockMax returns nothing

Give your shop the sell items ability, and add the swords with "AddItemToStock". When your hero buys a sword, you can use AddItemToStock again to change the max stock from 3 ... 2 ... 1. Remove the sword item completely with RemoveItemFromStock when the last sword is bought.
11-07-2007, 09:24 PM#3
cohadar
You totally did not understand my question...
11-07-2007, 09:28 PM#4
TheDamien
Quote:
Originally Posted by cohadar
You totally did not understand my question...

You totally did not understand my answer.

It is the only way I know to stop a unit from replenishing stock. You can put the max replenish time, but you can't stop it from replenishing altogether.

Edit: By the way, you need a wait or a 0.00 duration timer between the bought item Event and the changing of the max stock. Also make sure the shop is not owned by a neutral player.
11-07-2007, 09:42 PM#5
cohadar
It worked. (after a better explanation)

Here have some rep :P