From 0c181dc4247e8d666ae43f4560262128f0fa6b9e Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 18 Sep 2006 15:36:00 +0000 Subject: [PATCH] - Moved the equipment/card resistances to status ailments outside of status_get_sc_def, so that they are applied only to rate, not duration. - Due to this, the max sc resistance settings (battle/status.conf) no longer apply to equipment/card-granted resistances. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8795 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 3 +++ conf-tmpl/Changelog.txt | 4 ++++ conf-tmpl/battle/status.conf | 3 +-- src/map/battle.c | 4 ++-- src/map/status.c | 23 +++++++++++++---------- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 3a7cc966ed..bdbfdc1111 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,9 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/09/18 + * Moved the equipment/card resistances to status ailments outside of + status_get_sc_def, so that they are applied only to rate, not duration. + [Skotlex] * Modified the Asura code (again), hopefully movement sprite issues are fixed now [Skotlex] * @reloadscript scripts will no longer eliminate mobs with no respawn data. diff --git a/conf-tmpl/Changelog.txt b/conf-tmpl/Changelog.txt index fbe36534e5..9779269eb6 100644 --- a/conf-tmpl/Changelog.txt +++ b/conf-tmpl/Changelog.txt @@ -1,5 +1,9 @@ Date Added +2006/09/18 + * Due to a recent update of how cards/equipment status change defense + works, the max sc resistance settings (battle/status.conf) no longer apply + to them. [Skotlex] 2006/09/16 * Added monster_ai&256. When set, a monster will pick a random starting position to begin checking versus it's skills, otherwise, it will always diff --git a/conf-tmpl/battle/status.conf b/conf-tmpl/battle/status.conf index 5e611ab650..000c159eac 100644 --- a/conf-tmpl/battle/status.conf +++ b/conf-tmpl/battle/status.conf @@ -56,7 +56,6 @@ pc_luk_status_def: 300 mob_luk_status_def: 300 // Maximum resistance to status changes. (10000 = 100%) -// NOTE: This is applied after cards and equipment, so inmunity cards are -// capped to this. +// NOTE: Cards and equipment can go over this limit, so it only applies to natural resist. pc_max_status_def: 10000 mob_max_status_def: 10000 diff --git a/src/map/battle.c b/src/map/battle.c index f44493cb31..9d7bf7514c 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1654,7 +1654,7 @@ static struct Damage battle_calc_weapon_attack( (target->type == BL_MOB && sd->right_weapon.ignore_def_mob & (is_boss(target)?2:1)) || sd->right_weapon.ignore_def_ele & (1<def_ele) || sd->right_weapon.ignore_def_race & (1<race) || - sd->right_weapon.ignore_def_race & (is_boss(target)?1<<10:1<<11) + sd->right_weapon.ignore_def_race & (is_boss(target)?1<type == BL_MOB && sd->left_weapon.ignore_def_mob & (is_boss(target)?2:1)) || sd->left_weapon.ignore_def_ele & (1<def_ele) || sd->left_weapon.ignore_def_race & (1<race) || - sd->left_weapon.ignore_def_race & (is_boss(target)?1<<10:1<<11) + sd->left_weapon.ignore_def_race & (is_boss(target)?1<reseff[type-SC_COMMON_MIN] > 0) - sc_def+= sd->reseff[type-SC_COMMON_MIN]; - if (sc_def < battle_config.pc_max_sc_def) sc_def += (battle_config.pc_max_sc_def - sc_def)* status->luk/battle_config.pc_luk_sc_def; @@ -4459,18 +4455,25 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val if (!(flag&(1|4))) { int def = status_get_sc_def(bl, type); - if (def && !(flag&8)) - rate -= rate*def/10000; - - if (!(rand()%10000 < rate)) - return 0; - if (def && tick && !(flag&2)) { tick -= tick*def/10000; if (tick <= 0) return 0; } + + //Item defenses do not reduce duration, so they go out of the function. + if(sd && SC_COMMON_MIN<=type && type<=SC_COMMON_MAX + && sd->reseff[type-SC_COMMON_MIN] > 0) + def += sd->reseff[type-SC_COMMON_MIN]; + + if (def && !(flag&8)) + rate -= rate*def/10000; + + if (!(rand()%10000 < rate)) + return 0; + + } undead_flag=battle_check_undead(status->race,status->def_ele);