Core/Scripts: Expose calculated spell value variance to scripts
Port From (https://github.com/TrinityCore/TrinityCore/commit/701532f9f033547a5fc2d0b594d04f6349cb441b)
This commit is contained in:
@@ -914,6 +914,28 @@ namespace Game.Scripting
|
||||
m_spell.damage = value;
|
||||
}
|
||||
|
||||
public float GetEffectVariance()
|
||||
{
|
||||
if (!IsInEffectHook())
|
||||
{
|
||||
Log.outError(LogFilter.Scripts, $"Script: `{m_scriptName}` Spell: `{m_scriptSpellId}`: function SpellScript::GetEffectVariance was called, but function has no effect in current hook!");
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return m_spell.variance;
|
||||
}
|
||||
|
||||
public void SetEffectVariance(float variance)
|
||||
{
|
||||
if (!IsInEffectHook())
|
||||
{
|
||||
Log.outError(LogFilter.Scripts, $"Script: `{m_scriptName}` Spell: `{m_scriptSpellId}`: function SpellScript::SetEffectVariance was called, but function has no effect in current hook!");
|
||||
return;
|
||||
}
|
||||
|
||||
m_spell.variance = variance;
|
||||
}
|
||||
|
||||
// returns: cast item if present.
|
||||
public Item GetCastItem() { return m_spell.m_CastItem; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user