summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorDastgir <dastgirpojee@rocketmail.com>2015-12-27 15:01:36 +0530
committerDastgir <dastgirpojee@rocketmail.com>2016-01-16 20:39:26 +0530
commita7d49b6031898895bbd300eb625fd620f7b6daee (patch)
treeb949a50a2390d953ddd5385afe85bd809c7e3c62 /src/map/clif.c
parent9e48e2aebd5777179bd2fc2f45a58f8ad17b1373 (diff)
downloadhercules-a7d49b6031898895bbd300eb625fd620f7b6daee.tar.gz
hercules-a7d49b6031898895bbd300eb625fd620f7b6daee.tar.bz2
hercules-a7d49b6031898895bbd300eb625fd620f7b6daee.tar.xz
hercules-a7d49b6031898895bbd300eb625fd620f7b6daee.zip
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;
}