Eviscerate.lua 881 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. if not IsFlanking(Caster, Target) then
  15. SendMessage(Caster, "Must be flanking or behind", "yellow")
  16. return false
  17. end
  18. return true
  19. end
  20. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  21. -- Inflicts 144 - 241 melee damage on target
  22. if MaxVal ~= nil and MinVal < MaxVal then
  23. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  24. else
  25. SpellDamage(Target, DmgType, MinVal)
  26. end
  27. end