aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/characters.sql24
-rw-r--r--sql/updates/7904_characters_item_instance.sql1
-rw-r--r--sql/updates/7904_characters_item_text.sql1
-rw-r--r--src/game/AuctionHouseMgr.cpp6
-rw-r--r--src/game/Bag.h2
-rw-r--r--src/game/CharacterHandler.cpp2
-rw-r--r--src/game/Guild.cpp10
-rw-r--r--src/game/Item.cpp13
-rw-r--r--src/game/Item.h6
-rw-r--r--src/game/ItemHandler.cpp28
-rw-r--r--src/game/Mail.cpp27
-rw-r--r--src/game/ObjectMgr.cpp52
-rw-r--r--src/game/ObjectMgr.h16
-rw-r--r--src/game/Player.cpp22
-rw-r--r--src/game/PlayerDump.cpp12
-rw-r--r--src/game/World.cpp3
16 files changed, 67 insertions, 158 deletions
diff --git a/sql/characters.sql b/sql/characters.sql
index 1cee28f6ad5..4242d535997 100644
--- a/sql/characters.sql
+++ b/sql/characters.sql
@@ -1605,6 +1605,7 @@ CREATE TABLE `item_instance` (
`guid` int(11) unsigned NOT NULL default '0',
`owner_guid` int(11) unsigned NOT NULL default '0',
`data` longtext,
+ `text` longtext,
PRIMARY KEY (`guid`),
KEY `idx_owner_guid` (`owner_guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Item System';
@@ -1643,29 +1644,6 @@ LOCK TABLES `item_refund_instance` WRITE;
/*!40000 ALTER TABLE `item_refund_instance` DISABLE KEYS */;
/*!40000 ALTER TABLE `item_refund_instance` ENABLE KEYS */;
UNLOCK TABLES;
-
---
--- Table structure for table `item_text`
---
-
-DROP TABLE IF EXISTS `item_text`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `item_text` (
- `id` int(11) unsigned NOT NULL default '0',
- `text` longtext,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System';
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `item_text`
---
-
-LOCK TABLES `item_text` WRITE;
-/*!40000 ALTER TABLE `item_text` DISABLE KEYS */;
-/*!40000 ALTER TABLE `item_text` ENABLE KEYS */;
-UNLOCK TABLES;
--
-- Table structure for table `mail`
diff --git a/sql/updates/7904_characters_item_instance.sql b/sql/updates/7904_characters_item_instance.sql
new file mode 100644
index 00000000000..95cd7bca248
--- /dev/null
+++ b/sql/updates/7904_characters_item_instance.sql
@@ -0,0 +1 @@
+ALTER TABLE `item_instance` ADD COLUMN `text` longtext AFTER `data`;
diff --git a/sql/updates/7904_characters_item_text.sql b/sql/updates/7904_characters_item_text.sql
new file mode 100644
index 00000000000..517a4a04026
--- /dev/null
+++ b/sql/updates/7904_characters_item_text.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS `item_text`;
diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp
index 6a64f58487b..f5b3a960ffb 100644
--- a/src/game/AuctionHouseMgr.cpp
+++ b/src/game/AuctionHouseMgr.cpp
@@ -254,7 +254,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction)
void AuctionHouseMgr::LoadAuctionItems()
{
// data needs to be at first place for Item::LoadFromDB
- QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT data,itemguid,item_template FROM auctionhouse JOIN item_instance ON itemguid = guid");
+ QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT data, text, itemguid, item_template FROM auctionhouse JOIN item_instance ON itemguid = guid");
if (!result)
{
@@ -275,8 +275,8 @@ void AuctionHouseMgr::LoadAuctionItems()
bar.step();
fields = result->Fetch();
- uint32 item_guid = fields[1].GetUInt32();
- uint32 item_template = fields[2].GetUInt32();
+ uint32 item_guid = fields[2].GetUInt32();
+ uint32 item_template = fields[3].GetUInt32();
ItemPrototype const *proto = objmgr.GetItemPrototype(item_template);
diff --git a/src/game/Bag.h b/src/game/Bag.h
index 31bc0d406d1..5bc2480fc47 100644
--- a/src/game/Bag.h
+++ b/src/game/Bag.h
@@ -55,7 +55,7 @@ class Bag : public Item
// overwrite virtual Item::SaveToDB
void SaveToDB();
// overwrite virtual Item::LoadFromDB
- bool LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result = QueryResult_AutoPtr(NULL));
+ bool LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result);
// overwrite virtual Item::DeleteFromDB
void DeleteFromDB();
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp
index 84c893aa526..2ccbce54e10 100644
--- a/src/game/CharacterHandler.cpp
+++ b/src/game/CharacterHandler.cpp
@@ -77,7 +77,7 @@ bool LoginQueryHolder::Initialize()
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4 FROM character_queststatus WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS,"SELECT quest,time FROM character_queststatus_daily WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, "SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'", GUID_LOPART(m_guid));
- res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GUID_LOPART(m_guid));
+ res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, "SELECT a.button,a.action,a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.spec = c.activespec AND a.guid = '%u' ORDER BY button", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(m_guid),(uint64)time(NULL));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(m_guid));
diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index b77bbf33864..8bd4d806ab8 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -1115,17 +1115,17 @@ void Guild::LoadGuildBankFromDB()
// data needs to be at first place for Item::LoadFromDB
// 0 1 2 3 4
- result = CharacterDatabase.PQuery("SELECT data, TabId, SlotId, item_guid, item_entry FROM guild_bank_item JOIN item_instance ON item_guid = guid WHERE guildid='%u' ORDER BY TabId", m_Id);
+ result = CharacterDatabase.PQuery("SELECT data, text, TabId, SlotId, item_guid, item_entry FROM guild_bank_item JOIN item_instance ON item_guid = guid WHERE guildid='%u' ORDER BY TabId", m_Id);
if (!result)
return;
do
{
Field *fields = result->Fetch();
- uint8 TabId = fields[1].GetUInt8();
- uint8 SlotId = fields[2].GetUInt8();
- uint32 ItemGuid = fields[3].GetUInt32();
- uint32 ItemEntry = fields[4].GetUInt32();
+ uint8 TabId = fields[2].GetUInt8();
+ uint8 SlotId = fields[3].GetUInt8();
+ uint32 ItemGuid = fields[4].GetUInt32();
+ uint32 ItemEntry = fields[5].GetUInt32();
if (TabId >= m_PurchasedTabs || TabId >= GUILD_BANK_MAX_TABS)
{
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index 8a20fa91973..30023f511ab 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -308,20 +308,25 @@ void Item::SaveToDB()
{
case ITEM_NEW:
{
+ std::string text = m_text;
+ CharacterDatabase.escape_string(text);
std::ostringstream ss;
- ss << "REPLACE INTO item_instance (guid,owner_guid,data) VALUES (" << guid << "," << GUID_LOPART(GetOwnerGUID()) << ",'";
+ ss << "REPLACE INTO item_instance (guid, owner_guid, data, text) VALUES (" << guid << "," << GUID_LOPART(GetOwnerGUID()) << ",'";
for (uint16 i = 0; i < m_valuesCount; ++i)
ss << GetUInt32Value(i) << " ";
- ss << "')";
+ ss << "', '" << text << "')";
CharacterDatabase.Execute(ss.str().c_str());
}break;
case ITEM_CHANGED:
{
+ std::string text = m_text;
+ CharacterDatabase.escape_string(text);
std::ostringstream ss;
ss << "UPDATE item_instance SET data = '";
for (uint16 i = 0; i < m_valuesCount; ++i)
ss << GetUInt32Value(i) << " ";
- ss << "', owner_guid = '" << GUID_LOPART(GetOwnerGUID()) << "' WHERE guid = '" << guid << "'";
+ ss << "', owner_guid = '" << GUID_LOPART(GetOwnerGUID());
+ ss << "', text = '" << text << "' WHERE guid = '" << guid << "'";
CharacterDatabase.Execute(ss.str().c_str());
@@ -330,8 +335,6 @@ void Item::SaveToDB()
}break;
case ITEM_REMOVED:
{
- //if (GetUInt32Value(ITEM_FIELD_ITEM_TEXT_ID) > 0)
- // CharacterDatabase.PExecute("DELETE FROM item_text WHERE id = '%u'", GetUInt32Value(ITEM_FIELD_ITEM_TEXT_ID));
CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid = '%u'", guid);
if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED))
CharacterDatabase.PExecute("DELETE FROM character_gifts WHERE item_guid = '%u'", GetGUIDLow());
diff --git a/src/game/Item.h b/src/game/Item.h
index c03b6388b27..b4112b3d132 100644
--- a/src/game/Item.h
+++ b/src/game/Item.h
@@ -240,7 +240,7 @@ class Item : public Object
bool IsBindedNotWith(Player const* player) const;
bool IsBoundByEnchant() const;
virtual void SaveToDB();
- virtual bool LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result = QueryResult_AutoPtr(NULL));
+ virtual bool LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result);
virtual void DeleteFromDB();
void DeleteFromInventoryDB();
void SaveRefundDataToDB();
@@ -293,6 +293,9 @@ class Item : public Object
uint32 GetEnchantmentDuration(EnchantmentSlot slot) const { return GetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET);}
uint32 GetEnchantmentCharges(EnchantmentSlot slot) const { return GetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET);}
+ std::string const& GetText() const { return m_text; }
+ void SetText(std::string const& text) { m_text = text; }
+
void SendTimeUpdate(Player* owner);
void UpdateDuration(Player* owner, uint32 diff);
@@ -338,6 +341,7 @@ class Item : public Object
void BuildUpdate(UpdateDataMapType&);
private:
+ std::string m_text;
uint8 m_slot;
Bag *m_container;
ItemUpdateState uState;
diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp
index 6ade13551de..6b3d3fa3c36 100644
--- a/src/game/ItemHandler.cpp
+++ b/src/game/ItemHandler.cpp
@@ -1530,3 +1530,31 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data)
if (arenaRefund)
_player->ModifyArenaPoints(arenaRefund);
}
+
+/**
+ * Handles the packet sent by the client when requesting information about item text.
+ *
+ * This function is called when player clicks on item which has some flag set
+ */
+void WorldSession::HandleItemTextQuery(WorldPacket & recv_data )
+{
+ uint64 itemGuid;
+ recv_data >> itemGuid;
+
+ sLog.outDebug("CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid));
+
+ WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10)); // guess size
+
+ if (Item *item = _player->GetItemByGuid(itemGuid))
+ {
+ data << uint8(0); // has text
+ data << uint64(itemGuid); // item guid
+ data << item->GetText();
+ }
+ else
+ {
+ data << uint8(1); // no text
+ }
+
+ SendPacket(&data);
+}
diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
index 0942e3a306f..14096fa796f 100644
--- a/src/game/Mail.cpp
+++ b/src/game/Mail.cpp
@@ -643,29 +643,6 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data)
_player->UpdateNextMailTimeAndUnreads();
}
-///this function is called when client needs mail message body, or when player clicks on item which has ITEM_FIELD_ITEM_TEXT_ID > 0
-void WorldSession::HandleItemTextQuery(WorldPacket & recv_data)
-{
- uint64 itemGuid;
- recv_data >> itemGuid;
-
- sLog.outDebug("CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid));
-
- WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10)); // guess size
-
- if (Item *item = _player->GetItemByGuid(itemGuid))
- {
- data << uint8(0); // has text
- data << uint64(itemGuid); // item guid
- data << objmgr.GetItemText(item->GetGUIDLow()); // max 8000
- }
- else
- {
- data << uint8(1); // no text
- }
- SendPacket(&data);
-}
-
//used when player copies mail body to his inventory
void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data)
{
@@ -704,10 +681,10 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data)
return;
}
- objmgr.CreateItemText(bodyItem->GetGUIDLow(), mailTemplateEntry->content[GetSessionDbcLocale()]);
+ bodyItem->SetText(mailTemplateEntry->content[GetSessionDbcLocale()]);
}
else
- objmgr.CreateItemText(bodyItem->GetGUIDLow(), m->body);
+ bodyItem->SetText(m->body);
bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender);
bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER | ITEM_FLAGS_REFUNDABLE_2 | ITEM_FLAGS_UNK1);
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 9cf28c3c482..beb4ca2839e 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -4795,41 +4795,6 @@ void ObjectMgr::LoadGossipScripts()
// checks are done in LoadGossipMenuItems
}
-void ObjectMgr::LoadItemTexts()
-{
- QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT id, text FROM item_text");
-
- uint32 count = 0;
-
- if (!result)
- {
- barGoLink bar(1);
- bar.step();
-
- sLog.outString();
- sLog.outString(">> Loaded %u item pages", count);
- return;
- }
-
- barGoLink bar(result->GetRowCount());
-
- Field* fields;
- do
- {
- bar.step();
-
- fields = result->Fetch();
-
- mItemTexts[ fields[0].GetUInt32() ] = fields[1].GetCppString();
-
- ++count;
-
- } while (result->NextRow());
-
- sLog.outString();
- sLog.outString(">> Loaded %u item texts", count);
-}
-
void ObjectMgr::LoadPageTexts()
{
sPageTextStore.Free(); // for reload case
@@ -5986,10 +5951,6 @@ void ObjectMgr::SetHighestGuids()
if (result)
m_mailid = (*result)[0].GetUInt32()+1;
- result = CharacterDatabase.Query("SELECT MAX(id) FROM item_text");
- if (result)
- m_ItemTextId = (*result)[0].GetUInt32()+1;
-
result = CharacterDatabase.Query("SELECT MAX(guid) FROM corpse");
if (result)
m_hiCorpseGuid = (*result)[0].GetUInt32()+1;
@@ -6057,19 +6018,6 @@ uint32 ObjectMgr::GenerateMailID()
return m_mailid++;
}
-void ObjectMgr::CreateItemText(uint32 guid, std::string text)
-{
- // insert new item text to container
- mItemTexts[ guid ] = text;
-
- // save new item text
- CharacterDatabase.escape_string(text);
-
- std::ostringstream query;
- query << "INSERT INTO item_text (id,text) VALUES ( '" << guid << "', '" << text << "')";
- CharacterDatabase.Execute(query.str().c_str()); //needs to be run this way, because mail body may be more than 1024 characters
-}
-
uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
{
switch(guidhigh)
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index 538b21638f0..5101a8ba9f5 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -667,7 +667,6 @@ class ObjectMgr
void LoadTavernAreaTriggers();
void LoadGameObjectForQuests();
- void LoadItemTexts();
void LoadPageTexts();
void LoadPlayerInfo();
@@ -718,21 +717,9 @@ class ObjectMgr
uint32 GenerateAuctionID();
uint64 GenerateEquipmentSetGuid();
uint32 GenerateGuildId();
- //uint32 GenerateItemTextID();
uint32 GenerateMailID();
uint32 GeneratePetNumber();
- void CreateItemText(uint32 guid, std::string text);
- void AddItemText(uint32 guid, std::string text) { mItemTexts[guid] = text; }
- std::string GetItemText(uint32 id)
- {
- ItemTextMap::const_iterator itr = mItemTexts.find(id);
- if (itr != mItemTexts.end())
- return itr->second;
- else
- return "There is no info for this item";
- }
-
typedef std::multimap<int32, uint32> ExclusiveQuestGroups;
ExclusiveQuestGroups mExclusiveQuestGroups;
@@ -1021,7 +1008,6 @@ class ObjectMgr
typedef UNORDERED_MAP<uint32, GossipText> GossipTextMap;
typedef UNORDERED_MAP<uint32, uint32> QuestAreaTriggerMap;
- typedef UNORDERED_MAP<uint32, std::string> ItemTextMap;
typedef std::set<uint32> TavernAreaTriggerSet;
typedef std::set<uint32> GameObjectForQuestSet;
@@ -1029,8 +1015,6 @@ class ObjectMgr
GuildMap mGuildMap;
ArenaTeamMap mArenaTeamMap;
- ItemTextMap mItemTexts;
-
QuestAreaTriggerMap mQuestAreaTriggerMap;
TavernAreaTriggerSet mTavernAreaTriggerSet;
GameObjectForQuestSet mGameObjectForQuestSet;
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 666ebd26f56..a05356e25b1 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -4260,15 +4260,15 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
if (has_items)
{
// data needs to be at first place for Item::LoadFromDB
- QueryResult_AutoPtr resultItems = CharacterDatabase.PQuery("SELECT data,item_guid,item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail_id);
+ QueryResult_AutoPtr resultItems = CharacterDatabase.PQuery("SELECT data,text,item_guid,item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail_id);
if (resultItems)
{
do
{
Field *fields2 = resultItems->Fetch();
- uint32 item_guidlow = fields2[1].GetUInt32();
- uint32 item_template = fields2[2].GetUInt32();
+ uint32 item_guidlow = fields2[2].GetUInt32();
+ uint32 item_template = fields2[3].GetUInt32();
ItemPrototype const* itemProto = objmgr.GetItemPrototype(item_template);
if (!itemProto)
@@ -16366,7 +16366,7 @@ void Player::LoadCorpse()
void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff)
{
- //QueryResult *result = CharacterDatabase.PQuery("SELECT data,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GetGUIDLow());
+ //QueryResult *result = CharacterDatabase.PQuery("SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GetGUIDLow());
std::map<uint64, Bag*> bagMap; // fast guid lookup for bags
//NOTE: the "order by `bag`" is important because it makes sure
//the bagMap is filled before items in the bags are loaded
@@ -16384,10 +16384,10 @@ void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff)
do
{
Field *fields = result->Fetch();
- uint32 bag_guid = fields[1].GetUInt32();
- uint8 slot = fields[2].GetUInt8();
- uint32 item_guid = fields[3].GetUInt32();
- uint32 item_id = fields[4].GetUInt32();
+ uint32 bag_guid = fields[2].GetUInt32();
+ uint8 slot = fields[3].GetUInt8();
+ uint32 item_guid = fields[4].GetUInt32();
+ uint32 item_id = fields[5].GetUInt32();
ItemPrototype const * proto = objmgr.GetItemPrototype(item_id);
@@ -16560,15 +16560,15 @@ void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff)
void Player::_LoadMailedItems(Mail *mail)
{
// data needs to be at first place for Item::LoadFromDB
- QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT data, item_guid, item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail->messageID);
+ QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT data, text, item_guid, item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail->messageID);
if (!result)
return;
do
{
Field *fields = result->Fetch();
- uint32 item_guid_low = fields[1].GetUInt32();
- uint32 item_template = fields[2].GetUInt32();
+ uint32 item_guid_low = fields[2].GetUInt32();
+ uint32 item_template = fields[3].GetUInt32();
mail->AddItem(item_guid_low, item_template);
diff --git a/src/game/PlayerDump.cpp b/src/game/PlayerDump.cpp
index 3aceb1d1195..02a39c5ee8b 100644
--- a/src/game/PlayerDump.cpp
+++ b/src/game/PlayerDump.cpp
@@ -660,18 +660,6 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
ROLLBACK(DUMP_FILE_BROKEN);
break;
}
- case DTT_ITEM_TEXT: // item_text
- {
- // id
- if (!changeGuid(line, 1, itemTexts, objmgr.m_ItemTextId))
- ROLLBACK(DUMP_FILE_BROKEN);
-
- // add it to cache
- uint32 id= atoi(getnth(line,1).c_str());
- std::string text = getnth(line,2);
- objmgr.AddItemText(id,text);
- break;
- }
default:
sLog.outError("Unknown dump table type: %u",type);
break;
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 10eec0e5b32..630f339b7e4 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1350,9 +1350,6 @@ void World::SetInitialWorldSettings()
sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
objmgr.LoadItemPrototypes();
- sLog.outString("Loading Item Texts...");
- objmgr.LoadItemTexts();
-
sLog.outString("Loading Creature Model Based Info Data...");
objmgr.LoadCreatureModelInfo();