9
3

MiracleShot.lua 938 B

12345678910111213141516171819202122232425262728293031323334
  1. --[[
  2. Script Name : Spells/Scout/Predator/Ranger/MiracleShot.lua
  3. Script Author : neatz09
  4. Script Date : 2019.09.28 05:09:27
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Requires bow or aim
  9. function precast(Caster, Target)
  10. -- Requires bow
  11. local item = GetEquippedItemBySlot(Caster, 16)
  12. if not item or GetItemType(item) ~= 2 then
  13. -- no item or item is not a ranged item (no way to determine different range items currently)
  14. return false, 68
  15. end
  16. return true
  17. end
  18. -- Inflicts 170 - 284 ranged damage on target
  19. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  20. if MaxVal ~= nil and MinVal < MaxVal then
  21. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  22. else
  23. SpellDamage(Target, DmgType, MinVal)
  24. end
  25. end
  26. -- Requires you to currently have line of sight or to have acquired the target with line of sight