🏆 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!
Im creating an ability called Reversal Armor. it's supposed to give half the damage you take in mana. But i cant find any way to detect the damage taken.
Ok what you want is actually fairly simple, however it can only be detected by the Unit Specific Unit takes damage event. You can't use a Unit Generic Unit Event.
So basically you have to register the event on every unit that learns that ability. Yes this does leak if the heroes are disposable, but usually heroes tend not to be.
Set Up
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Reversal Armor
Actions
Trigger - Add to DoReversal <gen> the event (Unit - (Learning Hero) Takes damage)
DoReversal
Events
Conditions
Actions
Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + ((Damage taken) x 0.50))
you could if you used custom script: set udg_unit = GetTriggerUnit()
where udg_unit is a global variable called unit then just use unit whenever referring to the attacked unit.
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.