summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-07 23:50:15 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:23 +0300
commit6502e477692d10d9e66735f36c850e8ca306741c (patch)
tree4b0fd221d48800c0331b4c57533f2f21a31c20d2
parent727fca1c7d4132c7c15120be17765432ecdfb262 (diff)
downloadhercules-6502e477692d10d9e66735f36c850e8ca306741c.tar.gz
hercules-6502e477692d10d9e66735f36c850e8ca306741c.tar.bz2
hercules-6502e477692d10d9e66735f36c850e8ca306741c.tar.xz
hercules-6502e477692d10d9e66735f36c850e8ca306741c.zip
Update packet ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN.
-rw-r--r--src/map/clif.c17
-rw-r--r--src/map/packets_struct.h14
2 files changed, 24 insertions, 7 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 697faaa03..2e08cd14b 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -18985,7 +18985,7 @@ static void clif_package_item_announce(struct map_session_data *sd, unsigned sho
nullpo_retv(sd);
p.PacketType = package_item_announceType;
- p.PacketLength = 11+NAME_LENGTH;
+ p.PacketLength = 11 + NAME_LENGTH;
p.type = 0x0;
p.ItemID = nameid;
p.len = NAME_LENGTH;
@@ -19004,14 +19004,19 @@ static void clif_item_drop_announce(struct map_session_data *sd, unsigned short
nullpo_retv(sd);
p.PacketType = item_drop_announceType;
p.PacketLength = sizeof(p);
- p.type = 0x1;
p.ItemID = nameid;
+ p.monsterNameLen = NAME_LENGTH;
p.len = NAME_LENGTH;
safestrncpy(p.Name, sd->status.name, sizeof(p.Name));
- p.monsterNameLen = NAME_LENGTH;
- safestrncpy(p.monsterName, monsterName, sizeof(p.monsterName));
-
- clif->send(&p,sizeof(p), &sd->bl, ALL_CLIENT);
+ if (monsterName == NULL) {
+ // message: MSG_BROADCASTING_SPECIAL_ITEM_OBTAIN2
+ p.type = 0x2;
+ } else {
+ // message: MSG_BROADCASTING_SPECIAL_ITEM_OBTAIN
+ p.type = 0x1;
+ safestrncpy(p.monsterName, monsterName, sizeof(p.monsterName));
+ }
+ clif->send(&p, sizeof(p), &sd->bl, ALL_CLIENT);
}
/* [Ind/Hercules] special thanks to Yommy~! */
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 1114ef9c1..72354608b 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -981,11 +981,19 @@ struct packet_package_item_announce {
int16 PacketType;
int16 PacketLength;
uint8 type;
+#if PACKETVER_RE_NUM >= 20180704
+ uint32 ItemID;
+#else
uint16 ItemID;
+#endif
int8 len;
char Name[NAME_LENGTH];
- int8 unknown;
+ int8 unknown; // probably unused
+#if PACKETVER_RE_NUM >= 20180704
+ uint32 BoxItemID;
+#else
uint16 BoxItemID;
+#endif
} __attribute__((packed));
/* made possible thanks to Yommy!! */
@@ -993,7 +1001,11 @@ struct packet_item_drop_announce {
int16 PacketType;
int16 PacketLength;
uint8 type;
+#if PACKETVER_RE_NUM >= 20180704
+ uint32 ItemID;
+#else
uint16 ItemID;
+#endif
int8 len;
char Name[NAME_LENGTH];
char monsterNameLen;