Example #1
0
        public static void HandleQuestOfferReward(Packet packet)
        {
            packet.ReadGuid("GUID");
            uint entry = packet.ReadUInt32<QuestId>("Quest ID");
            packet.ReadCString("Title");
            string text = packet.ReadCString("Text");
            QuestOfferReward offerReward = new QuestOfferReward
            {
                ID = entry,
                RewardText = text
            };

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_1_13164))
            {
                packet.ReadCString("QuestGiver Text Window");
                packet.ReadCString("QuestGiver Target Name");
                packet.ReadCString("QuestTurn Text Window");
                packet.ReadCString("QuestTurn Target Name");
                packet.ReadUInt32("QuestGiverPortrait");
                packet.ReadUInt32("QuestTurnInPortrait");
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_0_10958))
                packet.ReadBool("Auto Finish");
            else
                packet.ReadBool<Int32>("Auto Finish");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3_11685))
                packet.ReadUInt32E<QuestFlags>("Quest Flags");

            packet.ReadUInt32("Suggested Players");

            uint count1 = packet.ReadUInt32("Emote Count");
            uint?[] emoteIDs = {0, 0, 0, 0};
            uint?[] emoteDelays = {0, 0, 0, 0};
            for (int i = 0; i < count1; i++)
            {
                emoteDelays[i] = packet.ReadUInt32("Emote Delay", i);
                emoteIDs[i] = (uint)packet.ReadUInt32E<EmoteType>("Emote Id", i);
            }
            offerReward.Emote = emoteIDs;
            offerReward.EmoteDelay = emoteDelays;

            ReadExtraQuestInfo(packet);

            Storage.QuestOfferRewards.Add(offerReward, packet.TimeSpan);
        }
Example #2
0
        public static void HandleQuestOfferReward(Packet packet)
        {
            var questOfferReward = new QuestOfferReward();

            packet.ReadPackedGuid128("QuestGiverGUID");

            packet.ReadInt32("QuestGiverCreatureID");
            var id = packet.ReadInt32("QuestID");

            for (int i = 0; i < 2; i++)
                packet.ReadInt32("QuestFlags", i);

            packet.ReadInt32("SuggestedPartyMembers");

            ReadQuestRewards(packet);

            var int252 = packet.ReadInt32("EmotesCount");

            // QuestDescEmote
            questOfferReward.Emote = new uint[4];
            questOfferReward.EmoteDelay = new uint[4];
            for (int i = 0; i < int252; i++)
            {
                questOfferReward.Emote[i] = (uint)packet.ReadInt32("Type");
                questOfferReward.EmoteDelay[i] = packet.ReadUInt32("Delay");
            }

            packet.ResetBitReader();

            packet.ReadBit("AutoLaunched");

            packet.ReadInt32("PortraitTurnIn");
            packet.ReadInt32("PortraitGiver");
            packet.ReadInt32("QuestPackageID");

            packet.ResetBitReader();

            var bits1139 = packet.ReadBits(9);
            var bits69 = packet.ReadBits(12);
            var bits883 = packet.ReadBits(10);
            var bits819 = packet.ReadBits(8);
            var bits1268 = packet.ReadBits(10);
            var bits4 = packet.ReadBits(8);

            packet.ReadWoWString("QuestTitle", bits1139);
            questOfferReward.RewardText = packet.ReadWoWString("RewardText", bits69);
            packet.ReadWoWString("PortraitGiverText", bits883);
            packet.ReadWoWString("PortraitGiverName", bits819);
            packet.ReadWoWString("PortraitTurnInText", bits1268);
            packet.ReadWoWString("PortraitTurnInName", bits4);

            Storage.QuestOfferRewards.Add((uint)id, questOfferReward, packet.TimeSpan);
        }
Example #3
0
        public static void QuestGiverOfferReward(Packet packet)
        {
            packet.ReadPackedGuid128("QuestGiverGUID");

            packet.ReadInt32("QuestGiverCreatureID");
            int id = packet.ReadInt32("QuestID");

            QuestOfferReward questOfferReward = new QuestOfferReward
            {
                ID = (uint)id
            };

            for (int i = 0; i < 2; i++)
                packet.ReadInt32("QuestFlags", i);

            packet.ReadInt32("SuggestedPartyMembers");

            int emotesCount = packet.ReadInt32("EmotesCount");

            // QuestDescEmote
            questOfferReward.Emote = new uint?[] { 0, 0, 0, 0 };
            questOfferReward.EmoteDelay = new uint?[] { 0, 0, 0, 0 };
            for (int i = 0; i < emotesCount; i++)
            {
                questOfferReward.Emote[i] = (uint)packet.ReadInt32("Type");
                questOfferReward.EmoteDelay[i] = packet.ReadUInt32("Delay");
            }

            packet.ResetBitReader();

            packet.ReadBit("AutoLaunched");

            ReadQuestRewards(packet, "QuestRewards");

            packet.ReadInt32("PortraitTurnIn");
            packet.ReadInt32("PortraitGiver");
            packet.ReadInt32("QuestPackageID");

            packet.ResetBitReader();

            uint questTitleLen = packet.ReadBits(9);
            uint rewardTextLen = packet.ReadBits(12);
            uint portraitGiverTextLen = packet.ReadBits(10);
            uint portraitGiverNameLen = packet.ReadBits(8);
            uint portraitTurnInTextLen = packet.ReadBits(10);
            uint portraitTurnInNameLen = packet.ReadBits(8);

            packet.ReadWoWString("QuestTitle", questTitleLen);
            questOfferReward.RewardText = packet.ReadWoWString("RewardText", rewardTextLen);
            packet.ReadWoWString("PortraitGiverText", portraitGiverTextLen);
            packet.ReadWoWString("PortraitGiverName", portraitGiverNameLen);
            packet.ReadWoWString("PortraitTurnInText", portraitTurnInTextLen);
            packet.ReadWoWString("PortraitTurnInName", portraitTurnInNameLen);

            Storage.QuestOfferRewards.Add(questOfferReward, packet.TimeSpan);
        }