BestowalofVitae.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --[[
  2. Script Name : Spells/Priest/Cleric/BestowalofVitae.lua
  3. Script Author : LordPazuzu
  4. Script Date : 12/1/2022
  5. Script Purpose :
  6. :
  7. --]]
  8. -- When any damage is received this spell will cast Vitae on target.
  9. -- Heals target for 34 - 42
  10. -- Grants a total of 5 triggers of the spell.
  11. function cast(Caster, Target, MinVal, MaxVal, Triggers, SpellLevel)
  12. AddProc(Target, 15, 100)
  13. SetSpellTriggerCount(Triggers, 1)
  14. end
  15. function proc(Caster, Target, Type, MinVal, MaxVal, Triggers, SpellLevel)
  16. Level = GetLevel(Caster)
  17. Mastery = SpellLevel + 10
  18. StatBonus = GetWis(Caster) / 10
  19. if Level < Mastery then
  20. LvlBonus = Level - SpellLevel
  21. else LvlBonus = Mastery - SpellLevel
  22. end
  23. HealBonus = LvlBonus + StatBonus
  24. MinHeal = math.floor(HealBonus) * 2 + MinVal
  25. MaxHeal = math.floor(HealBonus) * 2 + MaxVal
  26. if Type == 15 then
  27. Spell = GetSpell(5455, GetSpellTier())
  28. SetSpellDataIndex(Spell, 0, MinHeal)
  29. SetSpellDataIndex(Spell, 1, MaxHeal)
  30. CastCustomSpell(Spell, Caster, Target)
  31. RemoveTriggerFromSpell()
  32. end
  33. end
  34. function remove(Caster, Target)
  35. RemoveProc(Target)
  36. end