summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-01-16 06:31:59 +0300
committerAndrei Karas <akaras@inbox.ru>2019-02-05 01:16:49 +0300
commitcedd00b65123d2fcd32ac79dc0f6a077f4a279c2 (patch)
tree6061dc7fe2897c23d881d72a58adca117f36b2d0
parent1e28acbaab22d5a92e96a6a19a6e59a92b3f7a46 (diff)
downloadhercules-cedd00b65123d2fcd32ac79dc0f6a077f4a279c2.tar.gz
hercules-cedd00b65123d2fcd32ac79dc0f6a077f4a279c2.tar.bz2
hercules-cedd00b65123d2fcd32ac79dc0f6a077f4a279c2.tar.xz
hercules-cedd00b65123d2fcd32ac79dc0f6a077f4a279c2.zip
Add support for barter shops for main and re clients with version 20190116
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/packets.h2
-rw-r--r--src/map/packets_struct.h6
-rw-r--r--src/map/script.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index eba2ddce3..d41570640 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -22227,7 +22227,7 @@ static bool clif_enchant_equipment(struct map_session_data *sd, enum equip_pos p
static void clif_npc_barter_open(struct map_session_data *sd, struct npc_data *nd)
{
-#if PACKETVER_ZERO_NUM >= 20181226
+#if PACKETVER_MAIN_NUM >= 20190116 || PACKETVER_RE_NUM >= 20190116 || PACKETVER_ZERO_NUM >= 20181226
nullpo_retv(sd);
nullpo_retv(nd);
struct npc_item_list *shop = nd->u.scr.shop->item;
@@ -22263,7 +22263,7 @@ static void clif_npc_barter_open(struct map_session_data *sd, struct npc_data *n
static void clif_parse_NPCBarterPurchase(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
static void clif_parse_NPCBarterPurchase(int fd, struct map_session_data *sd)
{
-#if PACKETVER_ZERO_NUM >= 20181226
+#if PACKETVER_MAIN_NUM >= 20190116 || PACKETVER_RE_NUM >= 20190116 || PACKETVER_ZERO_NUM >= 20181226
const struct PACKET_CZ_NPC_BARTER_PURCHASE *p = RP2PTR(fd);
int count = (p->packetLength - sizeof(struct PACKET_CZ_NPC_BARTER_PURCHASE)) / sizeof p->list[0];
struct barteritemlist item_list;
diff --git a/src/map/packets.h b/src/map/packets.h
index 44a49b387..d430a6de8 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -1922,7 +1922,7 @@ packet(0x96e,clif->ackmergeitems);
packet(0x0b19,clif->pInventoryExpansionRejected);
#endif
-#if PACKETVER_ZERO_NUM >= 20181226
+#if PACKETVER_MAIN_NUM >= 20190116 || PACKETVER_RE_NUM >= 20190116 || PACKETVER_ZERO_NUM >= 20181226
packet(0x0b0f,clif->pNPCBarterPurchase);
packet(0x0b12,clif->pNPCBarterClosed);
#endif
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index d20b20bee..534da6378 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -3056,7 +3056,7 @@ struct PACKET_CZ_PARTY_CONFIG {
} __attribute__((packed));
DEFINE_PACKET_HEADER(CZ_PARTY_CONFIG, 0x02c8);
-#if PACKETVER_ZERO_NUM >= 20181226
+#if PACKETVER_MAIN_NUM >= 20190116 || PACKETVER_RE_NUM >= 20190116 || PACKETVER_ZERO_NUM >= 20181226
struct PACKET_ZC_NPC_BARTER_OPEN_sub {
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 nameid;
@@ -3084,14 +3084,14 @@ struct PACKET_ZC_NPC_BARTER_OPEN {
DEFINE_PACKET_HEADER(ZC_NPC_BARTER_OPEN, 0x0b0e);
#endif
-#if PACKETVER_ZERO_NUM >= 20181226
+#if PACKETVER_MAIN_NUM >= 20190116 || PACKETVER_RE_NUM >= 20190116 || PACKETVER_ZERO_NUM >= 20181226
struct PACKET_CZ_NPC_BARTER_CLOSE {
int16 packetType;
} __attribute__((packed));
DEFINE_PACKET_HEADER(CZ_NPC_BARTER_CLOSE, 0x0b12);
#endif
-#if PACKETVER_ZERO_NUM >= 20181226
+#if PACKETVER_MAIN_NUM >= 20190116 || PACKETVER_RE_NUM >= 20190116 || PACKETVER_ZERO_NUM >= 20181226
struct PACKET_CZ_NPC_BARTER_PURCHASE_sub {
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 itemId;
diff --git a/src/map/script.c b/src/map/script.c
index be591a3ae..76d15d8f1 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -24175,9 +24175,9 @@ static BUILDIN(tradertype)
script->reportsrc(st);
}
#endif
-#if PACKETVER_ZERO_NUM < 20181226
+#if PACKETVER_MAIN_NUM < 20190116 && PACKETVER_RE_NUM < 20190116 && PACKETVER_ZERO_NUM < 20181226
if (type == NST_BARTER) {
- ShowWarning("buildin_tradertype: NST_BARTER is only available with PACKETVER_ZERO_NUM 20181226 or newer!\n");
+ ShowWarning("buildin_tradertype: NST_BARTER is only available with PACKETVER_ZERO_NUM 20181226 or PACKETVER_MAIN_NUM 20190116 or PACKETVER_RE_NUM 20190116 or newer!\n");
script->reportsrc(st);
}
#endif