summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c28
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/packets.h1
-rw-r--r--src/map/vending.c2
4 files changed, 23 insertions, 10 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).
diff --git a/src/map/clif.h b/src/map/clif.h
index 8b75a32f3..60c03d6e0 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -896,7 +896,7 @@ struct clif_interface {
void (*vendinglist) (struct map_session_data* sd, unsigned int id, struct s_vending* vending_list);
void (*buyvending) (struct map_session_data* sd, int index, int amount, int fail);
void (*openvending) (struct map_session_data* sd, int id, struct s_vending* vending_list);
- void (*vendingreport) (struct map_session_data* sd, int index, int amount);
+ void (*vendingreport) (struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny);
/* storage handling */
void (*storagelist) (struct map_session_data* sd, struct item* items, int items_length);
void (*updatestorageamount) (struct map_session_data* sd, int amount, int max_amount);
diff --git a/src/map/packets.h b/src/map/packets.h
index 077320798..236728bf8 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -2820,6 +2820,7 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0936,36,clif->pStoragePassword,0);
packet(0x09DF,7);
packet(0x0a00,269);
+ packet(0x09e5,18); // ZC_DELETEITEM_FROM_MCSTORE2
#endif
/* Roulette System [Yommy/Hercules] */
diff --git a/src/map/vending.c b/src/map/vending.c
index 6f4515120..f92437cb8 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -191,7 +191,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid,
// vending item
pc->additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING);
vsd->vending[vend_list[i]].amount -= amount;
- clif->vendingreport(vsd, idx, amount);
+ clif->vendingreport(vsd, idx, amount, sd->status.char_id, (int)z);
pc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING);
//print buyer's name