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.
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)
Using WEU right? I also tried to get the damage when any unit takes damage but it didn't work for me either. I theory is that those functions does not work correctly.
Is it possible to do it without any unit takes damage? I tried to use a unit is attacked but I don't think damage taken works with a unit is attacked, so I guess this skill isn't possible?
It is, but you will probably need JASS, for the local triggers purpose. When an unit is attacked, you activate the trigger which checks if that unit is damaged by the unit with your skill. And then, the actions are the ones you mention... But unfortunately this works good only with JASS...