Core/Spells: Implement SPELL_ATTR6_IGNORE_CROWD_CONTROL_TARGETS (0x00000100). Spells with this attribute flag (Avenger's Shield, Hammer of Righteousness, Shield of Righteousness, Felguard Cleave, Fel Iron Bomb) will ignore secondary targets that are under the effect of crowd control aura's.

Thanks to Shauren for advices.
This commit is contained in:
Machiavelli
2011-01-15 19:40:06 +01:00
parent 52ec32e740
commit 38816cb1df
2 changed files with 9 additions and 5 deletions
@@ -487,7 +487,7 @@ enum SpellAttr6
SPELL_ATTR6_UNK5 = 0x00000020, // 5
SPELL_ATTR6_UNK6 = 0x00000040, // 6
SPELL_ATTR6_UNK7 = 0x00000080, // 7
SPELL_ATTR6_UNK8 = 0x00000100, // 8
SPELL_ATTR6_IGNORE_CROWD_CONTROL_TARGETS = 0x00000100, // 8
SPELL_ATTR6_UNK9 = 0x00000200, // 9
SPELL_ATTR6_UNK10 = 0x00000400, // 10
SPELL_ATTR6_NOT_IN_RAID_INSTANCE = 0x00000800, // 11 not usable in raid instance
+8 -4
View File
@@ -1790,15 +1790,19 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
tempUnitMap.sort(Trinity::ObjectDistanceOrderPred(cur));
next = tempUnitMap.begin();
if (cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
if (cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS) // Don't search beyond the max jump radius
break;
while ((m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE
// Check if (*next) is a valid chain target. If not, don't add to TagUnitMap, and repeat loop.
// If you want to add any conditions to exclude a target from TagUnitMap, add condition in this while() loop.
while ((m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE
&& !m_caster->isInFrontInMap(*next, max_range))
|| !m_caster->canSeeOrDetect(*next)
|| !cur->IsWithinLOSInMap(*next))
|| !cur->IsWithinLOSInMap(*next)
|| ((GetSpellInfo()->AttributesEx6 & SPELL_ATTR6_IGNORE_CROWD_CONTROL_TARGETS) && !(*next)->CanFreeMove()))
{
++next;
if (next == tempUnitMap.end() || cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
if (next == tempUnitMap.end() || cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS) // Don't search beyond the max jump radius
return;
}
}