diff options
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rw-r--r-- | src/server/game/Spells/SpellScript.cpp | 22 |
1 files changed, 22 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; |