From 1cdae46468e7375785f564e9fa85180fce1948b9 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 3 Mar 2009 18:41:11 -0600 Subject: [7376] Allow store in spell_area.aura_spell negative values for "not has aura" requirement. Author: VladimirMangos Also * Allow have in aura_spell spells with SPELL_AURA_PHASE in first effect. * Allow negative aura_spell chaining in spell_area table. * Better check at loading duplicate data (by requiremnt set) in spell_area table. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 77 +++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 31 deletions(-) (limited to 'src/game/SpellAuras.cpp') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index c922927a1fe..7177c137dd2 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1905,22 +1905,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real) m_modifier.m_amount = caster->SpellHealingBonus(m_target, GetSpellProto(), m_modifier.m_amount, SPELL_DIRECT_DAMAGE); return; } - - // some auras applied at aura apply - if(GetEffIndex()==0 && m_target->GetTypeId()==TYPEID_PLAYER) - { - SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId()); - if(saBounds.first != saBounds.second) - { - uint32 zone = m_target->GetZoneId(); - uint32 area = m_target->GetAreaId(); - - for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) - if(itr->second->autocast && itr->second->IsFitToRequirements((Player*)m_target,zone,area)) - if( !m_target->HasAura(itr->second->spellId,0) ) - m_target->CastSpell(m_target,itr->second->spellId,true); - } - } } // AT REMOVE else @@ -1985,21 +1969,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real) m_target->SetReducedThreatPercent(0, 0); return; } - - // some auras remove at aura remove - if(GetEffIndex()==0 && m_target->GetTypeId()==TYPEID_PLAYER) - { - SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId()); - if(saBounds.first != saBounds.second) - { - uint32 zone = m_target->GetZoneId(); - uint32 area = m_target->GetAreaId(); - - for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) - if(!itr->second->IsFitToRequirements((Player*)m_target,zone,area)) - m_target->RemoveAurasDueToSpell(itr->second->spellId); - } - } } // AT APPLY & REMOVE @@ -2250,6 +2219,29 @@ void Aura::HandleAuraDummy(bool apply, bool Real) m_target->RemovePetAura(petSpell); return; } + + if(GetEffIndex()==0 && m_target->GetTypeId()==TYPEID_PLAYER) + { + SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId()); + if(saBounds.first != saBounds.second) + { + uint32 zone = m_target->GetZoneId(); + uint32 area = m_target->GetAreaId(); + + for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) + { + // some auras remove at aura remove + if(!itr->second->IsFitToRequirements((Player*)m_target,zone,area)) + m_target->RemoveAurasDueToSpell(itr->second->spellId); + // some auras applied at aura apply + else if(itr->second->autocast) + { + if( !m_target->HasAura(itr->second->spellId,0) ) + m_target->CastSpell(m_target,itr->second->spellId,true); + } + } + } + } } void Aura::HandleAuraMounted(bool apply, bool Real) @@ -6599,6 +6591,29 @@ void Aura::HandlePhase(bool apply, bool Real) m_target->SetPhaseMask(apply ? GetMiscValue() : PHASEMASK_NORMAL,false); ((Player*)m_target)->GetSession()->SendSetPhaseShift(apply ? GetMiscValue() : PHASEMASK_NORMAL); + + if(GetEffIndex()==0) + { + SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId()); + if(saBounds.first != saBounds.second) + { + uint32 zone = m_target->GetZoneId(); + uint32 area = m_target->GetAreaId(); + + for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) + { + // some auras remove at aura remove + if(!itr->second->IsFitToRequirements((Player*)m_target,zone,area)) + m_target->RemoveAurasDueToSpell(itr->second->spellId); + // some auras applied at aura apply + else if(itr->second->autocast) + { + if( !m_target->HasAura(itr->second->spellId,0) ) + m_target->CastSpell(m_target,itr->second->spellId,true); + } + } + } + } } else m_target->SetPhaseMask(apply ? GetMiscValue() : PHASEMASK_NORMAL,false); -- cgit v1.2.3