9
3

Bash.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : Spells/Fighter/Warrior/Bash.lua
  3. Script Author : LordPazuzu
  4. Script Date : 3/30/2023
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. local item = GetEquippedItemBySlot(Caster, 1)
  10. if not item or GetItemType(item) ~= 4 then
  11. SendMessage(Caster, "Must have shield equipped", "yellow")
  12. return false, 70
  13. end
  14. return true
  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 = math.floor(DmgBonus) * 2 + MaxVal
  26. MinDmg = math.floor(DmgBonus) * 2 + MinVal
  27. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  28. if not IsEpic(Target) then
  29. CastSpell(Target, 5001, GetSpellTier())
  30. end
  31. end