Backstab.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : Spells/Scout/Rogue/Backstab.lua
  3. Script Author : LordPazuzu
  4. Script Date : 1/3/2023
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Inflicts 46 - 78 melee damage on target
  9. -- Decreases AGI of target by 7.2
  10. -- Must be flanking or behind
  11. function precast(Caster,Target)
  12. if not IsFlanking(Caster, Target) and not IsBehind(Caster, Target) then
  13. SendMessage(Caster, "Must be flanking or behind", "yellow")
  14. return false
  15. else
  16. return true
  17. end
  18. end
  19. function cast(Caster, Target, DmgType, MinVal, MaxVal, Agi)
  20. Level = GetLevel(Caster)
  21. SpellLevel = 10
  22. Mastery = SpellLevel + 10
  23. StatBonus = GetStr(Caster) / 10
  24. if Level < Mastery then
  25. LvlBonus = Level - SpellLevel
  26. else LvlBonus = Mastery - SpellLevel
  27. end
  28. DmgBonus = LvlBonus + StatBonus
  29. MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
  30. MinDmg = math.floor(DmgBonus) * 2 + MinVal
  31. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  32. AddSpellBonus(Target, 2, Agi)
  33. end
  34. function remove(Caster, Target)
  35. RemoveSpellBonus(Target)
  36. end