Core/PacketIO: Updated to 11.0.0
Port From (https://github.com/TrinityCore/TrinityCore/commit/e59eef5432c7b70679d33f4911c88d0f7d75fd39)
This commit is contained in:
@@ -195,7 +195,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
_worldPacket.WriteInt32(Info.Objectives.Count);
|
||||
_worldPacket.WriteUInt64(Info.AllowableRaces.RawValue);
|
||||
_worldPacket.WriteInt32(Info.TreasurePickerID);
|
||||
_worldPacket.WriteInt32(Info.TreasurePickerID.Count);
|
||||
_worldPacket.WriteInt32(Info.Expansion);
|
||||
_worldPacket.WriteInt32(Info.ManagedWorldStateID);
|
||||
_worldPacket.WriteInt32(Info.QuestSessionBonus);
|
||||
@@ -207,6 +207,10 @@ namespace Game.Networking.Packets
|
||||
foreach (QuestCompleteDisplaySpell rewardDisplaySpell in Info.RewardDisplaySpell)
|
||||
rewardDisplaySpell.Write(_worldPacket);
|
||||
|
||||
if (!Info.TreasurePickerID.Empty())
|
||||
foreach (var id in Info.TreasurePickerID)
|
||||
_worldPacket.WriteInt32(id);
|
||||
|
||||
_worldPacket.WriteBits(Info.LogTitle.GetByteCount(), 9);
|
||||
_worldPacket.WriteBits(Info.LogDescription.GetByteCount(), 12);
|
||||
_worldPacket.WriteBits(Info.QuestDescription.GetByteCount(), 12);
|
||||
@@ -217,12 +221,13 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteBits(Info.PortraitTurnInName.GetByteCount(), 8);
|
||||
_worldPacket.WriteBits(Info.QuestCompletionLog.GetByteCount(), 11);
|
||||
_worldPacket.WriteBit(Info.ReadyForTranslation);
|
||||
_worldPacket.WriteBit(Info.ResetByScheduler);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
foreach (QuestObjective questObjective in Info.Objectives)
|
||||
{
|
||||
_worldPacket.WriteUInt32(questObjective.Id);
|
||||
_worldPacket.WriteUInt8((byte)questObjective.Type);
|
||||
_worldPacket.WriteInt32((int)questObjective.Type);
|
||||
_worldPacket.WriteInt8(questObjective.StorageIndex);
|
||||
_worldPacket.WriteInt32(questObjective.ObjectID);
|
||||
_worldPacket.WriteInt32(questObjective.Amount);
|
||||
@@ -463,6 +468,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteInt32(DescEmotes.Count);
|
||||
_worldPacket.WriteInt32(Objectives.Count);
|
||||
_worldPacket.WriteInt32(QuestStartItemID);
|
||||
_worldPacket.WriteInt32(QuestInfoID);
|
||||
_worldPacket.WriteInt32(QuestSessionBonus);
|
||||
_worldPacket.WriteInt32(QuestGiverCreatureID);
|
||||
_worldPacket.WriteInt32(ConditionalDescriptionText.Count);
|
||||
@@ -479,9 +485,9 @@ namespace Game.Networking.Packets
|
||||
foreach (QuestObjectiveSimple obj in Objectives)
|
||||
{
|
||||
_worldPacket.WriteUInt32(obj.Id);
|
||||
_worldPacket.WriteUInt8(obj.Type);
|
||||
_worldPacket.WriteInt32(obj.ObjectID);
|
||||
_worldPacket.WriteInt32(obj.Amount);
|
||||
_worldPacket.WriteUInt8(obj.Type);
|
||||
}
|
||||
|
||||
_worldPacket.WriteBits(QuestTitle.GetByteCount(), 9);
|
||||
@@ -527,6 +533,7 @@ namespace Game.Networking.Packets
|
||||
public uint PortraitGiverMount;
|
||||
public int PortraitGiverModelSceneID;
|
||||
public int QuestStartItemID;
|
||||
public int QuestInfoID;
|
||||
public int QuestSessionBonus;
|
||||
public int QuestGiverCreatureID;
|
||||
public string PortraitGiverText = "";
|
||||
@@ -562,6 +569,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteInt32(Collect.Count);
|
||||
_worldPacket.WriteInt32(Currency.Count);
|
||||
_worldPacket.WriteInt32(StatusFlags);
|
||||
_worldPacket.WriteInt32(QuestInfoID);
|
||||
|
||||
foreach (QuestObjectiveCollect obj in Collect)
|
||||
{
|
||||
@@ -603,6 +611,7 @@ namespace Game.Networking.Packets
|
||||
public List<QuestObjectiveCollect> Collect = new();
|
||||
public List<QuestCurrency> Currency = new();
|
||||
public int StatusFlags;
|
||||
public int QuestInfoID;
|
||||
public uint[] QuestFlags = new uint[3];
|
||||
public string QuestTitle = "";
|
||||
public string CompletionText = "";
|
||||
@@ -1078,7 +1087,7 @@ namespace Game.Networking.Packets
|
||||
public uint CompleteSoundKitID;
|
||||
public uint AreaGroupID;
|
||||
public long TimeAllowed;
|
||||
public int TreasurePickerID;
|
||||
public List<int> TreasurePickerID = new();
|
||||
public int Expansion;
|
||||
public int ManagedWorldStateID;
|
||||
public int QuestSessionBonus;
|
||||
@@ -1098,6 +1107,24 @@ namespace Game.Networking.Packets
|
||||
public uint[] RewardCurrencyID = new uint[SharedConst.QuestRewardCurrencyCount];
|
||||
public uint[] RewardCurrencyQty = new uint[SharedConst.QuestRewardCurrencyCount];
|
||||
public bool ReadyForTranslation;
|
||||
public bool ResetByScheduler;
|
||||
}
|
||||
|
||||
public struct QuestRewardItem
|
||||
{
|
||||
public uint ItemID;
|
||||
public uint ItemQty;
|
||||
public QuestRewardContextFlags? ContextFlags;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(ItemID);
|
||||
data.WriteUInt32(ItemQty);
|
||||
data.WriteBit(ContextFlags.HasValue);
|
||||
data.FlushBits();
|
||||
if (ContextFlags.HasValue)
|
||||
data.WriteInt32((int)ContextFlags);
|
||||
}
|
||||
}
|
||||
|
||||
public struct QuestChoiceItem
|
||||
@@ -1105,21 +1132,47 @@ namespace Game.Networking.Packets
|
||||
public LootItemType LootItemType;
|
||||
public ItemInstance Item;
|
||||
public uint Quantity;
|
||||
public QuestRewardContextFlags? ContextFlags;
|
||||
|
||||
public void Read(WorldPacket data)
|
||||
{
|
||||
data.ResetBitPos();
|
||||
LootItemType = (LootItemType)data.ReadBits<byte>(2);
|
||||
bool hasContextFlags = data.HasBit();
|
||||
Item = new ItemInstance();
|
||||
Item.Read(data);
|
||||
Quantity = data.ReadUInt32();
|
||||
if (hasContextFlags)
|
||||
ContextFlags = (QuestRewardContextFlags)data.ReadInt32();
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteBits((byte)LootItemType, 2);
|
||||
data.WriteBit(ContextFlags.HasValue);
|
||||
Item.Write(data);
|
||||
data.WriteUInt32(Quantity);
|
||||
if (ContextFlags.HasValue)
|
||||
data.WriteInt32((int)ContextFlags.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public struct QuestRewardCurrency
|
||||
{
|
||||
public uint CurrencyID;
|
||||
public uint CurrencyQty;
|
||||
public int BonusQty;
|
||||
public QuestRewardContextFlags? ContextFlags;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(CurrencyID);
|
||||
data.WriteUInt32(CurrencyQty);
|
||||
data.WriteInt32(BonusQty);
|
||||
data.WriteBit(ContextFlags.HasValue);
|
||||
data.FlushBits();
|
||||
if (ContextFlags.HasValue)
|
||||
data.WriteInt32((int)ContextFlags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1138,29 +1191,23 @@ namespace Game.Networking.Packets
|
||||
public uint SpellCompletionID;
|
||||
public uint SkillLineID;
|
||||
public uint NumSkillUps;
|
||||
public uint TreasurePickerID;
|
||||
public List<int> TreasurePickerID = new();
|
||||
public QuestChoiceItem[] ChoiceItems = new QuestChoiceItem[SharedConst.QuestRewardChoicesCount];
|
||||
public uint[] ItemID = new uint[SharedConst.QuestRewardItemCount];
|
||||
public uint[] ItemQty = new uint[SharedConst.QuestRewardItemCount];
|
||||
public QuestRewardItem[] Items = new QuestRewardItem[SharedConst.QuestRewardItemCount];
|
||||
public uint[] FactionID = new uint[SharedConst.QuestRewardReputationsCount];
|
||||
public int[] FactionValue = new int[SharedConst.QuestRewardReputationsCount];
|
||||
public int[] FactionOverride = new int[SharedConst.QuestRewardReputationsCount];
|
||||
public int[] FactionCapIn = new int[SharedConst.QuestRewardReputationsCount];
|
||||
public uint[] CurrencyID = new uint[SharedConst.QuestRewardCurrencyCount];
|
||||
public uint[] CurrencyQty = new uint[SharedConst.QuestRewardCurrencyCount];
|
||||
public QuestRewardCurrency[] Currencies = new QuestRewardCurrency[SharedConst.QuestRewardCurrencyCount];
|
||||
public bool IsBoostSpell;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
foreach (QuestRewardItem item in Items)
|
||||
item.Write(data);
|
||||
|
||||
data.WriteUInt32(ChoiceItemCount);
|
||||
data.WriteUInt32(ItemCount);
|
||||
|
||||
for (int i = 0; i < SharedConst.QuestRewardItemCount; ++i)
|
||||
{
|
||||
data.WriteUInt32(ItemID[i]);
|
||||
data.WriteUInt32(ItemQty[i]);
|
||||
}
|
||||
|
||||
data.WriteUInt32(Money);
|
||||
data.WriteUInt32(XP);
|
||||
data.WriteUInt64(ArtifactXP);
|
||||
@@ -1181,22 +1228,21 @@ namespace Game.Networking.Packets
|
||||
data.WriteInt32(id);
|
||||
|
||||
data.WriteUInt32(SpellCompletionID);
|
||||
|
||||
for (int i = 0; i < SharedConst.QuestRewardCurrencyCount; ++i)
|
||||
{
|
||||
data.WriteUInt32(CurrencyID[i]);
|
||||
data.WriteUInt32(CurrencyQty[i]);
|
||||
}
|
||||
|
||||
data.WriteUInt32(SkillLineID);
|
||||
data.WriteUInt32(NumSkillUps);
|
||||
data.WriteUInt32(TreasurePickerID);
|
||||
data.WriteInt32(TreasurePickerID.Count);
|
||||
if (!TreasurePickerID.Empty())
|
||||
foreach (var id in TreasurePickerID)
|
||||
data.WriteInt32(id);
|
||||
|
||||
foreach (var choice in ChoiceItems)
|
||||
choice.Write(data);
|
||||
foreach (QuestRewardCurrency currency in Currencies)
|
||||
currency.Write(data);
|
||||
|
||||
data.WriteBit(IsBoostSpell);
|
||||
data.FlushBits();
|
||||
|
||||
foreach (QuestChoiceItem choiceItem in ChoiceItems)
|
||||
choiceItem.Write(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1223,8 +1269,9 @@ namespace Game.Networking.Packets
|
||||
data.WriteUInt32(QuestFlags[1]); // FlagsEx
|
||||
data.WriteUInt32(QuestFlags[2]); // FlagsEx2
|
||||
data.WriteUInt32(SuggestedPartyMembers);
|
||||
|
||||
data.WriteInt32(QuestInfoID);
|
||||
data.WriteInt32(Emotes.Count);
|
||||
|
||||
foreach (QuestDescEmote emote in Emotes)
|
||||
{
|
||||
data.WriteInt32(emote.Type);
|
||||
@@ -1246,14 +1293,15 @@ namespace Game.Networking.Packets
|
||||
public QuestRewards Rewards = new();
|
||||
public List<QuestDescEmote> Emotes = new();
|
||||
public uint[] QuestFlags = new uint[3]; // Flags and FlagsEx
|
||||
public int QuestInfoID;
|
||||
}
|
||||
|
||||
public struct QuestObjectiveSimple
|
||||
{
|
||||
public uint Id;
|
||||
public byte Type;
|
||||
public int ObjectID;
|
||||
public int Amount;
|
||||
public byte Type;
|
||||
}
|
||||
|
||||
public struct QuestObjectiveCollect
|
||||
|
||||
Reference in New Issue
Block a user