Is there an event that detects a unit auto-activating an ability?
or am I understanding the question wrongly here
what I meant is that when unit auto-activates an ability, the unit didn't start casting any ability yet, it can, but not necessarily
so the event - unit begins casting an ability is not the case here, but can be
although creating attachment when the unit casts an ability could be done in the said way, and Art - Caster attachment also gives the same result, I think what krainert is asking for here is to create special effects when the ability is auto-activated,
Correct me if I am wrong here, krainert
you asks very good questions and all of them, so far, are also what I wanted to know how to solve
edited
got it
from this thread
Trigger:
- detect
- Events
- Unit - A unit Is issued an order with no target
- Conditions
- Actions
- Game - Display to (All players) the text: A
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Issued order) Equal to (Order(flamingarrows))
- Then - Actions
- Game - Display to (All players) the text: B
- Special Effect - Create a special effect attached to the overhead of (Triggering unit) using units\critters\Albatross\Albatross.mdl
- Set speceff[1] = (Last created special effect)
- Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Orc\Ensnare\EnsnareMissile.mdl
- Set speceff[2] = (Last created special effect)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Issued order) Equal to (Order(unflamingarrows))
- Then - Actions
- Game - Display to (All players) the text: C
- Special Effect - Destroy speceff[1]
- Special Effect - Destroy speceff[2]
- Else - Actions
map attached
trigger name : Detect
Bear in mind that this method only creates/removes the effect when it's ordered on/off by the player, not when the ability is enabled/disabled by other means, eg. when running out of mana or being silenced. Hopefully that's OK with you, because it's not so easy to handle those other cases...believe me, I've tried.
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) has buff Empowered Kinetics ) Equal to True
Actions
Set _Ability = Empowered Kinetics
Set _Unit = (Attacking unit)
Set _Real = (Mana of _Unit)
Set _Integer = (Level of _Ability for _Unit)
Set _Real2 = ((Power(2.00, (Real((_Integer - 1))))) x 10.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
_Real Greater than or equal to _Real2
Then - Actions
Set _AttackType = Spells
Set _DamageType = Force
Set _Unit2 = (Attacked unit)
Set _Real3 = ((Power(2.00, (Real((_Integer - 1))))) x 20.00)
Unit - Set mana of _Unit to (_Real - _Real2)
Unit - Cause _Unit to damage _Unit2, dealing _Real3 damage of attack type _AttackType and damage type _DamageType
Else - Actions