OpenShot.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. Script Name : Spells/Scout/Predator/OpenShot.lua
  3. Script Author : LordPazuzu
  4. Script Date : 3/31/2023
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Inflicts 24 - 40 ranged damage on target
  9. -- Inflicts 24 - 40 ranged damage on target
  10. -- If weapon equipped in Ranged
  11. function precast(Caster, Target)
  12. -- Requires bow
  13. local item = GetEquippedItemBySlot(Caster, 16)
  14. if not item or GetItemType(item) ~= 2 then
  15. -- no item or item is not a ranged item (no way to determine different range items currently)
  16. return false, 68
  17. end
  18. return true
  19. end
  20. function cast(Caster, Target, MinVal, MaxVal)
  21. Level = GetLevel(Caster)
  22. SpellLevel = 16
  23. Mastery = SpellLevel + 10
  24. StatBonus = GetAgi(Caster) / 10
  25. if Level < Mastery then
  26. LvlBonus = Level - SpellLevel
  27. else LvlBonus = Mastery - SpellLevel
  28. end
  29. DmgBonus = LvlBonus + StatBonus
  30. MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
  31. MinDmg = math.floor(DmgBonus) * 2 + MinVal
  32. SpellDamage(Target, 2, MinDmg, MaxDmg)
  33. if LastSpellAttackHit() then
  34. SpellDamage(Target,2, MinDmg, MaxDmg)
  35. end
  36. end