diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellScript.cpp | 22 | ||||
-rw-r--r-- | src/server/game/Spells/SpellScript.h | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 25d1f6ffcb7..100ea02fbe5 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -849,6 +849,28 @@ void SpellScript::SetEffectValue(int32 value) m_spell->damage = value; } +float SpellScript::GetEffectVariance() const +{ + if (!IsInEffectHook()) + { + TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetEffectVariance was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + return 0.0f; + } + + return m_spell->variance; +} + +void SpellScript::SetEffectVariance(float variance) +{ + if (!IsInEffectHook()) + { + TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::SetEffectVariance was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + return; + } + + m_spell->variance = variance; +} + Item* SpellScript::GetCastItem() const { return m_spell->m_CastItem; diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index b415be64c24..7cbb3a5121b 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -614,6 +614,8 @@ class TC_GAME_API SpellScript : public _SpellScript SpellEffectInfo const& GetEffectInfo() const; int32 GetEffectValue() const; void SetEffectValue(int32 value); + float GetEffectVariance() const; + void SetEffectVariance(float variance); // returns: cast item if present. Item* GetCastItem() const; |