Warcraft III resources & community, 2003–2006 · archived

Detecting if a unit has an ability enabled

6 posts
#1

Detecting if a unit has an ability enabled

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.
#2
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.
#3
I don't need help tuning it on an off, what I need is a way to detect if it is activated or not.
#4
In Mana Shield case you can use the boolean condition
"unit has buff".
If the unit is with the mana shield enabled it will have the buff, then, I think it works. :D
#5
please re-read my post.
#6
Pardon me, the fist time I read it I must have missed the last line and skimmed the first, thanks anyhow man.