diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-12-27 23:10:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2020-01-09 09:37:39 +0300 |
commit | 59404730afc7c392cfc6978da861783f947c9d1c (patch) | |
tree | 6736523c99d0a1e6db6956656489583feaf7f97d /src/map | |
parent | d26dd0680197754a97e86e9fb7146e13460fa355 (diff) | |
download | hercules-59404730afc7c392cfc6978da861783f947c9d1c.tar.gz hercules-59404730afc7c392cfc6978da861783f947c9d1c.tar.bz2 hercules-59404730afc7c392cfc6978da861783f947c9d1c.tar.xz hercules-59404730afc7c392cfc6978da861783f947c9d1c.zip |
Update packet CZ_SE_CASHSHOP_OPEN to latest version
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 30 | ||||
-rw-r--r-- | src/map/clif.h | 4 | ||||
-rw-r--r-- | src/map/packets.h | 8 | ||||
-rw-r--r-- | src/map/packets_struct.h | 23 |
4 files changed, 51 insertions, 14 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 4adf605e1..f0cc179b7 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -19982,10 +19982,9 @@ static void clif_parse_dull(int fd, struct map_session_data *sd) return; } -static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); -static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) +static void clif_parse_CashShopOpen1(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_CashShopOpen1(int fd, struct map_session_data *sd) { -#if PACKETVER >= 20100824 if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) return; @@ -19995,6 +19994,27 @@ static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) } clif->cashShopOpen(fd, sd, 0); +} + +static void clif_parse_CashShopLimitedReq(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_CashShopLimitedReq(int fd, struct map_session_data *sd) +{ +} + +static void clif_parse_CashShopOpen2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_CashShopOpen2(int fd, struct map_session_data *sd) +{ + if (sd->state.trading != 0 || pc_isdead(sd) || pc_isvending(sd)) + return; + + if (map->list[sd->bl.m].flag.nocashshop != 0) { + clif->messagecolor_self(fd, COLOR_RED, msg_fd(fd, 1489)); //Cash Shop is disabled in this map + return; + } + +#if PACKETVER >= 20191224 + const struct PACKET_CZ_SE_CASHSHOP_OPEN2 *p = RFIFOP(fd, 0); + clif->cashShopOpen(fd, sd, p->tab); #endif } @@ -24626,7 +24646,9 @@ void clif_defaults(void) clif->pBGQueueRevokeReq = clif_parse_bgqueue_revoke_req; clif->pBGQueueBattleBeginAck = clif_parse_bgqueue_battlebegin_ack; /* RagExe Cash Shop [Ind/Hercules] */ - clif->pCashShopOpen = clif_parse_CashShopOpen; + clif->pCashShopOpen1 = clif_parse_CashShopOpen1; + clif->pCashShopOpen2 = clif_parse_CashShopOpen2; + clif->pCashShopLimitedReq = clif_parse_CashShopLimitedReq; clif->pCashShopClose = clif_parse_CashShopClose; clif->pCashShopReqTab = clif_parse_CashShopReqTab; clif->pCashShopSchedule = clif_parse_CashShopSchedule; diff --git a/src/map/clif.h b/src/map/clif.h index 7812b5366..99560f52e 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1548,7 +1548,9 @@ struct clif_interface { void (*pBGQueueRevokeReq) (int fd, struct map_session_data *sd); void (*pBGQueueBattleBeginAck) (int fd, struct map_session_data *sd); /* RagExe Cash Shop [Ind/Hercules] */ - void (*pCashShopOpen) (int fd, struct map_session_data *sd); + void (*pCashShopOpen1) (int fd, struct map_session_data *sd); + void (*pCashShopOpen2) (int fd, struct map_session_data *sd); + void (*pCashShopLimitedReq) (int fd, struct map_session_data *sd); void (*pCashShopClose) (int fd, struct map_session_data *sd); void (*pCashShopReqTab) (int fd, struct map_session_data *sd); void (*pCashShopSchedule) (int fd, struct map_session_data *sd); diff --git a/src/map/packets.h b/src/map/packets.h index 48d937957..abcbddadb 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -728,7 +728,7 @@ packet(0x96e,clif->ackmergeitems); // all versions #if PACKETVER >= 20100824 - packet(0x0844,clif->pCashShopOpen,2); + packet(0x0844,clif->pCashShopOpen1); #endif //2010-11-24aRagexeRE @@ -1980,7 +1980,11 @@ packet(0x96e,clif->ackmergeitems); #endif #if PACKETVER >= 20190724 - packet(0x0b4c,clif->pCashShopOpen,2); + packet(0x0b4c,clif->pCashShopLimitedReq); +#endif + +#if PACKETVER >= 20191224 + packet(0x0b6d,clif->pCashShopOpen2); #endif #endif /* MAP_PACKETS_H */ diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index afc8045ec..7b1d91004 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3748,17 +3748,26 @@ struct PACKET_ZC_NOTIFY_EFFECT3 { DEFINE_PACKET_HEADER(ZC_NOTIFY_EFFECT3, 0x0284); #endif -#if PACKETVER >= 20190724 -struct PACKET_CZ_SE_CASHSHOP_OPEN { +#if PACKETVER >= 20100824 +struct PACKET_CZ_SE_CASHSHOP_OPEN1 { int16 packetType; } __attribute__((packed)); -DEFINE_PACKET_HEADER(CZ_SE_CASHSHOP_OPEN, 0x0b4c); -CHECK_PACKET_HEADER(CZ_SE_CASHSHOP_OPEN, 0x0844); -#elif PACKETVER >= 20100824 -struct PACKET_CZ_SE_CASHSHOP_OPEN { +DEFINE_PACKET_HEADER(CZ_SE_CASHSHOP_OPEN1, 0x0844); +#endif + +#if PACKETVER >= 20191224 +struct PACKET_CZ_SE_CASHSHOP_OPEN2 { + int16 packetType; + uint32 tab; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_SE_CASHSHOP_OPEN2, 0x0b6d); +#endif + +#if PACKETVER >= 20190724 +struct PACKET_CZ_SE_CASHSHOP_LIMITED_REQ { int16 packetType; } __attribute__((packed)); -DEFINE_PACKET_HEADER(CZ_SE_CASHSHOP_OPEN, 0x0844); +DEFINE_PACKET_HEADER(CZ_SE_CASHSHOP_LIMITED_REQ, 0x0b4c); #endif #if PACKETVER_ZERO_NUM >= 20191224 |