aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-03 18:41:11 -0600
committermegamage <none@none>2009-03-03 18:41:11 -0600
commit1cdae46468e7375785f564e9fa85180fce1948b9 (patch)
tree776ef7d46a1fefded7826f5ca98258ee4cccae42 /src/game/SpellAuras.cpp
parentd6b09015d6c1ac5c62e63d51aeb496c0cc2d3fe5 (diff)
[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
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp77
1 files changed, 46 insertions, 31 deletions
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);