9
3

RangersBlade.lua 935 B

1234567891011121314151617181920212223242526272829303132
  1. --[[
  2. Script Name : Spells/Scout/Predator/Ranger/RangersBlade.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.03.10 06:03:48
  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) and not IsBehind(Caster, Target) then
  16. SendMessage(Caster, "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 153 - 256 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