Scripts/Trial Of The Crusader: Fixed Anub'arak Pursuing Spikes

Closes #21420
This commit is contained in:
Keader
2018-08-18 22:46:03 -03:00
parent 08121bbcc0
commit 8b9d18f29c

View File

@@ -860,18 +860,18 @@ class spell_pursuing_spikes : public AuraScript
void PeriodicTick(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
Unit* permafrostCaster = nullptr;
if (Aura* permafrostAura = GetTarget()->GetAura(sSpellMgr->GetSpellIdForDifficulty(SPELL_PERMAFROST, GetTarget())))
permafrostCaster = permafrostAura->GetCaster();
if (permafrostCaster)
{
PreventDefaultAction();
if (Creature* permafrostCasterCreature = permafrostCaster->ToCreature())
permafrostCasterCreature->DespawnOrUnsummon(3000);
GetTarget()->CastSpell(nullptr, SPELL_SPIKE_FAIL, false);
GetTarget()->CastSpell(nullptr, SPELL_SPIKE_FAIL);
GetTarget()->RemoveAllAuras();
if (Creature* targetCreature = GetTarget()->ToCreature())
targetCreature->DisappearAndDie();