fix(Core/Spells): Banish should only be dispelled by Mass Dispel (#17703)

* fix(Core/Spells): Banish should only be dispelled by Mass Dispel

* Update Unit.cpp

* Update Unit.cpp
This commit is contained in:
Andrew
2023-11-14 12:27:37 -03:00
committed by GitHub
parent 20cde236c7
commit 5a4fdc7de4
4 changed files with 11 additions and 4 deletions

View File

@@ -5529,7 +5529,7 @@ Aura* Unit::GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID, ObjectGu
return aurApp ? aurApp->GetBase() : nullptr;
}
void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList)
void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList, SpellInfo const* dispelSpell)
{
// we should not be able to dispel diseases if the target is affected by unholy blight
if (dispelMask & (1 << DISPEL_DISEASE) && HasAura(50536))
@@ -5575,6 +5575,12 @@ void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelCharges
continue;
}
// Banish should only be dispelled by Mass Dispel
if (aura->GetSpellInfo()->Mechanic == MECHANIC_BANISH && !dispelSpell->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
{
continue;
}
// The charges / stack amounts don't count towards the total number of auras that can be dispelled.
// Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell
// Polymorph instead of 1 / (5 + 1) -> 16%.

View File

@@ -1995,7 +1995,7 @@ public:
AuraApplication* GetAuraApplicationOfRankedSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraApplication* except = nullptr) const;
[[nodiscard]] Aura* GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0) const;
void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList);
void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList, SpellInfo const* dispelSpell);
[[nodiscard]] bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster = ObjectGuid::Empty) const;
[[nodiscard]] uint32 GetAuraCount(uint32 spellId) const;

View File

@@ -6077,7 +6077,8 @@ SpellCastResult Spell::CheckCast(bool strict)
}
DispelChargesList dispelList;
target->GetDispellableAuraList(m_caster, dispelMask, dispelList);
target->GetDispellableAuraList(m_caster, dispelMask, dispelList, m_spellInfo);
if (dispelList.empty())
return SPELL_FAILED_NOTHING_TO_DISPEL;
}

View File

@@ -2574,7 +2574,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(dispel_type));
DispelChargesList dispel_list;
unitTarget->GetDispellableAuraList(m_caster, dispelMask, dispel_list);
unitTarget->GetDispellableAuraList(m_caster, dispelMask, dispel_list, m_spellInfo);
if (dispel_list.empty())
return;