public static void HandleQuestRequestItems(Packet packet) { var questRequestItems = new QuestRequestItems(); packet.ReadPackedGuid128("QuestGiverGUID"); packet.ReadInt32("QuestGiverCreatureID"); var id = packet.ReadInt32("QuestID"); questRequestItems.CompEmoteDelay = packet.ReadInt32("CompEmoteDelay"); questRequestItems.CompEmoteType = packet.ReadInt32("CompEmoteType"); for (int i = 0; i < 2; i++) packet.ReadInt32("QuestFlags", i); packet.ReadInt32("SuggestPartyMembers"); packet.ReadInt32("MoneyToGet"); var int44 = packet.ReadInt32("QuestObjectiveCollectCount"); var int60 = packet.ReadInt32("QuestCurrencyCount"); packet.ReadInt32("StatusFlags"); for (int i = 0; i < int44; i++) { packet.ReadInt32("ObjectID", i); packet.ReadInt32("Amount", i); } for (int i = 0; i < int60; i++) { packet.ReadInt32("CurrencyID", i); packet.ReadInt32("Amount", i); } packet.ResetBitReader(); packet.ReadBit("AutoLaunched"); packet.ResetBitReader(); var bits3016 = packet.ReadBits(9); var bits16 = packet.ReadBits(12); packet.ReadWoWString("QuestTitle", bits3016); questRequestItems.CompletionText = packet.ReadWoWString("CompletionText", bits16); Storage.QuestRequestItems.Add((uint)id, questRequestItems, packet.TimeSpan); }
public static void HandleQuestRequestItems(Packet packet) { packet.ReadGuid("GUID"); uint entry = packet.ReadUInt32<QuestId>("Quest ID"); packet.ReadCString("Title"); string text = packet.ReadCString("Text"); QuestRequestItems requestItems = new QuestRequestItems { ID = entry, CompletionText = text }; requestItems.EmoteOnComplete = packet.ReadUInt32("Emote"); packet.ReadUInt32("Unk UInt32 1"); packet.ReadUInt32("Close Window on Cancel"); if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3_11685)) packet.ReadUInt32E<QuestFlags>("Quest Flags"); packet.ReadUInt32("Suggested Players"); packet.ReadUInt32("Money"); uint count = packet.ReadUInt32("Number of Required Items"); for (int i = 0; i < count; i++) { packet.ReadUInt32<ItemId>("Required Item Id", i); packet.ReadUInt32("Required Item Count", i); packet.ReadUInt32("Required Item Display Id", i); } // flags packet.ReadUInt32("Unk flags 1"); packet.ReadUInt32("Unk flags 2"); packet.ReadUInt32("Unk flags 3"); packet.ReadUInt32("Unk flags 4"); if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_1_13164)) { packet.ReadUInt32("Unk flags 5"); packet.ReadUInt32("Unk flags 6"); } requestItems.EmoteOnCompleteDelay = 0; Storage.QuestRequestItems.Add(requestItems, packet.TimeSpan); }
public static void HandleQuestRequestItems510(Packet packet) { packet.ReadGuid("GUID"); uint entry = packet.ReadUInt32<QuestId>("Quest ID"); packet.ReadCString("Title"); string text = packet.ReadCString("Text"); QuestRequestItems requestItems = new QuestRequestItems { ID = entry, CompletionText = text }; requestItems.EmoteOnComplete = packet.ReadUInt32("Emote"); requestItems.EmoteOnCompleteDelay = packet.ReadUInt32("Delay"); packet.ReadUInt32("Close Window on Cancel"); packet.ReadUInt32E<QuestFlags>("Quest Flags"); packet.ReadUInt32E<QuestFlags2>("Quest Flags 2"); packet.ReadUInt32("Suggested Players"); packet.ReadUInt32("Money"); uint countItems = packet.ReadUInt32("Number of Required Items"); for (int i = 0; i < countItems; i++) { packet.ReadUInt32<ItemId>("Required Item Id", i); packet.ReadUInt32("Required Item Count", i); packet.ReadUInt32("Required Item Display Id", i); } uint countCurrencies = packet.ReadUInt32("Number of Required Currencies"); for (int i = 0; i < countCurrencies; i++) { packet.ReadUInt32("Required Currency Id", i); packet.ReadUInt32("Required Currency Count", i); } // flags, if any of these flags is 0 quest is not completable packet.ReadUInt32("Unk flags 1"); // 2 packet.ReadUInt32("Unk flags 2"); // 4 packet.ReadUInt32("Unk flags 3"); // 8 packet.ReadUInt32("Unk flags 4"); // 16 packet.ReadUInt32("Unk flags 5"); // 64 Storage.QuestRequestItems.Add(requestItems, packet.TimeSpan); }
public static void HandleQuestGiverRequestItems(Packet packet) { packet.ReadPackedGuid128("QuestGiverGUID"); packet.ReadInt32("QuestGiverCreatureID"); int id = packet.ReadInt32("QuestID"); QuestRequestItems questRequestItems = new QuestRequestItems { ID = (uint)id }; questRequestItems.EmoteOnCompleteDelay = (uint)packet.ReadInt32("CompEmoteDelay"); questRequestItems.EmoteOnComplete = (uint)packet.ReadInt32("CompEmoteType"); for (int i = 0; i < 2; i++) packet.ReadInt32("QuestFlags", i); packet.ReadInt32("SuggestPartyMembers"); packet.ReadInt32("MoneyToGet"); int collectCount = packet.ReadInt32("CollectCount"); int currencyCount = packet.ReadInt32("CurrencyCount"); packet.ReadInt32("StatusFlags"); for (int i = 0; i < collectCount; i++) { packet.ReadInt32("ObjectID", i); packet.ReadInt32("Amount", i); packet.ReadUInt32("Flags", i); } for (int i = 0; i < currencyCount; i++) { packet.ReadInt32("CurrencyID", i); packet.ReadInt32("Amount", i); } packet.ResetBitReader(); packet.ReadBit("AutoLaunched"); packet.ReadBit("CanIgnoreQuest"); packet.ReadBit("IsQuestIgnored"); packet.ResetBitReader(); uint questTitleLen = packet.ReadBits(9); uint completionTextLen = packet.ReadBits(12); packet.ReadWoWString("QuestTitle", questTitleLen); questRequestItems.CompletionText = packet.ReadWoWString("CompletionText", completionTextLen); Storage.QuestRequestItems.Add(questRequestItems, packet.TimeSpan); }