9
3

Intercept.lua 943 B

12345678910111213141516171819202122232425262728
  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. -- 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. -- 100% chance to intercept all damage on target.
  17. -- On a successful intercept caster takes 50% of attack damage, target takes 75% of attack damage.
  18. -- Spell ends after 1 successful intercept.
  19. end
  20. end
  21. function remove(Caster, Target)
  22. -- code to remove the spell
  23. end