[General] Condition: Unit has an activated 'Defend'

Status
Not open for further replies.

Ardenian

A

Ardenian

How can I check in GUI/ GUIJASS whether a unit has 'Defend' activated ?
 

Ardenian

A

Ardenian

Hm, I think I understand, thanks. I prefer another work-around though.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
If you do not want to use boolean variable, there is another similar solution.When a unit orders "defend", add it an useless hidden ability and when "undefend"(or whatever order is) remove that ability.You can check if unit has ability to see its in defend state or not.
 

Ardenian

A

Ardenian

Thank you, I chose another approach, but this information is surely going to be useful for me in future times!
 

Ardenian

A

Ardenian

Thank you, I tried to find a solution without adding something new, like a variable or a unit group to my trigger, therefore I chose another solution ( looping through some stuff and adding unit-type requirement)
 

Ardenian

A

Ardenian

check if unit has buff defend?

I think there is one.
I thought so, too, but either I am too dumb or I did not see any. Manashield has one, but strangely Defend seems not to.

Defend has a Buff??!?
If so you SHOULD remove it, Ardenian, cuz it will tell the opponents that theyre being tricked.
Ah, the unit is invisible while it is under the activated Defend, so this would not be a problem, but thanks for paying attention :)

GetUnitCurrentOrder(Hero) == OrderId("defend").
It worked for me with "drain"...
The event is "A unit is issued an order with no target" (War3 Editor not with me atm).
The condition should be your OrderCondition (in this case, it's "defend" string for activation and "undefend" string for deactivation).
I use this for the initial check, if the ability is casted, but I need to know whether it is activated when other abilities are casted.
Chaosy said:
Checking for the buff is the best solution here. Provided that he didn't remove the buff from the default ability.
I did not find a buff for Defend, there is also no initial for the default ability for me. I don't know, I tried to add a custom one based on Manashield's one for Defend, but it did not work, afaik ( only checked for the visible icon, but not whether it triggers)
 
Status
Not open for further replies.
Top