Ejemplo n.º 1
0
        private static void LoadQuestTemplateLocale()
        {
            //                                                  0       1
            var query = new StringBuilder(string.Format("SELECT Id, locale, " +
                                                        //  2            3                 4                5                 6                  7                   8                   9                  10              11
                                                        "LogTitle, LogDescription, QuestDescription, AreaDescription, PortraitGiverText, PortraitGiverName, PortraitTurnInText, PortraitTurnInName, QuestCompletionLog, VerifiedBuild" +
                                                        " FROM {0}.quest_template_locale;", Settings.TDBDatabase));

            using (var reader = SQLConnector.ExecuteQuery(query.ToString()))
            {
                if (reader == null)
                {
                    return;
                }

                while (reader.Read())
                {
                    var localesQuest = new LocalesQuest();

                    var id     = (uint)reader.GetValue(0);
                    var locale = (string)reader.GetValue(1);

                    localesQuest.LogTitle           = (string)reader.GetValue(2);
                    localesQuest.LogDescription     = (string)reader.GetValue(3);
                    localesQuest.QuestDescription   = (string)reader.GetValue(4);
                    localesQuest.AreaDescription    = (string)reader.GetValue(5);
                    localesQuest.PortraitGiverText  = (string)reader.GetValue(6);
                    localesQuest.PortraitGiverName  = (string)reader.GetValue(7);
                    localesQuest.PortraitTurnInText = (string)reader.GetValue(8);
                    localesQuest.PortraitTurnInName = (string)reader.GetValue(9);
                    localesQuest.QuestCompletionLog = (string)reader.GetValue(10);
                    localesQuest.VerifiedBuild      = Convert.ToInt16(reader.GetValue(11));

                    LocalesQuestStores.Add(Tuple.Create(id, locale), localesQuest);
                }
            }
        }
