Hello, I'm trying to make the WoW priest ability Power Word: Shield. This is how I did it:
My problems:
Shield works as it should the first time it is casted at a unit. The next time the shield seems to have less HP. Another problem is that the maximum HP of the target of the shield is lowered by like 12. The ''Max HP'' spell is a item hit point spell with 99999999 hit point bonus.
Trigger:
- Power Word Shield
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Power Word: Shield
- Actions
- Set Caster = (Triggering unit)
- Set Target = (Target unit of ability being cast)
- Set PowerWordShield_ShieldHP[(Custom value of Target)] = ((Max life of Caster) x 0.35)
- Trigger - Add to Power Word Shield Damage1 <gen> the event (Unit - (Target unit of ability being cast) Takes damage)
- Events
Trigger:
- Power Word Shield Damage1
- Events
- Conditions
- ((Triggering unit) has buff Power Word: Shield ) Equal to True
- Actions
- Unit - Add Max HP to (Triggering unit)
- Unit Group - Add (Triggering unit) to PowerWordShield_Group
- Set PowerWordShield_DamageSource[(Custom value of (Triggering unit))] = (Damage source)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- PowerWordShield_ShieldHP[(Custom value of (Triggering unit))] Greater than (Damage taken)
- Then - Actions
- Set PowerWordShield_Damage[(Custom value of (Triggering unit))] = 0.00
- Set PowerWordShield_ShieldHP[(Custom value of (Triggering unit))] = (PowerWordShield_ShieldHP[(Custom value of (Triggering unit))] - (Damage taken))
- Else - Actions
- Set PowerWordShield_Damage[(Custom value of (Triggering unit))] = ((Damage taken) - PowerWordShield_ShieldHP[(Custom value of (Triggering unit))])
- Set PowerWordShield_ShieldHP[(Custom value of (Triggering unit))] = 0.00
- Unit - Remove Power Word: Shield buff from (Triggering unit)
- If - Conditions
- Countdown Timer - Start PowerWordShield_Timer as a One-shot timer that will expire in 0.00 seconds
Trigger:
- Power Word Shield Damage2
- Events
- Time - PowerWordShield_Timer expires
- Conditions
- Actions
- Trigger - Turn off Power Word Shield Damage1 <gen>
- Unit Group - Pick every unit in PowerWordShield_Group and do (Actions)
- Loop - Actions
- Unit - Remove Max HP from (Picked unit)
- Unit Group - Remove (Picked unit) from PowerWordShield_Group
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- PowerWordShield_ShieldHP[(Custom value of (Picked unit))] Less than PowerWordShield_Damage[(Custom value of (Picked unit))]
- Then - Actions
- Unit - Cause PowerWordShield_DamageSource[(Custom value of (Picked unit))] to damage (Picked unit), dealing PowerWordShield_Damage[(Custom value of (Picked unit))] damage of attack type Chaos and damage type Force
- Set PowerWordShield_Damage[(Custom value of (Triggering unit))] = 0.00
- Else - Actions
- If - Conditions
- Loop - Actions
- Trigger - Turn on Power Word Shield Damage1 <gen>
- Events
My problems:
Shield works as it should the first time it is casted at a unit. The next time the shield seems to have less HP. Another problem is that the maximum HP of the target of the shield is lowered by like 12. The ''Max HP'' spell is a item hit point spell with 99999999 hit point bonus.