Core/Scripts: Added wrapper method for despawning creatures DespawnOrUnsummon
This commit is contained in:
@@ -310,7 +310,7 @@ void VehicleAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
m_DoDismiss = false;
|
||||
me->SetVisible(false);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}else m_DismissTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
}
|
||||
case ACTION_T_FORCE_DESPAWN:
|
||||
{
|
||||
me->ForcedDespawn(action.forced_despawn.msDelay);
|
||||
me->DespawnOrUnsummon(action.forced_despawn.msDelay);
|
||||
break;
|
||||
}
|
||||
case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
|
||||
|
||||
@@ -246,7 +246,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
|
||||
me->Respawn();
|
||||
}
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
|
||||
me->Respawn();
|
||||
}
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
|
||||
if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT))
|
||||
{
|
||||
sLog->outDebug("TSCR: FollowerAI is set completed, despawns.");
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
|
||||
if (bIsMaxRangeExceeded)
|
||||
{
|
||||
sLog->outDebug("TSCR: FollowerAI failed because player/group was to far away or not found");
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ void FollowerAI::MovementInform(uint32 uiMotionType, uint32 uiPointId)
|
||||
AddFollowState(STATE_FOLLOW_RETURNING);
|
||||
}
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ void SmartAI::UpdateDespawn(const uint32 diff)
|
||||
mDespawnState++;
|
||||
}
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
} else mDespawnTime -= diff;
|
||||
}
|
||||
|
||||
|
||||
@@ -1656,6 +1656,14 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn)
|
||||
RemoveCorpse(false);
|
||||
}
|
||||
|
||||
void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/)
|
||||
{
|
||||
if (TempSummon* summon = this->ToTempSummon())
|
||||
summon->UnSummon();
|
||||
else
|
||||
ForcedDespawn(msTimeToDespawn);
|
||||
}
|
||||
|
||||
bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo)
|
||||
{
|
||||
if (!spellInfo)
|
||||
|
||||
@@ -596,6 +596,7 @@ class Creature : public Unit, public GridObject<Creature>
|
||||
bool isDeadByDefault() const { return m_isDeadByDefault; };
|
||||
|
||||
void ForcedDespawn(uint32 timeMSToDespawn = 0);
|
||||
void DespawnOrUnsummon(uint32 msTimeToDespawn = 0);
|
||||
|
||||
time_t const& GetRespawnTime() const { return m_respawnTime; }
|
||||
time_t GetRespawnTimeEx() const;
|
||||
|
||||
@@ -199,7 +199,7 @@ void Vehicle::RemoveAllPassengers()
|
||||
|
||||
// creature passengers mounted on player mounts should be despawned at dismount
|
||||
if (GetBase()->GetTypeId() == TYPEID_PLAYER && passenger->ToCreature())
|
||||
passenger->ToCreature()->ForcedDespawn();
|
||||
passenger->ToCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -801,7 +801,7 @@ void Map::ScriptsProcess()
|
||||
case SCRIPT_COMMAND_DESPAWN_SELF:
|
||||
// Target or source must be Creature.
|
||||
if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script, true))
|
||||
cSource->ForcedDespawn(step.script->DespawnSelf.DespawnDelay);
|
||||
cSource->DespawnOrUnsummon(step.script->DespawnSelf.DespawnDelay);
|
||||
break;
|
||||
|
||||
case SCRIPT_COMMAND_LOAD_PATH:
|
||||
|
||||
@@ -660,7 +660,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
|
||||
{
|
||||
ASSERT(GetPlayer() == vehicle->GetBase());
|
||||
unit->ExitVehicle();
|
||||
unit->ToCreature()->ForcedDespawn(1000);
|
||||
unit->ToCreature()->DespawnOrUnsummon(1000);
|
||||
ASSERT(!unit->IsOnVehicle(vehicle->GetBase()));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -2229,7 +2229,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
|
||||
|
||||
player->AutoStoreLoot(creature->GetCreatureInfo()->SkinLootId,LootTemplates_Skinning,true);
|
||||
|
||||
creature->ForcedDespawn();
|
||||
creature->DespawnOrUnsummon();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2279,7 +2279,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
|
||||
|
||||
Creature* creatureTarget = target->ToCreature();
|
||||
|
||||
creatureTarget->ForcedDespawn();
|
||||
creatureTarget->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
// Tear of Azzinoth Summon Channel - it's not really supposed to do anything,and this only prevents the console spam
|
||||
@@ -2375,7 +2375,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
|
||||
if (permafrostCaster)
|
||||
{
|
||||
if (Creature *permafrostCasterAsCreature = permafrostCaster->ToCreature())
|
||||
permafrostCasterAsCreature->ForcedDespawn(3000);
|
||||
permafrostCasterAsCreature->DespawnOrUnsummon(3000);
|
||||
|
||||
caster->CastSpell(caster, 66181, false);
|
||||
caster->RemoveAllAuras();
|
||||
|
||||
@@ -879,7 +879,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, uint32(creatureTarget->GetRespawnTime()-time(NULL)));
|
||||
sLog->outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019");
|
||||
|
||||
creatureTarget->ForcedDespawn();
|
||||
creatureTarget->DespawnOrUnsummon();
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1044,7 +1044,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
unitTarget->ToCreature()->ForcedDespawn();
|
||||
unitTarget->ToCreature()->DespawnOrUnsummon();
|
||||
|
||||
//cast spell Raptor Capture Credit
|
||||
m_caster->CastSpell(m_caster, 42337, true, NULL);
|
||||
@@ -3681,7 +3681,7 @@ void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
// "kill" original creature
|
||||
creatureTarget->ForcedDespawn();
|
||||
creatureTarget->DespawnOrUnsummon();
|
||||
|
||||
uint8 level = (creatureTarget->getLevel() < (m_caster->getLevel() - 5)) ? (m_caster->getLevel() - 5) : creatureTarget->getLevel();
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
if (DespawnTimer <= diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
DespawnTimer = 5000;
|
||||
} else DespawnTimer -= diff;
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ public:
|
||||
if (!Nefarian || !Nefarian->isAlive())
|
||||
{
|
||||
NefarianGUID = 0;
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
NefCheckTime = 2000;
|
||||
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[i]))
|
||||
{
|
||||
CAST_AI(mob_fiendish_portal::mob_fiendish_portalAI, pPortal->AI())->DespawnAllImp();
|
||||
pPortal->ForcedDespawn();
|
||||
pPortal->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
PortalGUID[i] = 0;
|
||||
@@ -351,7 +351,7 @@ public:
|
||||
if (PortalGUID[i])
|
||||
{
|
||||
if (Creature* pPortal = Unit::GetCreature((*me), PortalGUID[i]))
|
||||
pPortal->ForcedDespawn();
|
||||
pPortal->DespawnOrUnsummon();
|
||||
|
||||
PortalGUID[i] = 0;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void SummonTito();
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellEntry *Spell)
|
||||
@@ -440,7 +440,7 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
@@ -564,7 +564,7 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
@@ -648,7 +648,7 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
@@ -784,7 +784,7 @@ public:
|
||||
if (Creature* pBigBadWolf = pCreature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
|
||||
pBigBadWolf->AI()->AttackStart(pPlayer);
|
||||
|
||||
pCreature->ForcedDespawn();
|
||||
pCreature->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -848,7 +848,7 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
@@ -1086,7 +1086,7 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellEntry *Spell)
|
||||
@@ -1176,7 +1176,7 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*done_by*/, uint32 &damage)
|
||||
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
if (TalkCount > 3)
|
||||
{
|
||||
if (Creature* pSpotlight = Unit::GetCreature(*me, m_uiSpotlightGUID))
|
||||
pSpotlight->ForcedDespawn();
|
||||
pSpotlight->DespawnOrUnsummon();
|
||||
|
||||
SetEscortPaused(false);
|
||||
return;
|
||||
|
||||
@@ -579,7 +579,7 @@ public:
|
||||
Phase = 3;
|
||||
break;
|
||||
case 3:
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1331,7 +1331,7 @@ public:
|
||||
break;
|
||||
|
||||
case 73:
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class boss_arlokk : public CreatureScript
|
||||
m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED);
|
||||
|
||||
//we should be summoned, so despawn
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*pKiller*/)
|
||||
|
||||
@@ -333,7 +333,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,9 +411,9 @@ public:
|
||||
case PHASE_CTHUN_DONE:
|
||||
Creature* pPortal= me->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
|
||||
if (pPortal)
|
||||
pPortal->ForcedDespawn();
|
||||
pPortal->DespawnOrUnsummon();
|
||||
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ public:
|
||||
{
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(GO_END_DOOR));
|
||||
//TODO: leave the area...
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
// we mustn't remove the Creature in the same round in which we cast the summon spell, otherwise there will be no summons
|
||||
if (spellhit && morphtimer >= 5000)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
// walk 5 seconds before summoning
|
||||
@@ -335,7 +335,7 @@ public:
|
||||
{
|
||||
if (Must_Die_Timer <= diff)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
} else Must_Die_Timer -= diff;
|
||||
}
|
||||
@@ -396,7 +396,7 @@ public:
|
||||
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
|
||||
if (!pPlayer)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ public:
|
||||
|
||||
if (id == 57)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ public:
|
||||
{
|
||||
if (must_die_timer <= diff)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
} else must_die_timer -= diff;
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
if (RunAwayTimer)
|
||||
{
|
||||
if (RunAwayTimer <= diff)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
else
|
||||
RunAwayTimer -= diff;
|
||||
|
||||
@@ -611,7 +611,7 @@ public:
|
||||
if (DespawnTimer <= diff)
|
||||
{
|
||||
//once we are able to, despawn us
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
} else DespawnTimer -= diff;
|
||||
}
|
||||
@@ -768,7 +768,7 @@ public:
|
||||
if(FleeTimer)
|
||||
{
|
||||
if(FleeTimer <= diff)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
else FleeTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -445,7 +445,7 @@ public:
|
||||
{
|
||||
case ACTION_SCARAB_SUBMERGE:
|
||||
DoCast(SPELL_SUBMERGE_EFFECT);
|
||||
me->ForcedDespawn(1000);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -216,7 +216,7 @@ public:
|
||||
{
|
||||
m_pInstance->SetData(TYPE_CRUSADERS, FAIL);
|
||||
Summons.DespawnAll();
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
break;
|
||||
case IN_PROGRESS:
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
{
|
||||
m_pInstance->SetData(TYPE_CRUSADERS, DONE);
|
||||
Summons.DespawnAll();
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -277,7 +277,7 @@ struct boss_faction_championsAI : public ScriptedAI
|
||||
if (m_pInstance)
|
||||
if (Creature* pChampionController = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
pChampionController->AI()->SetData(2, FAIL);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
float CalculateThreat(float distance, float armor, uint32 health)
|
||||
|
||||
+5
-5
@@ -332,7 +332,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*pKiller*/)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
if (m_Timer <= uiDiff)
|
||||
{
|
||||
if (m_CountMax && m_CountMax == m_Count)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
else
|
||||
{
|
||||
DoCast(SPELL_INFERNAL_ERUPTION);
|
||||
@@ -394,7 +394,7 @@ public:
|
||||
return;
|
||||
|
||||
if (m_pInstance && m_pInstance->GetData(TYPE_JARAXXUS) != IN_PROGRESS)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
|
||||
if (m_uiFelStreakTimer <= uiDiff)
|
||||
{
|
||||
@@ -464,7 +464,7 @@ public:
|
||||
if (m_Timer <= uiDiff)
|
||||
{
|
||||
if (m_CountMax && m_CountMax == m_Count)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
else
|
||||
{
|
||||
DoCast(SPELL_NETHER_PORTAL);
|
||||
@@ -524,7 +524,7 @@ public:
|
||||
return;
|
||||
|
||||
if (m_pInstance && m_pInstance->GetData(TYPE_JARAXXUS) != IN_PROGRESS)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
|
||||
if (m_uiShivanSlashTimer <= uiDiff)
|
||||
{
|
||||
|
||||
+7
-22
@@ -159,7 +159,7 @@ public:
|
||||
{
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*pWho*/)
|
||||
@@ -287,12 +287,7 @@ public:
|
||||
{
|
||||
case 0: // JUMP!? Fuck! THAT'S BEEZARR! Would someone PLEASE make MotionMaster->Move* work better?
|
||||
if (m_bTargetDied)
|
||||
{
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -392,15 +387,8 @@ struct boss_jormungarAI : public ScriptedAI
|
||||
{
|
||||
instanceScript->SetData(TYPE_NORTHREND_BEASTS, SNAKES_DONE);
|
||||
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
|
||||
if (TempSummon* summ = otherWorm->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
otherWorm->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
otherWorm->DespawnOrUnsummon();
|
||||
}
|
||||
else
|
||||
instanceScript->SetData(TYPE_NORTHREND_BEASTS, SNAKES_SPECIAL);
|
||||
@@ -413,10 +401,7 @@ struct boss_jormungarAI : public ScriptedAI
|
||||
if (instanceScript && instanceScript->GetData(TYPE_NORTHREND_BEASTS) != FAIL)
|
||||
instanceScript->SetData(TYPE_NORTHREND_BEASTS, FAIL);
|
||||
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *pWho)
|
||||
@@ -674,7 +659,7 @@ public:
|
||||
{
|
||||
casted = false;
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->ForcedDespawn(60*IN_MILLISECONDS);
|
||||
me->DespawnOrUnsummon(60*IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 /*uiDiff*/)
|
||||
@@ -775,7 +760,7 @@ public:
|
||||
{
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *pWho)
|
||||
|
||||
+3
-3
@@ -169,7 +169,7 @@ struct boss_twin_baseAI : public ScriptedAI
|
||||
m_pInstance->SetData(TYPE_VALKIRIES, FAIL);
|
||||
m_pInstance->SetData(DATA_HEALTH_TWIN_SHARED, me->GetMaxHealth());
|
||||
}
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiId)
|
||||
@@ -623,7 +623,7 @@ public:
|
||||
{
|
||||
DoCastAOE(SPELL_UNLEASHED_DARK);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->ForcedDespawn(500);
|
||||
me->DespawnOrUnsummon(500);
|
||||
}
|
||||
m_uiRangeCheckTimer = IN_MILLISECONDS;
|
||||
}
|
||||
@@ -657,7 +657,7 @@ public:
|
||||
{
|
||||
DoCastAOE(SPELL_UNLEASHED_LIGHT);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->ForcedDespawn(500);
|
||||
me->DespawnOrUnsummon(500);
|
||||
}
|
||||
m_uiRangeCheckTimer = IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
+4
-4
@@ -325,7 +325,7 @@ class boss_lich_king_toc : public CreatureScript
|
||||
Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_ANUBARAK));
|
||||
if (!pTemp || !pTemp->isAlive())
|
||||
pTemp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
m_pInstance->SetData(TYPE_EVENT, 0);
|
||||
m_uiUpdateTimer = 20000;
|
||||
break;
|
||||
@@ -472,9 +472,9 @@ class npc_fizzlebang_toc : public CreatureScript
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, m_pInstance->GetData64(NPC_JARAXXUS)))
|
||||
pTemp->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
|
||||
if (Creature* pTrigger = Unit::GetCreature(*me, m_uiTriggerGUID))
|
||||
pTrigger->ForcedDespawn();
|
||||
pTrigger->DespawnOrUnsummon();
|
||||
if (Creature* pPortal = Unit::GetCreature(*me, m_uiPortalGUID))
|
||||
pPortal->ForcedDespawn();
|
||||
pPortal->DespawnOrUnsummon();
|
||||
m_pInstance->SetData(TYPE_EVENT, 1144);
|
||||
m_uiUpdateTimer = 10000;
|
||||
break;
|
||||
@@ -806,7 +806,7 @@ class npc_tirion_toc : public CreatureScript
|
||||
} else m_pInstance->SetData(TYPE_EVENT, 6030);
|
||||
break;
|
||||
case 6020:
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
m_uiUpdateTimer = 5000;
|
||||
m_pInstance->SetData(TYPE_EVENT, 6030);
|
||||
break;
|
||||
|
||||
@@ -379,7 +379,7 @@ class boss_krick : public CreatureScript
|
||||
case EVENT_OUTRO_1:
|
||||
{
|
||||
if (Creature* temp = me->GetCreature(*me, _instanceScript->GetData64(DATA_JAINA_SYLVANAS_1)))
|
||||
temp->ForcedDespawn();
|
||||
temp->DespawnOrUnsummon();
|
||||
|
||||
Creature* jainaOrSylvanas = NULL;
|
||||
if (_instanceScript->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
|
||||
@@ -599,7 +599,7 @@ class spell_exploding_orb_hasty_grow : public SpellScriptLoader
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_AUTO_GROW);
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_EXPLODING_ORB);
|
||||
if (Creature* creature = GetTarget()->ToCreature())
|
||||
creature->ForcedDespawn(1000);
|
||||
creature->DespawnOrUnsummon(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ class boss_tyrannus : public CreatureScript
|
||||
if (Creature* rimefang = GetRimefang())
|
||||
rimefang->AI()->EnterEvadeMode();
|
||||
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
|
||||
@@ -1373,12 +1373,7 @@ class spell_taldaram_flame_ball_visual : public SpellScriptLoader
|
||||
target->AI()->DoAction(ACTION_FLAME_BALL_CHASE);
|
||||
}
|
||||
else // SPELL_FLAME_SPHERE_DEATH_EFFECT
|
||||
{
|
||||
if (TempSummon* summ = target->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
target->ForcedDespawn();
|
||||
}
|
||||
target->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -643,8 +643,8 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
else if (id == POINT_FINAL)
|
||||
{
|
||||
if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID))
|
||||
deathbringer->ForcedDespawn();
|
||||
me->ForcedDespawn();
|
||||
deathbringer->DespawnOrUnsummon();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,7 +908,7 @@ class npc_saurfang_event : public CreatureScript
|
||||
if (action == ACTION_CHARGE && uiNPCindex)
|
||||
me->GetMotionMaster()->MoveCharge(chargePos[uiNPCindex].GetPositionX(), chargePos[uiNPCindex].GetPositionY(), chargePos[uiNPCindex].GetPositionZ(), 13.0f, POINT_CHARGE);
|
||||
else if (action == ACTION_DESPAWN)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -291,10 +291,7 @@ class npc_coldflame : public CreatureScript
|
||||
target = creOwner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true); // or the tank if its solo
|
||||
if (!target)
|
||||
{
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -363,17 +360,15 @@ class npc_bone_spike : public CreatureScript
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
{
|
||||
if (Unit* trapped = summ->GetSummoner())
|
||||
trapped->RemoveAurasDueToSpell(SPELL_IMPALED);
|
||||
summ->UnSummon();
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
me->DespawnOrUnsummon();
|
||||
victim->RemoveAurasDueToSpell(SPELL_IMPALED);
|
||||
}
|
||||
|
||||
|
||||
@@ -717,10 +717,8 @@ class npc_volatile_ooze : public CreatureScript
|
||||
AttackStart(target);
|
||||
me->CastCustomSpell(SPELL_VOLATILE_OOZE_ADHESIVE, SPELLVALUE_MAX_TARGETS, 1, target, false);
|
||||
}
|
||||
else if (TempSummon* summ = me->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
else
|
||||
newTargetSelectTimer -= diff;
|
||||
@@ -815,10 +813,8 @@ class spell_putricide_expunged_gas : public SpellScriptLoader
|
||||
for (uint8 i = 1; i < stack; ++i)
|
||||
dmg += mod * stack;
|
||||
}
|
||||
else if (TempSummon* summ = GetCaster()->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
GetCaster()->ToCreature()->ForcedDespawn();
|
||||
GetCaster()->ToCreature()->DespawnOrUnsummon();
|
||||
|
||||
SetHitDamage(dmg);
|
||||
}
|
||||
@@ -1091,10 +1087,7 @@ class spell_putricide_eat_ooze : public SpellScriptLoader
|
||||
{
|
||||
target->RemoveAurasDueToSpell(SPELL_GROW_STACKER);
|
||||
target->RemoveAura(grow);
|
||||
if (TempSummon* summ = target->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
target->ForcedDespawn();
|
||||
target->DespawnOrUnsummon();
|
||||
}
|
||||
else
|
||||
grow->ModStackAmount(-4);
|
||||
|
||||
@@ -270,13 +270,10 @@ class npc_little_ooze : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
{
|
||||
summ->UnSummon();
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
rotface->AI()->SummonedCreatureDespawn(me);
|
||||
}
|
||||
me->DespawnOrUnsummon();
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
rotface->AI()->SummonedCreatureDespawn(me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -332,13 +329,10 @@ class npc_big_ooze : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
{
|
||||
summ->UnSummon();
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
rotface->AI()->SummonedCreatureDespawn(me);
|
||||
}
|
||||
me->DespawnOrUnsummon();
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE)))
|
||||
rotface->AI()->SummonedCreatureDespawn(me);
|
||||
}
|
||||
|
||||
void DoAction(const int32 action)
|
||||
@@ -501,16 +495,13 @@ class spell_rotface_little_ooze_combine : public SpellScriptLoader
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!(GetHitUnit() && GetHitUnit()->isAlive()))
|
||||
if (!(GetHitCreature() && GetHitUnit()->isAlive()))
|
||||
return;
|
||||
|
||||
GetCaster()->RemoveAurasDueToSpell(SPELL_LITTLE_OOZE_COMBINE);
|
||||
GetHitUnit()->RemoveAurasDueToSpell(SPELL_LITTLE_OOZE_COMBINE);
|
||||
GetHitUnit()->CastSpell(GetCaster(), SPELL_OOZE_MERGE, true);
|
||||
if (TempSummon* summ = GetHitUnit()->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else
|
||||
GetHitCreature()->ForcedDespawn();
|
||||
GetHitCreature()->RemoveAurasDueToSpell(SPELL_LITTLE_OOZE_COMBINE);
|
||||
GetHitCreature()->CastSpell(GetCaster(), SPELL_OOZE_MERGE, true);
|
||||
GetHitCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -536,12 +527,12 @@ class spell_rotface_large_ooze_combine : public SpellScriptLoader
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!(GetHitUnit() && GetHitUnit()->isAlive()))
|
||||
if (!(GetHitCreature() && GetHitCreature()->isAlive()))
|
||||
return;
|
||||
|
||||
if (Aura* unstable = GetCaster()->GetAura(SPELL_UNSTABLE_OOZE))
|
||||
{
|
||||
if (Aura* targetAura = GetHitUnit()->GetAura(SPELL_UNSTABLE_OOZE))
|
||||
if (Aura* targetAura = GetHitCreature()->GetAura(SPELL_UNSTABLE_OOZE))
|
||||
unstable->ModStackAmount(targetAura->GetStackAmount());
|
||||
else
|
||||
unstable->ModStackAmount(1);
|
||||
@@ -550,13 +541,9 @@ class spell_rotface_large_ooze_combine : public SpellScriptLoader
|
||||
}
|
||||
|
||||
// just for safety
|
||||
GetHitUnit()->RemoveAurasDueToSpell(SPELL_LARGE_OOZE_BUFF_COMBINE);
|
||||
GetHitUnit()->RemoveAurasDueToSpell(SPELL_LARGE_OOZE_COMBINE);
|
||||
|
||||
if (TempSummon* summ = GetHitUnit()->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else if (GetHitCreature())
|
||||
GetHitCreature()->ForcedDespawn();
|
||||
GetHitCreature()->RemoveAurasDueToSpell(SPELL_LARGE_OOZE_BUFF_COMBINE);
|
||||
GetHitCreature()->RemoveAurasDueToSpell(SPELL_LARGE_OOZE_COMBINE);
|
||||
GetHitCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -582,7 +569,7 @@ class spell_rotface_large_ooze_buff_combine : public SpellScriptLoader
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!(GetHitUnit() && GetHitUnit()->isAlive()))
|
||||
if (!(GetHitCreature() && GetHitCreature()->isAlive()))
|
||||
return;
|
||||
|
||||
if (Aura* unstable = GetCaster()->GetAura(SPELL_UNSTABLE_OOZE))
|
||||
@@ -611,10 +598,7 @@ class spell_rotface_large_ooze_buff_combine : public SpellScriptLoader
|
||||
}
|
||||
}
|
||||
|
||||
if (TempSummon* summ = GetHitUnit()->ToTempSummon())
|
||||
summ->UnSummon();
|
||||
else if (GetHitCreature())
|
||||
GetHitCreature()->ForcedDespawn();
|
||||
GetHitCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
pSpark->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
|
||||
}
|
||||
else
|
||||
pSpark->ForcedDespawn();
|
||||
pSpark->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,7 +331,7 @@ public:
|
||||
return;
|
||||
|
||||
if (uiPointId == DATA_POINT_CALLBACK)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit * /*pDoneBy*/, uint32 &uiDamage)
|
||||
@@ -344,7 +344,7 @@ public:
|
||||
// Despawn if the encounter is not running
|
||||
if (pInstance && pInstance->GetData(TYPE_IONAR) != IN_PROGRESS)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ public:
|
||||
}
|
||||
}
|
||||
else
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
uiCheckTimer = 2*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (pTemp->isAlive())
|
||||
pTemp->ForcedDespawn();
|
||||
pTemp->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ public:
|
||||
// This is the dummy effect of the spells
|
||||
if (pSpell->Id == SPELL_SHATTER_N || pSpell->Id == SPELL_SHATTER_H)
|
||||
if (me->GetEntry() == NPC_BRITTLE_GOLEM)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
|
||||
@@ -343,7 +343,7 @@ public:
|
||||
{
|
||||
Creature* pTemp = Unit::GetCreature(*me, pInstance ? (*itr) : 0);
|
||||
if (pTemp && pTemp->isAlive())
|
||||
pTemp->ForcedDespawn();
|
||||
pTemp->DespawnOrUnsummon();
|
||||
}
|
||||
lDwarfGUIDList.clear();
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (pTemp->isAlive())
|
||||
pTemp->ForcedDespawn();
|
||||
pTemp->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
m_lCollapsingStarGUIDList.clear();
|
||||
|
||||
@@ -511,7 +511,7 @@ public:
|
||||
me->setFaction(16); // Same faction as bosses
|
||||
DoCast(SPELL_RUNE_OF_POWER);
|
||||
|
||||
me->ForcedDespawn(60000);
|
||||
me->DespawnOrUnsummon(60000);
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -572,7 +572,7 @@ public:
|
||||
{
|
||||
me->CastSpell(me, SPELL_RUNE_OF_SUMMONING_SUMMON, false);
|
||||
if (++summonCount == 10) // TODO: Find out if this amount is right
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
else
|
||||
summonTimer = 2000; // TODO: Find out of timer is right
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
me->RemoveAllAuras();
|
||||
DoCast(me, SPELL_SARONITE_VAPORS);
|
||||
me->ForcedDespawn(30000);
|
||||
me->DespawnOrUnsummon(30000);
|
||||
|
||||
if (Creature * pVezax = me->GetCreature(*me, pInstance ? pInstance->GetData64(TYPE_VEZAX) : 0))
|
||||
pVezax->AI()->DoAction(ACTION_VAPORS_DIE);
|
||||
|
||||
@@ -330,7 +330,7 @@ public:
|
||||
if (pIgnis->AI())
|
||||
pIgnis->AI()->DoAction(ACTION_REMOVE_BUFF);
|
||||
|
||||
me->ForcedDespawn(1000);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -616,7 +616,7 @@ public:
|
||||
pXT002->ModifyHealth(int32(pXT002->CountPctFromMaxHealth(1)));
|
||||
|
||||
// Despawns the scrapbot
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -739,7 +739,7 @@ public:
|
||||
DoCast(me, SPELL_BOOM);
|
||||
|
||||
//Despawns the boombot
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
break;
|
||||
case CREATURE_TRIGGER:
|
||||
pSummoned->CastSpell((Unit*)NULL, SPELL_FREEZING_CLOUD, true);
|
||||
pSummoned->ForcedDespawn(10*IN_MILLISECONDS);
|
||||
pSummoned->DespawnOrUnsummon(10*IN_MILLISECONDS);
|
||||
break;
|
||||
}
|
||||
Summons.Summon(pSummoned);
|
||||
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetDisplayId(DATA_SVALA_DISPLAY_ID);
|
||||
pArthas->ToTempSummon()->UnSummon();
|
||||
pArthas->DespawnOrUnsummon();
|
||||
uiArthasGUID = 0;
|
||||
Phase = FINISHED;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ class mob_tempest_minion : public CreatureScript
|
||||
if (overchargedAura->GetStackAmount() == 10)
|
||||
{
|
||||
DoCast(me, SPELL_OVERCHARGED_BLAST);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
DoScriptText(EMOTE_MINION_RESPAWN, me);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
if (killTimer <= diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
killTimer = 10000;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
pInstance->SetData(DATA_REMOVE_NPC, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
{
|
||||
if (pIchoron->AI())
|
||||
pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_HIT);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
|
||||
if (pInstance->GetData(DATA_REMOVE_NPC) == 1)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
pInstance->SetData(DATA_REMOVE_NPC, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -775,7 +775,7 @@ public:
|
||||
break;
|
||||
|
||||
case 7:
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
IntroPhase = 0;
|
||||
IntroTimer = 0;
|
||||
break;
|
||||
|
||||
@@ -591,7 +591,7 @@ public:
|
||||
void MovementInform(uint32, uint32 id)
|
||||
{
|
||||
if (id == 1)
|
||||
me->ForcedDespawn(DespawnTimer);
|
||||
me->DespawnOrUnsummon(DespawnTimer);
|
||||
}
|
||||
|
||||
void SpellHit(Unit *caster, const SpellEntry *spell)
|
||||
@@ -606,7 +606,7 @@ public:
|
||||
else
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->ForcedDespawn(DespawnTimer);
|
||||
me->DespawnOrUnsummon(DespawnTimer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
case 23:
|
||||
if (pPlayer)
|
||||
pPlayer->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
case 5:
|
||||
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f))
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
switch(i)
|
||||
{
|
||||
case 26:
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
uiDamage = 0;
|
||||
CAST_PLR(pDoneBy)->KilledMonsterCredit(NPC_ARGENT_VALIANT_CREDIT,0);
|
||||
me->setFaction(35);
|
||||
me->ForcedDespawn(5000);
|
||||
me->DespawnOrUnsummon(5000);
|
||||
me->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ public:
|
||||
if (spellId)
|
||||
pPlayer->CastSpell(pPlayer, spellId, true);
|
||||
DoScriptText(SAY_DWARF_HELP, pCreature);
|
||||
pCreature->ForcedDespawn();
|
||||
pCreature->DespawnOrUnsummon();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1153,10 +1153,8 @@ public:
|
||||
{
|
||||
if (!SummonList.empty())
|
||||
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, *itr))
|
||||
pTemp->ForcedDespawn();
|
||||
}
|
||||
pTemp->DespawnOrUnsummon();
|
||||
|
||||
if (Player* pPlayer = pKiller->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
pPlayer->GetCharmerOrOwnerPlayerOrPlayerItself()->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_FROM_BEYOND, pKiller);
|
||||
|
||||
@@ -300,7 +300,7 @@ public:
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
|
||||
DoCast(me, SPELL_ETHEREAL_APPRENTICE, true);
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
} else Apprentice_Timer -= diff;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
{
|
||||
if (Creature* Essence = Unit::GetCreature(*me, EssenceGUID))
|
||||
{
|
||||
Essence->ForcedDespawn();
|
||||
Essence->DespawnOrUnsummon();
|
||||
}
|
||||
EssenceGUID = 0;
|
||||
}
|
||||
@@ -324,7 +324,7 @@ public:
|
||||
{
|
||||
DoScriptText(DESI_SAY_AFTER, Essence);
|
||||
}
|
||||
Essence->ForcedDespawn();
|
||||
Essence->DespawnOrUnsummon();
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE,0);
|
||||
EssenceGUID = 0;
|
||||
SoulCount = 0;
|
||||
|
||||
+2
-2
@@ -338,7 +338,7 @@ public:
|
||||
Creature* pCreature = Unit::GetCreature((*me), InnderDemon[i]);
|
||||
if (pCreature && pCreature->isAlive())
|
||||
{
|
||||
pCreature->ForcedDespawn();
|
||||
pCreature->DespawnOrUnsummon();
|
||||
}
|
||||
InnderDemon[i] = 0;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ public:
|
||||
if (Demon)
|
||||
{
|
||||
if (Creature* pDemon = Unit::GetCreature(*me, Demon))
|
||||
pDemon->ForcedDespawn();
|
||||
pDemon->DespawnOrUnsummon();
|
||||
}
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE);
|
||||
|
||||
+1
-1
@@ -337,7 +337,7 @@ public:
|
||||
DoCast(me->getVictim(), SPELL_GLOBULE_EXPLOSION);
|
||||
|
||||
//despawn
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
Check_Timer = 500;
|
||||
|
||||
@@ -180,7 +180,7 @@ class mob_abyssal : public CreatureScript
|
||||
|
||||
if (Despawn_Timer <= diff)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
else Despawn_Timer -= diff;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
pCreatureTarget->AI()->AttackStart(GetCaster());
|
||||
|
||||
if (_despawnTime)
|
||||
pCreatureTarget->ForcedDespawn(_despawnTime);
|
||||
pCreatureTarget->DespawnOrUnsummon(_despawnTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
if (uiNewEntry)
|
||||
{
|
||||
pCreatureTarget->UpdateEntry(uiNewEntry);
|
||||
pCreatureTarget->ForcedDespawn(DESPAWN_TIME);
|
||||
pCreatureTarget->DespawnOrUnsummon(DESPAWN_TIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -460,7 +460,7 @@ public:
|
||||
}
|
||||
pCaster->CastSpell(pCaster, spellId, true, castItem);
|
||||
pCaster->CastSpell(pCaster, SPELL_ROBOT_KILL_CREDIT, true);
|
||||
pTarget->ForcedDespawn();
|
||||
pTarget->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -652,7 +652,7 @@ public:
|
||||
{
|
||||
pPlayer->CastSpell(pPlayer, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL);
|
||||
pPlayer->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, 0);
|
||||
pTarget->ForcedDespawn();
|
||||
pTarget->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1965,7 +1965,7 @@ public:
|
||||
despawnTimer -= diff;
|
||||
else
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2073,7 +2073,7 @@ public:
|
||||
else
|
||||
{
|
||||
if (uiDespawnTimer <= uiDiff)
|
||||
me->ForcedDespawn();
|
||||
me->DespawnOrUnsummon();
|
||||
else
|
||||
uiDespawnTimer -= uiDiff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user