From a7285e774dac19e47c9e9adca3cc97212ed30c59 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 19 Jul 2018 03:38:04 +0300 Subject: Add over weight packet. Thanks @functor-x --- src/map/clif.c | 14 ++++++++++++++ src/map/clif.h | 1 + src/map/packets_struct.h | 5 +++++ src/map/pc.c | 1 + 4 files changed, 21 insertions(+) diff --git a/src/map/clif.c b/src/map/clif.c index 80cd44aaf..e01bef5c9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -21562,6 +21562,19 @@ static void clif_style_change_response(struct map_session_data *sd, enum stylist #endif } +static void clif_overweight_percent(struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20171108 || PACKETVER_RE_NUM >= 20171025 || PACKETVER_ZERO_NUM >= 20171019 + struct PACKET_ZC_OVERWEIGHT_PERCENT p; + + nullpo_retv(sd); + + p.packetType = 0xade; + p.percent = battle_config.natural_heal_weight_rate; + clif->send(&p, sizeof(p), &sd->bl, SELF); +#endif +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -22599,6 +22612,7 @@ void clif_defaults(void) clif->pSkillSelectMenu = clif_parse_SkillSelectMenu; clif->pMoveItem = clif_parse_MoveItem; clif->p_cz_blocking_play_cancel = clif_parse_cz_blocking_play_cancel; + clif->overweight_percent = clif_overweight_percent; /* dull */ clif->pDull = clif_parse_dull; /* BGQueue */ diff --git a/src/map/clif.h b/src/map/clif.h index 8cff8a21e..57ff4001c 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1492,6 +1492,7 @@ struct clif_interface { /* Hat Effect */ void (*hat_effect) (struct block_list *bl, struct block_list *tbl, enum send_target target); void (*hat_effect_single) (struct block_list *bl, uint16 effectId, bool enable); + void (*overweight_percent) (struct map_session_data *sd); bool (*pAttendanceDB) (void); bool (*attendancedb_libconfig_sub) (struct config_setting_t *it, int n, const char *source); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 5f6443ef3..ab48025dc 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -2655,6 +2655,11 @@ struct packet_reqnameall_ack { #endif } __attribute__((packed)); +struct PACKET_ZC_OVERWEIGHT_PERCENT { + int16 packetType; + uint32 percent; +} __attribute__((packed)); + #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 diff --git a/src/map/pc.c b/src/map/pc.c index 01bae5e14..f3150bbdf 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1379,6 +1379,7 @@ static bool pc_authok(struct map_session_data *sd, int login_id2, time_t expirat pc->setpos(sd,sd->status.last_point.map,0,0,CLR_OUTSIGHT); } + clif->overweight_percent(sd); clif->authok(sd); //Prevent S. Novices from getting the no-death bonus just yet. [Skotlex] -- cgit v1.2.3-60-g2f50