diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-08 19:59:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-12 01:03:20 +0300 |
commit | 08de021655e1d032db5efa74f3da8f2d8b1efe99 (patch) | |
tree | a988367e56f938f10006f117a110baf620c07817 | |
parent | dfe7b9e4bb9c0f890009be0f037d4ba1a516605f (diff) | |
download | hercules-08de021655e1d032db5efa74f3da8f2d8b1efe99.tar.gz hercules-08de021655e1d032db5efa74f3da8f2d8b1efe99.tar.bz2 hercules-08de021655e1d032db5efa74f3da8f2d8b1efe99.tar.xz hercules-08de021655e1d032db5efa74f3da8f2d8b1efe99.zip |
Add packet id clif_buyingstore_update_item (0x9e6 / ZC_UPDATE_ITEM_FROM_BUYING_STORE2)
Based on rAthena commit:
commit 01adc9c3ff3c1c6f0f69f6f9f2db77eba20071d4
Author: Napster <arokaice@live.com>
Date: Mon Dec 21 20:05:29 2015 +0700
-rw-r--r-- | src/map/buyingstore.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 27 | ||||
-rw-r--r-- | src/map/clif.h | 2 | ||||
-rw-r--r-- | src/map/packets.h | 1 |
4 files changed, 23 insertions, 9 deletions
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 58a1f925f..d2e2a2c20 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -383,7 +383,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int // notify clients clif->buyingstore_delete_item(sd, index, amount, pl_sd->buyingstore.items[listidx].price); - clif->buyingstore_update_item(pl_sd, nameid, amount); + clif->buyingstore_update_item(pl_sd, nameid, amount, sd->status.char_id, zeny); } if( map->save_settings&128 ) { diff --git a/src/map/clif.c b/src/map/clif.c index eb6f848e9..7e4f6b825 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -16911,18 +16911,31 @@ void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short resu /// Updates the zeny limit and an item in the buying store item list (ZC_UPDATE_ITEM_FROM_BUYING_STORE). /// 081b <name id>.W <amount>.W <limit zeny>.L -void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount) +void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny) { int fd; +#if PACKETVER < 20141016 // TODO : not sure for client date [Napster] + const int cmd = 0x81b; +#else + const int cmd = 0x9e6; +#endif + const int len = packet_len(cmd); nullpo_retv(sd); fd = sd->fd; - WFIFOHEAD(fd,packet_len(0x81b)); - WFIFOW(fd,0) = 0x81b; - WFIFOW(fd,2) = nameid; - WFIFOW(fd,4) = amount; // amount of nameid received - WFIFOL(fd,6) = sd->buyingstore.zenylimit; - WFIFOSET(fd,packet_len(0x81b)); + WFIFOHEAD(fd, len); + WFIFOW(fd, 0) = cmd; + WFIFOW(fd, 2) = nameid; + WFIFOW(fd, 4) = amount; // amount of nameid received +#if PACKETVER < 20141016 + WFIFOL(fd, 6) = sd->buyingstore.zenylimit; +#else + WFIFOL(fd, 6) = zeny; // zeny + WFIFOL(fd, 10) = sd->buyingstore.zenylimit; + WFIFOL(fd, 14) = char_id; // GID + WFIFOL(fd, 18) = (int)time(NULL); // date +#endif + WFIFOSET(fd, len); } /// Deletes item from inventory, that was sold to a buying store (ZC_ITEM_DELETE_BUYING_STORE). diff --git a/src/map/clif.h b/src/map/clif.h index 60c03d6e0..8f6950666 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1058,7 +1058,7 @@ struct clif_interface { void (*buyingstore_disappear_entry_single) (struct map_session_data* sd, struct map_session_data* pl_sd); void (*buyingstore_itemlist) (struct map_session_data* sd, struct map_session_data* pl_sd); void (*buyingstore_trade_failed_buyer) (struct map_session_data* sd, short result); - void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount); + void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); void (*buyingstore_delete_item) (struct map_session_data* sd, short index, unsigned short amount, int price); void (*buyingstore_trade_failed_seller) (struct map_session_data* sd, short result, unsigned short nameid); /* search store-related */ diff --git a/src/map/packets.h b/src/map/packets.h index 236728bf8..33fa5236d 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2821,6 +2821,7 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x09DF,7); packet(0x0a00,269); packet(0x09e5,18); // ZC_DELETEITEM_FROM_MCSTORE2 + packet(0x09e6,22); // ZC_UPDATE_ITEM_FROM_BUYING_STORE2 #endif /* Roulette System [Yommy/Hercules] */ |