Core/Items: Removed no longer needed code for item set names and item set names locales
This commit is contained in:
1 parent
e8f08be901
commit
0e581b7991
8 files changed
+2
-173
No files matched your search
@@ -2622,118 +2622,6 @@ ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemSetNameLocales()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_itemSetNameLocaleStore.clear(); // need for reload case
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`, `name_loc1`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc5`, `name_loc6`, `name_loc7`, `name_loc8` FROM `locales_item_set_names`");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
|
||||
ItemSetNameLocale& data = _itemSetNameLocaleStore[entry];
|
||||
|
||||
for (uint8 i = 1; i < TOTAL_LOCALES; ++i)
|
||||
AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Name);
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(_itemSetNameLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemSetNames()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_itemSetNameStore.clear(); // needed for reload case
|
||||
|
||||
std::set<uint32> itemSetItems;
|
||||
|
||||
// fill item set member ids
|
||||
for (uint32 entryId = 0; entryId < sItemSetStore.GetNumRows(); ++entryId)
|
||||
{
|
||||
ItemSetEntry const* setEntry = sItemSetStore.LookupEntry(entryId);
|
||||
if (!setEntry)
|
||||
continue;
|
||||
|
||||
for (uint32 i = 0; i < MAX_ITEM_SET_ITEMS; ++i)
|
||||
if (setEntry->itemId[i])
|
||||
itemSetItems.insert(setEntry->itemId[i]);
|
||||
}
|
||||
|
||||
// 0 1 2
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outString(">> Loaded 0 item set names. DB table `item_set_names` is empty.");
|
||||
sLog->outString();
|
||||
return;
|
||||
}
|
||||
|
||||
_itemSetNameStore.rehash(result->GetRowCount());
|
||||
uint32 count = 0;
|
||||
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
if (itemSetItems.find(entry) == itemSetItems.end())
|
||||
{
|
||||
sLog->outErrorDb("Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemSetNameEntry &data = _itemSetNameStore[entry];
|
||||
data.name = fields[1].GetString();
|
||||
|
||||
uint32 invType = fields[2].GetUInt8();
|
||||
if (invType >= MAX_INVTYPE)
|
||||
{
|
||||
sLog->outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType);
|
||||
invType = INVTYPE_NON_EQUIP;
|
||||
}
|
||||
|
||||
data.InventoryType = invType;
|
||||
itemSetItems.erase(entry);
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
if (!itemSetItems.empty())
|
||||
{
|
||||
ItemTemplate const* pProto;
|
||||
for (std::set<uint32>::iterator itr = itemSetItems.begin(); itr != itemSetItems.end(); ++itr)
|
||||
{
|
||||
uint32 entry = *itr;
|
||||
// add data from item_template if available
|
||||
pProto = sObjectMgr->GetItemTemplate(entry);
|
||||
if (pProto)
|
||||
{
|
||||
sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry);
|
||||
ItemSetNameEntry &data = _itemSetNameStore[entry];
|
||||
data.name = pProto->Name1;
|
||||
data.InventoryType = pProto->InventoryType;
|
||||
++count;
|
||||
}
|
||||
else
|
||||
sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry);
|
||||
}
|
||||
}
|
||||
|
||||
sLog->outString(">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadVehicleTemplateAccessories()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
Reference in new issue
Block a user