9
3

SearingShot.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : Spells/Scout/Predator/Ranger/SearingShot.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.03.10 04:03:03
  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. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  18. -- Inflicts 9 - 15 heat damage on target
  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. -- Inflicts 9 - 15 heat damage on target
  25. if LastSpellAttackHit() then
  26. if MaxVal ~= nil and MinVal < MaxVal then
  27. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  28. else
  29. SpellDamage(Target, DmgType, MinVal)
  30. end
  31. end
  32. end