summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-08 19:59:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-12 01:03:20 +0300
commit08de021655e1d032db5efa74f3da8f2d8b1efe99 (patch)
treea988367e56f938f10006f117a110baf620c07817 /src/map/clif.c
parentdfe7b9e4bb9c0f890009be0f037d4ba1a516605f (diff)
downloadhercules-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
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c27
1 files changed, 20 insertions, 7 deletions
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).