Core/Spells: implement SMSG_MOUNT_RESULT and use it for transformed mounting cases
Port From (https://github.com/TrinityCore/TrinityCore/commit/fb0d2ed2b96c314ea144b3524195ae96878e0079)
This commit is contained in:
@@ -1107,6 +1107,18 @@ namespace Game.Network.Packets
|
||||
uint LoadingScreenID;
|
||||
}
|
||||
|
||||
class MountResultPacket : ServerPacket
|
||||
{
|
||||
public MountResult() : base(ServerOpcodes.MountResult, ConnectionType.Instance) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt32(Result);
|
||||
}
|
||||
|
||||
public uint Result;
|
||||
}
|
||||
|
||||
//Structs
|
||||
public struct SpellLogPowerData
|
||||
{
|
||||
|
||||
@@ -3465,6 +3465,23 @@ namespace Game.Spells
|
||||
caster.SendPacket(packet);
|
||||
}
|
||||
|
||||
void SendMountResult(MountResult result)
|
||||
{
|
||||
if (result == MountResult.Ok)
|
||||
return;
|
||||
|
||||
if (!m_caster.IsPlayer())
|
||||
return;
|
||||
|
||||
Player caster = m_caster.ToPlayer();
|
||||
if (caster.IsLoading()) // don't send mount results at loading time
|
||||
return;
|
||||
|
||||
MountResultPacket packet = new MountResultPacket();
|
||||
packet.Result = (uint)result;
|
||||
caster.SendPacket(packet);
|
||||
}
|
||||
|
||||
void SendSpellStart()
|
||||
{
|
||||
if (!IsNeedSendToClient())
|
||||
@@ -5264,7 +5281,10 @@ namespace Game.Spells
|
||||
return SpellCastResult.NoMountsAllowed;
|
||||
|
||||
if (m_caster.IsInDisallowedMountForm())
|
||||
return SpellCastResult.NotShapeshift;
|
||||
{
|
||||
SendMountResult(MountResult.Shapeshifted); // mount result gets sent before the cast result
|
||||
return SpellCastResult.DontReport;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user