• 🏆 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!

Detecting if a unit has an ability enabled

Status
Not open for further replies.
Level 4
Joined
Aug 30, 2005
Messages
94
I am trying to create a spell based on mana sheild that absorbs magical damage done to the hero and gives him life equal to the damage taken yet drains mana equal to the life gained, however I have been unable to find the trigger that enables me to check if the target of a spell has the set ability enabled and then go about giving the hero life. If anyone can help me find the tigger that checks if the unit has an ability enabled it would be greatly appreciated.
 
Level 8
Joined
Jul 28, 2004
Messages
258
You have to use orders, the order for turning on and off an ability is in the object editor, a switch type ability like defend has a use/turn on and a turn off order, when the unit is ordered the use/turn on order, u set a variable/handlevar/custom value (ur choise) to true, when he is ordered the turn off order, u set that variable/handlevar/custom value to false.
then u can find if the unit has that ability enabled if his variable/handlevar/custom value is set to true.
 
Level 4
Joined
Aug 30, 2005
Messages
94
I don't need help tuning it on an off, what I need is a way to detect if it is activated or not.
 
Level 4
Joined
Aug 30, 2005
Messages
94
Pardon me, the fist time I read it I must have missed the last line and skimmed the first, thanks anyhow man.
 
Status
Not open for further replies.
Top