diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index e75a758d0a..c80451bab5 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -555,6 +555,16 @@ void SpellScript::SetHitDamage(int32 damage) m_spell->m_damage = damage; } +void SpellScript::SetEffectDamage(int32 damage) +{ + if (!IsInTargetHook()) + { + TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + return; + } + m_spell->damage = damage; +} + int32 SpellScript::GetHitHeal() const { if (!IsInTargetHook()) @@ -575,6 +585,16 @@ void SpellScript::SetHitHeal(int32 heal) m_spell->m_healing = heal; } +void SpellScript::SetEffectHeal(int32 heal) +{ + if (!IsInTargetHook()) + { + TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::SetEffectHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + return; + } + m_spell->m_healing = heal; +} + Aura* SpellScript::GetHitAura() const { if (!IsInTargetHook()) diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index ada9008551..1a5699aed2 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -427,11 +427,13 @@ class TC_GAME_API SpellScript : public _SpellScript int32 GetHitDamage() const; void SetHitDamage(int32 damage); void PreventHitDamage() { SetHitDamage(0); } + void SetEffectDamage(int32 damage); // setter/getter for for heal done by spell to target of spell hit // returns healing calculated before hit, and real dmg done after hit int32 GetHitHeal() const; void SetHitHeal(int32 heal); void PreventHitHeal() { SetHitHeal(0); } + void SetEffectHeal(int32 heal); Spell* GetSpell() const { return m_spell; } // returns current spell hit target aura Aura* GetHitAura() const;