From 93b0264a8b81e3ecf49d5c94825ab21213ce14e3 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 1 Aug 2021 14:19:42 -0400 Subject: [PATCH] Update to focus SE_BlockNextSpell (#1479) Minor code changes to make the focus be checked consistent with how all other focuses are checked. No change in functionality. --- zone/bonuses.cpp | 7 +------ zone/common.h | 2 -- zone/lua_stat_bonuses.cpp | 2 +- zone/mob.h | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 53952e6ea..92bd537b9 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -2750,10 +2750,6 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne break; } - case SE_BlockNextSpellFocus: - new_bonus->BlockNextSpell = true; - break; - case SE_NegateSpellEffect: new_bonus->NegateEffects = true; break; @@ -3827,8 +3823,7 @@ uint8 Mob::IsFocusEffect(uint16 spell_id,int effect_index, bool AA,uint32 aa_eff case SE_Fc_Spell_Damage_Pct_IncomingPC: return focusFcSpellDamagePctIncomingPC; case SE_BlockNextSpellFocus: - //return focusBlockNextSpell; - return 0; //This is calculated as an actual bonus + return focusBlockNextSpell; case SE_FcTwincast: return focusTwincast; case SE_SympatheticProc: diff --git a/zone/common.h b/zone/common.h index 83be866e4..754d2b61f 100644 --- a/zone/common.h +++ b/zone/common.h @@ -483,8 +483,6 @@ struct StatBonuses { int HPPercCap[2]; //Spell effect that limits you to being healed/regening beyond a % of your max int ManaPercCap[2]; // ^^ 0 = % Cap 1 = Flat Amount Cap int EndPercCap[2]; // ^^ - bool BlockNextSpell; // Indicates whether the client can block a spell or not - //uint16 BlockSpellEffect[EFFECT_COUNT]; // Prevents spells with certain effects from landing on you *no longer used bool ImmuneToFlee; // Bypass the fleeing flag uint32 VoiceGraft; // Stores the ID of the mob with which to talk through int32 SpellProcChance; // chance to proc from sympathetic spell effects diff --git a/zone/lua_stat_bonuses.cpp b/zone/lua_stat_bonuses.cpp index c007e09ca..ef012c6d7 100644 --- a/zone/lua_stat_bonuses.cpp +++ b/zone/lua_stat_bonuses.cpp @@ -677,7 +677,7 @@ int Lua_StatBonuses::GetXPRateMod() const { bool Lua_StatBonuses::GetBlockNextSpell() const { Lua_Safe_Call_Bool(); - return self->BlockNextSpell; + //return self->BlockNextSpell; bonus no longer used due to effect being a focus } bool Lua_StatBonuses::GetImmuneToFlee() const { diff --git a/zone/mob.h b/zone/mob.h index aadeb6645..6bc9b8a8f 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -823,7 +823,7 @@ public: int GetCriticalChanceBonus(uint16 skill); int16 GetSkillDmgAmt(uint16 skill); bool TryReflectSpell(uint32 spell_id); - bool CanBlockSpell() const { return(spellbonuses.BlockNextSpell); } + inline bool CanBlockSpell() const { return(spellbonuses.FocusEffects[focusBlockNextSpell]); } bool DoHPToManaCovert(uint16 mana_cost = 0); int32 ApplySpellEffectiveness(int16 spell_id, int32 value, bool IsBard = false, uint16 caster_id=0); int8 GetDecayEffectValue(uint16 spell_id, uint16 spelleffect);