Ejemplo n.º 2
0
        public static void HandleQuestQueryResponse(Packet packet)
        {
            packet.ReadInt32("Entry");

            Bit hasData = packet.ReadBit("Has Data");

            if (!hasData)
            {
                return; // nothing to do
            }
            var id = packet.ReadEntry("Quest ID");

            QuestTemplate quest = new QuestTemplate
            {
                ID = (uint)id.Key
            };

            quest.QuestType  = packet.ReadInt32E <QuestType>("QuestType");
            quest.QuestLevel = packet.ReadInt32("QuestLevel");
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V7_3_5_25848))
            {
                quest.QuestMaxScalingLevel = packet.ReadInt32("QuestMaxScalingLevel");
            }
            quest.QuestPackageID     = packet.ReadUInt32("QuestPackageID");
            quest.MinLevel           = packet.ReadInt32("QuestMinLevel");
            quest.QuestSortID        = (QuestSort)packet.ReadUInt32("QuestSortID");
            quest.QuestInfoID        = packet.ReadInt32E <QuestInfo>("QuestInfoID");
            quest.SuggestedGroupNum  = packet.ReadUInt32("SuggestedGroupNum");
            quest.RewardNextQuest    = packet.ReadUInt32("RewardNextQuest");
            quest.RewardXPDifficulty = packet.ReadUInt32("RewardXPDifficulty");

            quest.RewardXPMultiplier = packet.ReadSingle("RewardXPMultiplier");

            quest.RewardMoney           = packet.ReadInt32("RewardMoney");
            quest.RewardMoneyDifficulty = packet.ReadUInt32("RewardMoneyDifficulty");

            quest.RewardMoneyMultiplier = packet.ReadSingle("RewardMoneyMultiplier");

            quest.RewardBonusMoney = packet.ReadUInt32("RewardBonusMoney");

            quest.RewardDisplaySpellLegion = new uint?[3];
            for (int i = 0; i < 3; ++i)
            {
                quest.RewardDisplaySpellLegion[i] = packet.ReadUInt32("RewardDisplaySpell", i);
            }

            quest.RewardSpellWod = packet.ReadUInt32("RewardSpell");
            quest.RewardHonorWod = packet.ReadUInt32("RewardHonor");

            quest.RewardKillHonor = packet.ReadSingle("RewardKillHonor");

            quest.RewardArtifactXPDifficulty = packet.ReadUInt32("RewardArtifactXPDifficulty");
            quest.RewardArtifactXPMultiplier = packet.ReadSingle("RewardArtifactXPMultiplier");
            quest.RewardArtifactCategoryID   = packet.ReadUInt32("RewardArtifactCategoryID");

            quest.StartItem = packet.ReadUInt32("StartItem");
            quest.Flags     = packet.ReadUInt32E <QuestFlags>("Flags");
            quest.FlagsEx   = packet.ReadUInt32E <QuestFlagsEx>("FlagsEx");

            quest.RewardItem       = new uint?[4];
            quest.RewardAmount     = new uint?[4];
            quest.ItemDrop         = new uint?[4];
            quest.ItemDropQuantity = new uint?[4];
            for (int i = 0; i < 4; ++i)
            {
                quest.RewardItem[i]       = packet.ReadUInt32("RewardItems", i);
                quest.RewardAmount[i]     = packet.ReadUInt32("RewardAmount", i);
                quest.ItemDrop[i]         = packet.ReadUInt32("ItemDrop", i);
                quest.ItemDropQuantity[i] = packet.ReadUInt32("ItemDropQuantity", i);
            }

            quest.RewardChoiceItemID        = new uint?[6];
            quest.RewardChoiceItemQuantity  = new uint?[6];
            quest.RewardChoiceItemDisplayID = new uint?[6];
            for (int i = 0; i < 6; ++i) // CliQuestInfoChoiceItem
            {
                quest.RewardChoiceItemID[i]        = packet.ReadUInt32("RewardChoiceItemID", i);
                quest.RewardChoiceItemQuantity[i]  = packet.ReadUInt32("RewardChoiceItemQuantity", i);
                quest.RewardChoiceItemDisplayID[i] = packet.ReadUInt32("RewardChoiceItemDisplayID", i);
            }

            quest.POIContinent = packet.ReadUInt32("POIContinent");

            quest.POIx = packet.ReadSingle("POIx");
            quest.POIy = packet.ReadSingle("POIy");

            quest.POIPriorityWod      = packet.ReadInt32("POIPriority");
            quest.RewardTitle         = packet.ReadUInt32("RewardTitle");
            quest.RewardArenaPoints   = packet.ReadUInt32("RewardArenaPoints");
            quest.RewardSkillLineID   = packet.ReadUInt32("RewardSkillLineID");
            quest.RewardNumSkillUps   = packet.ReadUInt32("RewardNumSkillUps");
            quest.QuestGiverPortrait  = packet.ReadUInt32("PortraitGiver");
            quest.QuestTurnInPortrait = packet.ReadUInt32("PortraitTurnIn");

            quest.RewardFactionID       = new uint?[5];
            quest.RewardFactionOverride = new int?[5];
            quest.RewardFactionValue    = new int?[5];
            quest.RewardFactionCapIn    = new int?[5];
            for (int i = 0; i < 5; ++i)
            {
                quest.RewardFactionID[i]       = packet.ReadUInt32("RewardFactionID", i);
                quest.RewardFactionValue[i]    = packet.ReadInt32("RewardFactionValue", i);
                quest.RewardFactionOverride[i] = packet.ReadInt32("RewardFactionOverride", i);
                quest.RewardFactionCapIn[i]    = packet.ReadInt32("RewardFactionCapIn", i);
            }

            quest.RewardFactionFlags = packet.ReadUInt32("RewardFactionFlags");

            quest.RewardCurrencyID    = new uint?[4];
            quest.RewardCurrencyCount = new uint?[4];
            for (int i = 0; i < 4; ++i)
            {
                quest.RewardCurrencyID[i]    = packet.ReadUInt32("RewardCurrencyID");
                quest.RewardCurrencyCount[i] = packet.ReadUInt32("RewardCurrencyQty");
            }

            quest.SoundAccept = packet.ReadUInt32("AcceptedSoundKitID");
            quest.SoundTurnIn = packet.ReadUInt32("CompleteSoundKitID");
            quest.AreaGroupID = packet.ReadUInt32("AreaGroupID");
            quest.TimeAllowed = packet.ReadUInt32("TimeAllowed");
            uint cliQuestInfoObjective = packet.ReadUInt32("CliQuestInfoObjective");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V7_3_5_25848))
            {
                quest.AllowableRacesWod = packet.ReadUInt64("AllowableRaces");
            }
            if (ClientVersion.AddedInVersion(ClientVersionBuild.V7_0_3_22248) && ClientVersion.RemovedInVersion(ClientVersionBuild.V7_3_5_25848))
            {
                quest.AllowableRacesWod = (uint)packet.ReadInt32("AllowableRaces");
            }
            quest.QuestRewardID = packet.ReadInt32("QuestRewardID");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V7_2_0_23826))
            {
                quest.Expansion = packet.ReadInt32("Expansion");
            }

            packet.ResetBitReader();

            uint logTitleLen             = packet.ReadBits(9);
            uint logDescriptionLen       = packet.ReadBits(12);
            uint questDescriptionLen     = packet.ReadBits(12);
            uint areaDescriptionLen      = packet.ReadBits(9);
            uint questGiverTextWindowLen = packet.ReadBits(10);
            uint questGiverTargetNameLen = packet.ReadBits(8);
            uint questTurnTextWindowLen  = packet.ReadBits(10);
            uint questTurnTargetNameLen  = packet.ReadBits(8);
            uint questCompletionLogLen   = packet.ReadBits(11);

            for (uint i = 0; i < cliQuestInfoObjective; ++i)
            {
                var objectiveId = packet.ReadEntry("Id", i);

                QuestObjective questInfoObjective = new QuestObjective
                {
                    ID      = (uint)objectiveId.Key,
                    QuestID = (uint)id.Key
                };
                questInfoObjective.Type         = packet.ReadByteE <QuestRequirementType>("Quest Requirement Type", i);
                questInfoObjective.StorageIndex = packet.ReadSByte("StorageIndex", i);
                questInfoObjective.Order        = i;
                questInfoObjective.ObjectID     = packet.ReadInt32("ObjectID", i);
                questInfoObjective.Amount       = packet.ReadInt32("Amount", i);
                questInfoObjective.Flags        = packet.ReadUInt32("Flags", i);
                if (ClientVersion.AddedInVersion(ClientVersionBuild.V7_1_0_22900))
                {
                    questInfoObjective.Flags2 = packet.ReadUInt32("Flags2", i);
                }
                questInfoObjective.ProgressBarWeight = packet.ReadSingle("ProgressBarWeight", i);

                int visualEffectsCount = packet.ReadInt32("VisualEffects", i);
                for (uint j = 0; j < visualEffectsCount; ++j)
                {
                    QuestVisualEffect questVisualEffect = new QuestVisualEffect
                    {
                        ID           = questInfoObjective.ID,
                        Index        = j,
                        VisualEffect = packet.ReadInt32("VisualEffectId", i, j)
                    };

                    Storage.QuestVisualEffects.Add(questVisualEffect, packet.TimeSpan);
                }

                packet.ResetBitReader();

                uint bits6 = packet.ReadBits(8);
                questInfoObjective.Description = packet.ReadWoWString("Description", bits6, i);

                if (ClientLocale.PacketLocale != LocaleConstant.enUS && questInfoObjective.Description != string.Empty)
                {
                    QuestObjectivesLocale localesQuestObjectives = new QuestObjectivesLocale
                    {
                        ID           = (uint)objectiveId.Key,
                        QuestId      = (uint)id.Key,
                        StorageIndex = questInfoObjective.StorageIndex,
                        Description  = questInfoObjective.Description
                    };

                    Storage.LocalesQuestObjectives.Add(localesQuestObjectives, packet.TimeSpan);
                }

                Storage.QuestObjectives.Add(questInfoObjective, packet.TimeSpan);
            }

            quest.LogTitle             = packet.ReadWoWString("LogTitle", logTitleLen);
            quest.LogDescription       = packet.ReadWoWString("LogDescription", logDescriptionLen);
            quest.QuestDescription     = packet.ReadWoWString("QuestDescription", questDescriptionLen);
            quest.AreaDescription      = packet.ReadWoWString("AreaDescription", areaDescriptionLen);
            quest.QuestGiverTextWindow = packet.ReadWoWString("PortraitGiverText", questGiverTextWindowLen);
            quest.QuestGiverTargetName = packet.ReadWoWString("PortraitGiverName", questGiverTargetNameLen);
            quest.QuestTurnTextWindow  = packet.ReadWoWString("PortraitTurnInText", questTurnTextWindowLen);
            quest.QuestTurnTargetName  = packet.ReadWoWString("PortraitTurnInName", questTurnTargetNameLen);
            quest.QuestCompletionLog   = packet.ReadWoWString("QuestCompletionLog", questCompletionLogLen);

            if (ClientLocale.PacketLocale != LocaleConstant.enUS)
            {
                LocalesQuest localesQuest = new LocalesQuest
                {
                    ID                 = (uint)id.Key,
                    LogTitle           = quest.LogTitle,
                    LogDescription     = quest.LogDescription,
                    QuestDescription   = quest.QuestDescription,
                    AreaDescription    = quest.AreaDescription,
                    PortraitGiverText  = quest.QuestGiverTextWindow,
                    PortraitGiverName  = quest.QuestGiverTargetName,
                    PortraitTurnInText = quest.QuestTurnTextWindow,
                    PortraitTurnInName = quest.QuestTurnTargetName,
                    QuestCompletionLog = quest.QuestCompletionLog
                };

                Storage.LocalesQuests.Add(localesQuest, packet.TimeSpan);
            }

            Storage.QuestTemplates.Add(quest, packet.TimeSpan);
        }
