9
3

NaturalSelection.lua 981 B

1234567891011121314151617181920212223242526272829303132
  1. --[[
  2. Script Name : Spells/Scout/Predator/Ranger/NaturalSelection.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.03.10 07:03:13
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- You must be in stealth to use this!
  10. if not IsStealthed(Caster) then
  11. SendMessage(Caster, "You must be in stealth to use this!", "yellow")
  12. end
  13. -- Requires bow
  14. local item = GetEquippedItemBySlot(Caster, 16)
  15. if not item or GetItemType(item) ~= 2 then
  16. -- no item or item is not a ranged item (no way to determine different range items currently)
  17. return false, 68
  18. end
  19. return true
  20. end
  21. function cast(Caster, Target, MinVal, MaxVal)
  22. -- Inflicts 184 - 308 ranged damage on targets in Area of Effect
  23. if MaxVal ~= nil and MinVal < MaxVal then
  24. SpellDamage(Target, 0, math.random(MinVal, MaxVal))
  25. else
  26. SpellDamage(Target, 0, MinVal)
  27. end
  28. end