aboutsummaryrefslogtreecommitdiff
path: root/src/game/ItemHandler.cpp
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2010-04-14 12:43:42 +0400
committern0n4m3 <none@none>2010-04-14 12:43:42 +0400
commite3e5ca62270f010d5dbc2c160db22cbffa6dc94b (patch)
treea60290ce37faf031fbe705121e7efa446f77c846 /src/game/ItemHandler.cpp
parent61e71986f076f636619380da8e800f084b4465f5 (diff)
Drop not needed table 'item_text', add new column 'text' in table 'item_instance'. Original patch by Vladimir.
--HG-- branch : trunk
Diffstat (limited to 'src/game/ItemHandler.cpp')
-rw-r--r--src/game/ItemHandler.cpp28
1 files changed, 28 insertions, 0 deletions
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);
+}