Core/PacketIO: Implemented SMSG_DISPLAY_TOAST for quest money rewards
Port From (https://github.com/TrinityCore/TrinityCore/commit/e5417e9ce747d92822538da77d32cf7d0f26ce8a)
This commit is contained in:
@@ -1296,6 +1296,51 @@ namespace Game.Networking.Packets
|
||||
|
||||
public uint UISplashScreenID;
|
||||
}
|
||||
|
||||
class DisplayToast : ServerPacket
|
||||
{
|
||||
public ulong Quantity;
|
||||
public DisplayToastMethod DisplayToastMethod;
|
||||
public bool Mailed;
|
||||
public DisplayToastType Type = DisplayToastType.Money;
|
||||
public uint QuestID;
|
||||
public bool IsSecondaryResult;
|
||||
public ItemInstance Item;
|
||||
public bool BonusRoll;
|
||||
public int LootSpec;
|
||||
public Gender Gender = Gender.None;
|
||||
public uint CurrencyID;
|
||||
|
||||
public DisplayToast() : base(ServerOpcodes.DisplayToast, ConnectionType.Instance) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(Quantity);
|
||||
_worldPacket.WriteUInt8((byte)DisplayToastMethod);
|
||||
_worldPacket.WriteUInt32(QuestID);
|
||||
|
||||
_worldPacket.WriteBit(Mailed);
|
||||
_worldPacket.WriteBits((byte)Type, 2);
|
||||
_worldPacket.WriteBit(IsSecondaryResult);
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case DisplayToastType.NewItem:
|
||||
_worldPacket.WriteBit(BonusRoll);
|
||||
Item.Write(_worldPacket);
|
||||
_worldPacket.WriteInt32(LootSpec);
|
||||
_worldPacket.WriteInt32((int)Gender);
|
||||
break;
|
||||
case DisplayToastType.NewCurrency:
|
||||
_worldPacket.WriteUInt32(CurrencyID);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
}
|
||||
|
||||
class DisplayGameError : ServerPacket
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user