diff --git a/conf/battle/player.conf b/conf/battle/player.conf index 017d5870fa..d14ee4e64e 100644 --- a/conf/battle/player.conf +++ b/conf/battle/player.conf @@ -61,7 +61,9 @@ natural_healsp_interval: 8000 natural_heal_skill_interval: 10000 // The maximum weight for a character to carry when the character stops healing naturally. (in %) +// For renewal: Requires client 20171025 or newer to display properly natural_heal_weight_rate: 50 +natural_heal_weight_rate_renewal: 70 // Maximum atk speed. (Default 190, Highest allowed 199) max_aspd: 190 diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 29d04b86f1..7c367c27f6 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -8178,7 +8178,8 @@ static const struct _battle_data { { "natural_healhp_interval", &battle_config.natural_healhp_interval, 6000, NATURAL_HEAL_INTERVAL, INT_MAX, }, { "natural_healsp_interval", &battle_config.natural_healsp_interval, 8000, NATURAL_HEAL_INTERVAL, INT_MAX, }, { "natural_heal_skill_interval", &battle_config.natural_heal_skill_interval, 10000, NATURAL_HEAL_INTERVAL, INT_MAX, }, - { "natural_heal_weight_rate", &battle_config.natural_heal_weight_rate, 50, 50, 101 }, + { "natural_heal_weight_rate", &battle_config.natural_heal_weight_rate, 50, 0, 100 }, + { "natural_heal_weight_rate_renewal", &battle_config.natural_heal_weight_rate_renewal,70, 0, 100 }, { "arrow_decrement", &battle_config.arrow_decrement, 1, 0, 2, }, { "max_aspd", &battle_config.max_aspd, 190, 100, 199, }, { "max_third_aspd", &battle_config.max_third_aspd, 193, 100, 199, }, diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 2ad3fb650e..dd2d647226 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -261,6 +261,7 @@ struct Battle_Config int natural_healsp_interval; int natural_heal_skill_interval; int natural_heal_weight_rate; + int natural_heal_weight_rate_renewal; int arrow_decrement; int max_aspd; int max_walk_speed; //Maximum walking speed after buffs [Skotlex] diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 2faa9299fd..76c10324be 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20350,6 +20350,25 @@ void clif_parse_attendance_request( int fd, struct map_session_data* sd ){ pc_attendance_claim_reward(sd); } +/// Send out the percentage of weight that causes it to be displayed in red. +/// 0ADE .L +void clif_weight_limit( struct map_session_data* sd ){ +#if PACKETVER >= 20171025 + nullpo_retv(sd); + + int fd = sd->fd; + + WFIFOHEAD(fd, packet_len(0xADE)); + WFIFOW(fd, 0) = 0xADE; +#ifdef RENEWAL + WFIFOL(fd, 2) = battle_config.natural_heal_weight_rate_renewal; +#else + WFIFOL(fd, 2) = battle_config.natural_heal_weight_rate; +#endif + WFIFOSET(fd, packet_len(0xADE)); +#endif +} + /*========================================== * Main client packet processing function *------------------------------------------*/ diff --git a/src/map/clif.hpp b/src/map/clif.hpp index 61b4b87c9e..5290bcd932 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -1088,4 +1088,6 @@ enum out_ui_type : int8 { void clif_ui_open( struct map_session_data *sd, enum out_ui_type ui_type, int32 data ); void clif_attendence_response( struct map_session_data *sd, int32 data ); +void clif_weight_limit( struct map_session_data* sd ); + #endif /* _CLIF_HPP_ */ diff --git a/src/map/clif_packetdb.hpp b/src/map/clif_packetdb.hpp index 8620d11937..fd619e0360 100644 --- a/src/map/clif_packetdb.hpp +++ b/src/map/clif_packetdb.hpp @@ -2364,6 +2364,11 @@ packet(0x0ACC,18); #endif +// 2017-10-25eRagexeRE +#if PACKETVER >= 20171025 + packet(0x0ADE,6); +#endif + // 2018-01-03aRagexeRE or 2018-01-03bRagexeRE #if PACKETVER >= 20180103 parseable_packet(0x0ae8,2,clif_parse_changedress,0); diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 6a7f686723..617824cc59 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -2015,7 +2015,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd) /*========================================== * Updates the weight status *------------------------------------------ - * 1: overweight 50% + * 1: overweight 50% for pre-renewal and 70% for renewal * 2: overweight 90% * It's assumed that SC_WEIGHT50 and SC_WEIGHT90 are only started/stopped here. */ @@ -2027,7 +2027,11 @@ void pc_updateweightstatus(struct map_session_data *sd) nullpo_retv(sd); old_overweight = (sd->sc.data[SC_WEIGHT90]) ? 2 : (sd->sc.data[SC_WEIGHT50]) ? 1 : 0; +#ifdef RENEWAL + new_overweight = (pc_is90overweight(sd)) ? 2 : (pc_is70overweight(sd)) ? 1 : 0; +#else new_overweight = (pc_is90overweight(sd)) ? 2 : (pc_is50overweight(sd)) ? 1 : 0; +#endif if( old_overweight == new_overweight ) return; // no change @@ -11746,6 +11750,8 @@ void pc_damage_log_clear(struct map_session_data *sd, int id) void pc_scdata_received(struct map_session_data *sd) { pc_inventory_rentals(sd); // Needed here to remove rentals that have Status Changes after chrif_load_scdata has finished + clif_weight_limit( sd ); + if( pc_has_permission( sd, PC_PERM_ATTENDANCE ) && pc_attendance_enabled() && !pc_attendance_rewarded_today( sd ) ){ clif_ui_open( sd, OUT_UI_ATTENDANCE, pc_attendance_counter( sd ) ); } diff --git a/src/map/pc.hpp b/src/map/pc.hpp index fa724b4ec2..e2609b5eb0 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -909,8 +909,9 @@ extern struct s_job_info job_info[CLASS_COUNT]; #define pc_isfalcon(sd) ( (sd)->sc.option&OPTION_FALCON ) #define pc_isriding(sd) ( (sd)->sc.option&OPTION_RIDING ) #define pc_isinvisible(sd) ( (sd)->sc.option&OPTION_INVISIBLE && !((sd)->sc.data && (sd)->sc.data[SC__FEINTBOMB]) ) -#define pc_is50overweight(sd) ( (sd)->weight*100 >= (sd)->max_weight*battle_config.natural_heal_weight_rate ) -#define pc_is90overweight(sd) ( (sd)->weight*10 >= (sd)->max_weight*9 ) +#define pc_is50overweight(sd) ( (sd)->weight * 100 >= (sd)->max_weight * battle_config.natural_heal_weight_rate ) +#define pc_is70overweight(sd) ( (sd)->weight * 100 >= (sd)->max_weight * battle_config.natural_heal_weight_rate_renewal ) +#define pc_is90overweight(sd) ( (sd)->weight * 10 >= (sd)->max_weight * 9 ) static inline bool pc_hasprogress(struct map_session_data *sd, enum e_wip_block progress) { return sd == NULL || (sd->state.workinprogress&progress) == progress; diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 975fb933cc..e22b2f7301 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -15575,7 +15575,11 @@ bool skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_i } break; case ST_RECOV_WEIGHT_RATE: - if(battle_config.natural_heal_weight_rate <= 100 && sd->weight*100/sd->max_weight >= (unsigned int)battle_config.natural_heal_weight_rate) { +#ifdef RENEWAL + if(pc_is70overweight(sd)) { +#else + if(pc_is50overweight(sd)) { +#endif clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); return false; }