9
3

SnaringShot.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : Spells/Scout/Predator/Ranger/SnaringShot.lua
  3. Script Author : neatz09
  4. Script Date : 2020.09.18 02:09:38
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Inflicts 182 - 304 ranged damage on target
  9. -- Slows target by 36.8%
  10. -- 10% chance to dispel when target receives hostile action
  11. -- Requires bow or aim
  12. function precast(Caster, Target)
  13. -- Requires bow
  14. local item = GetEquippedItemBySlot(Caster, 16)
  15. if not item or GetItemType(item) ~= 2 then
  16. -- no item or item is not a ranged item (no way to determine different range items currently)
  17. return false, 68
  18. end
  19. return true
  20. end
  21. function cast(Caster, Target, DmgMin, DmgMax, SlowAmt, Chance)
  22. local Slow = 100 - SlowAmt
  23. SpellDamage(Target, nil, DmgMin, DmgMax)
  24. SetSpeedMultiplier(Target, Slow)
  25. AddProc(Target, 1, Chance)
  26. end
  27. function proc(Caster, Target, Type, DmgMin, DmgMax, SlowAmt, Chance)
  28. if type == 1 then SetSpeedMultiplier(Target, 1)
  29. RemoveProc(Target)
  30. end
  31. end
  32. function remove(Caster, Target)
  33. RemoveProc(Target)
  34. SetSpeedMultiplier(Target, 1)
  35. end