diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-16 20:42:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-16 20:42:18 +0300 |
commit | 38efe26b9982a176f89910f9b6b3650558175360 (patch) | |
tree | 8513fb39f578a720a06349899b2b3e2292cd3338 /src/emap | |
parent | 063fa3b10532807caebe3a10ae15d0cb878d5f75 (diff) | |
download | plugin-38efe26b9982a176f89910f9b6b3650558175360.tar.gz plugin-38efe26b9982a176f89910f9b6b3650558175360.tar.bz2 plugin-38efe26b9982a176f89910f9b6b3650558175360.tar.xz plugin-38efe26b9982a176f89910f9b6b3650558175360.zip |
Add packet with cards and other attributes for dropped item on ground.
Diffstat (limited to 'src/emap')
-rw-r--r-- | src/emap/clif.c | 47 | ||||
-rw-r--r-- | src/emap/clif.h | 1 | ||||
-rw-r--r-- | src/emap/init.c | 1 |
3 files changed, 49 insertions, 0 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c index b1201f6..9583ac3 100644 --- a/src/emap/clif.c +++ b/src/emap/clif.c @@ -367,6 +367,28 @@ int eclif_send_actual(int *fd, void *buf, int *len) return 0; } } + if (packet == 0x84b) + { + struct SessionExt *data = session_get(*fd); + if (!data) + return 0; + if (data->clientVersion >= 10) + { // not sending old packets to new clients + hookStop(); + return 0; + } + } + if (packet == 0xb19) + { + struct SessionExt *data = session_get(*fd); + if (!data) + return 0; + if (data->clientVersion < 10) + { // not sending new packets to old clients + hookStop(); + return 0; + } + } } return 0; } @@ -568,3 +590,28 @@ void eclif_getareachar_item(struct map_session_data *sd, struct flooritem_data * WFIFOB(fd, 27) = fitem->suby; WFIFOSET(fd, 28); } + +void eclif_dropflooritem(struct flooritem_data* fitem) +{ + char buf[28]; + int view; + + WBUFW(buf, 0) = 0xb19; + WBUFL(buf, 2) = fitem->bl.id; + if((view = itemdb_viewid(fitem->item_data.nameid)) > 0) + WBUFW(buf, 6) = view; + else + WBUFW(buf, 6) = fitem->item_data.nameid; + WBUFB(buf, 8) = itemtype(itemdb_type(fitem->item_data.nameid)); + WBUFB(buf, 9) = fitem->item_data.identify; + WBUFB(buf, 10) = fitem->item_data.attribute; + WBUFB(buf, 11) = fitem->item_data.refine; + clif->addcards(WBUFP(buf, 12), &fitem->item_data); + WBUFW(buf, 20) = fitem->bl.x; + WBUFW(buf, 22) = fitem->bl.y; + WBUFW(buf, 24) = fitem->item_data.amount; + WBUFB(buf, 26) = fitem->subx; + WBUFB(buf, 27) = fitem->suby; + + clif->send(&buf, 28, &fitem->bl, AREA); +} diff --git a/src/emap/clif.h b/src/emap/clif.h index 7f72432..dfa0d19 100644 --- a/src/emap/clif.h +++ b/src/emap/clif.h @@ -27,5 +27,6 @@ void eclif_parse_LoadEndAck_pre(int *fdPtr, void eclif_changelook2(struct block_list *bl, int type, int val, struct item_data *id, int n); void eclif_getareachar_item(struct map_session_data *sd, struct flooritem_data *fitem); +void eclif_dropflooritem(struct flooritem_data* fitem); #endif // EVOL_MAP_CLIF diff --git a/src/emap/init.c b/src/emap/init.c index 8f0737a..f4c60b1 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -149,6 +149,7 @@ HPExport void plugin_init (void) addHookPre("clif->quest_add", eclif_quest_add); addHookPre("clif->charnameack", eclif_charnameack); addHookPre("clif->getareachar_item", eclif_getareachar_item); + addHookPre("clif->dropflooritem", eclif_dropflooritem); addHookPre("clif->sendlook", eclif_sendlook); addHookPre("clif->send", eclif_send); addHookPre("clif->set_unit_idle", eclif_set_unit_idle); |