summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-19 03:38:04 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-28 04:40:43 +0300
commita7285e774dac19e47c9e9adca3cc97212ed30c59 (patch)
treef82939e71892fbff768d90eed8444618df111e0a
parent2b6371dcbf04d6351fcc1141b1416131c6e453be (diff)
downloadhercules-a7285e774dac19e47c9e9adca3cc97212ed30c59.tar.gz
hercules-a7285e774dac19e47c9e9adca3cc97212ed30c59.tar.bz2
hercules-a7285e774dac19e47c9e9adca3cc97212ed30c59.tar.xz
hercules-a7285e774dac19e47c9e9adca3cc97212ed30c59.zip
Add over weight packet.
Thanks @functor-x
-rw-r--r--src/map/clif.c14
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/packets_struct.h5
-rw-r--r--src/map/pc.c1
4 files changed, 21 insertions, 0 deletions
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]