diff --git a/Source/Framework/Database/Databases/HotfixDatabase.cs b/Source/Framework/Database/Databases/HotfixDatabase.cs index 94489afef..4f58bf651 100644 --- a/Source/Framework/Database/Databases/HotfixDatabase.cs +++ b/Source/Framework/Database/Databases/HotfixDatabase.cs @@ -844,6 +844,8 @@ namespace Framework.Database PrepareStatement(HotfixStatements.SEL_QUEST_INFO, "SELECT ID, InfoName, Type, Modifiers, Profession FROM quest_info"); PrepareStatement(HotfixStatements.SEL_QUEST_INFO_LOCALE, "SELECT ID, InfoName_lang FROM quest_info_locale WHERE locale = ?"); + // QuestLineXQuest.db2 + PrepareStatement(HotfixStatements.SEL_QUEST_LINE_X_QUEST, "SELECT ID, QuestLineID, QuestID, OrderIndex FROM quest_line_x_quest"); // QuestMoneyReward.db2 PrepareStatement(HotfixStatements.SEL_QUEST_MONEY_REWARD, "SELECT ID, Difficulty1, Difficulty2, Difficulty3, Difficulty4, Difficulty5, Difficulty6, " + @@ -1627,6 +1629,8 @@ namespace Framework.Database SEL_QUEST_INFO, SEL_QUEST_INFO_LOCALE, + SEL_QUEST_LINE_X_QUEST, + SEL_QUEST_MONEY_REWARD, SEL_QUEST_PACKAGE_ITEM, diff --git a/Source/Game/DataStorage/CliDB.cs b/Source/Game/DataStorage/CliDB.cs index 08985f57f..65ee7941a 100644 --- a/Source/Game/DataStorage/CliDB.cs +++ b/Source/Game/DataStorage/CliDB.cs @@ -242,6 +242,7 @@ namespace Game.DataStorage PvpTalentSlotUnlockStorage = ReadDB2("PvpTalentSlotUnlock.db2", HotfixStatements.SEL_PVP_TALENT_SLOT_UNLOCK); QuestFactionRewardStorage = ReadDB2("QuestFactionReward.db2", HotfixStatements.SEL_QUEST_FACTION_REWARD); QuestInfoStorage = ReadDB2("QuestInfo.db2", HotfixStatements.SEL_QUEST_INFO, HotfixStatements.SEL_QUEST_INFO_LOCALE); + QuestLineXQuestStorage = ReadDB2("QuestLineXQuest.db2", HotfixStatements.SEL_QUEST_LINE_X_QUEST); QuestMoneyRewardStorage = ReadDB2("QuestMoneyReward.db2", HotfixStatements.SEL_QUEST_MONEY_REWARD); QuestPackageItemStorage = ReadDB2("QuestPackageItem.db2", HotfixStatements.SEL_QUEST_PACKAGE_ITEM); QuestSortStorage = ReadDB2("QuestSort.db2", HotfixStatements.SEL_QUEST_SORT, HotfixStatements.SEL_QUEST_SORT_LOCALE); @@ -611,6 +612,7 @@ namespace Game.DataStorage public static DB6Storage PvpTalentSlotUnlockStorage; public static DB6Storage QuestFactionRewardStorage; public static DB6Storage QuestInfoStorage; + public static DB6Storage QuestLineXQuestStorage; public static DB6Storage QuestMoneyRewardStorage; public static DB6Storage QuestPackageItemStorage; public static DB6Storage QuestSortStorage; diff --git a/Source/Game/DataStorage/DB2Manager.cs b/Source/Game/DataStorage/DB2Manager.cs index 0c926e7b0..99a65e050 100644 --- a/Source/Game/DataStorage/DB2Manager.cs +++ b/Source/Game/DataStorage/DB2Manager.cs @@ -448,6 +448,9 @@ namespace Game.DataStorage } } + foreach (QuestLineXQuestRecord questLineQuest in CliDB.QuestLineXQuestStorage.Values) + _questsByQuestLine.Add(questLineQuest.QuestLineID, questLineQuest); + foreach (QuestPackageItemRecord questPackageItem in CliDB.QuestPackageItemStorage.Values) { if (!_questPackages.ContainsKey(questPackageItem.PackageID)) @@ -1790,6 +1793,11 @@ namespace Game.DataStorage return slots; } + public List GetQuestsForQuestLine(uint questLineId) + { + return _questsByQuestLine.LookupByKey(questLineId); + } + public List GetQuestPackageItems(uint questPackageID) { if( _questPackages.ContainsKey(questPackageID)) @@ -2289,6 +2297,7 @@ namespace Game.DataStorage Dictionary _powerTypes = new(); Dictionary _pvpItemBonus = new(); PvpTalentSlotUnlockRecord[] _pvpTalentSlotUnlock = new PvpTalentSlotUnlockRecord[PlayerConst.MaxPvpTalentSlots]; + MultiMap _questsByQuestLine = new(); Dictionary, List>> _questPackages = new(); MultiMap _rewardPackCurrencyTypes = new(); MultiMap _rewardPackItems = new(); diff --git a/Source/Game/DataStorage/Structs/Q_Records.cs b/Source/Game/DataStorage/Structs/Q_Records.cs index 30a27ac58..fbaab4313 100644 --- a/Source/Game/DataStorage/Structs/Q_Records.cs +++ b/Source/Game/DataStorage/Structs/Q_Records.cs @@ -34,6 +34,14 @@ namespace Game.DataStorage public ushort Profession; } + public sealed class QuestLineXQuestRecord + { + public uint Id; + public uint QuestLineID; + public uint QuestID; + public uint OrderIndex; + } + public sealed class QuestMoneyRewardRecord { public uint Id; diff --git a/sql/updates/hotfixes/master/2021_06_06_03_hotfixes.sql b/sql/updates/hotfixes/master/2021_06_06_03_hotfixes.sql new file mode 100644 index 000000000..d36282070 --- /dev/null +++ b/sql/updates/hotfixes/master/2021_06_06_03_hotfixes.sql @@ -0,0 +1,15 @@ +-- +-- Table structure for table `quest_line_x_quest` +-- +DROP TABLE IF EXISTS `quest_line_x_quest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `quest_line_x_quest` ( + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `QuestLineID` int(10) unsigned NOT NULL DEFAULT '0', + `QuestID` int(10) unsigned NOT NULL DEFAULT '0', + `OrderIndex` int(10) unsigned NOT NULL DEFAULT '0', + `VerifiedBuild` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`,`VerifiedBuild`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */;