aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-01-14 20:10:16 +0100
committerShauren <shauren.trinity@gmail.com>2022-01-14 20:10:16 +0100
commitf2bde40922bf59b95bba74c77390d9d51c750065 (patch)
tree28ce0be749ca14fce2313bdbfc720ae7d2e911d7
parent16a80656c51affe44de19940bc519dccbaa3ee3f (diff)
Core/DataStores: Load UnitCondition.db2
-rw-r--r--sql/updates/hotfixes/master/2022_01_14_00_hotfixes.sql37
-rw-r--r--src/server/database/Database/Implementation/HotfixDatabase.cpp6
-rw-r--r--src/server/database/Database/Implementation/HotfixDatabase.h3
-rw-r--r--src/server/game/DataStores/DB2LoadInfo.h38
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp2
-rw-r--r--src/server/game/DataStores/DB2Stores.h1
-rw-r--r--src/server/game/DataStores/DB2Structure.h9
7 files changed, 96 insertions, 0 deletions
diff --git a/sql/updates/hotfixes/master/2022_01_14_00_hotfixes.sql b/sql/updates/hotfixes/master/2022_01_14_00_hotfixes.sql
new file mode 100644
index 00000000000..a39791053ae
--- /dev/null
+++ b/sql/updates/hotfixes/master/2022_01_14_00_hotfixes.sql
@@ -0,0 +1,37 @@
+--
+-- Table structure for table `unit_condition`
+--
+DROP TABLE IF EXISTS `unit_condition`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!50503 SET character_set_client = utf8mb4 */;
+CREATE TABLE `unit_condition` (
+ `ID` int(10) unsigned NOT NULL DEFAULT '0',
+ `Flags` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Variable1` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Variable2` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Variable3` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Variable4` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Variable5` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Variable6` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Variable7` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Variable8` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `Op1` tinyint(4) NOT NULL DEFAULT '0',
+ `Op2` tinyint(4) NOT NULL DEFAULT '0',
+ `Op3` tinyint(4) NOT NULL DEFAULT '0',
+ `Op4` tinyint(4) NOT NULL DEFAULT '0',
+ `Op5` tinyint(4) NOT NULL DEFAULT '0',
+ `Op6` tinyint(4) NOT NULL DEFAULT '0',
+ `Op7` tinyint(4) NOT NULL DEFAULT '0',
+ `Op8` tinyint(4) NOT NULL DEFAULT '0',
+ `Value1` int(11) NOT NULL DEFAULT '0',
+ `Value2` int(11) NOT NULL DEFAULT '0',
+ `Value3` int(11) NOT NULL DEFAULT '0',
+ `Value4` int(11) NOT NULL DEFAULT '0',
+ `Value5` int(11) NOT NULL DEFAULT '0',
+ `Value6` int(11) NOT NULL DEFAULT '0',
+ `Value7` int(11) NOT NULL DEFAULT '0',
+ `Value8` int(11) 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 */;
diff --git a/src/server/database/Database/Implementation/HotfixDatabase.cpp b/src/server/database/Database/Implementation/HotfixDatabase.cpp
index d88ecc71d53..0f31dcbe4b2 100644
--- a/src/server/database/Database/Implementation/HotfixDatabase.cpp
+++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp
@@ -1669,6 +1669,12 @@ void HotfixDatabaseConnection::DoPrepareStatements()
"BottomLeftFeatureTitle_lang, BottomLeftFeatureDesc_lang, RightFeatureTitle_lang, RightFeatureDesc_lang FROM ui_splash_screen_locale"
" WHERE (`VerifiedBuild` > 0) = ? AND locale = ?", CONNECTION_SYNCH);
+ // UnitCondition.db2
+ PrepareStatement(HOTFIX_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"
+ " WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH);
+ PREPARE_MAX_ID_STMT(HOTFIX_SEL_UNIT_CONDITION, "SELECT MAX(ID) + 1 FROM unit_condition", CONNECTION_SYNCH);
+
// UnitPowerBar.db2
PrepareStatement(HOTFIX_SEL_UNIT_POWER_BAR, "SELECT ID, Name, Cost, OutOfError, ToolTip, MinPower, MaxPower, StartPower, CenterPower, "
"RegenerationPeace, RegenerationCombat, BarType, Flags, StartInset, EndInset, FileDataID1, FileDataID2, FileDataID3, FileDataID4, "
diff --git a/src/server/database/Database/Implementation/HotfixDatabase.h b/src/server/database/Database/Implementation/HotfixDatabase.h
index ca7cfae3154..0b1c8dc4cab 100644
--- a/src/server/database/Database/Implementation/HotfixDatabase.h
+++ b/src/server/database/Database/Implementation/HotfixDatabase.h
@@ -969,6 +969,9 @@ enum HotfixDatabaseStatements : uint32
HOTFIX_SEL_UI_SPLASH_SCREEN_MAX_ID,
HOTFIX_SEL_UI_SPLASH_SCREEN_LOCALE,
+ HOTFIX_SEL_UNIT_CONDITION,
+ HOTFIX_SEL_UNIT_CONDITION_MAX_ID,
+
HOTFIX_SEL_UNIT_POWER_BAR,
HOTFIX_SEL_UNIT_POWER_BAR_MAX_ID,
HOTFIX_SEL_UNIT_POWER_BAR_LOCALE,
diff --git a/src/server/game/DataStores/DB2LoadInfo.h b/src/server/game/DataStores/DB2LoadInfo.h
index 2ddfdadf5ef..087be6f4eba 100644
--- a/src/server/game/DataStores/DB2LoadInfo.h
+++ b/src/server/game/DataStores/DB2LoadInfo.h
@@ -6403,6 +6403,44 @@ struct UiSplashScreenLoadInfo
}
};
+struct UnitConditionLoadInfo
+{
+ static DB2LoadInfo const* Instance()
+ {
+ static DB2FieldMeta const fields[] =
+ {
+ { false, FT_INT, "ID" },
+ { false, FT_BYTE, "Flags" },
+ { false, FT_BYTE, "Variable1" },
+ { false, FT_BYTE, "Variable2" },
+ { false, FT_BYTE, "Variable3" },
+ { false, FT_BYTE, "Variable4" },
+ { false, FT_BYTE, "Variable5" },
+ { false, FT_BYTE, "Variable6" },
+ { false, FT_BYTE, "Variable7" },
+ { false, FT_BYTE, "Variable8" },
+ { true, FT_BYTE, "Op1" },
+ { true, FT_BYTE, "Op2" },
+ { true, FT_BYTE, "Op3" },
+ { true, FT_BYTE, "Op4" },
+ { true, FT_BYTE, "Op5" },
+ { true, FT_BYTE, "Op6" },
+ { true, FT_BYTE, "Op7" },
+ { true, FT_BYTE, "Op8" },
+ { true, FT_INT, "Value1" },
+ { true, FT_INT, "Value2" },
+ { true, FT_INT, "Value3" },
+ { true, FT_INT, "Value4" },
+ { true, FT_INT, "Value5" },
+ { true, FT_INT, "Value6" },
+ { true, FT_INT, "Value7" },
+ { true, FT_INT, "Value8" },
+ };
+ static DB2LoadInfo const loadInfo(&fields[0], std::extent<decltype(fields)>::value, UnitConditionMeta::Instance(), HOTFIX_SEL_UNIT_CONDITION);
+ return &loadInfo;
+ }
+};
+
struct UnitPowerBarLoadInfo
{
static DB2LoadInfo const* Instance()
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index d1c7fe437a4..111b428a600 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -326,6 +326,7 @@ DB2Storage<UiMapAssignmentEntry> sUiMapAssignmentStore("UiMapAssi
DB2Storage<UiMapLinkEntry> sUiMapLinkStore("UiMapLink.db2", UiMapLinkLoadInfo::Instance());
DB2Storage<UiMapXMapArtEntry> sUiMapXMapArtStore("UiMapXMapArt.db2", UiMapXMapArtLoadInfo::Instance());
DB2Storage<UISplashScreenEntry> sUISplashScreenStore("UISplashScreen.db2", UiSplashScreenLoadInfo::Instance());
+DB2Storage<UnitConditionEntry> sUnitConditionStore("UnitCondition.db2", UnitConditionLoadInfo::Instance());
DB2Storage<UnitPowerBarEntry> sUnitPowerBarStore("UnitPowerBar.db2", UnitPowerBarLoadInfo::Instance());
DB2Storage<VehicleEntry> sVehicleStore("Vehicle.db2", VehicleLoadInfo::Instance());
DB2Storage<VehicleSeatEntry> sVehicleSeatStore("VehicleSeat.db2", VehicleSeatLoadInfo::Instance());
@@ -898,6 +899,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul
LOAD_DB2(sUiMapLinkStore);
LOAD_DB2(sUiMapXMapArtStore);
LOAD_DB2(sUISplashScreenStore);
+ LOAD_DB2(sUnitConditionStore);
LOAD_DB2(sUnitPowerBarStore);
LOAD_DB2(sVehicleStore);
LOAD_DB2(sVehicleSeatStore);
diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h
index 75f61df4747..68b558c3622 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -242,6 +242,7 @@ TC_GAME_API extern DB2Storage<TransportAnimationEntry> sTransportAn
TC_GAME_API extern DB2Storage<TransportRotationEntry> sTransportRotationStore;
TC_GAME_API extern DB2Storage<UiMapEntry> sUiMapStore;
TC_GAME_API extern DB2Storage<UISplashScreenEntry> sUISplashScreenStore;
+TC_GAME_API extern DB2Storage<UnitConditionEntry> sUnitConditionStore;
TC_GAME_API extern DB2Storage<UnitPowerBarEntry> sUnitPowerBarStore;
TC_GAME_API extern DB2Storage<VehicleEntry> sVehicleStore;
TC_GAME_API extern DB2Storage<VehicleSeatEntry> sVehicleSeatStore;
diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h
index d1b7390ed83..96da65fd463 100644
--- a/src/server/game/DataStores/DB2Structure.h
+++ b/src/server/game/DataStores/DB2Structure.h
@@ -3871,6 +3871,15 @@ struct UISplashScreenEntry
int32 RequiredTimeEventPassed; // serverside TimeEvent table, see ModifierTreeType::HasTimeEventPassed
};
+struct UnitConditionEntry
+{
+ uint32 ID;
+ uint8 Flags;
+ uint8 Variable[8];
+ int8 Op[8];
+ int32 Value[8];
+};
+
struct UnitPowerBarEntry
{
uint32 ID;