RighteousBlow.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : Spells/Fighter/Crusader/RighteousBlow.lua
  3. Script Author : LordPazuzu
  4. Script Date : 3/17/2023
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Applies Blessed Strike on termination.
  9. -- Inflicts 23 - 38 divine damage on target
  10. -- Inflicts 9 - 16 divine damage on target
  11. function cast(Caster, Target, Dmg1, Dmg1Min, Dmg1Max, Dmg2, Dmg2Min, Dmg2Max)
  12. Level = GetLevel(Caster)
  13. SpellLevel = 11
  14. Mastery = SpellLevel + 10
  15. StrBonus = GetStr(Caster) / 10
  16. IntBonus = GetInt(Caster) / 10
  17. Spell = GetSpell(2550392, GetSpellTier())
  18. if Level < Mastery then
  19. LvlBonus = Level - SpellLevel
  20. else LvlBonus = Mastery - SpellLevel
  21. end
  22. DmgBonus1 = LvlBonus + IntBonus
  23. DmgBonus2 = LvlBonus + StrBonus
  24. MaxDmg1 = math.floor(DmgBonus1) * 2 + Dmg1Max
  25. MinDmg1 = math.floor(DmgBonus1) * 2 + Dmg1Min
  26. MaxDmg2 = math.floor(DmgBonus2) * 2 + Dmg2Max
  27. MinDmg2 = math.floor(DmgBonus2) * 2 + Dmg2Min
  28. SpellDamage(Target, Dmg2, MinDmg2, MaxDmg2)
  29. if LastSpellAttackHit() then
  30. SetSpellDataIndex(Spell, 0, Dmg1)
  31. SetSpellDataIndex(Spell, 1, MinDmg1)
  32. SetSpellDataIndex(Spell, 2, MaxDmg1)
  33. CastCustomSpell(Spell, Caster, Target)
  34. end
  35. end