Core/Spells: Define and implement SPELL_ATTR2_CANT_TARGET_TAPPED attribute.

This commit is contained in:
QAston
2011-07-12 07:34:42 +02:00
parent b253c844fc
commit cd1df639b2
2 changed files with 3 additions and 3 deletions
@@ -341,7 +341,7 @@ enum SpellAttr2
SPELL_ATTR2_UNK3 = 0x00000008, // 3 SPELL_ATTR2_UNK3 = 0x00000008, // 3
SPELL_ATTR2_ALWAYS_APPLY_MODIFIERS = 0x00000010, // 4 ? spell modifiers are applied dynamically (even if aura is not passive) SPELL_ATTR2_ALWAYS_APPLY_MODIFIERS = 0x00000010, // 4 ? spell modifiers are applied dynamically (even if aura is not passive)
SPELL_ATTR2_AUTOREPEAT_FLAG = 0x00000020, // 5 SPELL_ATTR2_AUTOREPEAT_FLAG = 0x00000020, // 5
SPELL_ATTR2_UNK6 = 0x00000040, // 6 SPELL_ATTR2_CANT_TARGET_TAPPED = 0x00000040, // 6 target must be tapped by caster
SPELL_ATTR2_UNK7 = 0x00000080, // 7 SPELL_ATTR2_UNK7 = 0x00000080, // 7
SPELL_ATTR2_UNK8 = 0x00000100, // 8 not set in 3.0.3 SPELL_ATTR2_UNK8 = 0x00000100, // 8 not set in 3.0.3
SPELL_ATTR2_UNK9 = 0x00000200, // 9 SPELL_ATTR2_UNK9 = 0x00000200, // 9
+2 -2
View File
@@ -4731,8 +4731,8 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_caster->GetTypeId() == TYPEID_PLAYER) if (m_caster->GetTypeId() == TYPEID_PLAYER)
{ {
// Do not allow to banish target tapped by someone not in caster's group // Do not these spells to target creatures not tapped by us (Banish, Polymorph, many quest spells)
if (m_spellInfo->Mechanic == MECHANIC_BANISH) if (m_spellInfo->AttributesEx2 & SPELL_ATTR2_CANT_TARGET_TAPPED)
if (Creature *targetCreature = target->ToCreature()) if (Creature *targetCreature = target->ToCreature())
if (targetCreature->hasLootRecipient() && !targetCreature->isTappedBy(m_caster->ToPlayer())) if (targetCreature->hasLootRecipient() && !targetCreature->isTappedBy(m_caster->ToPlayer()))
return SPELL_FAILED_CANT_CAST_ON_TAPPED; return SPELL_FAILED_CANT_CAST_ON_TAPPED;