summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-08 19:43:56 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-12 01:03:20 +0300
commitdfe7b9e4bb9c0f890009be0f037d4ba1a516605f (patch)
treed4af5d5db98cf4b66a817f1cd8d88d6784a3d91a /src/map/clif.c
parent092ffb2b754365ea5487a82c7a2c60667a471cef (diff)
downloadhercules-dfe7b9e4bb9c0f890009be0f037d4ba1a516605f.tar.gz
hercules-dfe7b9e4bb9c0f890009be0f037d4ba1a516605f.tar.bz2
hercules-dfe7b9e4bb9c0f890009be0f037d4ba1a516605f.tar.xz
hercules-dfe7b9e4bb9c0f890009be0f037d4ba1a516605f.zip
Add packet id clif_vendingreport (0x9e5 / ZC_DELETEITEM_FROM_MCSTORE2)
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.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index c6689f9c0..eb6f848e9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6428,20 +6428,32 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven
#endif
}
-/// Inform merchant that someone has bought an item (ZC_DELETEITEM_FROM_MCSTORE).
-/// 0137 <index>.W <amount>.W
-void clif_vendingreport(struct map_session_data* sd, int index, int amount)
+/// Inform merchant that someone has bought an item.
+/// 0137 <index>.W <amount>.W (ZC_DELETEITEM_FROM_MCSTORE).
+/// 09e5 <index>.W <amount>.W <GID>.L <Date>.L <zeny>.L (ZC_DELETEITEM_FROM_MCSTORE2).
+void clif_vendingreport(struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny)
{
int fd;
+#if PACKETVER < 20141016 // TODO : not sure for client date [Napster]
+ const int cmd = 0x137;
+#else
+ const int cmd = 0x9e5;
+#endif
+ const int len = packet_len(cmd);
nullpo_retv(sd);
fd = sd->fd;
- WFIFOHEAD(fd,packet_len(0x137));
- WFIFOW(fd,0) = 0x137;
- WFIFOW(fd,2) = index+2;
- WFIFOW(fd,4) = amount;
- WFIFOSET(fd,packet_len(0x137));
+ WFIFOHEAD(fd, len);
+ WFIFOW(fd, 0) = cmd;
+ WFIFOW(fd, 2) = index + 2;
+ WFIFOW(fd, 4) = amount;
+#if PACKETVER >= 20141016
+ WFIFOL(fd,6) = char_id; // GID
+ WFIFOL(fd,10) = (int)time(NULL); // Date
+ WFIFOL(fd,14) = zeny; // zeny
+#endif
+ WFIFOSET(fd, len);
}
/// Result of organizing a party (ZC_ACK_MAKE_GROUP).