StormofArrows.lua 816 B

12345678910111213141516171819202122232425262728
  1. --[[
  2. Script Name : Spells/Scout/Predator/Ranger/StormofArrows.lua
  3. Script Author : neatz09
  4. Script Date : 2019.10.06 11:10:50
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- Requires bow
  10. local item = GetEquippedItemBySlot(Caster, 16)
  11. if not item or GetItemType(item) ~= 2 then
  12. -- no item or item is not a ranged item (no way to determine different range items currently)
  13. return false, 68
  14. end
  15. return true
  16. end
  17. -- Inflicts 602 - 1003 ranged damage on target encounter
  18. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  19. if MaxVal ~= nil and MinVal < MaxVal then
  20. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  21. else
  22. SpellDamage(Target, DmgType, MinVal)
  23. end
  24. end