summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-01-16 20:28:02 +0100
committerHaru <haru@dotalux.com>2016-01-16 20:28:02 +0100
commit3b1f9881edf52d725f768dbf2c0ef0c03ac60190 (patch)
tree4feaf21981ba31a0ce68abd22829773bc25acae9 /src/map/clif.c
parent76103463b0eba50c72aae6b3cf4db58871c84ee5 (diff)
parenta7d49b6031898895bbd300eb625fd620f7b6daee (diff)
downloadhercules-3b1f9881edf52d725f768dbf2c0ef0c03ac60190.tar.gz
hercules-3b1f9881edf52d725f768dbf2c0ef0c03ac60190.tar.bz2
hercules-3b1f9881edf52d725f768dbf2c0ef0c03ac60190.tar.xz
hercules-3b1f9881edf52d725f768dbf2c0ef0c03ac60190.zip
Merge pull request #1031 from dastgir/12-OneClickIdentify
Added OneClickIdentify packet
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1cd18b68d..3b15265f7 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11484,6 +11484,22 @@ void clif_parse_ItemIdentify(int fd,struct map_session_data *sd)
clif_menuskill_clear(sd);
}
+/// Identifying item with right-click (CZ_REQ_ONECLICK_ITEMIDENTIFY).
+/// 0A35 <index>.W
+void clif_parse_OneClick_ItemIdentify(int fd, struct map_session_data *sd)
+{
+ int cmd = RFIFOW(fd,0);
+ short idx = RFIFOW(fd, packet_db[cmd].pos[0]) - 2;
+ int n;
+
+ if (idx < 0 || idx >= MAX_INVENTORY || sd->inventory_data[idx] == NULL || sd->status.inventory[idx].nameid <= 0)
+ return;
+
+ if ((n = pc->have_magnifier(sd) ) != INDEX_NOT_FOUND &&
+ pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER) == 0)
+ skill->identify(sd, idx);
+}
+
void clif_parse_SelectArrow(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to arrow crafting item selection dialog (CZ_REQ_MAKINGARROW).
/// 01ae <name id>.W
@@ -19707,4 +19723,5 @@ void clif_defaults(void) {
clif->add_random_options = clif_add_random_options;
clif->pHotkeyRowShift = clif_parse_HotkeyRowShift;
clif->dressroom_open = clif_dressroom_open;
+ clif->pOneClick_ItemIdentify = clif_parse_OneClick_ItemIdentify;
}