diff options
author | megamage <none@none> | 2009-07-30 10:15:45 +0800 |
---|---|---|
committer | megamage <none@none> | 2009-07-30 10:15:45 +0800 |
commit | 9bd41d0255ba4b1a0bc217786e1bb4f3234a34ed (patch) | |
tree | 1009603dbf3f71ecb13f0974700cbd729a2654b2 /src/game/Unit.cpp | |
parent | 29e9bc64d1d1383cdd8b84f19db84e84f59922e6 (diff) |
[8218] Final part of talent 17962 and ranks fixes. Author: VladimirMangos
* Correctly show per-caster aura state for cleitns.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 359e31c3acc..84590d47336 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8536,6 +8536,48 @@ void Unit::RemoveAllAttackers() } } +bool Unit::HasAuraState(AuraState flag, SpellEntry const *spellProto, Unit * Caster) const +{ + if (Caster && spellProto) + { + AuraEffectList const& stateAuras = Caster->GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); + for(AuraEffectList::const_iterator j = stateAuras.begin();j != stateAuras.end(); ++j) + if((*j)->isAffectedOnSpell(spellProto)) + return true; + } + return HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)); +} + +/* +bool Unit::HasAuraStateForCaster(AuraState flag, uint64 caster) const +{ + if(!HasAuraState(flag)) + return false; + + // single per-caster aura state + if(flag == AURA_STATE_CONFLAGRATE) + { + Unit::AuraList const& dotList = GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); + for(Unit::AuraList::const_iterator i = dotList.begin(); i != dotList.end(); ++i) + { + if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && + (*i)->GetCasterGUID() == caster && + // Immolate + (((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004)) || + // Shadowflame + ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002))) + { + return true; + } + } + + return false; + } + + return true; +} +*/ + void Unit::ModifyAuraState(AuraState flag, bool apply) { if (apply) @@ -8581,18 +8623,6 @@ void Unit::ModifyAuraState(AuraState flag, bool apply) } } -bool Unit::HasAuraState(AuraState flag, SpellEntry const *spellProto, Unit * Caster) const -{ - if (Caster && spellProto) - { - AuraEffectList const& stateAuras = Caster->GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); - for(AuraEffectList::const_iterator j = stateAuras.begin();j != stateAuras.end(); ++j) - if((*j)->isAffectedOnSpell(spellProto)) - return true; - } - return HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)); -} - Unit *Unit::GetOwner() const { if(uint64 ownerid = GetOwnerGUID()) |