Skip to content

Commit

Permalink
Oneclick Itemidentify Packet Implemented
Browse files Browse the repository at this point in the history
* New Feature for 2015-05-13 client or newer
  Request 1 Magnifier when use (ctrl + click right)
  • Loading branch information
icxbb-xx committed Dec 16, 2015
1 parent 70eb71d commit 5fe8145
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
3 changes: 3 additions & 0 deletions db/packet_db.txt
Expand Up @@ -2506,6 +2506,9 @@ packet_keys: 0x62C86D09,0x75944F17,0x112C133D // [YomRawr]
0x0A10,-1 // ZC_STORE_ITEMLIST_EQUIP_V6
0x0A2D,-1 // ZC_EQUIPWIN_MICROSCOPE_V6

// OneClick Itemidentify
0x0A35,4,oneclick_itemidentify,2 // CZ_REQ_ONECLICK_ITEMIDENTIFY

// Title System
0x0A2E,6,dull,0 // CZ_REQ_CHANGE_TITLE
0x0A2F,7 // ZC_ACK_CHANGE_TITLE
Expand Down
33 changes: 30 additions & 3 deletions src/map/clif.c
Expand Up @@ -18486,8 +18486,7 @@ void clif_broadcast_obtain_special_item(const char *char_name, unsigned short na
clif_send(buf, WBUFW(buf, 2), NULL, ALL_CLIENT);
}

void clif_dressing_room(struct map_session_data *sd, int view)
{
void clif_dressing_room(struct map_session_data *sd, int view) {
int fd;

nullpo_retv(sd);
Expand All @@ -18499,6 +18498,32 @@ void clif_dressing_room(struct map_session_data *sd, int view)
WFIFOSET(fd, packet_len(0xa02));
}

/// Parsing a request from the client item identify oneclick (CZ_REQ_ONECLICK_ITEMIDENTIFY).
/// 0A35 <result>.W
void clif_parse_Oneclick_Itemidentify(int fd, struct map_session_data *sd) {
#if PACKETVER >= 20150513
short idx = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]) - 2;
int i;

// Invalid index - ignore the request
if ( idx < 0 )
return;

// Item already identified - ignore the request
if ( sd->status.inventory[idx].identify )
return;

if ( ( i = pc_search_inventory(sd,ITEMID_MAGNIFIER) ) == -1 )
return;

if ( pc_delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER) != 0 ) {
// TODO: deleting magnifier failed, for whatever reason...
}

skill_identify(sd, idx);
#endif
}

/*==========================================
* Main client packet processing function
*------------------------------------------*/
Expand Down Expand Up @@ -18900,7 +18925,7 @@ void packetdb_readdb(bool reload)
#endif
-1, 0, 0, 26, 0, 0, 0, 0, 14, 2, 23, 2, -1, 2, 3, 2,
21, 3, 5, 0, 66, 0, 0, 0, 3, 0, 0, 0, 0, -1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
struct {
void (*func)(int, struct map_session_data *);
Expand Down Expand Up @@ -19137,6 +19162,8 @@ void packetdb_readdb(bool reload)
{ clif_parse_merge_item_cancel, "mergeitem_cancel"},
// HotkeyRowShift
{ clif_parse_HotkeyRowShift, "hotkeyrowshift"},
// OneClick Item Identify
{ clif_parse_Oneclick_Itemidentify, "oneclick_itemidentify" },
{NULL,NULL}
};
struct {
Expand Down
1 change: 1 addition & 0 deletions src/map/itemdb.h
Expand Up @@ -52,6 +52,7 @@ enum item_itemid
ITEMID_WING_OF_BUTTERFLY = 602,
ITEMID_ANODYNE = 605,
ITEMID_ALOEBERA = 606,
ITEMID_MAGNIFIER = 611,
ITEMID_POISON_BOTTLE = 678,
ITEMID_EMPTY_BOTTLE = 713,
ITEMID_EMPERIUM = 714,
Expand Down

2 comments on commit 5fe8145

@renniw
Copy link

@renniw renniw commented on 5fe8145 Dec 16, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ja

@CairoLee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice~!! Thank you @icxbb-xx

Please sign in to comment.