• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to reduce item stock quantity

Status
Not open for further replies.

Vex

Vex

Level 3
Joined
Dec 1, 2007
Messages
33
Hi.

The question is simple. I have a neutral building that sell items. I want to remove N items from the stock of each type in that shop using triggers or jass. Like 'Healing Potion' with quantity 5 reduced to quantity 2 and stay like that (replenish rate set to 99999).

I know about the 'Neutral Building - Add/Remove items of type'. The problem with those, is that shortcut commands for buying items becomes unavailable. Players are supposed to buy different item-types fast, so shortcut commands is more important than stock reduction. Both would be nice though.

So if anyone knows of a way, no matter how complicated, I'd be grateful if you told me.

I have one possible solution that I don't want to use if possible. Create a unit with an inventory near the shop, wait for shop interaction, somehow force it to buy items then destroy them. Only way to do this as far as I know, is to create the unit for a user player, force the player to select the shop, then force it to press keyboard key's matching the item-types that should get their quantity reduced. Not a pretty way to do it.. If a non-user player could do this, it would be alot better.
 
Level 6
Joined
Sep 13, 2008
Messages
261
If it doesn't have to be jass or triggered, then you could just make a copy of the item and give it less stock in the object editor. Then put those items in your new shop.

If it does have to be jass or triggered then I can't help you.
 

Vex

Vex

Level 3
Joined
Dec 1, 2007
Messages
33
Didn't think about that possibility. Only thing is that it's 21 different item-types that should be able to have everything from 1 to 12 in stock.

Do you or anyone else happen to know the limit of custom objects and if there is separate limits for units, items, destructibles etc. or a total? If it's 'big enough', I'll go ahead and do it like that.

*Edit: nm, found out it was something like 7700 just for custom items :) Thanks for the help howl!
 
Status
Not open for further replies.
Top