Core: Updated to 10.0.2
Port From (https://github.com/TrinityCore/TrinityCore/commit/e98e1283ea0034baf6be9aa2ffb386eb5582801b)
This commit is contained in:
@@ -43,6 +43,23 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid Unit;
|
||||
}
|
||||
|
||||
public class NPCInteractionOpenResult : ServerPacket
|
||||
{
|
||||
public NPCInteractionOpenResult() : base(ServerOpcodes.NpcInteractionOpenResult) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(Npc);
|
||||
_worldPacket.WriteInt32((int)InteractionType);
|
||||
_worldPacket.WriteBit(Success);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public ObjectGuid Npc;
|
||||
public PlayerInteractionType InteractionType;
|
||||
public bool Success = true;
|
||||
}
|
||||
|
||||
public class GossipMessagePkt : ServerPacket
|
||||
{
|
||||
public GossipMessagePkt() : base(ServerOpcodes.GossipMessage) { }
|
||||
@@ -52,33 +69,20 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WritePackedGuid(GossipGUID);
|
||||
_worldPacket.WriteUInt32(GossipID);
|
||||
_worldPacket.WriteInt32(FriendshipFactionID);
|
||||
_worldPacket.WriteInt32(TextID);
|
||||
|
||||
_worldPacket.WriteInt32(GossipOptions.Count);
|
||||
_worldPacket.WriteInt32(GossipText.Count);
|
||||
_worldPacket.WriteBit(TextID.HasValue);
|
||||
_worldPacket.WriteBit(TextID2.HasValue);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
foreach (ClientGossipOptions options in GossipOptions)
|
||||
{
|
||||
_worldPacket.WriteInt32(options.ClientOption);
|
||||
_worldPacket.WriteUInt8((byte)options.OptionNPC);
|
||||
_worldPacket.WriteUInt8(options.OptionFlags);
|
||||
_worldPacket.WriteInt32(options.OptionCost);
|
||||
_worldPacket.WriteUInt32(options.OptionLanguage);
|
||||
options.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteBits(options.Text.GetByteCount(), 12);
|
||||
_worldPacket.WriteBits(options.Confirm.GetByteCount(), 12);
|
||||
_worldPacket.WriteBits((byte)options.Status, 2);
|
||||
_worldPacket.WriteBit(options.SpellID.HasValue);
|
||||
_worldPacket.FlushBits();
|
||||
if (TextID.HasValue)
|
||||
_worldPacket.WriteInt32(TextID.Value);
|
||||
|
||||
options.Treasure.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteString(options.Text);
|
||||
_worldPacket.WriteString(options.Confirm);
|
||||
|
||||
if (options.SpellID.HasValue)
|
||||
_worldPacket.WriteInt32(options.SpellID.Value);
|
||||
}
|
||||
if (TextID2.HasValue)
|
||||
_worldPacket.WriteInt32(TextID2.Value);
|
||||
|
||||
foreach (ClientGossipText text in GossipText)
|
||||
text.Write(_worldPacket);
|
||||
@@ -88,7 +92,8 @@ namespace Game.Networking.Packets
|
||||
public int FriendshipFactionID;
|
||||
public ObjectGuid GossipGUID;
|
||||
public List<ClientGossipText> GossipText = new();
|
||||
public int TextID;
|
||||
public int? TextID;
|
||||
public int? TextID2;
|
||||
public uint GossipID;
|
||||
}
|
||||
|
||||
@@ -100,18 +105,38 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
GossipUnit = _worldPacket.ReadPackedGuid();
|
||||
GossipID = _worldPacket.ReadUInt32();
|
||||
GossipIndex = _worldPacket.ReadUInt32();
|
||||
GossipOptionID = _worldPacket.ReadInt32();
|
||||
|
||||
uint length = _worldPacket.ReadBits<uint>(8);
|
||||
PromotionCode = _worldPacket.ReadString(length);
|
||||
}
|
||||
|
||||
public ObjectGuid GossipUnit;
|
||||
public uint GossipIndex;
|
||||
public int GossipOptionID;
|
||||
public uint GossipID;
|
||||
public string PromotionCode;
|
||||
}
|
||||
|
||||
class GossipOptionNPCInteraction : ServerPacket
|
||||
{
|
||||
public GossipOptionNPCInteraction() : base(ServerOpcodes.GossipOptionNpcInteraction) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(GossipGUID);
|
||||
_worldPacket.WriteInt32(GossipNpcOptionID);
|
||||
_worldPacket.WriteBit(FriendshipFactionID.HasValue);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
if (FriendshipFactionID.HasValue)
|
||||
_worldPacket.WriteInt32(FriendshipFactionID.Value);
|
||||
}
|
||||
|
||||
public ObjectGuid GossipGUID;
|
||||
public int GossipNpcOptionID;
|
||||
public int? FriendshipFactionID;
|
||||
}
|
||||
|
||||
public class GossipComplete : ServerPacket
|
||||
{
|
||||
public bool SuppressSound;
|
||||
@@ -181,30 +206,6 @@ namespace Game.Networking.Packets
|
||||
public string Greeting;
|
||||
}
|
||||
|
||||
public class ShowBank : ServerPacket
|
||||
{
|
||||
public ShowBank() : base(ServerOpcodes.ShowBank, ConnectionType.Instance) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(Guid);
|
||||
}
|
||||
|
||||
public ObjectGuid Guid;
|
||||
}
|
||||
|
||||
public class PlayerTabardVendorActivate : ServerPacket
|
||||
{
|
||||
public PlayerTabardVendorActivate() : base(ServerOpcodes.PlayerTabardVendorActivate) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(Vendor);
|
||||
}
|
||||
|
||||
public ObjectGuid Vendor;
|
||||
}
|
||||
|
||||
class GossipPOI : ServerPacket
|
||||
{
|
||||
public GossipPOI() : base(ServerOpcodes.GossipPoi) { }
|
||||
@@ -243,18 +244,6 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid Healer;
|
||||
}
|
||||
|
||||
public class SpiritHealerConfirm : ServerPacket
|
||||
{
|
||||
public SpiritHealerConfirm() : base(ServerOpcodes.SpiritHealerConfirm) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(Unit);
|
||||
}
|
||||
|
||||
public ObjectGuid Unit;
|
||||
}
|
||||
|
||||
class TrainerBuySpell : ClientPacket
|
||||
{
|
||||
public TrainerBuySpell(WorldPacket packet) : base(packet) { }
|
||||
@@ -344,16 +333,47 @@ namespace Game.Networking.Packets
|
||||
|
||||
public class ClientGossipOptions
|
||||
{
|
||||
public int ClientOption;
|
||||
public int GossipOptionID;
|
||||
public GossipOptionNpc OptionNPC;
|
||||
public byte OptionFlags;
|
||||
public int OptionCost;
|
||||
public uint OptionLanguage;
|
||||
public GossipOptionFlags Flags;
|
||||
public int OrderIndex;
|
||||
public GossipOptionStatus Status;
|
||||
public string Text;
|
||||
public string Confirm;
|
||||
public string Text = "";
|
||||
public string Confirm = "";
|
||||
public TreasureLootList Treasure = new();
|
||||
public int? SpellID;
|
||||
public int? OverrideIconID;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(GossipOptionID);
|
||||
data.WriteUInt8((byte)OptionNPC);
|
||||
data.WriteInt8((sbyte)OptionFlags);
|
||||
data.WriteInt32(OptionCost);
|
||||
data.WriteUInt32(OptionLanguage);
|
||||
data.WriteInt32((int)Flags);
|
||||
data.WriteInt32(OrderIndex);
|
||||
data.WriteBits(Text.GetByteCount(), 12);
|
||||
data.WriteBits(Confirm.GetByteCount(), 12);
|
||||
data.WriteBits((byte)Status, 2);
|
||||
data.WriteBit(SpellID.HasValue);
|
||||
data.WriteBit(OverrideIconID.HasValue);
|
||||
data.FlushBits();
|
||||
|
||||
Treasure.Write(data);
|
||||
|
||||
data.WriteString(Text);
|
||||
data.WriteString(Confirm);
|
||||
|
||||
if (SpellID.HasValue)
|
||||
data.WriteInt32(SpellID.Value);
|
||||
|
||||
if (OverrideIconID.HasValue)
|
||||
data.WriteInt32(OverrideIconID.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public class ClientGossipText
|
||||
@@ -386,19 +406,20 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(MuID);
|
||||
data.WriteInt32(Type);
|
||||
data.WriteInt32(Quantity);
|
||||
data.WriteUInt64(Price);
|
||||
data.WriteInt32(MuID);
|
||||
data.WriteInt32(Durability);
|
||||
data.WriteInt32(StackCount);
|
||||
data.WriteInt32(Quantity);
|
||||
data.WriteInt32(ExtendedCostID);
|
||||
data.WriteInt32(PlayerConditionFailed);
|
||||
Item.Write(data);
|
||||
data.WriteBits(Type, 3);
|
||||
data.WriteBit(Locked);
|
||||
data.WriteBit(DoNotFilterOnVendor);
|
||||
data.WriteBit(Refundable);
|
||||
data.FlushBits();
|
||||
|
||||
Item.Write(data);
|
||||
}
|
||||
|
||||
public int MuID;
|
||||
|
||||
Reference in New Issue
Block a user