From 38816cb1dfc212c2fbf2ff8c454257426c6564b3 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 15 Jan 2011 19:40:06 +0100 Subject: 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. --- src/server/game/Spells/Spell.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/server/game/Spells/Spell.cpp') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index f0bc46aec98..04da8686a86 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1790,15 +1790,19 @@ void Spell::SearchChainTarget(std::list &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; } } -- cgit v1.2.3