diff --git a/Source/Framework/Database/Databases/HotfixDatabase.cs b/Source/Framework/Database/Databases/HotfixDatabase.cs index 08996bcdf..92c639810 100644 --- a/Source/Framework/Database/Databases/HotfixDatabase.cs +++ b/Source/Framework/Database/Databases/HotfixDatabase.cs @@ -1205,6 +1205,13 @@ namespace Framework.Database // UiMapXMapArt.db2 PrepareStatement(HotfixStatements.SEL_UI_MAP_X_MAP_ART, "SELECT ID, PhaseID, UiMapArtID, UiMapID FROM ui_map_x_map_art"); + // UiSplashScreen.db2 + PrepareStatement(HotfixStatements.SEL_UI_SPLASH_SCREEN, "SELECT ID, Header, TopLeftFeatureTitle, TopLeftFeatureDesc, BottomLeftFeatureTitle, " + + "BottomLeftFeatureDesc, RightFeatureTitle, RightFeatureDesc, AllianceQuestID, HordeQuestID, ScreenType, TextureKitID, SoundKitID, " + + "PlayerConditionID, CharLevelConditionID, RequiredTimeEventPassed FROM ui_splash_screen"); + PrepareStatement(HotfixStatements.SEL_UI_SPLASH_SCREEN_LOCALE, "SELECT ID, Header_lang, TopLeftFeatureTitle_lang, TopLeftFeatureDesc_lang, " + + "BottomLeftFeatureTitle_lang, BottomLeftFeatureDesc_lang, RightFeatureTitle_lang, RightFeatureDesc_lang FROM ui_splash_screen_locale WHERE locale = ?"); + // UnitPowerBar.db2 PrepareStatement(HotfixStatements.SEL_UNIT_POWER_BAR, "SELECT ID, Name, Cost, OutOfError, ToolTip, MinPower, MaxPower, StartPower, CenterPower, " + "RegenerationPeace, RegenerationCombat, BarType, Flags, StartInset, EndInset, FileDataID1, FileDataID2, FileDataID3, FileDataID4, " + @@ -1895,6 +1902,9 @@ namespace Framework.Database SEL_UI_MAP_X_MAP_ART, + SEL_UI_SPLASH_SCREEN, + SEL_UI_SPLASH_SCREEN_LOCALE, + SEL_UNIT_POWER_BAR, SEL_UNIT_POWER_BAR_LOCALE, diff --git a/Source/Game/DataStorage/CliDB.cs b/Source/Game/DataStorage/CliDB.cs index f0a8725b9..ec7e9c77d 100644 --- a/Source/Game/DataStorage/CliDB.cs +++ b/Source/Game/DataStorage/CliDB.cs @@ -331,6 +331,7 @@ namespace Game.DataStorage UiMapAssignmentStorage = ReadDB2("UiMapAssignment.db2", HotfixStatements.SEL_UI_MAP_ASSIGNMENT); UiMapLinkStorage = ReadDB2("UiMapLink.db2", HotfixStatements.SEL_UI_MAP_LINK); UiMapXMapArtStorage = ReadDB2("UiMapXMapArt.db2", HotfixStatements.SEL_UI_MAP_X_MAP_ART); + UISplashScreenStorage = ReadDB2("UISplashScreen.db2", HotfixStatements.SEL_UI_SPLASH_SCREEN, HotfixStatements.SEL_UI_SPLASH_SCREEN_LOCALE); UnitPowerBarStorage = ReadDB2("UnitPowerBar.db2", HotfixStatements.SEL_UNIT_POWER_BAR, HotfixStatements.SEL_UNIT_POWER_BAR_LOCALE); VehicleStorage = ReadDB2("Vehicle.db2", HotfixStatements.SEL_VEHICLE); VehicleSeatStorage = ReadDB2("VehicleSeat.db2", HotfixStatements.SEL_VEHICLE_SEAT); @@ -715,6 +716,7 @@ namespace Game.DataStorage public static DB6Storage UiMapAssignmentStorage; public static DB6Storage UiMapLinkStorage; public static DB6Storage UiMapXMapArtStorage; + public static DB6Storage UISplashScreenStorage; public static DB6Storage UnitPowerBarStorage; public static DB6Storage VehicleStorage; public static DB6Storage VehicleSeatStorage; diff --git a/Source/Game/DataStorage/Structs/U_Records.cs b/Source/Game/DataStorage/Structs/U_Records.cs index 43c8eff64..87beccdf8 100644 --- a/Source/Game/DataStorage/Structs/U_Records.cs +++ b/Source/Game/DataStorage/Structs/U_Records.cs @@ -74,6 +74,26 @@ namespace Game.DataStorage public uint UiMapID; } + public sealed class UISplashScreenRecord + { + public uint Id; + public string Header; + public string TopLeftFeatureTitle; + public string TopLeftFeatureDesc; + public string BottomLeftFeatureTitle; + public string BottomLeftFeatureDesc; + public string RightFeatureTitle; + public string RightFeatureDesc; + public int AllianceQuestID; + public int HordeQuestID; + public sbyte ScreenType; + public int TextureKitID; + public int SoundKitID; + public int PlayerConditionID; + public int CharLevelConditionID; + public int RequiredTimeEventPassed; // serverside TimeEvent table, see ModifierTreeType::HasTimeEventPassed + } + public sealed class UnitPowerBarRecord { public uint Id; diff --git a/Source/Game/Handlers/MiscHandler.cs b/Source/Game/Handlers/MiscHandler.cs index 675e3840a..ad622f1e0 100644 --- a/Source/Game/Handlers/MiscHandler.cs +++ b/Source/Game/Handlers/MiscHandler.cs @@ -464,6 +464,25 @@ namespace Game Global.ScriptMgr.OnConversationLineStarted(convo, conversationLineStarted.LineID, _player); } + [WorldPacketHandler(ClientOpcodes.RequestLatestSplashScreen)] + void HandleRequestLatestSplashScreen(RequestLatestSplashScreen requestLatestSplashScreen) + { + UISplashScreenRecord splashScreen = null; + foreach (var itr in CliDB.UISplashScreenStorage.Values) + { + PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(itr.CharLevelConditionID); + if (playerCondition != null) + if (!ConditionManager.IsPlayerMeetingCondition(_player, playerCondition)) + continue; + + splashScreen = itr; + } + + SplashScreenShowLatest splashScreenShowLatest = new(); + splashScreenShowLatest.UISplashScreenID = splashScreen != null ? splashScreen.Id : 0; + SendPacket(splashScreenShowLatest); + } + [WorldPacketHandler(ClientOpcodes.ChatUnregisterAllAddonPrefixes)] void HandleUnregisterAllAddonPrefixes(ChatUnregisterAllAddonPrefixes packet) { diff --git a/Source/Game/Networking/Packets/MiscPackets.cs b/Source/Game/Networking/Packets/MiscPackets.cs index db4535581..80391e7ce 100644 --- a/Source/Game/Networking/Packets/MiscPackets.cs +++ b/Source/Game/Networking/Packets/MiscPackets.cs @@ -1263,6 +1263,25 @@ namespace Game.Networking.Packets LineID = _worldPacket.ReadUInt32(); } } + + class RequestLatestSplashScreen : ClientPacket + { + public RequestLatestSplashScreen(WorldPacket packet) : base(packet) { } + + public override void Read() { } + } + + class SplashScreenShowLatest : ServerPacket + { + public SplashScreenShowLatest() : base(ServerOpcodes.SplashScreenShowLatest, ConnectionType.Instance) { } + + public override void Write() + { + _worldPacket.WriteUInt32(UISplashScreenID); + } + + public uint UISplashScreenID; + } class DisplayGameError : ServerPacket {