Eviscerate.lua 906 B

1234567891011121314151617181920212223242526272829303132
  1. --[[
  2. Script Name : Spells/Scout/Predator/Assassin/Eviscerate.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.04.17 04:04:33
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- You must be sneaking to use this ability.
  10. if not IsStealthed(Caster) then
  11. SendMessage(Caster, "You must be sneaking to use this ability.", "yellow")
  12. return false
  13. end
  14. -- Must be flanking or behind
  15. if not IsFlanking(Caster, Target) then
  16. SendMessage(Caster, "You must be flanking or behind", "yellow")
  17. return false
  18. end
  19. return true
  20. end
  21. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  22. -- Inflicts 144 - 241 melee damage on target
  23. if MaxVal ~= nil and MinVal < MaxVal then
  24. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  25. else
  26. SpellDamage(Target, DmgType, MinVal)
  27. end
  28. end