Scripts/Spells: Move Demonic Circle mechanics to spell_warlock.cpp

This commit is contained in:
Souler
2012-02-26 17:22:27 +01:00
parent a0de042efe
commit 05097c7fc5
4 changed files with 93 additions and 45 deletions
@@ -5668,27 +5668,6 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
target->CastSpell((Unit*)NULL, m_spellInfo->Effects[m_effIndex].TriggerSpell, true);
break;
}
case SPELLFAMILY_WARLOCK:
{
switch (GetSpellInfo()->Id)
{
// Demonic Circle
case 48018:
if (GameObject* obj = target->GetGameObject(GetSpellInfo()->Id))
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(48020);
if (target->IsWithinDist(obj, spellInfo->GetMaxRange(true)))
{
if (!target->HasAura(62388))
target->CastSpell(target, 62388, true);
}
else
target->RemoveAura(62388);
}
break;
}
break;
}
case SPELLFAMILY_DRUID:
{
switch (GetSpellInfo()->Id)
@@ -1202,19 +1202,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
break;
}
break;
case SPELLFAMILY_WARLOCK:
switch (GetId())
{
case 48020: // Demonic Circle
if (target->GetTypeId() == TYPEID_PLAYER)
if (GameObject* obj = target->GetGameObject(48018))
{
target->NearTeleportTo(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation());
target->RemoveMovementImpairingAuras();
}
break;
}
break;
case SPELLFAMILY_PRIEST:
if (!caster)
break;
@@ -1418,17 +1405,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
caster->CastSpell(target, spellId, true);
}
}
switch (GetId())
{
case 48018: // Demonic Circle
// Do not remove GO when aura is removed by stack
// to prevent remove GO added by new spell
// old one is already removed
if (!onReapply)
target->RemoveGameObject(GetId(), true);
target->RemoveAura(62388);
break;
}
break;
case SPELLFAMILY_PRIEST:
if (!caster)