Exemplo n.º 1
0
        public static void HandleQuestgiverDetails(Packet packet)
        {
            var questDetails = new QuestDetails();

            packet.ReadPackedGuid128("QuestGiverGUID");
            packet.ReadPackedGuid128("InformUnit");

            var id = packet.ReadInt32("QuestID");
            packet.ReadInt32("QuestPackageID");
            packet.ReadInt32("PortraitGiver");
            packet.ReadInt32("SuggestedPartyMembers");

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

            packet.ReadInt32("PortraitTurnIn");
            var int5860 = packet.ReadInt32("LearnSpellsCount");

            ReadQuestRewards(packet);

            var int2584 = packet.ReadInt32("DescEmotesCount");
            var int5876 = packet.ReadInt32("ObjectivesCount");

            for (int i = 0; i < int5860; i++)
                packet.ReadInt32("LearnSpells", i);

            questDetails.Emote = new uint[4];
            questDetails.EmoteDelay = new uint[4];
            for (int i = 0; i < int2584; i++)
            {
                questDetails.Emote[i] = (uint)packet.ReadInt32("Type", i);
                questDetails.EmoteDelay[i] = packet.ReadUInt32("Delay", i);
            }

            for (int i = 0; i < int5876; i++)
            {
                packet.ReadInt32("ObjectID", i);
                packet.ReadInt32("ObjectID", i);
                packet.ReadInt32("Amount", i);
                packet.ReadByte("Type", i);
            }

            packet.ResetBitReader();

            var bits516 = packet.ReadBits(9);
            var bits1606 = packet.ReadBits(12);
            var bits715 = packet.ReadBits(12);
            var bits260 = packet.ReadBits(10);
            var bits650 = packet.ReadBits(8);
            var bits4 = packet.ReadBits(10);
            var bits1532 = packet.ReadBits(8);

            packet.ReadBit("DisplayPopup");
            packet.ReadBit("StartCheat");
            packet.ReadBit("AutoLaunched");

            packet.ReadWoWString("QuestTitle", bits516);
            packet.ReadWoWString("DescriptionText", bits1606);
            packet.ReadWoWString("LogDescription", bits715);
            packet.ReadWoWString("PortraitGiverText", bits260);
            packet.ReadWoWString("PortraitGiverName", bits650);
            packet.ReadWoWString("PortraitTurnInText", bits4);
            packet.ReadWoWString("PortraitTurnInName", bits1532);

            Storage.QuestDetails.Add((uint)id, questDetails, packet.TimeSpan);
        }
Exemplo n.º 2
0
        public static void HandleQuestGiverQuestDetails(Packet packet)
        {
            packet.ReadPackedGuid128("QuestGiverGUID");
            packet.ReadPackedGuid128("InformUnit");

            int id = packet.ReadInt32("QuestID");
            QuestDetails questDetails = new QuestDetails
            {
                ID = (uint)id
            };

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

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

            packet.ReadInt32("PortraitTurnIn");
            int learnSpellsCount = packet.ReadInt32("LearnSpellsCount");

            ReadQuestRewards(packet);

            int descEmotesCount = packet.ReadInt32("DescEmotesCount");
            int objectivesCount = packet.ReadInt32("ObjectivesCount");
            packet.ReadInt32("QuestStartItemID");

            for (int i = 0; i < learnSpellsCount; i++)
                packet.ReadInt32("LearnSpells", i);

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

            for (int i = 0; i < objectivesCount; i++)
            {
                packet.ReadInt32("ObjectID", i);
                packet.ReadInt32("ObjectID", i);
                packet.ReadInt32("Amount", i);
                packet.ReadByte("Type", i);
            }

            packet.ResetBitReader();

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

            packet.ReadBit("DisplayPopup");
            packet.ReadBit("StartCheat");
            packet.ReadBit("AutoLaunched");
            packet.ReadBit("CanIgnoreQuest");
            packet.ReadBit("IsQuestIgnored");

            packet.ReadWoWString("QuestTitle", questTitleLen);
            packet.ReadWoWString("DescriptionText", descriptionTextLen);
            packet.ReadWoWString("LogDescription", logDescriptionLen);
            packet.ReadWoWString("PortraitGiverText", portraitGiverTextLen);
            packet.ReadWoWString("PortraitGiverName", portraitGiverNameLen);
            packet.ReadWoWString("PortraitTurnInText", portraitTurnInTextLen);
            packet.ReadWoWString("PortraitTurnInName", portraitTurnInNameLen);

            Storage.QuestDetails.Add(questDetails, packet.TimeSpan);
        }