UnyieldingAdvance.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --[[
  2. Script Name : Spells/Fighter/Crusader/UnyieldingAdvance.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.03.17 04:03:19
  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, Hate)
  17. Level = GetLevel(Caster)
  18. SpellLevel = 13
  19. Mastery = SpellLevel + 10
  20. StatBonus = GetStr(Caster) / 10
  21. if Level < Mastery then
  22. LvlBonus = Level - SpellLevel
  23. else LvlBonus = Mastery - SpellLevel
  24. end
  25. DmgBonus = LvlBonus + StatBonus
  26. MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
  27. MinDmg = math.floor(DmgBonus) * 2 + MinVal
  28. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  29. TotalHate = LvlBonus *2 + Hate
  30. AddHate(Caster, Target, TotalHate, 1)
  31. if not IsEpic(Target) then
  32. CastSpell(Target, 5001, GetSpellTier())
  33. end
  34. end