Core/Spells: Implemented SPELL_AURA_BLOCK_SPELL_FAMILY

This commit is contained in:
Shauren
2011-10-02 16:23:52 +02:00
parent a7f98e4bd7
commit 26c76bf388
2 changed files with 13 additions and 5 deletions
+11 -3
View File
@@ -3407,7 +3407,7 @@ void Spell::_handle_immediate_phase()
} }
} }
// Proc damage for spells which have only dest targets (2484 should proc 51486 for example) // Proc damage for spells which have only dest targets (2484 should proc 51486 for example)
m_originalCaster->ProcDamageAndSpell(0, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell); m_originalCaster->ProcDamageAndSpell(NULL, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell);
} }
} }
@@ -4577,7 +4577,10 @@ SpellCastResult Spell::CheckCast(bool strict)
} }
if (m_spellInfo->AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL && !m_caster->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS)) if (m_spellInfo->AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL && !m_caster->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS))
return SPELL_FAILED_SPELL_UNAVAILABLE; {
m_customError = SPELL_CUSTOM_ERROR_GM_ONLY;
return SPELL_FAILED_CUSTOM_ERROR;
}
// Check global cooldown // Check global cooldown
if (strict && !(_triggeredCastFlags & TRIGGERED_IGNORE_GCD) && HasGlobalCooldown()) if (strict && !(_triggeredCastFlags & TRIGGERED_IGNORE_GCD) && HasGlobalCooldown())
@@ -4626,7 +4629,12 @@ SpellCastResult Spell::CheckCast(bool strict)
} }
} }
bool reqCombat=true; 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 ((*blockItr)->GetMiscValue() == m_spellInfo->SpellFamilyName)
return SPELL_FAILED_SPELL_UNAVAILABLE;
bool reqCombat = true;
Unit::AuraEffectList const& stateAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); Unit::AuraEffectList const& stateAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j) for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
{ {
+2 -2
View File
@@ -1597,10 +1597,10 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b
if (target != caster && (caster->IsControlledByPlayer() || !IsPositive()) && target->GetTypeId() == TYPEID_PLAYER) if (target != caster && (caster->IsControlledByPlayer() || !IsPositive()) && target->GetTypeId() == TYPEID_PLAYER)
{ {
if (!target->ToPlayer()->IsVisible()) if (!target->ToPlayer()->IsVisible())
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BM_OR_INVISGOD;
if (target->ToPlayer()->isGameMaster()) if (target->ToPlayer()->isGameMaster())
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BM_OR_INVISGOD;
} }
// not allow casting on flying player // not allow casting on flying player