diff options
author | megamage <none@none> | 2008-12-24 12:23:48 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-24 12:23:48 -0600 |
commit | 8c6b82f448f08afb6dc0a0216f751d686ddc08cb (patch) | |
tree | f005162b37cc68f866c06ea775e64e7ef160ffba /src/game/Unit.cpp | |
parent | f511dc2c12f37538d057beb2d945a20c76f1a464 (diff) | |
parent | 4a917033c5da12c838d47bff6798434a1698655a (diff) |
Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 34156ac661d..80d6ea39227 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -13064,8 +13064,25 @@ bool Unit::IsInRaidWith(Unit const *unit) const return false; } -void Unit::GetRaidMember(std::list<Unit*> &TagUnitMap, float radius) +void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius) { + Player *owner = GetCharmerOrOwnerPlayerOrPlayerItself(); + if(!owner) + return; + + Group *pGroup = owner->GetGroup(); + if(!pGroup) + return; + + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* Target = itr->getSource(); + + // IsHostileTo check duel and controlled by enemy + if( Target && Target != this && Target->isAlive() + && IsWithinDistInMap(Target, radius) && !IsHostileTo(Target) ) + nearMembers.push_back(Target); + } } void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius) @@ -13107,17 +13124,23 @@ void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius) void Unit::AddAura(uint32 spellId, Unit* target) { - if(!target) + if(!target || !target->isAlive()) return; SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if(!spellInfo) return; + if (target->IsImmunedToSpell(spellInfo)) + return; + for(uint32 i = 0; i < 3; ++i) { if(spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA) { + if(target->IsImmunedToSpellEffect(spellInfo->Effect[i], spellInfo->EffectMechanic[i])) + continue; + if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER) { Aura *Aur = CreateAura(spellInfo, i, NULL, this, this); |