• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

gaining mana on hit

Status
Not open for further replies.
Level 1
Joined
Oct 24, 2015
Messages
5
Hi! I'm making a map where my units are running along a set path. When they get hurt I want them to gain 1 mana each time they get hit. I've been trying with the trigger editor a bit but I can't seem to get it right.
 
Level 9
Joined
Apr 23, 2011
Messages
527
for the event, you'd need a damage detection system. try finding one from the spells section. i've never used one so i don't really know exactly how to apply it.

use this action for adding mana:
  • Unit - Set mana of unitvar to ((Mana of unitvar) + 1.00)
unitvar being whatever the name of your unit variable
1.00 being the amount you wish to add
 
Level 1
Joined
Oct 24, 2015
Messages
5
Since this unit is spawning constantly I can't use a specific unit variable, as then only one of the many units gets the effect. This is what I've come up with so far:

  • Events
  • Unit - A unit Is attacked
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (else Action)
  • If -Conditions
  • Unit-type of (triggering unit)) Equals to Xen-pie
  • Then - Actions
  • Unit - Set mana of (triggering unit) to 1.00
  • Else - Actions
  • Do nothing
Xen-pie = my unit (it's a pun, yes yes)

What I'm not sure of is how I should make this line work for me:
  • Unit - Set mana of (triggering unit) to 1.00
As of right now all the units (Xen-pies) actually get one mana if they get attacked, which is just as planned, however they do not get more then one mana, as the trigger is "set mana" and not "add mana" if I put it like that.

Any advice?
 
Level 12
Joined
Dec 11, 2014
Messages
666
  • Actions
    • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 1.00)
Also use Damage Detection System (GUI Friendly(You can find it here on Hive) to make it only when they are damaged and not when they get attacked (There is a difference)
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
Status
Not open for further replies.
Top