- Joined
- Mar 24, 2013
- Messages
- 1,105
Hello, I'm trying to make a damage "block" ability that upon activation it will "prevent" damage to the unit, by prevent I mean give it back the hp it would lose from damage. It technically WORKS as of now (except when the caster is full hp (but I'm not worried about that), but for some reason the caster still seems to take ~ about 2 damage or so but I'm not sure why. Thanks!
-
Protection
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Protection
-
Actions
- Set Protection_Caster = (Casting unit)
- Set Protection_CasterHP = (Life of Protection_Caster)
- Trigger - Add to Protection 2 <gen> the event (Unit - Protection_Caster Takes damage)
- Trigger - Turn on Protection 2 <gen>
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Real((Level of Protection for Protection_Caster))) Equal to 1.00
-
Then - Actions
- Wait 5.00 seconds
- Else - Actions
-
If - Conditions
- Trigger - Turn off Protection 2 <gen>
-
Events
-
Protection 2
- Events
- Conditions
-
Actions
- Unit - Set life of Protection_Caster to (Protection_CasterHP + ((Damage taken))