From 3aad3e7e9732d35f2a06b683d32f5689f924e5db Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 25 Feb 2022 19:47:39 -0500 Subject: [PATCH] Core/DataStores: Load UnitCondition.db2 Port From (https://github.com/TrinityCore/TrinityCore/commit/f2bde40922bf59b95bba74c77390d9d51c750065) --- Source/Framework/Database/Databases/HotfixDatabase.cs | 6 ++++++ Source/Game/DataStorage/CliDB.cs | 2 ++ Source/Game/DataStorage/Structs/U_Records.cs | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/Source/Framework/Database/Databases/HotfixDatabase.cs b/Source/Framework/Database/Databases/HotfixDatabase.cs index f8c5c26d2..47be63cc4 100644 --- a/Source/Framework/Database/Databases/HotfixDatabase.cs +++ b/Source/Framework/Database/Databases/HotfixDatabase.cs @@ -1227,6 +1227,10 @@ namespace Framework.Database 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 = ?"); + // UnitCondition.db2 + PrepareStatement(HotfixStatements.SEL_UNIT_CONDITION, "SELECT ID, Flags, Variable1, Variable2, Variable3, Variable4, Variable5, Variable6, Variable7, " + + "Variable8, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8 FROM unit_condition"); + // 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, " + @@ -1926,6 +1930,8 @@ namespace Framework.Database SEL_UI_SPLASH_SCREEN, SEL_UI_SPLASH_SCREEN_LOCALE, + SEL_UNIT_CONDITION, + SEL_UNIT_POWER_BAR, SEL_UNIT_POWER_BAR_LOCALE, diff --git a/Source/Game/DataStorage/CliDB.cs b/Source/Game/DataStorage/CliDB.cs index 926f09218..918f6f005 100644 --- a/Source/Game/DataStorage/CliDB.cs +++ b/Source/Game/DataStorage/CliDB.cs @@ -335,6 +335,7 @@ namespace Game.DataStorage 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); + UnitConditionStorage = ReadDB2("UnitCondition.db2", HotfixStatements.SEL_UNIT_CONDITION); 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); @@ -724,6 +725,7 @@ namespace Game.DataStorage public static DB6Storage UiMapLinkStorage; public static DB6Storage UiMapXMapArtStorage; public static DB6Storage UISplashScreenStorage; + public static DB6Storage sUnitConditionStorage; 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 87beccdf8..26427a1a6 100644 --- a/Source/Game/DataStorage/Structs/U_Records.cs +++ b/Source/Game/DataStorage/Structs/U_Records.cs @@ -94,6 +94,15 @@ namespace Game.DataStorage public int RequiredTimeEventPassed; // serverside TimeEvent table, see ModifierTreeType::HasTimeEventPassed } + public sealed class UnitConditionRecord + { + public uint Id; + public byte Flags; + public byte[] Variable = new byte[8]; + public sbyte[] Op = new sbyte[8]; + public int[] Value = new int[8]; + }; + public sealed class UnitPowerBarRecord { public uint Id;