Core/DataStores: Load QuestLineXQuest.db2

Port From (https://github.com/TrinityCore/TrinityCore/commit/5134622a75bdc8ffafb0d86e0c0275d731385d0c)
This commit is contained in:
hondacrx
2021-06-07 10:53:32 -04:00
parent 6ab159039b
commit 35d8cf8b9f
5 changed files with 38 additions and 0 deletions
@@ -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,
+2
View File
@@ -242,6 +242,7 @@ namespace Game.DataStorage
PvpTalentSlotUnlockStorage = ReadDB2<PvpTalentSlotUnlockRecord>("PvpTalentSlotUnlock.db2", HotfixStatements.SEL_PVP_TALENT_SLOT_UNLOCK);
QuestFactionRewardStorage = ReadDB2<QuestFactionRewardRecord>("QuestFactionReward.db2", HotfixStatements.SEL_QUEST_FACTION_REWARD);
QuestInfoStorage = ReadDB2<QuestInfoRecord>("QuestInfo.db2", HotfixStatements.SEL_QUEST_INFO, HotfixStatements.SEL_QUEST_INFO_LOCALE);
QuestLineXQuestStorage = ReadDB2<QuestLineXQuestRecord>("QuestLineXQuest.db2", HotfixStatements.SEL_QUEST_LINE_X_QUEST);
QuestMoneyRewardStorage = ReadDB2<QuestMoneyRewardRecord>("QuestMoneyReward.db2", HotfixStatements.SEL_QUEST_MONEY_REWARD);
QuestPackageItemStorage = ReadDB2<QuestPackageItemRecord>("QuestPackageItem.db2", HotfixStatements.SEL_QUEST_PACKAGE_ITEM);
QuestSortStorage = ReadDB2<QuestSortRecord>("QuestSort.db2", HotfixStatements.SEL_QUEST_SORT, HotfixStatements.SEL_QUEST_SORT_LOCALE);
@@ -611,6 +612,7 @@ namespace Game.DataStorage
public static DB6Storage<PvpTalentSlotUnlockRecord> PvpTalentSlotUnlockStorage;
public static DB6Storage<QuestFactionRewardRecord> QuestFactionRewardStorage;
public static DB6Storage<QuestInfoRecord> QuestInfoStorage;
public static DB6Storage<QuestLineXQuestRecord> QuestLineXQuestStorage;
public static DB6Storage<QuestMoneyRewardRecord> QuestMoneyRewardStorage;
public static DB6Storage<QuestPackageItemRecord> QuestPackageItemStorage;
public static DB6Storage<QuestSortRecord> QuestSortStorage;
+9
View File
@@ -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<QuestLineXQuestRecord> GetQuestsForQuestLine(uint questLineId)
{
return _questsByQuestLine.LookupByKey(questLineId);
}
public List<QuestPackageItemRecord> GetQuestPackageItems(uint questPackageID)
{
if( _questPackages.ContainsKey(questPackageID))
@@ -2289,6 +2297,7 @@ namespace Game.DataStorage
Dictionary<PowerType, PowerTypeRecord> _powerTypes = new();
Dictionary<uint, byte> _pvpItemBonus = new();
PvpTalentSlotUnlockRecord[] _pvpTalentSlotUnlock = new PvpTalentSlotUnlockRecord[PlayerConst.MaxPvpTalentSlots];
MultiMap<uint, QuestLineXQuestRecord> _questsByQuestLine = new();
Dictionary<uint, Tuple<List<QuestPackageItemRecord>, List<QuestPackageItemRecord>>> _questPackages = new();
MultiMap<uint, RewardPackXCurrencyTypeRecord> _rewardPackCurrencyTypes = new();
MultiMap<uint, RewardPackXItemRecord> _rewardPackItems = new();
@@ -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;
@@ -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 */;