BlessedWeapon.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : Spells/Fighter/Crusader/BlessedWeapon.lua
  3. Script Author : LordPazuzu
  4. Script Date : 3/17/2023
  5. Script Purpose :
  6. :
  7. --]]
  8. -- On a melee hit this spell may cast Blessed Strike on target of attack. Triggers about 2.0 times per minute.
  9. -- Inflicts 21 - 35 divine damage on target
  10. function cast(Caster, Target, DmgType, MinVal, MaxVal, Chance)
  11. AddProc(Caster, 3, Chance)
  12. end
  13. function proc(Caster, Target, Type, DmgType, MinVal, MaxVal, Chance)
  14. Spell = GetSpell(2550392, GetSpellTier())
  15. Level = GetLevel(Caster)
  16. SpellLevel = 10
  17. Mastery = SpellLevel + 10
  18. StatBonus = GetInt(Caster) / 10
  19. if Level < Mastery then
  20. LvlBonus = Level - SpellLevel
  21. else LvlBonus = Mastery - SpellLevel
  22. end
  23. DmgBonus = LvlBonus + StatBonus
  24. MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
  25. MinDmg = math.floor(DmgBonus) * 2 + MinVal
  26. if Type == 3 then
  27. SetSpellDataIndex(Spell, 0, DmgType)
  28. SetSpellDataIndex(Spell, 1, MinDmg)
  29. SetSpellDataIndex(Spell, 2, MaxDmg)
  30. CastCustomSpell(Spell, Caster, Target)
  31. end
  32. end
  33. function remove(Caster, Target)
  34. RemoveProc(Caster)
  35. end