🏆 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!
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.
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
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.
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)
Using the event 'A unit is attacked' is not a good idea because even when the attack hasn't hit yet, it will still run the trigger thus, it is abusable. That's why you should use DDS like this
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.