DistractingBlade.lua 961 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --[[
  2. Script Name : Spells/Scout/Rogue/DistractingBlade.lua
  3. Script Author : LordPazuzu
  4. Script Date : 1/3/2023
  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)
  16. Level = GetLevel(Caster)
  17. SpellLevel = 19
  18. Mastery = SpellLevel + 10
  19. StatBonus = GetStr(Caster) / 10
  20. if Level < Mastery then
  21. LvlBonus = Level - SpellLevel
  22. else LvlBonus = Mastery - SpellLevel
  23. end
  24. DmgBonus = LvlBonus + StatBonus
  25. MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
  26. MinDmg = math.floor(DmgBonus) * 2 + MinVal
  27. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  28. Interrupt(Caster, Target)
  29. end