Ejemplo n.º 3
0
        public static void HandleQuestQueryResponse(Packet packet)
        {
            packet.ReadInt32("Entry");

            Bit hasData = packet.ReadBit("Has Data");

            if (!hasData)
            {
                return; // nothing to do
            }
            var id = packet.ReadEntry("Quest ID");

            QuestTemplate quest = new QuestTemplate
            {
                ID = (uint)id.Key
            };

            quest.QuestType          = packet.ReadInt32E <QuestType>("QuestType");
            quest.QuestLevel         = packet.ReadInt32("QuestLevel");
            quest.QuestPackageID     = packet.ReadUInt32("QuestPackageID");
            quest.MinLevel           = packet.ReadInt32("QuestMinLevel");
            quest.QuestSortID        = (QuestSort)packet.ReadUInt32("QuestSortID");
            quest.QuestInfoID        = packet.ReadInt32E <QuestInfo>("QuestInfoID");
            quest.SuggestedGroupNum  = packet.ReadUInt32("SuggestedGroupNum");
            quest.RewardNextQuest    = packet.ReadUInt32("RewardNextQuest");
            quest.RewardXPDifficulty = packet.ReadUInt32("RewardXPDifficulty");

            quest.RewardXPMultiplier = packet.ReadSingle("RewardXPMultiplier");

            quest.RewardMoney           = packet.ReadInt32("RewardMoney");
            quest.RewardMoneyDifficulty = packet.ReadUInt32("RewardMoneyDifficulty");

            quest.RewardMoneyMultiplier = packet.ReadSingle("RewardMoneyMultiplier");

            quest.RewardBonusMoney   = packet.ReadUInt32("RewardBonusMoney");
            quest.RewardDisplaySpell = packet.ReadUInt32("RewardDisplaySpell");
            quest.RewardSpellWod     = packet.ReadUInt32("RewardSpell");
            quest.RewardHonorWod     = packet.ReadUInt32("RewardHonor");

            quest.RewardKillHonor = packet.ReadSingle("RewardKillHonor");

            quest.StartItem = packet.ReadUInt32("StartItem");
            quest.Flags     = packet.ReadUInt32E <QuestFlags>("Flags");
            quest.FlagsEx   = packet.ReadUInt32E <QuestFlags2>("FlagsEx");

            quest.RewardItem       = new uint?[4];
            quest.RewardAmount     = new uint?[4];
            quest.ItemDrop         = new uint?[4];
            quest.ItemDropQuantity = new uint?[4];
            for (int i = 0; i < 4; ++i)
            {
                quest.RewardItem[i]       = packet.ReadUInt32("RewardItems", i);
                quest.RewardAmount[i]     = packet.ReadUInt32("RewardAmount", i);
                quest.ItemDrop[i]         = packet.ReadUInt32("ItemDrop", i);
                quest.ItemDropQuantity[i] = packet.ReadUInt32("ItemDropQuantity", i);
            }

            quest.RewardChoiceItemID        = new uint?[6];
            quest.RewardChoiceItemQuantity  = new uint?[6];
            quest.RewardChoiceItemDisplayID = new uint?[6];
            for (int i = 0; i < 6; ++i) // CliQuestInfoChoiceItem
            {
                quest.RewardChoiceItemID[i]        = packet.ReadUInt32("RewardChoiceItemID", i);
                quest.RewardChoiceItemQuantity[i]  = packet.ReadUInt32("RewardChoiceItemQuantity", i);
                quest.RewardChoiceItemDisplayID[i] = packet.ReadUInt32("RewardChoiceItemDisplayID", i);
            }

            quest.POIContinent = packet.ReadUInt32("POIContinent");

            quest.POIx = packet.ReadSingle("POIx");
            quest.POIy = packet.ReadSingle("POIy");

            quest.POIPriorityWod      = packet.ReadInt32("POIPriority");
            quest.RewardTitle         = packet.ReadUInt32("RewardTitle");
            quest.RewardTalents       = packet.ReadUInt32("RewardTalents");
            quest.RewardArenaPoints   = packet.ReadUInt32("RewardArenaPoints");
            quest.RewardSkillLineID   = packet.ReadUInt32("RewardSkillLineID");
            quest.RewardNumSkillUps   = packet.ReadUInt32("RewardNumSkillUps");
            quest.QuestGiverPortrait  = packet.ReadUInt32("PortraitGiver");
            quest.QuestTurnInPortrait = packet.ReadUInt32("PortraitTurnIn");

            quest.RewardFactionID       = new uint?[5];
            quest.RewardFactionValue    = new int?[5];
            quest.RewardFactionOverride = new int?[5];
            for (int i = 0; i < 5; ++i)
            {
                quest.RewardFactionID[i]       = packet.ReadUInt32("RewardFactionID", i);
                quest.RewardFactionValue[i]    = packet.ReadInt32("RewardFactionValue", i);
                quest.RewardFactionOverride[i] = packet.ReadInt32("RewardFactionOverride", i);
            }

            quest.RewardFactionFlags = packet.ReadUInt32("RewardFactionFlags");

            quest.RewardCurrencyID    = new uint?[4];
            quest.RewardCurrencyCount = new uint?[4];
            for (int i = 0; i < 4; ++i)
            {
                quest.RewardCurrencyID[i]    = packet.ReadUInt32("RewardCurrencyID");
                quest.RewardCurrencyCount[i] = packet.ReadUInt32("RewardCurrencyQty");
            }

            quest.SoundAccept = packet.ReadUInt32("AcceptedSoundKitID");
            quest.SoundTurnIn = packet.ReadUInt32("CompleteSoundKitID");
            quest.AreaGroupID = packet.ReadUInt32("AreaGroupID");
            quest.TimeAllowed = packet.ReadUInt32("TimeAllowed");
            uint int2946 = packet.ReadUInt32("CliQuestInfoObjective");

            quest.AllowableRacesWod = packet.ReadInt32("AllowableRaces");

            for (int i = 0; i < int2946; ++i)
            {
                var objectiveId = packet.ReadEntry("Id", i);

                QuestObjective questInfoObjective = new QuestObjective
                {
                    ID      = (uint)objectiveId.Key,
                    QuestID = (uint)id.Key
                };
                questInfoObjective.Type         = packet.ReadByteE <QuestRequirementType>("Quest Requirement Type", i);
                questInfoObjective.StorageIndex = packet.ReadSByte("StorageIndex", i);
                questInfoObjective.ObjectID     = packet.ReadInt32("ObjectID", i);
                questInfoObjective.Amount       = packet.ReadInt32("Amount", i);
                questInfoObjective.Flags        = packet.ReadUInt32("Flags", i);
                questInfoObjective.UnkFloat     = packet.ReadSingle("Float5", i);

                int int280 = packet.ReadInt32("VisualEffects", i);
                for (int j = 0; j < int280; ++j)
                {
                    QuestVisualEffect questVisualEffect = new QuestVisualEffect
                    {
                        ID           = questInfoObjective.ID,
                        Index        = (uint)j,
                        VisualEffect = packet.ReadInt32("VisualEffectId", i, j)
                    };

                    Storage.QuestVisualEffects.Add(questVisualEffect, packet.TimeSpan);
                }

                packet.ResetBitReader();

                uint bits6 = packet.ReadBits(8);
                questInfoObjective.Description = packet.ReadWoWString("Description", bits6, i);

                if (BinaryPacketReader.GetLocale() != LocaleConstant.enUS && questInfoObjective.Description != string.Empty)
                {
                    QuestObjectivesLocale localesQuestObjectives = new QuestObjectivesLocale
                    {
                        ID           = (uint)objectiveId.Key,
                        QuestId      = (uint)id.Key,
                        StorageIndex = questInfoObjective.StorageIndex,
                        Description  = questInfoObjective.Description
                    };

                    Storage.LocalesQuestObjectives.Add(localesQuestObjectives, packet.TimeSpan);
                }

                Storage.QuestObjectives.Add(questInfoObjective, packet.TimeSpan);
            }

            packet.ResetBitReader();

            uint bits26   = packet.ReadBits(9);
            uint bits154  = packet.ReadBits(12);
            uint bits904  = packet.ReadBits(12);
            uint bits1654 = packet.ReadBits(9);
            uint bits1789 = packet.ReadBits(10);
            uint bits2045 = packet.ReadBits(8);
            uint bits2109 = packet.ReadBits(10);
            uint bits2365 = packet.ReadBits(8);
            uint bits2429 = packet.ReadBits(11);

            quest.LogTitle             = packet.ReadWoWString("LogTitle", bits26);
            quest.LogDescription       = packet.ReadWoWString("LogDescription", bits154);
            quest.QuestDescription     = packet.ReadWoWString("QuestDescription", bits904);
            quest.AreaDescription      = packet.ReadWoWString("AreaDescription", bits1654);
            quest.QuestGiverTextWindow = packet.ReadWoWString("PortraitGiverText", bits1789);
            quest.QuestGiverTargetName = packet.ReadWoWString("PortraitGiverName", bits2045);
            quest.QuestTurnTextWindow  = packet.ReadWoWString("PortraitTurnInText", bits2109);
            quest.QuestTurnTargetName  = packet.ReadWoWString("PortraitTurnInName", bits2365);
            quest.QuestCompletionLog   = packet.ReadWoWString("QuestCompletionLog", bits2429);

            if (BinaryPacketReader.GetLocale() != LocaleConstant.enUS)
            {
                LocalesQuest localesQuest = new LocalesQuest
                {
                    ID                 = (uint)id.Key,
                    Locale             = BinaryPacketReader.GetClientLocale(),
                    LogTitle           = quest.LogTitle,
                    LogDescription     = quest.LogDescription,
                    QuestDescription   = quest.QuestDescription,
                    AreaDescription    = quest.AreaDescription,
                    PortraitGiverText  = quest.QuestGiverTextWindow,
                    PortraitGiverName  = quest.QuestGiverTargetName,
                    PortraitTurnInText = quest.QuestTurnTextWindow,
                    PortraitTurnInName = quest.QuestTurnTargetName,
                    QuestCompletionLog = quest.QuestCompletionLog
                };

                Storage.LocalesQuests.Add(localesQuest, packet.TimeSpan);
            }

            Storage.QuestTemplates.Add(quest, packet.TimeSpan);
        }
