From 063fa3b10532807caebe3a10ae15d0cb878d5f75 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Aug 2015 18:34:22 +0300 Subject: Add packet with cards and other attributes for visible item on ground. --- src/emap/clif.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/emap/clif.c') diff --git a/src/emap/clif.c b/src/emap/clif.c index 69ed4f2..b1201f6 100644 --- a/src/emap/clif.c +++ b/src/emap/clif.c @@ -522,3 +522,49 @@ void eclif_changelook2(struct block_list *bl, int type, int val, send_changelook2(sd, bl, bl->id, type, val, val2, id, n, target); } } + +static inline int itemtype(const int type) +{ + switch (type) + { +#if PACKETVER >= 20080827 + case IT_WEAPON: + return IT_ARMOR; + case IT_ARMOR: + case IT_PETARMOR: +#endif + case IT_PETEGG: + return IT_WEAPON; + default: + return type; + } +} + +void eclif_getareachar_item(struct map_session_data *sd, struct flooritem_data *fitem) +{ + int view; + int fd = sd->fd; + + struct SessionExt *data = session_get(fd); + if (!data || data->clientVersion < 10) + return; + hookStop(); + WFIFOHEAD(fd, 28); + WFIFOW(fd, 0) = 0xb18; + WFIFOL(fd, 2) = fitem->bl.id; + if((view = itemdb_viewid(fitem->item_data.nameid)) > 0) + WFIFOW(fd, 6) = view; + else + WFIFOW(fd, 6) = fitem->item_data.nameid; + WFIFOB(fd, 8) = itemtype(itemdb_type(fitem->item_data.nameid)); + WFIFOB(fd, 9) = fitem->item_data.identify; + WFIFOB(fd, 10) = fitem->item_data.attribute; + WFIFOB(fd, 11) = fitem->item_data.refine; + clif->addcards(WFIFOP(fd, 12), &fitem->item_data); + WFIFOW(fd, 20) = fitem->bl.x; + WFIFOW(fd, 22) = fitem->bl.y; + WFIFOW(fd, 24) = fitem->item_data.amount; + WFIFOB(fd, 26) = fitem->subx; + WFIFOB(fd, 27) = fitem->suby; + WFIFOSET(fd, 28); +} -- cgit v1.2.3-60-g2f50