9
3

CripplingArrow.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. Level = GetLevel(Caster)
  20. SpellLevel = 20
  21. Mastery = SpellLevel + 10
  22. StatBonus = GetAgi(Caster) / 10
  23. if Level < Mastery then
  24. LvlBonus = Level - SpellLevel
  25. else LvlBonus = Mastery - SpellLevel
  26. end
  27. DmgBonus = LvlBonus + StatBonus
  28. MaxDmg = math.floor(DmgBonus * 2.5) + MaxVal
  29. MinDmg = math.floor(DmgBonus * 2.5) + MaxVal
  30. SpellDamage(Target, 0, MinDmg, MaxDmg)
  31. -- Decreases Deflection and Parry of target by 10.8
  32. AddSkillBonus(Target, GetSkillIDByName("Deflection"), SkillAmt)
  33. AddSkillBonus(Target, GetSkillIDByName("Parry"), SkillAmt)
  34. end
  35. function remove(Caster, Target)
  36. RemoveSkillBonus(Target)
  37. end