From e95f3c0b4e6895d1d75efc34c5264e373ddedbed Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Tue, 5 Nov 2024 20:49:43 +0100 Subject: [PATCH] Fixed SMSG_QUERY_QUEST_INFO_RESPONSE structure for 4.4.1 --- .../Parsers/QuestHandler.cs | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/WowPacketParserModule.V4_4_0_54481/Parsers/QuestHandler.cs b/WowPacketParserModule.V4_4_0_54481/Parsers/QuestHandler.cs index 640e5eb8b8..138230ffeb 100644 --- a/WowPacketParserModule.V4_4_0_54481/Parsers/QuestHandler.cs +++ b/WowPacketParserModule.V4_4_0_54481/Parsers/QuestHandler.cs @@ -373,13 +373,50 @@ public static void HandleQuestQueryResponse(Packet packet) quest.TimeAllowed = packet.ReadInt64("TimeAllowed"); uint objectiveCount = packet.ReadUInt32("ObjectiveCount"); quest.AllowableRacesWod = packet.ReadUInt64("AllowableRaces"); - quest.QuestRewardID = packet.ReadInt32("TreasurePickerID"); + + var treasurePickerCount = 0u; + var treasurePickerCount2 = 0u; + if (ClientVersion.RemovedInVersion(ClientVersionBuild.V4_4_1_57294)) + quest.QuestRewardID = packet.ReadInt32("TreasurePickerID"); + else + { + treasurePickerCount = packet.ReadUInt32(); + treasurePickerCount2 = packet.ReadUInt32(); + } + quest.Expansion = packet.ReadInt32("Expansion"); packet.ReadInt32("QuestGiverCreatureID"); var conditionalQuestDescriptionCount = packet.ReadUInt32(); var conditionalQuestCompletionLogCount = packet.ReadUInt32(); + if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_4_1_57294)) + { + for (uint i = 0; i < treasurePickerCount; ++i) + { + var treasurePickerID = packet.ReadInt32("TreasurePickerID"); + QuestTreasurePickers pickers = new() + { + QuestID = quest.ID, + TreasurePickerID = treasurePickerID, + OrderIndex = (int)i + }; + Storage.QuestTreasurePickersStorage.Add(pickers); + } + + for (uint i = 0; i < treasurePickerCount2; ++i) + { + var treasurePickerID = packet.ReadInt32("TreasurePickerID2"); + //QuestTreasurePickers pickers = new() + //{ + // QuestID = quest.ID, + // TreasurePickerID = treasurePickerID, + // OrderIndex = (int)i + //}; + //Storage.QuestTreasurePickersStorage.Add(pickers); + } + } + packet.ResetBitReader(); uint logTitleLen = packet.ReadBits(9); @@ -401,7 +438,12 @@ public static void HandleQuestQueryResponse(Packet packet) ID = (uint)objectiveId.Key, QuestID = (uint)id.Key }; - questInfoObjective.Type = packet.ReadByteE("Quest Requirement Type", i); + + if (ClientVersion.RemovedInVersion(ClientVersionBuild.V4_4_1_57294)) + questInfoObjective.Type = packet.ReadByteE("Quest Requirement Type", i); + else + questInfoObjective.Type = packet.ReadInt32E("Quest Requirement Type", i); + questInfoObjective.StorageIndex = packet.ReadSByte("StorageIndex", i); questInfoObjective.Order = i; questInfoObjective.ObjectID = packet.ReadInt32("ObjectID", i);