diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 37 | ||||
-rw-r--r-- | src/map/clif.h | 11 | ||||
-rw-r--r-- | src/map/packets.h | 16 | ||||
-rw-r--r-- | src/map/packets_struct.h | 8 |
4 files changed, 68 insertions, 4 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 3abbc2c36..42f4f49d9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -12377,6 +12377,42 @@ static void clif_parse_RemoveOption(int fd, struct map_session_data *sd) } } +static void clif_parse_reqGearOff(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_reqGearOff(int fd, struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20190703 || PACKETVER_RE_NUM >= 20190703 || PACKETVER_ZERO_NUM >= 20190709 + const struct PACKET_CZ_REQ_MOUNTOFF *p = RFIFOP(fd, 0); + switch (p->action) { + case REMOVE_MOUNT_DRAGON: + if (pc_isridingdragon(sd)) + pc->setoption(sd, sd->sc.option &~ OPTION_DRAGON); + break; + case REMOVE_MOUNT_MADO: + if (pc_ismadogear(sd)) + pc->setoption(sd, sd->sc.option &~ OPTION_MADOGEAR); + break; + case REMOVE_MOUNT_PECO: + if (pc_isridingpeco(sd)) + pc->setoption(sd, sd->sc.option &~ OPTION_RIDING); + break; + case REMOVE_MOUNT_FALCON: + if (pc_isfalcon(sd)) + pc->setoption(sd, sd->sc.option &~ OPTION_FALCON); + break; + case REMOVE_MOUNT_CART: + // this packet exists in clients with only new carts [4144] + if (sd->sc.data[SC_PUSH_CART]) + pc->setcart(sd, 0); + break; + case REMOVE_MOUNT_0: + case REMOVE_MOUNT_2: + default: + ShowError("Unknown action in remove mount packet: %d\n", p->action); + break; + } +#endif +} + static void clif_parse_ChangeCart(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); /// Request to change cart's visual look (CZ_REQ_CHANGECART). /// 01af <num>.W @@ -24680,4 +24716,5 @@ void clif_defaults(void) clif->lapineDdukDdak_result = clif_lapineDdukDdak_result; clif->plapineDdukDdak_ack = clif_parse_lapineDdukDdak_ack; clif->plapineDdukDdak_close = clif_parse_lapineDdukDdak_close; + clif->pReqGearOff = clif_parse_reqGearOff; } diff --git a/src/map/clif.h b/src/map/clif.h index 0dfc00c01..eb5cb36bd 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -733,6 +733,16 @@ enum lapineddukddak_result { LAPINEDDKUKDDAK_INVALID_ITEM = 7, }; +enum removeGear_flag { + REMOVE_MOUNT_0 = 0, // unused + REMOVE_MOUNT_DRAGON = 1, + REMOVE_MOUNT_2 = 2, // unused + REMOVE_MOUNT_MADO = 3, + REMOVE_MOUNT_PECO = 4, + REMOVE_MOUNT_FALCON = 5, + REMOVE_MOUNT_CART = 6, +}; + /** * Clif.c Interface **/ @@ -1670,6 +1680,7 @@ struct clif_interface { bool (*lapineDdukDdak_result) (struct map_session_data *sd, enum lapineddukddak_result result); void (*plapineDdukDdak_ack) (int fd, struct map_session_data *sd); void (*plapineDdukDdak_close) (int fd, struct map_session_data *sd); + void (*pReqGearOff) (int fd, struct map_session_data *sd); }; #ifdef HERCULES_CORE diff --git a/src/map/packets.h b/src/map/packets.h index 8fb47eb7a..312b1e1d7 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1796,6 +1796,14 @@ packet(0x96e,clif->ackmergeitems); // changed packet sizes #endif +#if PACKETVER >= 20160302 + packet(0x0a4f,clif->plapineDdukDdak_ack); +#endif + +#if PACKETVER >= 20160504 + packet(0x0a70,clif->plapineDdukDdak_close); +#endif + // all 2016-05-25 #if PACKETVER >= 20160525 packet(0x0a77,clif->pCameraInfo); // CZ_CAMERA_INFO @@ -1959,12 +1967,12 @@ packet(0x96e,clif->ackmergeitems); packet(0x0b2c,clif->pGuildCastleInfoRequest); #endif -#if PACKETVER >= 20160302 - packet(0x0a4f,clif->plapineDdukDdak_ack); +#if PACKETVER_MAIN_NUM >= 20190703 || PACKETVER_RE_NUM >= 20190703 + packet(0x0b35,clif->pReqGearOff); #endif -#if PACKETVER >= 20160504 - packet(0x0a70,clif->plapineDdukDdak_close); +#if PACKETVER_ZERO_NUM >= 20190709 + packet(0x0b35,clif->pReqGearOff); #endif #endif /* MAP_PACKETS_H */ diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index c0d1054d7..428e0127c 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3714,6 +3714,14 @@ struct PACKET_ZC_LAPINEDDUKDDAK_RESULT { DEFINE_PACKET_HEADER(ZC_LAPINEDDUKDDAK_RESULT, 0x0a50); #endif // PACKETVER_MAIN_NUM >= 20160601 || PACKETVER_RE_NUM >= 20160525 || defined(PACKETVER_ZERO) +#if PACKETVER_MAIN_NUM >= 20190703 || PACKETVER_RE_NUM >= 20190703 || PACKETVER_ZERO_NUM >= 20190709 +struct PACKET_CZ_REQ_MOUNTOFF { + int16 packetType; + uint8 action; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_REQ_MOUNTOFF, 0x0b35); +#endif + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris |