Ambush.lua 923 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : Spells/Scout/Ambush.lua
  3. Script Author : LordPazuzu
  4. Script Date : 12/8/2022
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- You must be sneaking to use this ability.
  10. if IsStealthed(Caster) then
  11. return true
  12. end
  13. SendMessage(Caster, "You must be sneaking to use this ability.", "yellow")
  14. return false
  15. end
  16. function cast(Caster, Target, DmgType, MinVal, MaxVal, SpellLevel)
  17. Level = GetLevel(Caster)
  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 = MaxVal + math.floor(DmgBonus)
  26. MinDmg = MinVal + math.floor(DmgBonus)
  27. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  28. end