diff options
author | linencloth <none@none> | 2010-09-15 06:33:38 +0200 |
---|---|---|
committer | linencloth <none@none> | 2010-09-15 06:33:38 +0200 |
commit | a582ab9d9d5890b54e5fd2a10e07be75a33b184d (patch) | |
tree | 9458f6c08f69def93e07ca1bf0d207210502c562 /src/server/game/Spells/Spell.h | |
parent | ec5edaf6bff0aadd92d30d5cd32f5f5968a70c79 (diff) |
Core/Spells: Allow AoE spells to target dead units.
Also removes some unneeded checks from ally targeting.
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Spells/Spell.h')
-rw-r--r-- | src/server/game/Spells/Spell.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 9c4ad549ebc..df7d3b7944b 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -738,11 +738,12 @@ namespace Trinity const Unit * const i_source; uint32 i_entry; const Position * const i_pos; + bool i_requireDeadTarget; SpellNotifierCreatureAndPlayer(Unit *source, std::list<Unit*> &data, float radius, SpellNotifyPushType type, - SpellTargets TargetType = SPELL_TARGETS_ENEMY, const Position *pos = NULL, uint32 entry = 0) + SpellTargets TargetType = SPELL_TARGETS_ENEMY, const Position *pos = NULL, uint32 entry = 0, bool requireDeadTarget = false) : i_data(&data), i_push_type(type), i_radius(radius), i_TargetType(TargetType), - i_source(source), i_entry(entry), i_pos(pos) + i_source(source), i_entry(entry), i_pos(pos), i_requireDeadTarget(requireDeadTarget) { ASSERT(i_source); } @@ -761,7 +762,7 @@ namespace Trinity case SPELL_TARGETS_ENEMY: if (target->isTotem()) continue; - if (!target->isAttackableByAOE()) + if (!target->isAttackableByAOE(i_requireDeadTarget)) continue; if (i_source->IsControlledByPlayer()) { @@ -777,7 +778,13 @@ namespace Trinity case SPELL_TARGETS_ALLY: if (target->isTotem()) continue; - if (!target->isAttackableByAOE() || !i_source->IsFriendlyTo(target)) + if (!i_source->IsFriendlyTo(target)) + continue; + if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + continue; + if (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster()) + continue; + if (target->isAlive() == i_requireDeadTarget) continue; break; case SPELL_TARGETS_ENTRY: |