Core/Auras: Initialize aura spell visual from spell that created it instead of recalculating it

Port From (https://github.com/TrinityCore/TrinityCore/commit/616c5094e0c75c9f8e0c89510f9b7f2f69c70ac7)
This commit is contained in:
Hondacrx
2025-08-14 21:21:35 -04:00
parent 17e64c88d7
commit b788c67030
2 changed files with 13 additions and 1 deletions
+12 -1
View File
@@ -346,7 +346,7 @@ namespace Game.Spells
m_castItemGuid = createInfo.CastItemGUID;
m_castItemId = createInfo.CastItemId;
m_castItemLevel = createInfo.CastItemLevel;
m_spellVisual = new SpellCastVisual(createInfo.Caster != null ? createInfo.Caster.GetCastSpellXSpellVisualId(createInfo._spellInfo) : createInfo._spellInfo.GetSpellXSpellVisualId(), 0);
m_spellVisual = createInfo.CalcSpellVisual();
m_applyTime = GameTime.GetGameTime();
m_owner = createInfo._owner;
m_timeCla = 0;
@@ -3071,6 +3071,7 @@ namespace Game.Spells
internal Difficulty _castDifficulty;
internal uint _auraEffectMask;
internal WorldObject _owner;
internal SpellCastVisual? _spellVisual;
internal uint _targetEffectMask;
@@ -3089,6 +3090,15 @@ namespace Game.Spells
Cypher.Assert(auraEffMask <= SpellConst.MaxEffectMask);
}
public SpellCastVisual CalcSpellVisual()
{
return _spellVisual.GetValueOrDefault(new SpellCastVisual()
{
SpellXSpellVisualID = Caster != null ? Caster.GetCastSpellXSpellVisualId(_spellInfo) : _spellInfo.GetSpellXSpellVisualId(),
ScriptVisualID = 0
});
}
public void SetCasterGUID(ObjectGuid guid) { CasterGUID = guid; }
public void SetCaster(Unit caster) { Caster = caster; }
public void SetBaseAmount(int[] bp) { BaseAmount = bp; }
@@ -3097,6 +3107,7 @@ namespace Game.Spells
public void SetStackAmount(int stackAmount) { StackAmount = stackAmount > 0 ? stackAmount : 1; }
public void SetOwnerEffectMask(uint effMask) { _targetEffectMask = effMask; }
public void SetAuraEffectMask(uint effMask) { _auraEffectMask = effMask; }
public void SetSpellVisual(SpellCastVisual spellVisual) { _spellVisual = spellVisual; }
public SpellInfo GetSpellInfo() { return _spellInfo; }
public uint GetAuraEffectMask() { return _auraEffectMask; }
+1
View File
@@ -2355,6 +2355,7 @@ namespace Game.Spells
createInfo.SetPeriodicReset(resetPeriodicTimer);
createInfo.SetOwnerEffectMask(aura_effmask);
createInfo.SetStackAmount(m_spellValue.AuraStackAmount);
createInfo.SetSpellVisual(m_SpellVisual);
Aura aura = Aura.TryRefreshStackOrCreate(createInfo, false);
if (aura != null)