• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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