diff options
author | Ovahlord <dreadkiller@gmx.de> | 2023-11-27 22:04:39 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2023-11-27 22:04:39 +0100 |
commit | bbb320f39013bb540d69a36fe7be72c1ac6ba9d3 (patch) | |
tree | 1c52714724cc6009fefe363c248fd9d11a05980c | |
parent | cb5f57a8b39c3c6250b487990a414b55f2a44eab (diff) |
Core/DataStores: load ItemRandomProperties.db2 and ItemRandomSuffix.db2
-rw-r--r-- | sql/updates/hotfixes/3.4.x/2023_11_27_00_hotfixes.sql | 134 | ||||
-rw-r--r-- | src/server/database/Database/Implementation/HotfixDatabase.cpp | 18 | ||||
-rw-r--r-- | src/server/database/Database/Implementation/HotfixDatabase.h | 8 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2LoadInfo.h | 37 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Stores.cpp | 2 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Stores.h | 2 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Structure.h | 15 |
7 files changed, 214 insertions, 2 deletions
diff --git a/sql/updates/hotfixes/3.4.x/2023_11_27_00_hotfixes.sql b/sql/updates/hotfixes/3.4.x/2023_11_27_00_hotfixes.sql new file mode 100644 index 00000000000..2f939e108a9 --- /dev/null +++ b/sql/updates/hotfixes/3.4.x/2023_11_27_00_hotfixes.sql @@ -0,0 +1,134 @@ +-- +-- Table structure for table `item_random_properties` +-- + +DROP TABLE IF EXISTS `item_random_properties`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `item_random_properties` ( + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `Name` text, + `Enchantment1` smallint(5) unsigned NOT NULL DEFAULT '0', + `Enchantment2` smallint(5) unsigned NOT NULL DEFAULT '0', + `Enchantment3` smallint(5) unsigned NOT NULL DEFAULT '0', + `Enchantment4` smallint(5) unsigned NOT NULL DEFAULT '0', + `Enchantment5` smallint(5) 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 */; + +-- +-- Dumping data for table `item_random_properties` +-- + +LOCK TABLES `item_random_properties` WRITE; +/*!40000 ALTER TABLE `item_random_properties` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_random_properties` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_random_properties_locale` +-- + +DROP TABLE IF EXISTS `item_random_properties_locale`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `item_random_properties_locale` ( + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `locale` varchar(4) NOT NULL, + `Name_lang` text, + `VerifiedBuild` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`,`locale`,`VerifiedBuild`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +/*!50500 PARTITION BY LIST COLUMNS(locale) +(PARTITION deDE VALUES IN ('deDE') ENGINE = InnoDB, + PARTITION esES VALUES IN ('esES') ENGINE = InnoDB, + PARTITION esMX VALUES IN ('esMX') ENGINE = InnoDB, + PARTITION frFR VALUES IN ('frFR') ENGINE = InnoDB, + PARTITION itIT VALUES IN ('itIT') ENGINE = InnoDB, + PARTITION koKR VALUES IN ('koKR') ENGINE = InnoDB, + PARTITION ptBR VALUES IN ('ptBR') ENGINE = InnoDB, + PARTITION ruRU VALUES IN ('ruRU') ENGINE = InnoDB, + PARTITION zhCN VALUES IN ('zhCN') ENGINE = InnoDB, + PARTITION zhTW VALUES IN ('zhTW') ENGINE = InnoDB) */; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_random_properties_locale` +-- + +LOCK TABLES `item_random_properties_locale` WRITE; +/*!40000 ALTER TABLE `item_random_properties_locale` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_random_properties_locale` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_random_suffix` +-- + +DROP TABLE IF EXISTS `item_random_suffix`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `item_random_suffix` ( + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `Name` text, + `Enchantment1` smallint(5) unsigned NOT NULL DEFAULT '0', + `Enchantment2` smallint(5) unsigned NOT NULL DEFAULT '0', + `Enchantment3` smallint(5) unsigned NOT NULL DEFAULT '0', + `Enchantment4` smallint(5) unsigned NOT NULL DEFAULT '0', + `Enchantment5` smallint(5) unsigned NOT NULL DEFAULT '0', + `AllocationPct1` smallint(5) unsigned NOT NULL DEFAULT '0', + `AllocationPct2` smallint(5) unsigned NOT NULL DEFAULT '0', + `AllocationPct3` smallint(5) unsigned NOT NULL DEFAULT '0', + `AllocationPct4` smallint(5) unsigned NOT NULL DEFAULT '0', + `AllocationPct5` smallint(5) 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 */; + +-- +-- Dumping data for table `item_random_suffix` +-- + +LOCK TABLES `item_random_suffix` WRITE; +/*!40000 ALTER TABLE `item_random_suffix` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_random_suffix` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_random_suffix_locale` +-- + +DROP TABLE IF EXISTS `item_random_suffix_locale`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `item_random_suffix_locale` ( + `ID` int(10) unsigned NOT NULL DEFAULT '0', + `locale` varchar(4) NOT NULL, + `Name_lang` text, + `VerifiedBuild` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`,`locale`,`VerifiedBuild`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +/*!50500 PARTITION BY LIST COLUMNS(locale) +(PARTITION deDE VALUES IN ('deDE') ENGINE = InnoDB, + PARTITION esES VALUES IN ('esES') ENGINE = InnoDB, + PARTITION esMX VALUES IN ('esMX') ENGINE = InnoDB, + PARTITION frFR VALUES IN ('frFR') ENGINE = InnoDB, + PARTITION itIT VALUES IN ('itIT') ENGINE = InnoDB, + PARTITION koKR VALUES IN ('koKR') ENGINE = InnoDB, + PARTITION ptBR VALUES IN ('ptBR') ENGINE = InnoDB, + PARTITION ruRU VALUES IN ('ruRU') ENGINE = InnoDB, + PARTITION zhCN VALUES IN ('zhCN') ENGINE = InnoDB, + PARTITION zhTW VALUES IN ('zhTW') ENGINE = InnoDB) */; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_random_suffix_locale` +-- + +LOCK TABLES `item_random_suffix_locale` WRITE; +/*!40000 ALTER TABLE `item_random_suffix_locale` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_random_suffix_locale` ENABLE KEYS */; +UNLOCK TABLES; diff --git a/src/server/database/Database/Implementation/HotfixDatabase.cpp b/src/server/database/Database/Implementation/HotfixDatabase.cpp index c5f1b720b3d..5f12c0eb458 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.cpp +++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp @@ -722,8 +722,8 @@ void HotfixDatabaseConnection::DoPrepareStatements() PREPARE_MAX_ID_STMT(HOTFIX_SEL_GLYPH_REQUIRED_SPEC, "SELECT MAX(ID) + 1 FROM glyph_required_spec", CONNECTION_SYNCH); // GossipNpcOption.db2 - PrepareStatement(HOTFIX_SEL_GOSSIP_NPC_OPTION, "SELECT ID, GossipNpcOption, LFGDungeonsID, Unk341_1, Unk341_2, Unk341_3, Unk341_4, Unk341_5, Unk341_6, " - "Unk341_7, Unk341_8, Unk341_9, GossipOptionID FROM gossip_npc_option WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); + PrepareStatement(HOTFIX_SEL_GOSSIP_NPC_OPTION, "SELECT ID, GossipNpcOption, LFGDungeonsID, Unk341_1, Unk341_2, Unk341_3, Unk341_4, Unk341_5, " + "Unk341_6, Unk341_7, Unk341_8, Unk341_9, GossipOptionID FROM gossip_npc_option WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); PREPARE_MAX_ID_STMT(HOTFIX_SEL_GOSSIP_NPC_OPTION, "SELECT MAX(ID) + 1 FROM gossip_npc_option", CONNECTION_SYNCH); // GuildColorBackground.db2 @@ -930,6 +930,20 @@ void HotfixDatabaseConnection::DoPrepareStatements() PrepareStatement(HOTFIX_SEL_ITEM_PRICE_BASE, "SELECT ID, ItemLevel, Armor, Weapon FROM item_price_base WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); PREPARE_MAX_ID_STMT(HOTFIX_SEL_ITEM_PRICE_BASE, "SELECT MAX(ID) + 1 FROM item_price_base", CONNECTION_SYNCH); + // ItemRandomProperties.db2 + PrepareStatement(HOTFIX_SEL_ITEM_RANDOM_PROPERTIES, "SELECT ID, Name, Enchantment1, Enchantment2, Enchantment3, Enchantment4, Enchantment5" + " FROM item_random_properties WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); + PREPARE_MAX_ID_STMT(HOTFIX_SEL_ITEM_RANDOM_PROPERTIES, "SELECT MAX(ID) + 1 FROM item_random_properties", CONNECTION_SYNCH); + PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_RANDOM_PROPERTIES, "SELECT ID, Name_lang FROM item_random_properties_locale WHERE (`VerifiedBuild` > 0) = ?" + " AND locale = ?", CONNECTION_SYNCH); + + // ItemRandomSuffix.db2 + PrepareStatement(HOTFIX_SEL_ITEM_RANDOM_SUFFIX, "SELECT ID, Name, Enchantment1, Enchantment2, Enchantment3, Enchantment4, Enchantment5, " + "AllocationPct1, AllocationPct2, AllocationPct3, AllocationPct4, AllocationPct5 FROM item_random_suffix WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); + PREPARE_MAX_ID_STMT(HOTFIX_SEL_ITEM_RANDOM_SUFFIX, "SELECT MAX(ID) + 1 FROM item_random_suffix", CONNECTION_SYNCH); + PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_RANDOM_SUFFIX, "SELECT ID, Name_lang FROM item_random_suffix_locale WHERE (`VerifiedBuild` > 0) = ?" + " AND locale = ?", CONNECTION_SYNCH); + // ItemSearchName.db2 PrepareStatement(HOTFIX_SEL_ITEM_SEARCH_NAME, "SELECT AllowableRace, Display, ID, OverallQualityID, ExpansionID, MinFactionID, MinReputation, " "AllowableClass, RequiredLevel, RequiredSkill, RequiredSkillRank, RequiredAbility, ItemLevel, Flags1, Flags2, Flags3, Flags4" diff --git a/src/server/database/Database/Implementation/HotfixDatabase.h b/src/server/database/Database/Implementation/HotfixDatabase.h index 350f2531ff5..cc56229d867 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.h +++ b/src/server/database/Database/Implementation/HotfixDatabase.h @@ -544,6 +544,14 @@ enum HotfixDatabaseStatements : uint32 HOTFIX_SEL_ITEM_PRICE_BASE, HOTFIX_SEL_ITEM_PRICE_BASE_MAX_ID, + HOTFIX_SEL_ITEM_RANDOM_PROPERTIES, + HOTFIX_SEL_ITEM_RANDOM_PROPERTIES_MAX_ID, + HOTFIX_SEL_ITEM_RANDOM_PROPERTIES_LOCALE, + + HOTFIX_SEL_ITEM_RANDOM_SUFFIX, + HOTFIX_SEL_ITEM_RANDOM_SUFFIX_MAX_ID, + HOTFIX_SEL_ITEM_RANDOM_SUFFIX_LOCALE, + HOTFIX_SEL_ITEM_SEARCH_NAME, HOTFIX_SEL_ITEM_SEARCH_NAME_MAX_ID, HOTFIX_SEL_ITEM_SEARCH_NAME_LOCALE, diff --git a/src/server/game/DataStores/DB2LoadInfo.h b/src/server/game/DataStores/DB2LoadInfo.h index 6cb7a4124e2..5df14becfee 100644 --- a/src/server/game/DataStores/DB2LoadInfo.h +++ b/src/server/game/DataStores/DB2LoadInfo.h @@ -2917,6 +2917,43 @@ struct ItemPriceBaseLoadInfo static constexpr DB2LoadInfo Instance{ Fields, 4, &ItemPriceBaseMeta::Instance, HOTFIX_SEL_ITEM_PRICE_BASE }; }; +struct ItemRandomPropertiesLoadInfo +{ + static constexpr DB2FieldMeta Fields[7] = + { + { false, FT_INT, "ID" }, + { false, FT_STRING, "Name" }, + { false, FT_SHORT, "Enchantment1" }, + { false, FT_SHORT, "Enchantment2" }, + { false, FT_SHORT, "Enchantment3" }, + { false, FT_SHORT, "Enchantment4" }, + { false, FT_SHORT, "Enchantment5" }, + }; + + static constexpr DB2LoadInfo Instance{ Fields, 7, &ItemRandomPropertiesMeta::Instance, HOTFIX_SEL_ITEM_RANDOM_PROPERTIES }; +}; + +struct ItemRandomSuffixLoadInfo +{ + static constexpr DB2FieldMeta Fields[12] = + { + { false, FT_INT, "ID" }, + { false, FT_STRING, "Name" }, + { false, FT_SHORT, "Enchantment1" }, + { false, FT_SHORT, "Enchantment2" }, + { false, FT_SHORT, "Enchantment3" }, + { false, FT_SHORT, "Enchantment4" }, + { false, FT_SHORT, "Enchantment5" }, + { false, FT_SHORT, "AllocationPct1" }, + { false, FT_SHORT, "AllocationPct2" }, + { false, FT_SHORT, "AllocationPct3" }, + { false, FT_SHORT, "AllocationPct4" }, + { false, FT_SHORT, "AllocationPct5" }, + }; + + static constexpr DB2LoadInfo Instance{ Fields, 12, &ItemRandomSuffixMeta::Instance, HOTFIX_SEL_ITEM_RANDOM_SUFFIX }; +}; + struct ItemSearchNameLoadInfo { static constexpr DB2FieldMeta Fields[17] = diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 6fbd316f650..6b50a5cfc07 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -195,6 +195,8 @@ DB2Storage<ItemModifiedAppearanceEntry> sItemModifiedAppearanceStore("It DB2Storage<ItemModifiedAppearanceExtraEntry> sItemModifiedAppearanceExtraStore("ItemModifiedAppearanceExtra.db2", &ItemModifiedAppearanceExtraLoadInfo::Instance); DB2Storage<ItemNameDescriptionEntry> sItemNameDescriptionStore("ItemNameDescription.db2", &ItemNameDescriptionLoadInfo::Instance); DB2Storage<ItemPriceBaseEntry> sItemPriceBaseStore("ItemPriceBase.db2", &ItemPriceBaseLoadInfo::Instance); +DB2Storage<ItemRandomPropertiesEntry> sItemRandomPropertiesStore("ItemRandomProperties.db2", &ItemRandomPropertiesLoadInfo::Instance); +DB2Storage<ItemRandomSuffixEntry> sItemRandomSuffixStore("ItemRandomSuffix.db2", &ItemRandomSuffixLoadInfo::Instance); DB2Storage<ItemSearchNameEntry> sItemSearchNameStore("ItemSearchName.db2", &ItemSearchNameLoadInfo::Instance); DB2Storage<ItemSetEntry> sItemSetStore("ItemSet.db2", &ItemSetLoadInfo::Instance); DB2Storage<ItemSetSpellEntry> sItemSetSpellStore("ItemSetSpell.db2", &ItemSetSpellLoadInfo::Instance); diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index 0374d9228e6..1bcc2e6c4d4 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -159,6 +159,8 @@ TC_GAME_API extern DB2Storage<ItemLimitCategoryEntry> sItemLimitCa TC_GAME_API extern DB2Storage<ItemModifiedAppearanceEntry> sItemModifiedAppearanceStore; TC_GAME_API extern DB2Storage<ItemModifiedAppearanceExtraEntry> sItemModifiedAppearanceExtraStore; TC_GAME_API extern DB2Storage<ItemPriceBaseEntry> sItemPriceBaseStore; +TC_GAME_API extern DB2Storage<ItemRandomPropertiesEntry> sItemRandomPropertiesStore; +TC_GAME_API extern DB2Storage<ItemRandomSuffixEntry> sItemRandomSuffixStore; TC_GAME_API extern DB2Storage<ItemSearchNameEntry> sItemSearchNameStore; TC_GAME_API extern DB2Storage<ItemSetEntry> sItemSetStore; TC_GAME_API extern DB2Storage<ItemSetSpellEntry> sItemSetSpellStore; diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index d020b457199..4024dc833bf 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -2240,6 +2240,21 @@ struct ItemPriceBaseEntry float Weapon; }; +struct ItemRandomPropertiesEntry +{ + uint32 ID; + LocalizedString Name; + std::array<uint16, 5> Enchantment; +}; + +struct ItemRandomSuffixEntry +{ + uint32 ID; + LocalizedString Name; + std::array<uint16, 5> Enchantment; + std::array<uint16, 5> AllocationPct; +}; + struct ItemSearchNameEntry { Trinity::RaceMask<int64> AllowableRace; |