9
3

Intercept.lua 1.1 KB

123456789101112131415161718192021222324252627282930
  1. --[[
  2. Script Name : Spells/Fighter/Intercept.lua
  3. Script Author : John Adams
  4. Script Date : 2013.08.10 02:08:36
  5. Script Notes : Intercept damage to Target --]]
  6. function cast(Caster, Target)
  7. local HalfMaxHP = GetMaxHP(Target) * .5
  8. local CurrentHP = GetHP(Target)
  9. --Say(Caster, "[DEVL: HalfMaxHP: " .. HalfMaxHP .. " CurrentHP: " .. CurrentHP)
  10. if CurrentHP <= HalfMaxHP then
  11. AddWard(0,0,0,0,25,0,50,2)
  12. -- 100% chance to intercept all damage on target.
  13. -- On a successful intercept caster takes 50% of attack damage, target takes 75% of attack damage.
  14. -- Spell ends after 2 successful intercepts.
  15. else
  16. AddWard(0,0,0,0,25,0,50,1)
  17. -- 100% chance to intercept all damage on target.
  18. -- On a successful intercept caster takes 50% of attack damage, target takes 75% of attack damage.
  19. -- Spell ends after 1 successful intercept.
  20. end
  21. end
  22. function remove(Caster, Target)
  23. RemoveWard()
  24. end