Added support for item set names in case where item does not exist in item_template (like gladiator gear)
--HG-- branch : trunk
This commit is contained in:
@@ -585,9 +585,11 @@ INSERT INTO `command` VALUES
|
||||
('reload gm_tickets',3,'Syntax: .reload gm_tickets\nReload gm_tickets table.'),
|
||||
('reload item_enchantment_template',3,'Syntax: .reload item_enchantment_template\nReload item_enchantment_template table.'),
|
||||
('reload item_loot_template',3,'Syntax: .reload item_loot_template\nReload item_loot_template table.'),
|
||||
('reload item_set_names',3,'Syntax: .reload item_set_names\nReload item_set_names table.'),
|
||||
('reload locales_creature',3,'Syntax: .reload locales_creature\nReload locales_creature table.'),
|
||||
('reload locales_gameobject',3,'Syntax: .reload locales_gameobject\nReload locales_gameobject table.'),
|
||||
('reload locales_item',3,'Syntax: .reload locales_item\nReload locales_item table.'),
|
||||
('reload locales_item_set_name',3,'Syntax: .reload locales_item_set_name\nReload locales_item_set_name table.'),
|
||||
('reload locales_npc_text',3,'Syntax: .reload locales_npc_text\nReload locales_npc_text table.'),
|
||||
('reload locales_page_text',3,'Syntax: .reload locales_page_text\nReload locales_page_text table.'),
|
||||
('reload locales_points_of_interest',3,'Syntax: .reload locales_points_of_interest\nReload locales_point_of_interest table.'),
|
||||
@@ -2746,6 +2748,30 @@ LOCK TABLES `item_loot_template` WRITE;
|
||||
/*!40000 ALTER TABLE `item_loot_template` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `item_set_names`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `item_set_names`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `item_set_names` (
|
||||
`entry` mediumint(8) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL default '',
|
||||
`InventoryType` tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`entry`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `item_set_names`
|
||||
--
|
||||
|
||||
LOCK TABLES `item_set_names` WRITE;
|
||||
/*!40000 ALTER TABLE `item_set_names` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `item_set_names` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `item_required_target`
|
||||
--
|
||||
@@ -3083,6 +3109,36 @@ LOCK TABLES `locales_item` WRITE;
|
||||
/*!40000 ALTER TABLE `locales_item` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `locales_item_set_name`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `locales_item_set_name`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `locales_item_set_name` (
|
||||
`entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`name_loc1` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc2` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc3` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc4` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc5` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc6` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc7` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc8` varchar(100) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`entry`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `locales_item_set_name`
|
||||
--
|
||||
|
||||
LOCK TABLES `locales_item_set_name` WRITE;
|
||||
/*!40000 ALTER TABLE `locales_item_set_name` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `locales_item_set_name` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `locales_gossip_menu_option`
|
||||
--
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
DELETE FROM `command` WHERE `name` IN ('reload item_set_names','reload locales_item_set_name');
|
||||
INSERT INTO `command` VALUES
|
||||
('reload item_set_names',3,'Syntax: .reload item_set_names\nReload item_set_names table.'),
|
||||
('reload locales_item_set_name',3,'Syntax: .reload locales_item_set_name\nReload locales_item_set_name table.');
|
||||
@@ -0,0 +1,14 @@
|
||||
--
|
||||
-- Table structure for table `item_set_names`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `item_set_names`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `item_set_names` (
|
||||
`entry` mediumint(8) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL default '',
|
||||
`InventoryType` tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`entry`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -0,0 +1,20 @@
|
||||
--
|
||||
-- Table structure for table `locales_item_set_name`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `locales_item_set_name`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `locales_item_set_name` (
|
||||
`entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`name_loc1` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc2` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc3` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc4` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc5` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc6` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc7` varchar(100) NOT NULL DEFAULT '',
|
||||
`name_loc8` varchar(100) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`entry`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -479,10 +479,12 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipMenuOptionCommand, "", NULL },
|
||||
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL },
|
||||
{ "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL },
|
||||
{ "item_set_names", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemSetNamesCommand, "", NULL },
|
||||
{ "locales_achievement_reward", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesAchievementRewardCommand,"", NULL },
|
||||
{ "locales_creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesCreatureCommand, "", NULL },
|
||||
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGameobjectCommand, "", NULL },
|
||||
{ "locales_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemCommand, "", NULL },
|
||||
{ "locales_item_set_name", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemSetNameCommand, "", NULL },
|
||||
{ "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL },
|
||||
{ "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL },
|
||||
{ "locales_points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPointsOfInterestCommand, "", NULL },
|
||||
|
||||
@@ -378,10 +378,12 @@ class ChatHandler
|
||||
bool HandleReloadGOQuestRelationsCommand(const char* args);
|
||||
bool HandleReloadGOQuestInvRelationsCommand(const char* args);
|
||||
bool HandleReloadItemEnchantementsCommand(const char* args);
|
||||
bool HandleReloadItemSetNamesCommand(const char* args);
|
||||
bool HandleReloadLocalesAchievementRewardCommand(const char* args);
|
||||
bool HandleReloadLocalesCreatureCommand(const char* args);
|
||||
bool HandleReloadLocalesGameobjectCommand(const char* args);
|
||||
bool HandleReloadLocalesItemCommand(const char* args);
|
||||
bool HandleReloadLocalesItemSetNameCommand(const char* args);
|
||||
bool HandleReloadLocalesNpcTextCommand(const char* args);
|
||||
bool HandleReloadLocalesPageTextCommand(const char* args);
|
||||
bool HandleReloadLocalesPointsOfInterestCommand(const char* args);
|
||||
|
||||
@@ -1284,6 +1284,14 @@ bool ChatHandler::HandleReloadItemEnchantementsCommand(const char*)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReloadItemSetNamesCommand(const char*)
|
||||
{
|
||||
sLog.outString("Re-Loading Item set names...");
|
||||
LoadRandomEnchantmentsTable();
|
||||
SendGlobalGMSysMessage("DB table `item_set_names` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReloadGameObjectScriptsCommand(const char* arg)
|
||||
{
|
||||
if (sWorld.IsScriptScheduled())
|
||||
@@ -1502,6 +1510,14 @@ bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReloadLocalesItemSetNameCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales Item set name... ");
|
||||
objmgr.LoadItemSetNameLocales();
|
||||
SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/)
|
||||
{
|
||||
sLog.outString("Re-Loading Locales NPC Text ... ");
|
||||
|
||||
@@ -1080,12 +1080,14 @@ struct ItemRandomSuffixEntry
|
||||
uint32 prefix[5]; // 22-24 m_allocationPct
|
||||
};
|
||||
|
||||
#define MAX_ITEM_SET_ITEMS 10
|
||||
struct ItemSetEntry
|
||||
{
|
||||
//uint32 id // 0 m_ID
|
||||
char* name[16]; // 1-16 m_name_lang
|
||||
// 17 string flags, unused
|
||||
//uint32 itemId[17]; // 18-34 m_itemID
|
||||
uint32 itemId[MAX_ITEM_SET_ITEMS]; // 18-27 m_itemID
|
||||
//uint32 unknown[7]; // 28-34 unk, all 0
|
||||
uint32 spells[8]; // 35-42 m_setSpellID
|
||||
uint32 items_to_triggerspell[8]; // 43-50 m_setThreshold
|
||||
uint32 required_skill_id; // 51 m_requiredSkill
|
||||
|
||||
@@ -72,7 +72,7 @@ const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiiix";
|
||||
const char ItemLimitCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxix";
|
||||
const char ItemRandomPropertiesfmt[]="nxiiiiissssssssssssssssx";
|
||||
const char ItemRandomSuffixfmt[]="nssssssssssssssssxxiiiiiiiiii";
|
||||
const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii";
|
||||
const char ItemSetEntryfmt[]="dssssssssssssssssxiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii";
|
||||
const char LFGDungeonEntryfmt[]="nxxxxxxxxxxxxxxxxxiiiiiiixixxixixxxxxxxxxxxxxxxxx";
|
||||
const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
|
||||
const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxssssssssssssssssx";
|
||||
|
||||
@@ -661,6 +661,17 @@ struct ItemLocale
|
||||
std::vector<std::string> Description;
|
||||
};
|
||||
|
||||
struct ItemSetNameEntry
|
||||
{
|
||||
std::string name;
|
||||
uint32 InventoryType;
|
||||
};
|
||||
|
||||
struct ItemSetNameLocale
|
||||
{
|
||||
std::vector<std::string> Name;
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack()
|
||||
|
||||
@@ -2368,7 +2368,132 @@ void ObjectMgr::LoadItemPrototypes()
|
||||
}
|
||||
|
||||
for (std::set<uint32>::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr)
|
||||
sLog.outErrorDb("Item (Entry: %u) not exist in `item_template` but referenced in `CharStartOutfit.dnc`", *itr);
|
||||
sLog.outErrorDb("Item (Entry: %u) not exist in `item_template` but referenced in `CharStartOutfit.dbc`", *itr);
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemSetNameLocales()
|
||||
{
|
||||
mItemSetNameLocaleMap.clear(); // need for reload case
|
||||
|
||||
QueryResult_AutoPtr 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_name`");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
barGoLink bar(result->GetRowCount());
|
||||
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
bar.step();
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
|
||||
ItemSetNameLocale& data = mItemSetNameLocaleMap[entry];
|
||||
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[i].GetCppString();
|
||||
if (!str.empty())
|
||||
{
|
||||
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||
if (idx >= 0)
|
||||
{
|
||||
if (data.Name.size() <= idx)
|
||||
data.Name.resize(idx+1);
|
||||
|
||||
data.Name[idx] = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded %lu Item set name locale strings", (uint32)mItemSetNameLocaleMap.size());
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemSetNames()
|
||||
{
|
||||
mItemSetNameMap.clear(); // needed for reload case
|
||||
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT `entry`,`name`,`InventoryType` FROM `item_set_names`");
|
||||
|
||||
uint32 count = 0;
|
||||
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]);
|
||||
}
|
||||
|
||||
if (result)
|
||||
{
|
||||
barGoLink bar(result->GetRowCount());
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
bar.step();
|
||||
|
||||
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 = mItemSetNameMap[entry];
|
||||
data.name = fields[1].GetCppString();
|
||||
|
||||
uint32 invType = fields[2].GetUInt32();
|
||||
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());
|
||||
}
|
||||
else
|
||||
{
|
||||
barGoLink bar(1);
|
||||
bar.step();
|
||||
|
||||
sLog.outString();
|
||||
sLog.outErrorDb(">> Loaded 0 item set names. DB table `item_set_names` is empty.");
|
||||
}
|
||||
|
||||
if (!itemSetItems.empty())
|
||||
{
|
||||
ItemPrototype const* pProto;
|
||||
for (std::set<uint32>::iterator itr = itemSetItems.begin(); itr != itemSetItems.end(); ++itr)
|
||||
{
|
||||
uint32 entry = *itr;
|
||||
// add data from item_template if available
|
||||
if (pProto = GetItemPrototype(entry))
|
||||
{
|
||||
sLog.outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry);
|
||||
ItemSetNameEntry &data = mItemSetNameMap[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();
|
||||
sLog.outString(">> Loaded %u item set names", count);
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadVehicleAccessories()
|
||||
|
||||
@@ -164,6 +164,7 @@ typedef UNORDERED_MAP<uint32,GameObjectData> GameObjectDataMap;
|
||||
typedef UNORDERED_MAP<uint32,CreatureLocale> CreatureLocaleMap;
|
||||
typedef UNORDERED_MAP<uint32,GameObjectLocale> GameObjectLocaleMap;
|
||||
typedef UNORDERED_MAP<uint32,ItemLocale> ItemLocaleMap;
|
||||
typedef UNORDERED_MAP<uint32,ItemSetNameLocale> ItemSetNameLocaleMap;
|
||||
typedef UNORDERED_MAP<uint32,QuestLocale> QuestLocaleMap;
|
||||
typedef UNORDERED_MAP<uint32,NpcTextLocale> NpcTextLocaleMap;
|
||||
typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap;
|
||||
@@ -431,6 +432,14 @@ class ObjectMgr
|
||||
|
||||
static ItemPrototype const* GetItemPrototype(uint32 id) { return sItemStorage.LookupEntry<ItemPrototype>(id); }
|
||||
|
||||
ItemSetNameEntry const* GetItemSetNameEntry(uint32 itemId)
|
||||
{
|
||||
ItemSetNameMap::iterator itr = mItemSetNameMap.find(itemId);
|
||||
if(itr != mItemSetNameMap.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static InstanceTemplate const* GetInstanceTemplate(uint32 map)
|
||||
{
|
||||
return sInstanceTemplate.LookupEntry<InstanceTemplate>(map);
|
||||
@@ -607,6 +616,8 @@ class ObjectMgr
|
||||
void LoadGameobjectRespawnTimes();
|
||||
void LoadItemPrototypes();
|
||||
void LoadItemLocales();
|
||||
void LoadItemSetNames();
|
||||
void LoadItemSetNameLocales();
|
||||
void LoadQuestLocales();
|
||||
void LoadNpcTextLocales();
|
||||
void LoadPageTextLocales();
|
||||
@@ -740,6 +751,12 @@ class ObjectMgr
|
||||
if (itr == mItemLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
ItemSetNameLocale const* GetItemSetNameLocale(uint32 entry) const
|
||||
{
|
||||
ItemSetNameLocaleMap::const_iterator itr = mItemSetNameLocaleMap.find(entry);
|
||||
if (itr == mItemSetNameLocaleMap.end())return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestLocale const* GetQuestLocale(uint32 entry) const
|
||||
{
|
||||
QuestLocaleMap::const_iterator itr = mQuestLocaleMap.find(entry);
|
||||
@@ -1045,6 +1062,9 @@ class ObjectMgr
|
||||
HalfNameMap PetHalfName0;
|
||||
HalfNameMap PetHalfName1;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, ItemSetNameEntry> ItemSetNameMap;
|
||||
ItemSetNameMap mItemSetNameMap;
|
||||
|
||||
MapObjectGuids mMapObjectGuids;
|
||||
CreatureDataMap mCreatureDataMap;
|
||||
CreatureLinkedRespawnMap mCreatureLinkedRespawnMap;
|
||||
@@ -1052,6 +1072,7 @@ class ObjectMgr
|
||||
GameObjectDataMap mGameObjectDataMap;
|
||||
GameObjectLocaleMap mGameObjectLocaleMap;
|
||||
ItemLocaleMap mItemLocaleMap;
|
||||
ItemSetNameLocaleMap mItemSetNameLocaleMap;
|
||||
QuestLocaleMap mQuestLocaleMap;
|
||||
NpcTextLocaleMap mNpcTextLocaleMap;
|
||||
PageTextLocaleMap mPageTextLocaleMap;
|
||||
|
||||
@@ -1003,40 +1003,25 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
|
||||
recv_data.read_skip<uint64>(); // guid
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid);
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid);
|
||||
if (pProto)
|
||||
ItemSetNameEntry const *pName = objmgr.GetItemSetNameEntry(itemid);
|
||||
if (pName)
|
||||
{
|
||||
std::string Name;
|
||||
Name = pProto->Name1;
|
||||
|
||||
std::string Name = pName->name;
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId);
|
||||
if (il)
|
||||
{
|
||||
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
|
||||
Name = il->Name[loc_idx];
|
||||
}
|
||||
ItemSetNameLocale const *isnl = objmgr.GetItemSetNameLocale(itemid);
|
||||
if (isnl)
|
||||
if (isnl->Name.size() > size_t(loc_idx) && !isnl->Name[loc_idx].empty())
|
||||
Name = isnl->Name[loc_idx];
|
||||
}
|
||||
// guess size
|
||||
WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+10));
|
||||
data << uint32(pProto->ItemId);
|
||||
|
||||
WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+Name.size()+1+4));
|
||||
data << uint32(itemid);
|
||||
data << Name;
|
||||
data << uint32(pProto->InventoryType);
|
||||
data << uint32(pName->InventoryType);
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
// This is a BS check, there are lots of items listed in Item.dbc that do not even exist on official -- so we can NEVER get the data for them.
|
||||
// If you *really* want to spam your error log -- uncomment this.
|
||||
/* else
|
||||
{
|
||||
// listed in dbc or not expected to exist unknown item
|
||||
if (sItemStore.LookupEntry(itemid))
|
||||
sLog.outErrorDb("WORLD: CMSG_ITEM_NAME_QUERY for item %u failed (item listed in Item.dbc but not exist in DB)", itemid);
|
||||
else
|
||||
sLog.outError("WORLD: CMSG_ITEM_NAME_QUERY for item %u failed (unknown item, not listed in Item.dbc)", itemid);
|
||||
} */
|
||||
}
|
||||
|
||||
void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
|
||||
|
||||
@@ -1320,6 +1320,7 @@ void World::SetInitialWorldSettings()
|
||||
objmgr.LoadCreatureLocales();
|
||||
objmgr.LoadGameObjectLocales();
|
||||
objmgr.LoadItemLocales();
|
||||
objmgr.LoadItemSetNameLocales();
|
||||
objmgr.LoadQuestLocales();
|
||||
objmgr.LoadNpcTextLocales();
|
||||
objmgr.LoadPageTextLocales();
|
||||
@@ -1332,7 +1333,7 @@ void World::SetInitialWorldSettings()
|
||||
sLog.outString("Loading Page Texts...");
|
||||
objmgr.LoadPageTexts();
|
||||
|
||||
sLog.outString("Loading Game Object Templates..."); // must be after LoadPageTexts
|
||||
sLog.outString("Loading Game Object Templates..."); // must be after LoadPageTexts
|
||||
objmgr.LoadGameobjectInfo();
|
||||
|
||||
sLog.outString("Loading Spell Rank Data...");
|
||||
@@ -1371,9 +1372,12 @@ void World::SetInitialWorldSettings()
|
||||
sLog.outString("Loading Item Random Enchantments Table...");
|
||||
LoadRandomEnchantmentsTable();
|
||||
|
||||
sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
|
||||
sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
|
||||
objmgr.LoadItemPrototypes();
|
||||
|
||||
sLog.outString("Loading Item set names..."); // must be after LoadItemPrototypes
|
||||
objmgr.LoadItemSetNames();
|
||||
|
||||
sLog.outString("Loading Creature Model Based Info Data...");
|
||||
objmgr.LoadCreatureModelInfo();
|
||||
|
||||
@@ -1408,15 +1412,15 @@ void World::SetInitialWorldSettings()
|
||||
objmgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
|
||||
|
||||
sLog.outString("Loading Vehicle Accessories...");
|
||||
objmgr.LoadVehicleAccessories(); // must be after LoadCreatureTemplates()
|
||||
objmgr.LoadVehicleAccessories(); // must be after LoadCreatureTemplates()
|
||||
|
||||
sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances()
|
||||
sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances()
|
||||
objmgr.LoadCreatureRespawnTimes();
|
||||
|
||||
sLog.outString("Loading Gameobject Data...");
|
||||
objmgr.LoadGameobjects();
|
||||
|
||||
sLog.outString("Loading Gameobject Respawn Data..."); // must be after PackInstances()
|
||||
sLog.outString("Loading Gameobject Respawn Data..."); // must be after PackInstances()
|
||||
objmgr.LoadGameobjectRespawnTimes();
|
||||
|
||||
sLog.outString("Loading Objects Pooling Data...");
|
||||
@@ -1440,7 +1444,7 @@ void World::SetInitialWorldSettings()
|
||||
sLog.outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data...");
|
||||
objmgr.LoadNPCSpellClickSpells();
|
||||
|
||||
sLog.outString("Loading SpellArea Data..."); // must be after quest load
|
||||
sLog.outString("Loading SpellArea Data..."); // must be after quest load
|
||||
spellmgr.LoadSpellAreas();
|
||||
|
||||
sLog.outString("Loading AreaTrigger definitions...");
|
||||
@@ -1603,7 +1607,7 @@ void World::SetInitialWorldSettings()
|
||||
sLog.outString(">>> Scripts loaded");
|
||||
sLog.outString();
|
||||
|
||||
sLog.outString("Loading Scripts text locales..."); // must be after Load*Scripts calls
|
||||
sLog.outString("Loading Scripts text locales..."); // must be after Load*Scripts calls
|
||||
objmgr.LoadDbScriptStrings();
|
||||
|
||||
sLog.outString("Loading CreatureEventAI Texts...");
|
||||
@@ -1671,7 +1675,7 @@ void World::SetInitialWorldSettings()
|
||||
sLog.outString("Starting Arena Season...");
|
||||
gameeventmgr.StartArenaSeason();
|
||||
|
||||
sLog.outString("Loading World States..."); // must be loaded before battleground and outdoor PvP
|
||||
sLog.outString("Loading World States..."); // must be loaded before battleground and outdoor PvP
|
||||
LoadWorldStates();
|
||||
|
||||
///- Initialize Looking For Group
|
||||
|
||||
Reference in New Issue
Block a user