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
This commit is contained in:
Atemo 2024-06-18 15:04:37 +02:00 committed by GitHub
parent ba5221ef97
commit 4555e7c14c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 20 deletions

View File

@ -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

View File

@ -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, },

View File

@ -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;