I am trying to make an ability that if a unit is attacked and they have a specific buff then 50% of the time the unit with the buff takes no damage and the attacking unit damages himsekf with the damage that was going to hurt the unit with the buff, her eis what I have and it isn't working.
I took out the % chance for testing purposes.
Code:
Untitled Trigger 001
Events
Advanced - Any unit takes damage
Conditions
((Triggering unit) has buff Countering ) Equal to True
Actions
Set ROBUNE = (Damage source)
Unit - Set life of ROBUNE to ((Life of ROBUNE) - (Damage taken))
Special Effect - Create a special effect attached to the overhead of ROBUNE using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
Special Effect - Destroy (Last created special effect)
I took out the % chance for testing purposes.