diff --git a/Source/Framework/Database/Databases/HotfixDatabase.cs b/Source/Framework/Database/Databases/HotfixDatabase.cs index efa9d6350..21972d2fe 100644 --- a/Source/Framework/Database/Databases/HotfixDatabase.cs +++ b/Source/Framework/Database/Databases/HotfixDatabase.cs @@ -199,6 +199,9 @@ namespace Framework.Database PrepareStatement(HotfixStatements.SEL_CHAT_CHANNELS, "SELECT Name, Shortcut, ID, Flags, FactionGroup, Ruleset FROM chat_channels"); PrepareStatement(HotfixStatements.SEL_CHAT_CHANNELS_LOCALE, "SELECT ID, Name_lang, Shortcut_lang FROM chat_channels_locale WHERE locale = ?"); + // ChrClassUiDisplay.db2 + PrepareStatement(HotfixStatements.SEL_CHR_CLASS_UI_DISPLAY, "SELECT ID, ChrClassesID, AdvGuidePlayerConditionID, SplashPlayerConditionID FROM chr_class_ui_display"); + // ChrClasses.db2 PrepareStatement(HotfixStatements.SEL_CHR_CLASSES, "SELECT Name, Filename, NameMale, NameFemale, PetNameToken, Description, RoleInfoString, DisabledString, " + "HyphenatedNameMale, HyphenatedNameFemale, ID, CreateScreenFileDataID, SelectScreenFileDataID, IconFileDataID, LowResScreenFileDataID, Flags, " + @@ -1256,6 +1259,8 @@ namespace Framework.Database SEL_CHAT_CHANNELS, SEL_CHAT_CHANNELS_LOCALE, + SEL_CHR_CLASS_UI_DISPLAY, + SEL_CHR_CLASSES, SEL_CHR_CLASSES_LOCALE, diff --git a/Source/Game/DataStorage/CliDB.cs b/Source/Game/DataStorage/CliDB.cs index c4a652868..18c434ff7 100644 --- a/Source/Game/DataStorage/CliDB.cs +++ b/Source/Game/DataStorage/CliDB.cs @@ -96,6 +96,7 @@ namespace Game.DataStorage CharacterLoadoutStorage = ReadDB2("CharacterLoadout.db2", HotfixStatements.SEL_CHARACTER_LOADOUT); CharacterLoadoutItemStorage = ReadDB2("CharacterLoadoutItem.db2", HotfixStatements.SEL_CHARACTER_LOADOUT_ITEM); ChatChannelsStorage = ReadDB2("ChatChannels.db2", HotfixStatements.SEL_CHAT_CHANNELS, HotfixStatements.SEL_CHAT_CHANNELS_LOCALE); + ChrClassUIDisplayStorage = ReadDB2("ChrClassUIDisplay.db2", HotfixStatements.SEL_CHR_CLASS_UI_DISPLAY); ChrClassesStorage = ReadDB2("ChrClasses.db2", HotfixStatements.SEL_CHR_CLASSES, HotfixStatements.SEL_CHR_CLASSES_LOCALE); ChrClassesXPowerTypesStorage = ReadDB2("ChrClassesXPowerTypes.db2", HotfixStatements.SEL_CHR_CLASSES_X_POWER_TYPES); ChrCustomizationChoiceStorage= ReadDB2("ChrCustomizationChoice.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_CHOICE, HotfixStatements.SEL_CHR_CUSTOMIZATION_CHOICE_LOCALE); @@ -455,6 +456,7 @@ namespace Game.DataStorage public static DB6Storage CharacterLoadoutStorage; public static DB6Storage CharacterLoadoutItemStorage; public static DB6Storage ChatChannelsStorage; + public static DB6Storage ChrClassUIDisplayStorage; public static DB6Storage ChrClassesStorage; public static DB6Storage ChrClassesXPowerTypesStorage; public static DB6Storage ChrCustomizationChoiceStorage; diff --git a/Source/Game/DataStorage/DB2Manager.cs b/Source/Game/DataStorage/DB2Manager.cs index 329d2d04c..ee2c0f01c 100644 --- a/Source/Game/DataStorage/DB2Manager.cs +++ b/Source/Game/DataStorage/DB2Manager.cs @@ -133,6 +133,12 @@ namespace Game.DataStorage } } + foreach (var uiDisplay in CliDB.ChrClassUIDisplayStorage.Values) + { + Cypher.Assert(uiDisplay.ChrClassesID < (byte)Class.Max); + _uiDisplayByClass[uiDisplay.ChrClassesID] = uiDisplay; + } + var powers = new List(); foreach (var chrClasses in CliDB.ChrClassesXPowerTypesStorage.Values) powers.Add(chrClasses); @@ -999,6 +1005,12 @@ namespace Game.DataStorage return broadcastText.Text[SharedConst.DefaultLocale]; } + public ChrClassUIDisplayRecord GetUiDisplayForClass(Class unitClass) + { + Cypher.Assert(unitClass < Class.Max); + return _uiDisplayByClass[(int)unitClass]; + } + public string GetClassName(Class class_, Locale locale = Locale.enUS) { ChrClassesRecord classEntry = CliDB.ChrClassesStorage.LookupByKey(class_); @@ -2292,6 +2304,7 @@ namespace Game.DataStorage MultiMap _azeritePowers = new MultiMap(); Dictionary<(uint azeriteUnlockSetId, ItemContext itemContext), byte[]> _azeriteTierUnlockLevels = new Dictionary<(uint azeriteUnlockSetId, ItemContext itemContext), byte[]>(); Dictionary<(uint itemId, ItemContext itemContext), AzeriteUnlockMappingRecord> _azeriteUnlockMappings = new Dictionary<(uint itemId, ItemContext itemContext), AzeriteUnlockMappingRecord>(); + ChrClassUIDisplayRecord[] _uiDisplayByClass = new ChrClassUIDisplayRecord[(int)Class.Max]; uint[][] _powersByClass = new uint[(int)Class.Max][]; MultiMap _chrCustomizationChoicesByOption = new MultiMap(); Dictionary, ChrModelRecord> _chrModelsByRaceAndGender = new Dictionary, ChrModelRecord>(); diff --git a/Source/Game/DataStorage/Structs/C_Records.cs b/Source/Game/DataStorage/Structs/C_Records.cs index ed4583377..46e2842cd 100644 --- a/Source/Game/DataStorage/Structs/C_Records.cs +++ b/Source/Game/DataStorage/Structs/C_Records.cs @@ -66,6 +66,14 @@ namespace Game.DataStorage public int Ruleset; } + public sealed class ChrClassUIDisplayRecord + { + public uint Id; + public byte ChrClassesID; + public uint AdvGuidePlayerConditionID; + public uint SplashPlayerConditionID; + } + public sealed class ChrClassesRecord { public LocalizedString Name; diff --git a/Source/Game/Handlers/AdventureJournalHandler.cs b/Source/Game/Handlers/AdventureJournalHandler.cs index 7c1447d78..c5baffe78 100644 --- a/Source/Game/Handlers/AdventureJournalHandler.cs +++ b/Source/Game/Handlers/AdventureJournalHandler.cs @@ -38,6 +38,11 @@ namespace Game [WorldPacketHandler(ClientOpcodes.AdventureJournalOpenQuest)] void HandleAdventureJournalOpenQuest(AdventureJournalOpenQuest openQuest) { + var uiDisplay = Global.DB2Mgr.GetUiDisplayForClass(_player.GetClass()); + if (uiDisplay != null) + if (!_player.MeetPlayerCondition(uiDisplay.AdvGuidePlayerConditionID)) + return; + var adventureJournal = CliDB.AdventureJournalStorage.LookupByKey(openQuest.AdventureJournalID); if (adventureJournal == null) return; @@ -80,6 +85,11 @@ namespace Game [WorldPacketHandler(ClientOpcodes.AdventureJournalUpdateSuggestions)] void HandleAdventureJournalUpdateSuggestions(AdventureJournalUpdateSuggestions updateSuggestions) { + var uiDisplay = Global.DB2Mgr.GetUiDisplayForClass(_player.GetClass()); + if (uiDisplay != null) + if (!_player.MeetPlayerCondition(uiDisplay.AdvGuidePlayerConditionID)) + return; + AdventureJournalDataResponse response = new AdventureJournalDataResponse(); response.OnLevelUp = updateSuggestions.OnLevelUp; diff --git a/sql/updates/hotfixes/master/2021_03_14_01_hotfixes.sql b/sql/updates/hotfixes/master/2021_03_14_01_hotfixes.sql new file mode 100644 index 000000000..78636252f --- /dev/null +++ b/sql/updates/hotfixes/master/2021_03_14_01_hotfixes.sql @@ -0,0 +1,15 @@ +-- +-- Table structure for table `chr_class_ui_display` +-- +DROP TABLE IF EXISTS `chr_class_ui_display`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `chr_class_ui_display` ( + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `ChrClassesID` tinyint(3) unsigned NOT NULL DEFAULT '0', + `AdvGuidePlayerConditionID` int(10) unsigned NOT NULL DEFAULT '0', + `SplashPlayerConditionID` 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 */;