SingingShot.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : Spells/Scout/Bard/SingingShot.lua
  3. Script Author : neatz09
  4. Script Date : 2020.11.06 06:11:13
  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, DmgType, MinVal, MaxVal)
  18. Level = GetLevel(Caster)
  19. SpellLevel = 16
  20. Mastery = SpellLevel + 10
  21. StatBonus = GetAgi(Caster) / 10
  22. if Level < Mastery then
  23. LvlBonus = Level - SpellLevel
  24. else LvlBonus = Mastery - SpellLevel
  25. end
  26. DmgBonus = LvlBonus + StatBonus
  27. MinDmg = math.floor(DmgBonus) * 2 + MinVal
  28. MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
  29. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  30. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  31. end