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

Item Stacking

Status
Not open for further replies.
Level 6
Joined
May 8, 2010
Messages
150
Heyy,
basically im making a mining system, and when the hero destroys/mines a rock it adds the material into the heroes inventory.. BUTT
if the hero already has this material, it will add a charge.. so it looks like hes carrying more than 1 type of rock.
This is the trigger i've got so far.
+ rep for help as always.
[trigger=trigger]MithrilItem
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Mithril
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Attacking unit) has an item of type Mithril) Equal to True
Then - Actions
Item - Set charges remaining in (Item carried by (Killing unit) of type Mithril) to ((Charges remaining in (Item carried by (Killing unit) of type Mithril)) + 1)
Else - Actions
Hero - Create Mithril and give it to (Killing unit)
[/trigger]
 
Status
Not open for further replies.
Top