From ef1f6adf185e920b077ea4261a33d788c170e58b Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Mon, 13 Dec 2021 20:32:25 -0500 Subject: [PATCH] effective casting level update (#1886) --- zone/spell_effects.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index efefec421..3e347436c 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1040,14 +1040,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } - int buff_count = GetMaxTotalSlots(); for(int slot = 0; slot < buff_count; slot++) { if( buffs[slot].spellid != SPELL_UNKNOWN && spells[buffs[slot].spellid].dispel_flag == 0 && !IsDiscipline(buffs[slot].spellid)) { - if (caster && TryDispel(caster->GetLevel(),buffs[slot].casterlevel, effect_value)){ + if (caster && TryDispel(caster->GetCasterLevel(spell_id), buffs[slot].casterlevel, effect_value)){ BuffFadeBySlot(slot); slot = buff_count; } @@ -1296,11 +1295,21 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #ifdef SPELL_EFFECT_SPAM snprintf(effect_desc, _EDLEN, "Blind: %+i", effect_value); #endif - // this should catch the cures - if (BeneficialSpell(spell_id) && spells[spell_id].buff_duration == 0) - BuffFadeByEffect(SE_Blind); - else if (!IsClient()) + // 'cure blind' + if (BeneficialSpell(spell_id) && spells[spell_id].buff_duration == 0) { + int buff_count = GetMaxBuffSlots(); + for (int slot = 0; slot < buff_count; slot++) { + if (buffs[slot].spellid != SPELL_UNKNOWN && IsEffectInSpell(buffs[slot].spellid, SE_Blind)) { + if (caster && TryDispel(caster->GetCasterLevel(spell_id), buffs[slot].casterlevel, 1)) { + BuffFadeBySlot(slot); + slot = buff_count; + } + } + } + } + else if (!IsClient()) { CalculateNewFearpoint(); + } break; }