Intercept.lua 1020 B

12345678910111213141516171819202122232425262728293031
  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. --]]
  7. function cast(Caster, Target)
  8. local HalfMaxHP = GetMaxHP(Target) * .5
  9. local CurrentHP = GetHP(Target)
  10. --Say(Caster, "[DEVL: HalfMaxHP: " .. HalfMaxHP .. " CurrentHP: " .. CurrentHP)
  11. if CurrentHP <= HalfMaxHP then
  12. AddWard(0,0,0,0,25,0,50,2)
  13. -- 100% chance to intercept all damage on target.
  14. -- On a successful intercept caster takes 50% of attack damage, target takes 75% of attack damage.
  15. -- Spell ends after 2 successful intercepts.
  16. else
  17. AddWard(0,0,0,0,25,0,50,1)
  18. -- 100% chance to intercept all damage on target.
  19. -- On a successful intercept caster takes 50% of attack damage, target takes 75% of attack damage.
  20. -- Spell ends after 1 successful intercept.
  21. end
  22. end
  23. function remove(Caster, Target)
  24. RemoveWard()
  25. -- code to remove the spell
  26. end