aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2011-01-15 19:40:06 +0100
committerMachiavelli <machiavelli.trinity@gmail.com>2011-01-15 19:40:06 +0100
commit38816cb1dfc212c2fbf2ff8c454257426c6564b3 (patch)
treee0dbbf1c014af606877a75c8b1443052827b3643 /src/server/game/Spells/Spell.cpp
parent52ec32e7402a9098e00bc1fa1784c5b558d68775 (diff)
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.
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp12
1 files changed, 8 insertions, 4 deletions
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<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;
}
}