Core/DataStore: Load ItemNameDescription

This commit is contained in:
Shauren
2020-03-26 20:09:40 +01:00
parent f2a9da7b49
commit 0969e93d15
7 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
--
-- Table structure for table `item_name_description`
--
DROP TABLE IF EXISTS `item_name_description`;
CREATE TABLE `item_name_description` (
`ID` int(10) unsigned NOT NULL DEFAULT '0',
`Description` text,
`Color` int(11) NOT NULL DEFAULT '0',
`VerifiedBuild` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Table structure for table `item_name_description_locale`
--
DROP TABLE IF EXISTS `item_name_description_locale`;
CREATE TABLE `item_name_description_locale` (
`ID` int(10) unsigned NOT NULL DEFAULT '0',
`locale` varchar(4) NOT NULL,
`Description_lang` text,
`VerifiedBuild` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`,`locale`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View File

@@ -601,6 +601,10 @@ void HotfixDatabaseConnection::DoPrepareStatements()
PrepareStatement(HOTFIX_SEL_ITEM_MODIFIED_APPEARANCE, "SELECT ID, ItemID, ItemAppearanceModifierID, ItemAppearanceID, OrderIndex, "
"TransmogSourceTypeEnum FROM item_modified_appearance ORDER BY ID DESC", CONNECTION_SYNCH);
// ItemNameDescription.db2
PrepareStatement(HOTFIX_SEL_ITEM_NAME_DESCRIPTION, "SELECT ID, Description, Color FROM item_name_description ORDER BY ID DESC", CONNECTION_SYNCH);
PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_NAME_DESCRIPTION, "SELECT ID, Description_lang FROM item_name_description_locale WHERE locale = ?", CONNECTION_SYNCH);
// ItemPriceBase.db2
PrepareStatement(HOTFIX_SEL_ITEM_PRICE_BASE, "SELECT ID, ItemLevel, Armor, Weapon FROM item_price_base ORDER BY ID DESC", CONNECTION_SYNCH);

View File

@@ -326,6 +326,9 @@ enum HotfixDatabaseStatements : uint32
HOTFIX_SEL_ITEM_MODIFIED_APPEARANCE,
HOTFIX_SEL_ITEM_NAME_DESCRIPTION,
HOTFIX_SEL_ITEM_NAME_DESCRIPTION_LOCALE,
HOTFIX_SEL_ITEM_PRICE_BASE,
HOTFIX_SEL_ITEM_SEARCH_NAME,

View File

@@ -2848,6 +2848,21 @@ struct ItemModifiedAppearanceLoadInfo
}
};
struct ItemNameDescriptionLoadInfo
{
static DB2LoadInfo const* Instance()
{
static DB2FieldMeta const fields[] =
{
{ false, FT_INT, "ID" },
{ false, FT_STRING, "Description" },
{ true, FT_INT, "Color" },
};
static DB2LoadInfo const loadInfo(&fields[0], std::extent<decltype(fields)>::value, ItemNameDescriptionMeta::Instance(), HOTFIX_SEL_ITEM_NAME_DESCRIPTION);
return &loadInfo;
}
};
struct ItemPriceBaseLoadInfo
{
static DB2LoadInfo const* Instance()

View File

@@ -168,6 +168,7 @@ DB2Storage<ItemLevelSelectorQualitySetEntry> sItemLevelSelectorQualitySetStor
DB2Storage<ItemLimitCategoryEntry> sItemLimitCategoryStore("ItemLimitCategory.db2", ItemLimitCategoryLoadInfo::Instance());
DB2Storage<ItemLimitCategoryConditionEntry> sItemLimitCategoryConditionStore("ItemLimitCategoryCondition.db2", ItemLimitCategoryConditionLoadInfo::Instance());
DB2Storage<ItemModifiedAppearanceEntry> sItemModifiedAppearanceStore("ItemModifiedAppearance.db2", ItemModifiedAppearanceLoadInfo::Instance());
DB2Storage<ItemNameDescriptionEntry> sItemNameDescriptionStore("ItemNameDescription.db2", ItemNameDescriptionLoadInfo::Instance());
DB2Storage<ItemPriceBaseEntry> sItemPriceBaseStore("ItemPriceBase.db2", ItemPriceBaseLoadInfo::Instance());
DB2Storage<ItemSearchNameEntry> sItemSearchNameStore("ItemSearchName.db2", ItemSearchNameLoadInfo::Instance());
DB2Storage<ItemSetEntry> sItemSetStore("ItemSet.db2", ItemSetLoadInfo::Instance());
@@ -659,6 +660,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
LOAD_DB2(sItemLimitCategoryStore);
LOAD_DB2(sItemLimitCategoryConditionStore);
LOAD_DB2(sItemModifiedAppearanceStore);
LOAD_DB2(sItemNameDescriptionStore);
LOAD_DB2(sItemPriceBaseStore);
LOAD_DB2(sItemSearchNameStore);
LOAD_DB2(sItemSetStore);

View File

@@ -128,6 +128,7 @@ TC_GAME_API extern DB2Storage<ItemDamageTwoHandEntry> sItemDamageT
TC_GAME_API extern DB2Storage<ItemDamageTwoHandCasterEntry> sItemDamageTwoHandCasterStore;
TC_GAME_API extern DB2Storage<ItemDisenchantLootEntry> sItemDisenchantLootStore;
TC_GAME_API extern DB2Storage<ItemEffectEntry> sItemEffectStore;
TC_GAME_API extern DB2Storage<ItemNameDescriptionEntry> sItemNameDescriptionStore;
TC_GAME_API extern DB2Storage<ItemEntry> sItemStore;
TC_GAME_API extern DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore;
TC_GAME_API extern DB2Storage<ItemLimitCategoryEntry> sItemLimitCategoryStore;

View File

@@ -1754,6 +1754,13 @@ struct ItemModifiedAppearanceEntry
int8 TransmogSourceTypeEnum;
};
struct ItemNameDescriptionEntry
{
uint32 ID;
LocalizedString* Description;
int32 Color;
};
struct ItemPriceBaseEntry
{
uint32 ID;