Scripts: Replaced calls to ForcedDespawn with DespawnOrUnsummon (calls appropriate AI hooks in case of temporary summons) and made ForcedDespawn private

This commit is contained in:
Shauren
2012-04-24 16:53:37 +02:00
parent 396b1ded1a
commit 1851a2e9e3
18 changed files with 32 additions and 31 deletions
@@ -262,7 +262,7 @@ class ValithriaDespawner : public BasicEvent
if (CreatureData const* data = creature->GetCreatureData())
creature->SetPosition(data->posX, data->posY, data->posZ, data->orientation);
creature->ForcedDespawn();
creature->DespawnOrUnsummon();
creature->SetCorpseDelay(corpseDelay);
creature->SetRespawnDelay(respawnDelay);
@@ -1087,7 +1087,7 @@ class npc_dream_cloud : public CreatureScript
me->GetMotionMaster()->MoveIdle();
// must use originalCaster the same for all clouds to allow stacking
me->CastSpell(me, EMERALD_VIGOR, false, NULL, NULL, _instance->GetData64(DATA_VALITHRIA_DREAMWALKER));
me->ForcedDespawn(100);
me->DespawnOrUnsummon(100);
break;
default:
break;
@@ -346,7 +346,7 @@ class FrostwingGauntletRespawner
if (CreatureData const* data = creature->GetCreatureData())
creature->SetPosition(data->posX, data->posY, data->posZ, data->orientation);
creature->ForcedDespawn();
creature->DespawnOrUnsummon();
creature->SetCorpseDelay(corpseDelay);
creature->SetRespawnDelay(respawnDelay);
@@ -298,14 +298,14 @@ class npc_auriaya_seeping_trigger : public CreatureScript
void Reset()
{
me->ForcedDespawn(600000);
me->DespawnOrUnsummon(600000);
DoCast(me, SPELL_SEEPING_ESSENCE);
}
void UpdateAI(uint32 const /*diff*/)
{
if (instance->GetBossState(BOSS_AURIAYA) != IN_PROGRESS)
me->ForcedDespawn();
me->DespawnOrUnsummon();
}
private:
@@ -507,7 +507,7 @@ class boss_freya : public CreatureScript
for (uint8 n = 0; n < 3; ++n)
{
summons.remove(Elemental[n][i]->GetGUID());
Elemental[n][i]->ForcedDespawn(5000);
Elemental[n][i]->DespawnOrUnsummon(5000);
trioDefeated[i] = true;
Elemental[n][i]->CastSpell(me, SPELL_REMOVE_10STACK, true);
}
@@ -664,12 +664,12 @@ class boss_freya : public CreatureScript
case NPC_DETONATING_LASHER:
summoned->CastSpell(me, SPELL_REMOVE_2STACK, true);
summoned->CastSpell(who, SPELL_DETONATE, true);
summoned->ForcedDespawn(5000);
summoned->DespawnOrUnsummon(5000);
summons.remove(summoned->GetGUID());
break;
case NPC_ANCIENT_CONSERVATOR:
summoned->CastSpell(me, SPELL_REMOVE_25STACK, true);
summoned->ForcedDespawn(5000);
summoned->DespawnOrUnsummon(5000);
summons.remove(summoned->GetGUID());
break;
}
@@ -1385,7 +1385,7 @@ class npc_healthy_spore : public CreatureScript
if (lifeTimer <= diff)
{
me->RemoveAurasDueToSpell(SPELL_GROW);
me->ForcedDespawn(2200);
me->DespawnOrUnsummon(2200);
lifeTimer = urand(22000, 30000);
}
else
@@ -1423,7 +1423,7 @@ class npc_eonars_gift : public CreatureScript
{
me->RemoveAurasDueToSpell(SPELL_GROW);
DoCast(SPELL_LIFEBINDERS_GIFT);
me->ForcedDespawn(2500);
me->DespawnOrUnsummon(2500);
lifeBindersGiftTimer = 12000;
}
else
@@ -186,7 +186,7 @@ public:
if (owner->GetTypeId() == TYPEID_PLAYER)
{
owner->CastSpell(owner, 46231, true);
CAST_CRE(who)->ForcedDespawn();
CAST_CRE(who)->DespawnOrUnsummon();
}
}
}
+3 -3
View File
@@ -550,7 +550,7 @@ public:
// drake unsummoned, passengers dropped
if (!me->IsOnVehicle(drake) && !hasEmptySeats)
me->ForcedDespawn(3000);
me->DespawnOrUnsummon(3000);
if (enter_timer <= 0)
return;
@@ -605,7 +605,7 @@ public:
me->ExitVehicle();
me->CastSpell(me, SPELL_SUMMON_LIBERATED, true);
me->ForcedDespawn(500);
me->DespawnOrUnsummon(500);
// drake is empty now, deliver credit for drake and despawn him
if (drake->GetVehicleKit()->HasEmptySeat(1) &&
@@ -616,7 +616,7 @@ public:
if (rider->ToPlayer())
rider->ToPlayer()->KilledMonsterCredit(29709, 0);
drake->ForcedDespawn(0);
drake->DespawnOrUnsummon(0);
}
}
}