From 253f4bf374ccaa83d20a7ff58e31b37300f4a26e Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 24 Dec 2008 10:57:04 -0600 Subject: *Fix the bug that many talents lose one point. --HG-- branch : trunk --- src/game/Unit.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e00b2446010..123dbbcf2eb 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12943,8 +12943,25 @@ bool Unit::IsInRaidWith(Unit const *unit) const return false; } -void Unit::GetRaidMember(std::list &TagUnitMap, float radius) +void Unit::GetRaidMember(std::list &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 &TagUnitMap, float radius) -- cgit v1.2.3 From 4a917033c5da12c838d47bff6798434a1698655a Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 24 Dec 2008 11:12:34 -0600 Subject: *Fix the bug that boss is stunned by proc stun aura. --HG-- branch : trunk --- src/game/Unit.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 123dbbcf2eb..86d1d23be75 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -13003,17 +13003,23 @@ void Unit::GetPartyMember(std::list &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); -- cgit v1.2.3