Ejemplo n.º 4
0
        public static void HandleQuestQueryResponse(Packet packet)
        {
            packet.ReadInt32("Entry");

            Bit hasData = packet.ReadBit("Has Data");

            if (!hasData)
            {
                return; // nothing to do
            }
            var id = packet.ReadEntry("Quest ID");

            QuestTemplate quest = new QuestTemplate
            {
                ID = (uint)id.Key
            };

            quest.QuestType          = packet.ReadInt32E <QuestType>("QuestType");
            quest.QuestPackageID     = (uint)packet.ReadInt32("QuestPackageID");
            quest.ContentTuningID    = packet.ReadInt32("ContentTuningID");
            quest.QuestSortID        = (QuestSort)packet.ReadInt32("QuestSortID");
            quest.QuestInfoID        = packet.ReadInt32E <QuestInfo>("QuestInfoID");
            quest.SuggestedGroupNum  = (uint)packet.ReadInt32("SuggestedGroupNum");
            quest.RewardNextQuest    = (uint)packet.ReadInt32("RewardNextQuest");
            quest.RewardXPDifficulty = (uint)packet.ReadInt32("RewardXPDifficulty");

            quest.RewardXPMultiplier = packet.ReadSingle("RewardXPMultiplier");

            quest.RewardMoney           = packet.ReadInt32("RewardMoney");
            quest.RewardMoneyDifficulty = (uint)packet.ReadInt32("RewardMoneyDifficulty");

            quest.RewardMoneyMultiplier = packet.ReadSingle("RewardMoneyMultiplier");

            quest.RewardBonusMoney = (uint)packet.ReadInt32("RewardBonusMoney");

            var rewardDisplaySpellCount = packet.ReadUInt32("rewardDisplaySpellCount");

            quest.RewardSpellWod = (uint)packet.ReadInt32("RewardSpell");
            quest.RewardHonorWod = (uint)packet.ReadInt32("RewardHonor");

            quest.RewardKillHonor = packet.ReadSingle("RewardKillHonor");

            quest.RewardArtifactXPDifficulty = (uint)packet.ReadInt32("RewardArtifactXPDifficulty");
            quest.RewardArtifactXPMultiplier = packet.ReadSingle("RewardArtifactXPMultiplier");
            quest.RewardArtifactCategoryID   = (uint)packet.ReadInt32("RewardArtifactCategoryID");

            quest.StartItem = (uint)packet.ReadInt32("StartItem");
            quest.Flags     = packet.ReadInt32E <QuestFlags>("Flags");
            quest.FlagsEx   = packet.ReadInt32E <QuestFlagsEx>("FlagsEx");
            quest.FlagsEx2  = packet.ReadInt32E <QuestFlagsEx2>("FlagsEx2");

            quest.RewardItem       = new uint?[4];
            quest.RewardAmount     = new uint?[4];
            quest.ItemDrop         = new uint?[4];
            quest.ItemDropQuantity = new uint?[4];
            for (int i = 0; i < 4; ++i)
            {
                quest.RewardItem[i]       = (uint)packet.ReadInt32("RewardItems", i);
                quest.RewardAmount[i]     = (uint)packet.ReadInt32("RewardAmount", i);
                quest.ItemDrop[i]         = (uint)packet.ReadInt32("ItemDrop", i);
                quest.ItemDropQuantity[i] = (uint)packet.ReadInt32("ItemDropQuantity", i);
            }

            quest.RewardChoiceItemID        = new uint?[6];
            quest.RewardChoiceItemQuantity  = new uint?[6];
            quest.RewardChoiceItemDisplayID = new uint?[6];
            for (int i = 0; i < 6; ++i)
            {
                quest.RewardChoiceItemID[i]        = (uint)packet.ReadInt32("RewardChoiceItemID", i);
                quest.RewardChoiceItemQuantity[i]  = (uint)packet.ReadInt32("RewardChoiceItemQuantity", i);
                quest.RewardChoiceItemDisplayID[i] = (uint)packet.ReadInt32("RewardChoiceItemDisplayID", i);
            }

            quest.POIContinent = (uint)packet.ReadInt32("POIContinent");

            quest.POIx = packet.ReadSingle("POIx");
            quest.POIy = packet.ReadSingle("POIy");

            quest.POIPriorityWod      = packet.ReadInt32("POIPriority");
            quest.RewardTitle         = (uint)packet.ReadInt32("RewardTitle");
            quest.RewardArenaPoints   = (uint)packet.ReadInt32("RewardArenaPoints");
            quest.RewardSkillLineID   = (uint)packet.ReadInt32("RewardSkillLineID");
            quest.RewardNumSkillUps   = (uint)packet.ReadInt32("RewardNumSkillUps");
            quest.QuestGiverPortrait  = (uint)packet.ReadInt32("PortraitGiver");
            quest.PortraitGiverMount  = (uint)packet.ReadInt32("PortraitGiverMount");
            quest.QuestTurnInPortrait = (uint)packet.ReadInt32("PortraitTurnIn");

            quest.RewardFactionID       = new uint?[5];
            quest.RewardFactionOverride = new int?[5];
            quest.RewardFactionValue    = new int?[5];
            quest.RewardFactionCapIn    = new int?[5];
            for (int i = 0; i < 5; ++i)
            {
                quest.RewardFactionID[i]       = (uint)packet.ReadInt32("RewardFactionID", i);
                quest.RewardFactionValue[i]    = packet.ReadInt32("RewardFactionValue", i);
                quest.RewardFactionOverride[i] = packet.ReadInt32("RewardFactionOverride", i);
                quest.RewardFactionCapIn[i]    = packet.ReadInt32("RewardFactionCapIn", i);
            }

            quest.RewardFactionFlags = (uint)packet.ReadInt32("RewardFactionFlags");

            quest.RewardCurrencyID    = new uint?[4];
            quest.RewardCurrencyCount = new uint?[4];
            for (int i = 0; i < 4; ++i)
            {
                quest.RewardCurrencyID[i]    = (uint)packet.ReadInt32("RewardCurrencyID", i);
                quest.RewardCurrencyCount[i] = (uint)packet.ReadInt32("RewardCurrencyQty", i);
            }

            quest.SoundAccept = (uint)packet.ReadInt32("AcceptedSoundKitID");
            quest.SoundTurnIn = (uint)packet.ReadInt32("CompleteSoundKitID");
            quest.AreaGroupID = (uint)packet.ReadInt32("AreaGroupID");
            quest.TimeAllowed = (uint)packet.ReadInt32("TimeAllowed");
            uint objectiveCount = packet.ReadUInt32("ObjectiveCount");

            quest.AllowableRacesWod   = packet.ReadUInt64("AllowableRaces");
            quest.QuestRewardID       = packet.ReadInt32("TreasurePickerID");
            quest.Expansion           = packet.ReadInt32("Expansion");
            quest.ManagedWorldStateID = packet.ReadInt32("ManagedWorldStateID");
            quest.QuestSessionBonus   = packet.ReadInt32("QuestSessionBonus");

            // May group that into own table
            quest.RewardDisplaySpellShadowlands     = new uint[12];
            quest.RewardDisplaySpellPlayerCondition = new int[12];
            for (int i = 0; i < rewardDisplaySpellCount; ++i)
            {
                quest.RewardDisplaySpellShadowlands[i]     = (uint)packet.ReadInt32 <SpellId>("SpellID", i, "RewardDisplaySpell");
                quest.RewardDisplaySpellPlayerCondition[i] = packet.ReadInt32("PlayerCondition", i, "RewardDisplaySpell");
            }

            packet.ResetBitReader();

            uint logTitleLen             = packet.ReadBits("logTitleLen", 9);
            uint logDescriptionLen       = packet.ReadBits("logDescriptionLen", 12);
            uint questDescriptionLen     = packet.ReadBits("questDescriptionLen", 12);
            uint areaDescriptionLen      = packet.ReadBits("areaDescriptionLen", 9);
            uint questGiverTextWindowLen = packet.ReadBits("questGiverTextWindowLen", 10);
            uint questGiverTargetNameLen = packet.ReadBits("questGiverTargetNameLen", 8);
            uint questTurnTextWindowLen  = packet.ReadBits("questTurnTextWindowLen", 10);
            uint questTurnTargetNameLen  = packet.ReadBits("questTurnTargetNameLen", 8);
            uint questCompletionLogLen   = packet.ReadBits("questCompletionLogLen", 11);

            for (uint i = 0; i < objectiveCount; ++i)
            {
                var objectiveId = packet.ReadEntry("Id", i);

                QuestObjective questInfoObjective = new QuestObjective
                {
                    ID      = (uint)objectiveId.Key,
                    QuestID = (uint)id.Key
                };
                questInfoObjective.Type              = packet.ReadByteE <QuestRequirementType>("Quest Requirement Type", i);
                questInfoObjective.StorageIndex      = packet.ReadSByte("StorageIndex", i);
                questInfoObjective.Order             = i;
                questInfoObjective.ObjectID          = packet.ReadInt32("ObjectID", i);
                questInfoObjective.Amount            = packet.ReadInt32("Amount", i);
                questInfoObjective.Flags             = (uint)packet.ReadInt32("Flags", i);
                questInfoObjective.Flags2            = packet.ReadUInt32("Flags2", i);
                questInfoObjective.ProgressBarWeight = packet.ReadSingle("ProgressBarWeight", i);

                var visualEffectsCount = packet.ReadUInt32("VisualEffects", i);
                for (var j = 0; j < visualEffectsCount; ++j)
                {
                    QuestVisualEffect questVisualEffect = new QuestVisualEffect
                    {
                        ID           = questInfoObjective.ID,
                        Index        = (uint)j,
                        VisualEffect = packet.ReadInt32("VisualEffectId", i, j)
                    };

                    Storage.QuestVisualEffects.Add(questVisualEffect, packet.TimeSpan);
                }

                packet.ResetBitReader();

                uint descriptionLength = packet.ReadBits(8);
                questInfoObjective.Description = packet.ReadWoWString("Description", descriptionLength, i);

                if (ClientLocale.PacketLocale != LocaleConstant.enUS && questInfoObjective.Description != string.Empty)
                {
                    QuestObjectivesLocale localesQuestObjectives = new QuestObjectivesLocale
                    {
                        ID           = (uint)objectiveId.Key,
                        QuestId      = (uint)id.Key,
                        StorageIndex = questInfoObjective.StorageIndex,
                        Description  = questInfoObjective.Description
                    };

                    Storage.LocalesQuestObjectives.Add(localesQuestObjectives, packet.TimeSpan);
                }

                Storage.QuestObjectives.Add(questInfoObjective, packet.TimeSpan);
            }

            quest.LogTitle             = packet.ReadWoWString("LogTitle", logTitleLen);
            quest.LogDescription       = packet.ReadWoWString("LogDescription", logDescriptionLen);
            quest.QuestDescription     = packet.ReadWoWString("QuestDescription", questDescriptionLen);
            quest.AreaDescription      = packet.ReadWoWString("AreaDescription", areaDescriptionLen);
            quest.QuestGiverTextWindow = packet.ReadWoWString("PortraitGiverText", questGiverTextWindowLen);
            quest.QuestGiverTargetName = packet.ReadWoWString("PortraitGiverName", questGiverTargetNameLen);
            quest.QuestTurnTextWindow  = packet.ReadWoWString("PortraitTurnInText", questTurnTextWindowLen);
            quest.QuestTurnTargetName  = packet.ReadWoWString("PortraitTurnInName", questTurnTargetNameLen);
            quest.QuestCompletionLog   = packet.ReadWoWString("QuestCompletionLog", questCompletionLogLen);

            if (ClientLocale.PacketLocale != LocaleConstant.enUS)
            {
                LocalesQuest localesQuest = new LocalesQuest
                {
                    ID                 = (uint)id.Key,
                    LogTitle           = quest.LogTitle,
                    LogDescription     = quest.LogDescription,
                    QuestDescription   = quest.QuestDescription,
                    AreaDescription    = quest.AreaDescription,
                    PortraitGiverText  = quest.QuestGiverTextWindow,
                    PortraitGiverName  = quest.QuestGiverTargetName,
                    PortraitTurnInText = quest.QuestTurnTextWindow,
                    PortraitTurnInName = quest.QuestTurnTargetName,
                    QuestCompletionLog = quest.QuestCompletionLog
                };

                Storage.LocalesQuests.Add(localesQuest, packet.TimeSpan);
            }

            Storage.QuestTemplates.Add(quest, packet.TimeSpan);
        }