9
3

DeadlyShot.lua 975 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --[[
  2. Script Name : Spells/Scout/Predator/Assassin/DeadlyShot.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.04.17 03:04:40
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- If weapon equipped in Ranged
  10. local item = GetEquippedItemBySlot(Caster, 16)
  11. if item then
  12. if GetItemType(item) == 2 then
  13. return true
  14. end
  15. end
  16. return false, 68
  17. end
  18. function cast(Caster, Target, MinVal, MaxVal)
  19. -- Inflicts 8 - 13 ranged damage on target
  20. if MaxVal ~= nil and MinVal < MaxVal then
  21. SpellDamage(Target, 0, math.random(MinVal, MaxVal))
  22. else
  23. SpellDamage(Target, 0, MinVal)
  24. end
  25. if LastSpellAttackHit() then
  26. -- Inflicts 8 - 13 ranged damage on target
  27. if MaxVal ~= nil and MinVal < MaxVal then
  28. SpellDamage(Target, 0, math.random(MinVal, MaxVal))
  29. else
  30. SpellDamage(Target, 0, MinVal)
  31. end
  32. end
  33. end