9
3

SpineShot.lua 910 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : Spells/Scout/Predator/Assassin/SpineShot.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.04.17 04:04:06
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- Must be flanking or behind
  10. if not IsFlanking(Target, Caster) then
  11. SendMessage(Caster, "Must be flanking or behind", "yellow")
  12. return false
  13. end
  14. -- If weapon equipped in Ranged
  15. local item = GetEquippedItemBySlot(Caster, 16)
  16. if item~= nil then
  17. if GetItemType(item) == 2 then
  18. return true
  19. end
  20. end
  21. return false, 68
  22. end
  23. function cast(Caster, Target, MinVal, MaxVal)
  24. -- Inflicts 189 - 315 ranged damage on target
  25. if MaxVal ~= nil and MinVal < MaxVal then
  26. SpellDamage(Target, 0, math.random(MinVal, MaxVal))
  27. else
  28. SpellDamage(Target, 0, MinVal)
  29. end
  30. end