Core/Spells: corrected implementation of SPELL_AURA_BLOCK_SPELL_FAMILY and implement trigger cast flag to ignore blocked spells
This commit is contained in:
1 parent
221ed21ed2
commit
05fcab82d8
2 files changed
+5
-5
No files matched your search
@@ -327,7 +327,7 @@ enum TriggerCastFlags : uint32
|
||||
TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state
|
||||
TRIGGERED_DISALLOW_PROC_EVENTS = 0x00001000, //! Disallows proc events from triggered spell (default)
|
||||
TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions
|
||||
// reuse = 0x00004000,
|
||||
TRIGGERED_IGNORE_BLOCKED_SPELL_FAMILY = 0x00004000, //! Will ignore blocked casts of SPELL_AURA_BLOCK_SPELL_FAMILY
|
||||
// reuse = 0x00008000,
|
||||
TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements
|
||||
TRIGGERED_DONT_RESET_PERIODIC_TIMER = 0x00020000, //! Will allow periodic aura timers to keep ticking (instead of resetting)
|
||||
|
||||
@@ -5360,10 +5360,10 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
|
||||
}
|
||||
}
|
||||
|
||||
Unit::AuraEffectList const& blockSpells = m_caster->GetAuraEffectsByType(SPELL_AURA_BLOCK_SPELL_FAMILY);
|
||||
for (Unit::AuraEffectList::const_iterator blockItr = blockSpells.begin(); blockItr != blockSpells.end(); ++blockItr)
|
||||
if (uint32((*blockItr)->GetMiscValue()) == m_spellInfo->SpellFamilyName)
|
||||
return SPELL_FAILED_SPELL_UNAVAILABLE;
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_BLOCKED_SPELL_FAMILY))
|
||||
for (AuraEffect const* blocked : m_caster->GetAuraEffectsByType(SPELL_AURA_BLOCK_SPELL_FAMILY))
|
||||
if (!blocked->GetMiscValue() || uint32(blocked->GetMiscValue()) == m_spellInfo->SpellFamilyName)
|
||||
return SPELL_FAILED_SPELL_UNAVAILABLE;
|
||||
|
||||
bool reqCombat = true;
|
||||
Unit::AuraEffectList const& stateAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
|
||||
|
||||
Reference in new issue
Block a user