9
3

CripplingArrow.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : Spells/Scout/Predator/Ranger/CripplingArrow.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.03.10 04:03:07
  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, MinVal, MaxVal, SkillAmt)
  18. -- Inflicts 175 - 293 ranged damage on target
  19. if MaxVal ~= nil and MinVal < MaxVal then
  20. SpellDamage(Target, 0, math.random(MinVal, MaxVal))
  21. else
  22. SpellDamage(Target, 0, MinVal)
  23. end
  24. -- Decreases Deflection and Parry of target by 10.8
  25. AddSkillBonus(Target, GetSkillIDByName("Deflection"), SkillAmt)
  26. AddSkillBonus(Target, GetSkillIDByName("Parry"), SkillAmt)
  27. end
  28. function remove(Caster, Target)
  29. RemoveSkillBonus(Target)
  30. end