Core/PacketIO: Implemented CMSG_UPDATE_SPELL_VISUAL

Port From (https://github.com/TrinityCore/TrinityCore/commit/0d475eac5f2fdee58d79b1f3361da6d3f22b0232)
This commit is contained in:
Hondacrx
2025-08-14 21:27:54 -04:00
parent b788c67030
commit a66b484370
3 changed files with 42 additions and 0 deletions
+20
View File
@@ -603,6 +603,26 @@ namespace Game
}
}
[WorldPacketHandler(ClientOpcodes.UpdateSpellVisual, Processing = PacketProcessing.Inplace)]
void HandleUpdateAuraVisual(UpdateAuraVisual updateAuraVisual)
{
Unit target = Global.ObjAccessor.GetUnit(_player, updateAuraVisual.TargetGUID);
if (target == null)
return;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(updateAuraVisual.SpellID, _player.GetMap().GetDifficultyID());
if (spellInfo == null)
return;
uint spellXspellVisualId = _player.GetCastSpellXSpellVisualId(spellInfo);
foreach (var (_, auraApp) in target.GetAppliedAuras().Where(p => p.Key == spellInfo.Id))
if (auraApp.GetBase().GetCasterGUID() == _player.GetGUID())
auraApp.GetBase().SetSpellVisual(new SpellCastVisual() { SpellXSpellVisualID = spellXspellVisualId });
if (_player.GetChannelSpellId() == spellInfo.Id)
_player.SetChannelVisual(new SpellCastVisualField() { SpellXSpellVisualID = spellXspellVisualId });
}
[WorldPacketHandler(ClientOpcodes.KeyboundOverride, Processing = PacketProcessing.ThreadSafe)]
void HandleKeyboundOverride(KeyboundOverride keyboundOverride)
{