9
3

SneakAttack.lua 900 B

12345678910111213141516171819202122232425262728293031323334
  1. --[[
  2. Script Name : Spells/Scout/SneakAttack.lua
  3. Script Author : LordPazuzu
  4. Script Date : 12/8/2022
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster,Target)
  9. if not IsFlanking(Caster, Target) and not IsBehind(Caster, Target) then
  10. SendMessage(Caster, "Must be flanking or behind", "yellow")
  11. return false
  12. end
  13. return true
  14. end
  15. function cast(Caster, Target, DmgType, MinVal, MaxVal, SpellLevel)
  16. Level = GetLevel(Caster)
  17. Mastery = SpellLevel + 10
  18. StatBonus = GetStr(Caster) / 10
  19. if Level < Mastery then
  20. LvlBonus = Level - SpellLevel
  21. else LvlBonus = Mastery - SpellLevel
  22. end
  23. DmgBonus = LvlBonus + StatBonus
  24. MaxDmg = MaxVal + math.floor(DmgBonus)
  25. MinDmg = MinVal + math.floor(DmgBonus)
  26. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  27. end