PowerCleave.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : Spells/Fighter/Crusader/PowerCleave.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.03.17 07:03:02
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. local wield_type = GetInfoStructUInt(Caster, "wield_type")
  10. if wield_type ~= 4 then
  11. SendMessage(Caster, "Must have a two-handed weapon equipped", "yellow")
  12. return false, 70
  13. end
  14. return true
  15. end
  16. function cast(Caster, Target, DmgType, MinVal, MaxVal, Parry)
  17. Level = GetLevel(Caster)
  18. SpellLevel = 15
  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. AddSkillBonus(Target, GetSkillIDByName("Parry"), Parry)
  30. end
  31. function remove(Caster, Target)
  32. RemoveSkillBonus(Target)
  33. end