Core/PacketIO: Implemented CMSG_UPDATE_SPELL_VISUAL
Port From (https://github.com/TrinityCore/TrinityCore/commit/0d475eac5f2fdee58d79b1f3361da6d3f22b0232)
This commit is contained in:
@@ -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)]
|
[WorldPacketHandler(ClientOpcodes.KeyboundOverride, Processing = PacketProcessing.ThreadSafe)]
|
||||||
void HandleKeyboundOverride(KeyboundOverride keyboundOverride)
|
void HandleKeyboundOverride(KeyboundOverride keyboundOverride)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1216,6 +1216,22 @@ namespace Game.Networking.Packets
|
|||||||
public MovementInfo Status;
|
public MovementInfo Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class UpdateAuraVisual : ClientPacket
|
||||||
|
{
|
||||||
|
public uint SpellID;
|
||||||
|
public SpellCastVisual Visual;
|
||||||
|
public ObjectGuid TargetGUID;
|
||||||
|
|
||||||
|
public UpdateAuraVisual(WorldPacket packet) : base(packet) { }
|
||||||
|
|
||||||
|
public override void Read()
|
||||||
|
{
|
||||||
|
SpellID = _worldPacket.ReadUInt32();
|
||||||
|
Visual.Read(_worldPacket);
|
||||||
|
TargetGUID = _worldPacket.ReadPackedGuid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class SpellDelayed : ServerPacket
|
public class SpellDelayed : ServerPacket
|
||||||
{
|
{
|
||||||
public SpellDelayed() : base(ServerOpcodes.SpellDelayed, ConnectionType.Instance) { }
|
public SpellDelayed() : base(ServerOpcodes.SpellDelayed, ConnectionType.Instance) { }
|
||||||
|
|||||||
@@ -426,6 +426,12 @@ namespace Game.Spells
|
|||||||
_DeleteRemovedApplications();
|
_DeleteRemovedApplications();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetSpellVisual(SpellCastVisual spellVisual)
|
||||||
|
{
|
||||||
|
m_spellVisual = spellVisual;
|
||||||
|
SetNeedClientUpdateForTargets();
|
||||||
|
}
|
||||||
|
|
||||||
public Unit GetCaster()
|
public Unit GetCaster()
|
||||||
{
|
{
|
||||||
if (m_owner.GetGUID() == m_casterGuid)
|
if (m_owner.GetGUID() == m_casterGuid)
|
||||||
|
|||||||
Reference in New Issue
Block a user