[c12599] Add support for condition_id to spell_area table

This commit is contained in:
Schmoozerd 2013-05-31 11:09:41 +01:00 committed by Antz
parent 4f86b168c0
commit 15bb475d40
10 changed files with 111 additions and 138 deletions

View file

@ -3368,7 +3368,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return;
}
if (GetEffIndex() == EFFECT_INDEX_0 && target->GetTypeId() == TYPEID_PLAYER)
if (target->GetTypeId() == TYPEID_PLAYER)
{
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if (saBounds.first != saBounds.second)
@ -3377,17 +3377,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
target->GetZoneAndAreaId(zone, area);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
// some auras remove at aura remove
if (!itr->second->IsFitToRequirements((Player*)target, zone, area))
target->RemoveAurasDueToSpell(itr->second->spellId);
// some auras applied at aura apply
else if (itr->second->autocast)
{
if (!target->HasAura(itr->second->spellId, EFFECT_INDEX_0))
target->CastSpell(target, itr->second->spellId, true);
}
}
itr->second->ApplyOrRemoveSpellIfCan((Player*)target, zone, area, false);
}
}
@ -8770,7 +8760,7 @@ void Aura::HandlePhase(bool apply, bool Real)
target->SetPhaseMask(apply ? GetMiscValue() : uint32(PHASEMASK_NORMAL), true);
// no-phase is also phase state so same code for apply and remove
if (GetEffIndex() == EFFECT_INDEX_0 && target->GetTypeId() == TYPEID_PLAYER)
if (target->GetTypeId() == TYPEID_PLAYER)
{
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if (saBounds.first != saBounds.second)
@ -8779,17 +8769,7 @@ void Aura::HandlePhase(bool apply, bool Real)
target->GetZoneAndAreaId(zone, area);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
// some auras remove at aura remove
if (!itr->second->IsFitToRequirements((Player*)target, zone, area))
target->RemoveAurasDueToSpell(itr->second->spellId);
// some auras applied at aura apply
else if (itr->second->autocast)
{
if (!target->HasAura(itr->second->spellId, EFFECT_INDEX_0))
target->CastSpell(target, itr->second->spellId, true);
}
}
itr->second->ApplyOrRemoveSpellIfCan((Player*)target, zone, area, false);
}
}
}