diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-14 01:54:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-14 02:42:36 +0300 |
commit | 388961002f81f1e8ddd5343c54d510af0ad5bdc6 (patch) | |
tree | b9ba33ddd0de676d9bd4f9edc19684b43e00b564 /src/emap/clif.c | |
parent | 4bf7ac022dd4baf2ddca750971ecd2853979a40c (diff) | |
download | plugin-388961002f81f1e8ddd5343c54d510af0ad5bdc6.tar.gz plugin-388961002f81f1e8ddd5343c54d510af0ad5bdc6.tar.bz2 plugin-388961002f81f1e8ddd5343c54d510af0ad5bdc6.tar.xz plugin-388961002f81f1e8ddd5343c54d510af0ad5bdc6.zip |
Add support for item attribute MaxFloorOffset.
Change plugin version to 12.
Diffstat (limited to 'src/emap/clif.c')
-rw-r--r-- | src/emap/clif.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c index 87e65b5..7aaf3d0 100644 --- a/src/emap/clif.c +++ b/src/emap/clif.c @@ -28,8 +28,10 @@ #include "emap/map.h" #include "emap/packets_struct.h" #include "emap/send.h" +#include "emap/data/itemd.h" #include "emap/data/mapd.h" #include "emap/data/session.h" +#include "emap/struct/itemdext.h" #include "emap/struct/mapdext.h" #include "emap/struct/sessionext.h" @@ -1118,7 +1120,7 @@ void eclif_getareachar_item(struct map_session_data *sd, struct flooritem_data * 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; @@ -1137,6 +1139,7 @@ void eclif_getareachar_item(struct map_session_data *sd, struct flooritem_data * WFIFOB(fd, 26) = fitem->subx; WFIFOB(fd, 27) = fitem->suby; WFIFOSET(fd, 28); + hookStop(); } void eclif_dropflooritem(struct flooritem_data* fitem) @@ -1144,6 +1147,19 @@ void eclif_dropflooritem(struct flooritem_data* fitem) char buf[28]; int view; + struct ItemdExt *itemData = itemd_get_by_item(&fitem->item_data); + if (itemData) + { + if (itemData->subX) + fitem->subx = (rand() % (itemData->subX * 2)) - itemData->subX; + else + fitem->subx = 0; + if (itemData->subY) + fitem->suby = (rand() % (itemData->subY * 2)) - itemData->subY; + else + fitem->suby = 0; + } + WBUFW(buf, 0) = 0xb19; WBUFL(buf, 2) = fitem->bl.id; if((view = itemdb_viewid(fitem->item_data.nameid)) > 0) |