summaryrefslogtreecommitdiff
path: root/src/emap/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-16 18:34:22 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-16 18:34:22 +0300
commit063fa3b10532807caebe3a10ae15d0cb878d5f75 (patch)
tree641c7d5994d999317cdacb1b1f2bf47a92d0b65b /src/emap/clif.c
parent38c48c78eb1d5822565504363863918e39e0cd4a (diff)
downloadevol-hercules-063fa3b10532807caebe3a10ae15d0cb878d5f75.tar.gz
evol-hercules-063fa3b10532807caebe3a10ae15d0cb878d5f75.tar.bz2
evol-hercules-063fa3b10532807caebe3a10ae15d0cb878d5f75.tar.xz
evol-hercules-063fa3b10532807caebe3a10ae15d0cb878d5f75.zip
Add packet with cards and other attributes for visible item on ground.
Diffstat (limited to 'src/emap/clif.c')
-rw-r--r--src/emap/clif.c46
1 files changed, 46 insertions, 0 deletions
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);
+}