Warcraft III resources & community, 2003–2006 · archived

A unit is attacked with buff

6 posts
#1

A unit is attacked with buff

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)


I took out the % chance for testing purposes.
#2
Because it is working all the time right? I don't see any other error. You just need to add to the conditions this condition:

(Random Integer between 1 and 2) is equal to 1

It may the event's fault, but I never tried WEU so it might be the trigger's fault.

~Daelin
#3

Re: A unit is attacked with buff

KeigaI took out the % chance for testing purposes.


Daelin, you didn't read properly. >_>
#4
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.
#5
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?
#6
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...

~Daelin