From 48ee77e4fdfc3741996df0ddaca49c090292fc10 Mon Sep 17 00:00:00 2001 From: HoraK-FDF Date: Wed, 7 Aug 2024 23:40:36 +0200 Subject: sc_phys_shield_item --- src/map/battle.cpp | 4 ++-- src/map/pc.cpp | 4 ++-- src/map/script-fun.cpp | 1 + src/map/skill.cpp | 6 ++++-- 4 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.cpp b/src/map/battle.cpp index ac8dcf2..d66308d 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -2091,10 +2091,10 @@ ATK battle_weapon_attack(dumb_ptr src, dumb_ptr target, } if (wd.damage > 0 - && t_sc_data[StatusChange::SC_PHYS_SHIELD].timer + && (t_sc_data[StatusChange::SC_PHYS_SHIELD].timer || t_sc_data[StatusChange::SC_PHYS_SHIELD_ITEM].timer) && target->bl_type == BL::PC) { - int reduction = t_sc_data[StatusChange::SC_PHYS_SHIELD].val1; + int reduction = std::max(t_sc_data[StatusChange::SC_PHYS_SHIELD].val1, t_sc_data[StatusChange::SC_PHYS_SHIELD_ITEM].val1); // highest value is taken here but serverdata should make sure only one of those is active if (reduction > wd.damage) reduction = wd.damage; diff --git a/src/map/pc.cpp b/src/map/pc.cpp index df5423e..9ef70fe 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -1553,8 +1553,8 @@ int pc_calcstatus(dumb_ptr sd, int first) /* Slow down if protected */ - if (sd->sc_data[StatusChange::SC_PHYS_SHIELD].timer) - aspd_rate += sd->sc_data[StatusChange::SC_PHYS_SHIELD].val1; + if (sd->sc_data[StatusChange::SC_PHYS_SHIELD].timer || sd->sc_data[StatusChange::SC_PHYS_SHIELD_ITEM].timer) + aspd_rate += std::max(sd->sc_data[StatusChange::SC_PHYS_SHIELD].val1, sd->sc_data[StatusChange::SC_PHYS_SHIELD_ITEM].val1); // highest value is taken here but serverdata should make sure only one of those is active if (sd->sc_data[StatusChange::SC_SLOWMOVE].timer) speed_rate += sd->sc_data[StatusChange::SC_SLOWMOVE].val1; diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 3bbd369..fee39d6 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -3920,6 +3920,7 @@ void builtin_sc_start(ScriptState *st) // all those use ms so this checks for < 1s are not needed on those // and it would break the cooldown symbol since many spells have cooldowns less than 1s case StatusChange::SC_PHYS_SHIELD: + case StatusChange::SC_PHYS_SHIELD_ITEM: case StatusChange::SC_MBARRIER: case StatusChange::SC_COOLDOWN: case StatusChange::SC_COOLDOWN_MG: diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 65df758..7454cc3 100644 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -201,9 +201,9 @@ int skill_additional_effect(dumb_ptr src, dumb_ptr bl, } sc_def_phys_shield_spell = 0; - if (battle_get_sc_data(bl)[StatusChange::SC_PHYS_SHIELD].timer) + if (battle_get_sc_data(bl)[StatusChange::SC_PHYS_SHIELD].timer || battle_get_sc_data(bl)[StatusChange::SC_PHYS_SHIELD_ITEM].timer) sc_def_phys_shield_spell = - battle_get_sc_data(bl)[StatusChange::SC_PHYS_SHIELD].val1; + std::max(battle_get_sc_data(bl)[StatusChange::SC_PHYS_SHIELD].val1, battle_get_sc_data(bl)[StatusChange::SC_PHYS_SHIELD_ITEM].val1); // highest value is taken here but serverdata should make sure only one of those is active // 対象の耐性 | Target resistance luk = battle_get_luk(bl); @@ -753,6 +753,7 @@ void skill_status_change_end(dumb_ptr bl, StatusChange type, TimerDa case StatusChange::SC_ATKPOT: /* attack potion [Valaris] */ case StatusChange::SC_MATKPOT: /* magic attack potion [Valaris] */ case StatusChange::SC_PHYS_SHIELD: + case StatusChange::SC_PHYS_SHIELD_ITEM: case StatusChange::SC_HASTE: case StatusChange::SC_SLOWMOVE: calc_flag = 1; @@ -1033,6 +1034,7 @@ int skill_status_effect(dumb_ptr bl, StatusChange type, case StatusChange::SC_HASTE: case StatusChange::SC_PHYS_SHIELD: + case StatusChange::SC_PHYS_SHIELD_ITEM: case StatusChange::SC_MBARRIER: case StatusChange::SC_SLOWMOVE: calc_flag = 1; -- cgit v1.2.3-70-g09d2