From 4555e7c14cb0014cb3b5c71b14f1fbf85f0dea23 Mon Sep 17 00:00:00 2001 From: Atemo Date: Tue, 18 Jun 2024 15:04:37 +0200 Subject: [PATCH] Updated max RES/MRES and max RES/MRES ignored (#8442) * Removed the limit of RES/MRES and remove max_res_mres_reduction battle config * Added a limit of RES/MRES ignored by items and skills in max_res_mres_ignored battle config --- conf/battle/player.conf | 9 +++------ src/map/battle.cpp | 16 +++------------- src/map/battle.hpp | 2 +- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/conf/battle/player.conf b/conf/battle/player.conf index 4e4cee755c..2e3873ccb7 100644 --- a/conf/battle/player.conf +++ b/conf/battle/player.conf @@ -298,12 +298,9 @@ trait_points_job_change: 7 // Official is 100. max_trait_parameter: 100 -// Max amount of RES/MRES to take into the resistance damage reduction formula. -// A setting of 625 means the max reduction of damage allowed is 50.0%. -// Formula is 100 - 100 * (5000 + RES) / (5000 + 10 * RES) -// Note: Best to leave this setting alone unless you know what your doing. -// Default: 625 -max_res_mres_reduction: 625 +// Max percent of RES/MRES that can be ignored by item bonus/skill. +// Default: 50 +max_res_mres_ignored: 50 // Maximum AP // Default: 1000 diff --git a/src/map/battle.cpp b/src/map/battle.cpp index d87fdb8990..686a7c592e 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -7513,16 +7513,11 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl ignore_res += sc->getSCE(SC_POTENT_VENOM)->val2; } - ignore_res = min(ignore_res, 100); + ignore_res = min(ignore_res, battle_config.max_res_mres_ignored); if (ignore_res > 0) res -= res * ignore_res / 100; - // Max damage reduction from Res is officially 50%. - // That means 625 Res is needed to hit that cap. - if (res > battle_config.max_res_mres_reduction) - res = battle_config.max_res_mres_reduction; - // Apply damage reduction. wd.damage = wd.damage * (5000 + res) / (5000 + 10 * res); wd.damage2 = wd.damage2 * (5000 + res) / (5000 + 10 * res); @@ -8786,16 +8781,11 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list if (sc && sc->getSCE(SC_A_VITA)) ignore_mres += sc->getSCE(SC_A_VITA)->val2; - ignore_mres = min(ignore_mres, 100); + ignore_mres = min(ignore_mres, battle_config.max_res_mres_ignored); if (ignore_mres > 0) mres -= mres * ignore_mres / 100; - // Max damage reduction from MRes is officially 50%. - // That means 625 MRes is needed to hit that cap. - if (mres > battle_config.max_res_mres_reduction) - mres = battle_config.max_res_mres_reduction; - // Apply damage reduction. ad.damage = ad.damage * (5000 + mres) / (5000 + 10 * mres); } @@ -11499,7 +11489,7 @@ static const struct _battle_data { { "use_traitpoint_table", &battle_config.use_traitpoint_table, 1, 0, 1, }, { "trait_points_job_change", &battle_config.trait_points_job_change, 7, 1, 1000, }, { "max_trait_parameter", &battle_config.max_trait_parameter, 100, 10, SHRT_MAX, }, - { "max_res_mres_reduction", &battle_config.max_res_mres_reduction, 625, 1, SHRT_MAX, }, + { "max_res_mres_ignored", &battle_config.max_res_mres_ignored, 50, 0, 100, }, { "max_ap", &battle_config.max_ap, 200, 100, 1000000000, }, { "ap_rate", &battle_config.ap_rate, 100, 1, INT_MAX, }, { "restart_ap_rate", &battle_config.restart_ap_rate, 0, 0, 100, }, diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 61d040fa5a..d82cc3aeff 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -730,7 +730,7 @@ struct Battle_Config int trait_points_job_change; int use_traitpoint_table; int max_trait_parameter; - int max_res_mres_reduction; + int max_res_mres_ignored; int max_ap; int ap_rate; int restart_ap_rate;