refactor(Core): DespawnOrUnsummon (#23141)

This commit is contained in:
天鹭 2025-10-13 14:36:23 +08:00 committed by GitHub
parent 8e2e30328f
commit 53238a68d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
148 changed files with 363 additions and 366 deletions

View file

@ -50,9 +50,9 @@ AISpellInfoType* GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i];
* @param WorldObject target The target of the speech, in case it has elements such as $n, where the target's name will be referrenced.
* @param Milliseconds delay Delay until the creature says the text line. Creatures will talk immediately by default.
*/
void CreatureAI::Talk(uint8 id, WorldObject const* target /*= nullptr*/, Milliseconds delay /*= 0s*/)
void CreatureAI::Talk(uint8 id, WorldObject const* target /*= nullptr*/, Milliseconds delay /*= 0ms*/)
{
if (delay > Seconds::zero())
if (delay > 0ms)
{
ObjectGuid targetGuid;

View file

@ -94,7 +94,7 @@ public:
EVADE_REASON_OTHER
};
void Talk(uint8 id, WorldObject const* whisperTarget = nullptr, Milliseconds delay = 0s);
void Talk(uint8 id, WorldObject const* whisperTarget = nullptr, Milliseconds delay = 0ms);
void Talk(uint8 id, Milliseconds delay) { Talk(id, nullptr, delay); }
WorldObject* GetSummoner() const;

View file

@ -68,7 +68,7 @@ void SummonList::DespawnEntry(uint32 entry)
}
}
void SummonList::DespawnAll(uint32 delay /*= 0*/)
void SummonList::DespawnAll(Milliseconds delay /*= 0ms*/)
{
while (!storage_.empty())
{
@ -325,13 +325,13 @@ void ScriptedAI::ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax
return;
}
scheduler.Schedule(timerMin == 0s ? timerMax : timerMin, timerMax, [exec, repeatMin, repeatMax, uniqueId](TaskContext context)
scheduler.Schedule(timerMin == 0ms ? timerMax : timerMin, timerMax, [exec, repeatMin, repeatMax, uniqueId](TaskContext context)
{
exec();
if (!uniqueId)
{
repeatMax > 0s ? context.Repeat(repeatMin, repeatMax) : context.Repeat(repeatMin);
repeatMax > 0ms ? context.Repeat(repeatMin, repeatMax) : context.Repeat(repeatMin);
}
});
@ -654,7 +654,7 @@ void BossAI::_JustEngagedWith()
ScheduleTasks();
if (callForHelpRange)
{
ScheduleTimedEvent(0s, [&]
ScheduleTimedEvent(0ms, [&]
{
me->CallForHelp(callForHelpRange);
}, 2s);

View file

@ -88,7 +88,7 @@ public:
void Summon(Creature const* summon) { storage_.push_back(summon->GetGUID()); }
void Despawn(Creature const* summon) { storage_.remove(summon->GetGUID()); }
void DespawnEntry(uint32 entry);
void DespawnAll(uint32 delay = 0);
void DespawnAll(Milliseconds delay = 0ms);
bool IsAnyCreatureAlive() const;
bool IsAnyCreatureWithEntryAlive(uint32 entry) const;
bool IsAnyCreatureInCombat() const;
@ -355,11 +355,11 @@ struct ScriptedAI : public CreatureAI
void ClearUniqueTimedEventsDone() { _uniqueTimedEvents.clear(); }
// Schedules a timed event using task scheduler.
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function<void()> exec, Milliseconds repeatMin, Milliseconds repeatMax = 0s, uint32 uniqueId = 0);
void ScheduleTimedEvent(Milliseconds timerMax, std::function<void()> exec, Milliseconds repeatMin, Milliseconds repeatMax = 0s, uint32 uniqueId = 0) { ScheduleTimedEvent(0s, timerMax, exec, repeatMin, repeatMax, uniqueId); };
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function<void()> exec, Milliseconds repeatMin, Milliseconds repeatMax = 0ms, uint32 uniqueId = 0);
void ScheduleTimedEvent(Milliseconds timerMax, std::function<void()> exec, Milliseconds repeatMin, Milliseconds repeatMax = 0ms, uint32 uniqueId = 0) { ScheduleTimedEvent(0ms, timerMax, exec, repeatMin, repeatMax, uniqueId); };
// Schedules a timed event using task scheduler that never repeats. Requires an unique non-zero ID.
void ScheduleUniqueTimedEvent(Milliseconds timer, std::function<void()> exec, uint32 uniqueId) { ScheduleTimedEvent(0s, timer, exec, 0s, 0s, uniqueId); };
void ScheduleUniqueTimedEvent(Milliseconds timer, std::function<void()> exec, uint32 uniqueId) { ScheduleTimedEvent(0ms, timer, exec, 0ms, 0ms, uniqueId); };
bool HealthBelowPct(uint32 pct) const { return me->HealthBelowPct(pct); }
bool HealthAbovePct(uint32 pct) const { return me->HealthAbovePct(pct); }
@ -463,7 +463,7 @@ enum HealthCheckStatus
struct HealthCheckEventData
{
HealthCheckEventData(uint8 healthPct, std::function<void()> exec, uint8 status = HEALTH_CHECK_SCHEDULED, bool allowedWhileCasting = true, Milliseconds Delay = 0s) : _healthPct(healthPct), _exec(exec), _status(status), _allowedWhileCasting(allowedWhileCasting), _delay(Delay) { };
HealthCheckEventData(uint8 healthPct, std::function<void()> exec, uint8 status = HEALTH_CHECK_SCHEDULED, bool allowedWhileCasting = true, Milliseconds Delay = 0ms) : _healthPct(healthPct), _exec(exec), _status(status), _allowedWhileCasting(allowedWhileCasting), _delay(Delay) { };
uint8 _healthPct;
std::function<void()> _exec;

View file

@ -410,7 +410,7 @@ void SmartAI::UpdatePath(const uint32 diff)
// Xinef: allow to properly hook out of range despawn action, which in most cases should perform the same operation as dying
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, me);
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
return;
}
mEscortInvokerCheckTimer = 1000;

View file

@ -415,7 +415,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
{
for (GuidUnorderedSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
if (Creature* creature = GetCreature(*itr))
creature->DespawnOrUnsummon(1);
creature->DespawnOrUnsummon(1ms);
m_vehicles[team].clear();
}

View file

@ -251,7 +251,7 @@ CreatureBaseStats const* CreatureBaseStats::GetBaseStats(uint8 level, uint8 unit
bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{
m_owner.DespawnOrUnsummon(0s, m_respawnTimer); // since we are here, we are not TempSummon as object type cannot change during runtime
m_owner.DespawnOrUnsummon(0ms, m_respawnTimer); // since we are here, we are not TempSummon as object type cannot change during runtime
return true;
}
@ -2174,12 +2174,12 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds forceRespawnTimer)
// Xinef: Set new respawn time, ignore corpse decay time...
RemoveCorpse(true);
if (forceRespawnTimer > Seconds::zero())
if (forceRespawnTimer > 0s)
if (GetMap())
GetMap()->ScheduleCreatureRespawn(GetGUID(), forceRespawnTimer);
}
void Creature::DespawnOrUnsummon(Milliseconds msTimeToDespawn /*= 0*/, Seconds forcedRespawnTimer)
void Creature::DespawnOrUnsummon(Milliseconds msTimeToDespawn /*= 0ms*/, Seconds forcedRespawnTimer /*= 0s*/)
{
if (TempSummon* summon = this->ToTempSummon())
summon->UnSummon(msTimeToDespawn.count());
@ -2204,7 +2204,7 @@ void Creature::DespawnOnEvade(Seconds respawnDelay)
return;
}
DespawnOrUnsummon(Milliseconds(0), respawnDelay);
DespawnOrUnsummon(0ms, respawnDelay);
}
void Creature::InitializeReactState()

View file

@ -283,8 +283,7 @@ public:
void RemoveCorpse(bool setSpawnTime = true, bool skipVisibility = false);
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer);
void DespawnOrUnsummon(uint32 msTimeToDespawn = 0) { DespawnOrUnsummon(Milliseconds(msTimeToDespawn), 0s); };
void DespawnOrUnsummon(Milliseconds msTimeToDespawn = 0ms, Seconds forcedRespawnTimer = 0s);
void DespawnOnEvade(Seconds respawnDelay = 20s);
[[nodiscard]] time_t const& GetRespawnTime() const { return m_respawnTime; }

View file

@ -929,7 +929,7 @@ void GameObject::AddUniqueUse(Player* player)
m_unique_users.insert(player->GetGUID());
}
void GameObject::DespawnOrUnsummon(Milliseconds delay, Seconds forceRespawnTime)
void GameObject::DespawnOrUnsummon(Milliseconds delay /*= 0ms*/, Seconds forceRespawnTime /*= 0s*/)
{
if (delay > 0ms)
{

View file

@ -692,7 +692,7 @@ void Pet::Update(uint32 diff)
}
}
if (m_duration > 0s)
if (m_duration > 0ms)
{
if (m_duration > _diff)
m_duration -= _diff;
@ -708,7 +708,7 @@ void Pet::Update(uint32 diff)
if (getPowerType() == POWER_FOCUS)
{
m_petRegenTimer -= _diff;
if (m_petRegenTimer <= 0s)
if (m_petRegenTimer <= 0ms)
{
m_petRegenTimer += PET_FOCUS_REGEN_INTERVAL;
Regenerate(POWER_FOCUS);
@ -1026,7 +1026,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
Unit* owner = GetOwner();
if (!owner) // just to be sure, asynchronous now
{
DespawnOrUnsummon(1000);
DespawnOrUnsummon(1s);
return false;
}

View file

@ -52,7 +52,7 @@ public:
PetType getPetType() const { return m_petType; }
void setPetType(PetType type) { m_petType = type; }
bool isControlled() const { return getPetType() == SUMMON_PET || getPetType() == HUNTER_PET; }
bool isTemporarySummoned() const { return m_duration > 0s; }
bool isTemporarySummoned() const { return m_duration > 0ms; }
bool IsPermanentPetFor(Player* owner) const; // pet have tab in character windows and set UNIT_FIELD_PETNUMBER

View file

@ -9014,7 +9014,7 @@ Pet* Player::GetPet() const
return nullptr;
}
Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration /*= 0s*/, uint32 healthPct /*= 0*/)
Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration /*= 0ms*/, uint32 healthPct /*= 0*/)
{
PetStable& petStable = GetOrInitPetStable();
@ -9035,7 +9035,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
++itr;
}
if (duration > 0s)
if (duration > 0ms)
pet->SetDuration(duration);
// Generate a new name for the newly summoned ghoul
@ -9129,7 +9129,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
}
}
if (duration > 0s)
if (duration > 0ms)
pet->SetDuration(duration);
if (NeedSendSpectatorData() && pet->GetCreatureTemplate()->family)

View file

@ -1210,7 +1210,7 @@ public:
[[nodiscard]] PetStable const* GetPetStable() const { return m_petStable.get(); }
[[nodiscard]] Pet* GetPet() const;
Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration = 0s, uint32 healthPct = 0);
Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration = 0ms, uint32 healthPct = 0);
void RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent = false);
bool CanPetResurrect();
bool IsExistPet();

View file

@ -19681,7 +19681,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
else if (vehicleBase->IsCreature())
{
vehicle->Uninstall();
vehicleBase->m_Events.AddEvent(new VehicleDespawnEvent(*vehicleBase, 2000), vehicleBase->m_Events.CalculateTime(2000));
vehicleBase->m_Events.AddEventAtOffset(new VehicleDespawnEvent(*vehicleBase, 2s), 2s);
}
// xinef: ugly hack, no appripriate hook later to cast spell

View file

@ -100,12 +100,12 @@ private:
class VehicleDespawnEvent : public BasicEvent
{
public:
VehicleDespawnEvent(Unit& self, uint32 duration) : _self(self), _duration(duration) { }
VehicleDespawnEvent(Unit& self, Milliseconds duration) : _self(self), _duration(duration) { }
bool Execute(uint64 e_time, uint32 p_time) override;
protected:
Unit& _self;
uint32 _duration;
Milliseconds _duration;
};
#endif

View file

@ -757,7 +757,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->DespawnOrUnsummon(step.script->DespawnSelf.DespawnDelay);
cSource->DespawnOrUnsummon(Milliseconds(step.script->DespawnSelf.DespawnDelay));
break;
case SCRIPT_COMMAND_LOAD_PATH:

View file

@ -5213,7 +5213,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
{
// Position passed to SummonPet is irrelevant with current implementation,
// pet will be relocated without using these coords in Pet::LoadPetFromDB
player->SummonPet(0, 0.0f, 0.0f, 0.0f, 0.0f, SUMMON_PET, 0s, damage);
player->SummonPet(0, 0.0f, 0.0f, 0.0f, 0.0f, SUMMON_PET, 0ms, damage);
return;
}

View file

@ -162,7 +162,7 @@ void WorldUpdateTime::SetRecordUpdateTimeInterval(Milliseconds t)
void WorldUpdateTime::RecordUpdateTime(Milliseconds gameTimeMs, uint32 diff, uint32 sessionCount)
{
if (_recordUpdateTimeInverval > 0s && diff > _recordUpdateTimeMin.count())
if (_recordUpdateTimeInverval > 0ms && diff > _recordUpdateTimeMin.count())
{
if (GetMSTimeDiff(_lastRecordTime, gameTimeMs) > _recordUpdateTimeInverval)
{

View file

@ -1046,7 +1046,7 @@ public:
break;
case EVENT_VAEL_3_DESPAWN:
DoCast(me, SPELL_VAELASTRASZ_SPAWN);
me->DespawnOrUnsummon(1500);
me->DespawnOrUnsummon(1500ms);
break;
default:
break;

View file

@ -435,7 +435,7 @@ public:
break;
case EVENT_SUCCESS_2:
DoCast(me, SPELL_VAELASTRASZZ_SPAWN);
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
break;
case EVENT_PATH_3:
me->GetMotionMaster()->MovePath(NEFARIUS_PATH_3, false);

View file

@ -199,7 +199,7 @@ class spell_mc_play_dead_aura : public AuraScript
else
{
Unit::Kill(creatureTarget, creatureTarget);
creatureTarget->DespawnOrUnsummon(14000);
creatureTarget->DespawnOrUnsummon(14s);
}
}

View file

@ -146,7 +146,7 @@ public:
{
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
player->GroupEventHappens(QUEST_A_FINE_MESS, me);
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
}
}

View file

@ -88,7 +88,7 @@ struct npc_kilrek : public ScriptedAI
DoCast(Terestian, SPELL_BROKEN_PACT, true);
}
}
me->DespawnOrUnsummon(15000);
me->DespawnOrUnsummon(15s);
}
void UpdateAI(uint32 diff) override

View file

@ -523,9 +523,9 @@ public:
}
}
me->DespawnOrUnsummon(100);
me->DespawnOrUnsummon(100ms);
if (Creature* arca = ObjectAccessor::GetCreature((*me), ArcanagosGUID))
arca->DespawnOrUnsummon(100);
arca->DespawnOrUnsummon(100ms);
return 5000;
default:

View file

@ -141,7 +141,7 @@ struct boss_vexallus : public BossAI
void SummonedCreatureDies(Creature* summon, Unit* killer) override
{
summons.Despawn(summon);
summon->DespawnOrUnsummon(1);
summon->DespawnOrUnsummon(1ms);
if (killer)
killer->CastSpell(killer, SPELL_ENERGY_FEEDBACK, true, 0, 0, summon->GetGUID());
}

View file

@ -230,7 +230,7 @@ public:
me->RemoveAllAuras();
me->CastSpell(attacker, SPELL_DUEL_VICTORY, true);
me->RestoreFaction();
me->DespawnOrUnsummon(10000);
me->DespawnOrUnsummon(10s);
}
}
}
@ -407,7 +407,7 @@ public:
{
if (type == POINT_MOTION_TYPE && point == 1)
{
me->DespawnOrUnsummon(1500);
me->DespawnOrUnsummon(1500ms);
me->CastSpell(me, SPELL_GHOUL_SUBMERGE, true);
}
}

View file

@ -692,7 +692,7 @@ public:
orbaz->SetReactState(REACT_PASSIVE);
orbaz->AI()->Talk(EMOTE_LIGHT_OF_DAWN04);
orbaz->GetMotionMaster()->MovePoint(2, LightOfDawnPos[2], true, true);
orbaz->DespawnOrUnsummon(7000);
orbaz->DespawnOrUnsummon(7s);
}
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
@ -839,7 +839,7 @@ public:
alex->AI()->Talk(SAY_LIGHT_OF_DAWN41);
if (Creature* darion = GetEntryFromSummons(NPC_DARION_MOGRAINE))
darion->DespawnOrUnsummon(3000);
darion->DespawnOrUnsummon(3s);
break;
case EVENT_OUTRO_SCENE_19:
if (Creature* alex = GetEntryFromSummons(NPC_HIGHLORD_ALEXANDROS_MOGRAINE))
@ -886,7 +886,7 @@ public:
case EVENT_OUTRO_SCENE_23:
if (Creature* alex = GetEntryFromSummons(NPC_HIGHLORD_ALEXANDROS_MOGRAINE))
{
alex->DespawnOrUnsummon(5000);
alex->DespawnOrUnsummon(5s);
alex->SetVisible(false);
}
break;
@ -1055,7 +1055,7 @@ public:
if (Creature* lk = GetEntryFromSummons(NPC_THE_LICH_KING))
{
lk->CastSpell(lk, SPELL_EXIT_TELEPORT_VISUAL, true);
lk->DespawnOrUnsummon(1500);
lk->DespawnOrUnsummon(1500ms);
}
if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING))
@ -1145,7 +1145,7 @@ public:
}
case EVENT_OUTRO_SCENE_61:
summons.DespawnAll();
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
events.Reset();
return;
}

View file

@ -103,7 +103,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
instance->SetData(DATA_KIRTONOS_THE_HERALD, FAIL);
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
void MovementInform(uint32 type, uint32 id) override

View file

@ -360,7 +360,7 @@ struct npc_madrigosa : public NullCreatureAI
break;
case EVENT_SPAWN_FELMYST:
DoCastAOE(SPELL_SUMMON_FELBLAZE, true);
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
break;
}
}

View file

@ -425,7 +425,7 @@ struct npc_demonic_vapor_trail : public NullCreatureAI
void Reset() override
{
me->CastSpell(me, SPELL_DEMONIC_VAPOR_TRAIL_PERIODIC, true);
me->DespawnOrUnsummon(20000);
me->DespawnOrUnsummon(20s);
}
void SpellHitTarget(Unit* /*unit*/, SpellInfo const* spellInfo) override

View file

@ -387,7 +387,7 @@ struct boss_kiljaeden : public BossAI
{
anveena->RemoveAllAuras();
anveena->CastSpell(anveena, SPELL_SACRIFICE_OF_ANVEENA, true);
anveena->DespawnOrUnsummon(1500);
anveena->DespawnOrUnsummon(1500ms);
DoCastSelf(SPELL_CUSTOM_08_STATE, true);
me->SetUnitFlag(UNIT_FLAG_PACIFIED);
scheduler.CancelAll();
@ -555,7 +555,7 @@ struct boss_kiljaeden : public BossAI
summon->CastSpell(summon, SPELL_ARMAGEDDON_VISUAL, true);
summon->SetPosition(summon->GetPositionX(), summon->GetPositionY(), summon->GetPositionZ() + 20.0f, 0.0f);
summon->m_Events.AddEvent(new CastArmageddon(summon), summon->m_Events.CalculateTime(6000));
summon->DespawnOrUnsummon(urand(8000, 10000));
summon->DespawnOrUnsummon(randtime(8s, 10s));
}
}
@ -919,7 +919,7 @@ struct npc_kalecgos_kj : public NullCreatureAI
if (Creature* velen = summons.GetCreatureWithEntry(NPC_PROPHET_VELEN))
{
velen->GetMotionMaster()->MovePoint(0, 1739.38f, 643.79f, 28.06f);
velen->DespawnOrUnsummon(5000);
velen->DespawnOrUnsummon(5s);
}
events.ScheduleEvent(eventId + 1, 3s);
break;
@ -929,7 +929,7 @@ struct npc_kalecgos_kj : public NullCreatureAI
if (summon->GetEntry() == NPC_SHATTERED_SUN_SOLDIER)
{
summon->GetMotionMaster()->MovePoint(0, 1739.38f, 643.79f, 28.06f);
summon->DespawnOrUnsummon(summon->GetExactDist2d(1734.96f, 642.43f) * 100);
summon->DespawnOrUnsummon(Milliseconds(uint32(summon->GetExactDist2d(1734.96f, 642.43f) * 100)));
}
events.ScheduleEvent(eventId + 1, 7s);
break;

View file

@ -274,7 +274,7 @@ struct npc_singularity : public NullCreatureAI
void Reset() override
{
me->DespawnOrUnsummon(18000);
me->DespawnOrUnsummon(18s);
me->m_Events.AddEventAtOffset([&] {
DoCastSelf(SPELL_BLACK_HOLE_SUMMON_VISUAL, true);

View file

@ -285,10 +285,7 @@ struct boss_zuljin : public BossAI
instance->SetBossState(DATA_ZULJIN, DONE);
Talk(SAY_DEATH);
summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
me->m_Events.AddEventAtOffset( [this] {
summons.DespawnAll();
}, 3s);
summons.DespawnAll(3s);
}
void SpawnAdds()

View file

@ -78,7 +78,7 @@ struct npc_forest_frog : public ScriptedAI
void MovementInform(uint32 type, uint32 data) override
{
if (type == POINT_MOTION_TYPE && data == POINT_DESPAWN)
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
void UpdateAI(uint32 diff) override

View file

@ -355,7 +355,7 @@ public:
if (arlokk->IsAlive())
arlokk->GetAI()->SetData(_sideData, 0);
}
me->DespawnOrUnsummon(4000);
me->DespawnOrUnsummon(4s);
}
void UpdateAI(uint32 diff) override

View file

@ -641,7 +641,7 @@ public:
{
DoCast(target, SPELL_REVIVE);
}
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
}

View file

@ -64,7 +64,7 @@ struct boss_twilight_corrupter : public ScriptedAI
{
if (creature->IsAlive() && me->GetGUID() != creature->GetGUID())
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
break;
}
}

View file

@ -262,7 +262,7 @@ public:
if (Unit* creature = summon->GetSummonerUnit())
creature->GetAI()->DoAction(1);
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
void JustDied(Unit*) override

View file

@ -586,7 +586,7 @@ public:
case 13:
me->setActive(false);
if (Creature* c = me->FindNearestCreature(NPC_SUNWELL_VISUAL_BUNNY, 60.0f, true))
c->DespawnOrUnsummon(1);
c->DespawnOrUnsummon(1ms);
if (GameObject* go = me->FindNearestGameObject(GO_QUEL_DELAR, 60.0f))
go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
me->SetWalk(true);

View file

@ -3054,10 +3054,10 @@ public:
if (Creature* valimathras = ObjectAccessor::GetCreature(*me, ValimathrasGUID))
{
valimathras->GetMotionMaster()->MovePoint(0, 1804.559f, 235.504f, 62.753f);
valimathras->DespawnOrUnsummon(3 * IN_MILLISECONDS);
valimathras->DespawnOrUnsummon(3s);
}
if (Creature* valimathrasportal = ObjectAccessor::GetCreature(*me, ValimathrasPortalGUID))
valimathrasportal->DespawnOrUnsummon(6 * IN_MILLISECONDS);
valimathrasportal->DespawnOrUnsummon(6s);
JumpToNextStep(1 * IN_MILLISECONDS);
break;
case 26:
@ -3332,10 +3332,10 @@ public:
if (Creature* valimathras = ObjectAccessor::GetCreature(*me, ValimathrasGUID))
{
valimathras->GetMotionMaster()->MovePoint(0, 1596.642f, 429.811f, -46.3429f);
valimathras->DespawnOrUnsummon(3 * IN_MILLISECONDS);
valimathras->DespawnOrUnsummon(3s);
}
if (Creature* valimathrasportal = ObjectAccessor::GetCreature(*me, ValimathrasPortalGUID))
valimathrasportal->DespawnOrUnsummon(3 * IN_MILLISECONDS);
valimathrasportal->DespawnOrUnsummon(3s);
JumpToNextStep(2 * IN_MILLISECONDS);
break;
// KHANOK - Trashspawn
@ -3865,8 +3865,8 @@ public:
me->GetCreatureListWithEntryInGrid(HelperList, NPC_OVERLORD_SAURFANG, 100.0f);
if (!HelperList.empty())
for (std::list<Creature*>::iterator itr = HelperList.begin(); itr != HelperList.end(); itr++)
(*itr)->DespawnOrUnsummon(120 * IN_MILLISECONDS);
me->DespawnOrUnsummon(120 * IN_MILLISECONDS);
(*itr)->DespawnOrUnsummon(120s);
me->DespawnOrUnsummon(120s);
bStepping = false;
JumpToNextStep(0 * IN_MILLISECONDS);
break;

View file

@ -603,7 +603,7 @@ struct npc_dark_iron_attack_mole_machine : public ScriptedAI
{
me->SummonCreature(NPC_DARK_IRON_GUZZLER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
summonTimer = 0;
me->DespawnOrUnsummon(3000);
me->DespawnOrUnsummon(3s);
}
}
}

View file

@ -697,7 +697,7 @@ struct npc_hallows_end_soh : public ScriptedAI
void EnterEvadeMode(EvadeReason /* why */) override
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
uint32 GetData(uint32 /*type*/) const override
@ -848,7 +848,7 @@ struct npc_hallows_end_soh : public ScriptedAI
if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
c->RemoveAllAuras();
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
else
{
@ -1029,7 +1029,7 @@ struct boss_headless_horseman : public ScriptedAI
std::list<Creature*> unitList;
me->GetCreaturesWithEntryInRange(unitList, 100.0f, NPC_PUMPKIN_FIEND);
for (std::list<Creature*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
(*itr)->ToCreature()->DespawnOrUnsummon(500);
(*itr)->ToCreature()->DespawnOrUnsummon(500ms);
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.IsEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())

View file

@ -247,7 +247,7 @@ struct npc_love_in_air_snivel_real : public ScriptedAI
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
me->CastSpell(owner, SPELL_SNIVEL_GUN, true);
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
}
}

View file

@ -192,7 +192,7 @@ class spell_winter_veil_racer_slam_hit : public SpellScript
return;
target->CastSpell(target->GetPositionX() + irand(-10, 10), target->GetPositionY() + irand(-10, 10), target->GetPositionZ(), SPELL_RACER_DEATH_VISUAL, true);
target->DespawnOrUnsummon(3000);
target->DespawnOrUnsummon(3s);
target->CastSpell(target, SPELL_RACER_FLAMES, true);
caster->CastSpell(caster, SPELL_RACER_KILL_COUNTER, true);

View file

@ -67,7 +67,7 @@ public:
summons.DespawnAll();
if (InstanceScript* pInstance = me->GetInstanceScript())
if (pInstance->GetData(DATA_GUARDIANTIME_EVENT) == 0)
me->DespawnOrUnsummon(500);
me->DespawnOrUnsummon(500ms);
me->SummonCreature(NPC_TIME_RIFT, 2337.6f, 1270.0f, 132.95f, 2.79f);
me->SummonCreature(NPC_GUARDIAN_OF_TIME, 2319.3f, 1267.7f, 132.8f, 1.0f);
@ -93,11 +93,11 @@ public:
{
if (cr->GetEntry() == NPC_TIME_RIFT)
{
cr->DespawnOrUnsummon(1000);
cr->DespawnOrUnsummon(1s);
}
else
{
cr->DespawnOrUnsummon(5000);
cr->DespawnOrUnsummon(5s);
cr->RemoveAllAuras();
cr->AI()->Talk(SAY_THANKS);
}
@ -120,7 +120,7 @@ public:
{
Talk(SAY_FAIL);
summons.DespawnAll();
me->DespawnOrUnsummon(500);
me->DespawnOrUnsummon(500ms);
}
}

View file

@ -80,7 +80,7 @@ public:
if (finished)
{
Talk(SAY_OUTRO);
me->DespawnOrUnsummon(20000);
me->DespawnOrUnsummon(20s);
}
}

View file

@ -547,7 +547,7 @@ public:
if (Creature* stalker = me->SummonCreature(NPC_INVIS_TARGET, 2026.469f, 1287.088f, 143.596f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 14000))
{
me->SetFacingToObject(stalker);
stalker->DespawnOrUnsummon(500);
stalker->DespawnOrUnsummon(500ms);
}
break;
// Reached first cityman
@ -861,7 +861,7 @@ public:
if (Creature* stalker = me->SummonCreature(NPC_INVIS_TARGET, 2081.447f, 1287.770f, 141.3241f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 10000))
{
me->SetFacingToObject(stalker);
stalker->DespawnOrUnsummon(500);
stalker->DespawnOrUnsummon(500ms);
}
Talk(SAY_PHASE205);
ScheduleNextEvent(currentEvent, 4s);
@ -1343,7 +1343,7 @@ void npc_arthas::npc_arthasAI::SpawnTimeRift()
if (Creature* cr = me->SummonCreature(/*entry*/(uint32)RiftAndSpawnsLocations[timeRiftId][i][0], RiftAndSpawnsLocations[timeRiftId][0][1], RiftAndSpawnsLocations[timeRiftId][0][2], RiftAndSpawnsLocations[timeRiftId][0][3], RiftAndSpawnsLocations[timeRiftId][0][4]))
{
if (cr->GetEntry() == NPC_TIME_RIFT)
cr->DespawnOrUnsummon(10000);
cr->DespawnOrUnsummon(10s);
else // x, y, z (0 is entry)
{
// first infinite
@ -1538,7 +1538,7 @@ public:
if (me->GetDistance(2400, 1200, 135) > 20.0f && data >= COS_PROGRESS_FINISHED_CITY_INTRO)
{
if (data >= COS_PROGRESS_KILLED_SALRAMM)
me->DespawnOrUnsummon(500);
me->DespawnOrUnsummon(500ms);
else
InfectMe(3000);
}

View file

@ -307,7 +307,7 @@ public:
if (Creature* cr = instance->SummonCreature(NPC_CHROMIE_MIDDLE, pos))
{
cr->SetVisible(false);
cr->DespawnOrUnsummon(1000);
cr->DespawnOrUnsummon(1s);
sCreatureTextMgr->SendChat(cr, textId, player, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
}
}

View file

@ -382,7 +382,7 @@ public:
if (Creature* horse = me->FindNearestCreature(NPC_SKARLOC_MOUNT, 10.0f))
{
horse->GetMotionMaster()->MovePoint(0, 2501.15f, 572.14f, 54.13f);
horse->DespawnOrUnsummon(30 * IN_MILLISECONDS);
horse->DespawnOrUnsummon(30s);
}
Talk(SAY_EMOTE_HORSE);
SetEscortPaused(true);

View file

@ -143,7 +143,7 @@ public:
case NPC_INFINITE_EXECUTIONER_2:
case NPC_INFINITE_VANQUISHER:
case NPC_INFINITE_VANQUISHER_2:
creature->DespawnOrUnsummon(1);
creature->DespawnOrUnsummon(1ms);
break;
default:
break;

View file

@ -109,7 +109,7 @@ struct npc_medivh_bm : public ScriptedAI
{
if (summon->GetEntry() == NPC_DP_CRYSTAL_STALKER)
{
summon->DespawnOrUnsummon(25000);
summon->DespawnOrUnsummon(25s);
summon->CastSpell(summon, RAND(SPELL_BANISH_PURPLE, SPELL_BANISH_GREEN), true);
summon->GetMotionMaster()->MoveSplinePath(&_airArray);
}
@ -199,19 +199,19 @@ struct npc_medivh_bm : public ScriptedAI
events.ScheduleEvent(EVENT_OUTRO_3, 2s);
break;
case EVENT_OUTRO_3:
SummonOrcs(-2046.158f, -3.0f, 37000, 30000, true);
SummonOrcs(-2046.158f, -3.0f, 37s, 30000, true);
events.ScheduleEvent(EVENT_OUTRO_4, 2s);
break;
case EVENT_OUTRO_4:
SummonOrcs(-2055.97f, -2.0f, 33000, 28000, false);
SummonOrcs(-2055.97f, -2.0f, 33s, 28000, false);
events.ScheduleEvent(EVENT_OUTRO_5, 2s);
break;
case EVENT_OUTRO_5:
SummonOrcs(-2064.0f, -1.5f, 29000, 26000, false);
SummonOrcs(-2064.0f, -1.5f, 29s, 26000, false);
events.ScheduleEvent(EVENT_OUTRO_6, 2s);
break;
case EVENT_OUTRO_6:
SummonOrcs(-2074.35f, -0.1f, 26000, 24000, false);
SummonOrcs(-2074.35f, -0.1f, 26s, 24000, false);
events.ScheduleEvent(EVENT_OUTRO_7, 7s);
break;
case EVENT_OUTRO_7:
@ -228,7 +228,7 @@ struct npc_medivh_bm : public ScriptedAI
}
}
void SummonOrcs(float x, float y, uint32 duration, uint32 homeTime, bool first)
void SummonOrcs(float x, float y, Milliseconds duration, uint32 homeTime, bool first)
{
for (uint8 i = 0; i < 6; ++i)
{
@ -236,7 +236,7 @@ struct npc_medivh_bm : public ScriptedAI
{
cr->GetMotionMaster()->MovePoint(0, (first && i == 3) ? x + 2.0f : x, cr->GetPositionY() + y, cr->GetMapHeight(x, cr->GetPositionY() + y, cr->GetPositionZ(), true));
cr->m_Events.AddEvent(new NpcRunToHome(*cr), cr->m_Events.CalculateTime(homeTime + urand(0, 2000)));
cr->DespawnOrUnsummon(duration + urand(0, 2000));
cr->DespawnOrUnsummon(duration + randtime(0ms, 2s));
}
}
}
@ -355,7 +355,7 @@ struct npc_time_rift : public NullCreatureAI
{
if (creature->GetGUID() == _riftKeeperGUID)
{
me->DespawnOrUnsummon(0);
me->DespawnOrUnsummon(0ms);
}
}

View file

@ -58,7 +58,7 @@ public:
case NPC_HIGHBORNE_SUMMONER:
if (_pylonsState == ALL_PYLONS_OFF)
{
creature->DespawnOrUnsummon(5000);
creature->DespawnOrUnsummon(5s);
}
else
{

View file

@ -115,7 +115,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(5000);
me->DespawnOrUnsummon(5s);
}
void sQuestAccept(Player* /*player*/, Quest const* quest) override

View file

@ -231,7 +231,7 @@ struct npc_buru_egg : public ScriptedAI
}
}
me->DespawnOrUnsummon(5000);
me->DespawnOrUnsummon(5s);
}
void UpdateAI(uint32 /*diff*/) override { }

View file

@ -310,7 +310,7 @@ public:
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
DoFinalSpell();
Talk(EMOTE_DEVOURED);
me->DespawnOrUnsummon(3000);
me->DespawnOrUnsummon(3s);
return;
}

View file

@ -170,7 +170,7 @@ struct boss_ouro : public BossAI
}
}
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
void CastGroundRupture()
@ -273,7 +273,7 @@ struct boss_ouro : public BossAI
if (me->GetThreatMgr().GetThreatList().empty())
{
DoCastSelf(SPELL_OURO_SUBMERGE_VISUAL);
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
instance->SetBossState(DATA_OURO, FAIL);
if (GameObject* base = me->FindNearestGameObject(GO_SANDWORM_BASE, 200.f))
base->DespawnOrUnsummon();
@ -334,7 +334,7 @@ struct npc_dirt_mound : ScriptedAI
scheduler.Schedule(30s, [this](TaskContext /*context*/)
{
DoCastSelf(SPELL_SUMMON_SCARABS, true);
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
})
.Schedule(100ms, [this](TaskContext context)
{

View file

@ -418,7 +418,7 @@ public:
if (Creature* mastersEye = instance->GetCreature(DATA_MASTERS_EYE))
{
mastersEye->AI()->Talk(EMOTE_MASTERS_EYE_AT, player);
mastersEye->DespawnOrUnsummon(11000);
mastersEye->DespawnOrUnsummon(11s);
mastersEye->m_Events.AddEventAtOffset([mastersEye, player]()
{
mastersEye->SetFacingToObject(player);

View file

@ -474,7 +474,7 @@ struct npc_ahnqiraji_critter : public ScriptedAI
{
if (me->GetEntry() == NPC_QIRAJI_SCORPION)
{
me->DespawnOrUnsummon(5 * IN_MILLISECONDS);
me->DespawnOrUnsummon(5s);
}
}

View file

@ -176,25 +176,25 @@ public:
if (Creature* weegli = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_WEEGLI)))
{
weegli->CastSpell(weegli, SPELL_BLYS_BAND_ESCAPE);
weegli->DespawnOrUnsummon(10000);
weegli->DespawnOrUnsummon(10s);
}
if (Creature* raven = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_RAVEN)))
{
raven->CastSpell(raven, SPELL_BLYS_BAND_ESCAPE);
raven->DespawnOrUnsummon(10000);
raven->DespawnOrUnsummon(10s);
}
if (Creature* oro = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_ORO)))
{
oro->CastSpell(oro, SPELL_BLYS_BAND_ESCAPE);
oro->DespawnOrUnsummon(10000);
oro->DespawnOrUnsummon(10s);
}
if (Creature* murta = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_MURTA)))
{
murta->CastSpell(murta, SPELL_BLYS_BAND_ESCAPE);
murta->DespawnOrUnsummon(10000);
murta->DespawnOrUnsummon(10s);
}
DoCastSelf(SPELL_BLYS_BAND_ESCAPE);
me->DespawnOrUnsummon(10000);
me->DespawnOrUnsummon(10s);
Porthome_Timer = 156000; //set timer back so that the event doesn't keep triggering
}
else
@ -436,7 +436,7 @@ public:
case 1:
me->GetMotionMaster()->MovePoint(2, 1871.18f, 1100.f, 8.88f);
Talk(SAY_WEEGLI_OUT_OF_HERE);
me->DespawnOrUnsummon(8000);
me->DespawnOrUnsummon(8s);
instance->SetData(DATA_PYRAMID, PYRAMID_GATES_DESTROYED);
destroyingDoor = false;
break;

View file

@ -463,7 +463,7 @@ public:
_events.Reset();
_events.ScheduleEvent(EVENT_CHECK_FOLLOWING, 1s);
player->KilledMonsterCredit(NPC_CAPTURED_RABID_THISTLE_BEAR);
me->DespawnOrUnsummon(240000);
me->DespawnOrUnsummon(240s);
}
}
}

View file

@ -474,7 +474,7 @@ public:
else if (spell->Id == SPELL_KODO_KOMBO_GOSSIP)
{
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
me->DespawnOrUnsummon(60000);
me->DespawnOrUnsummon(60s);
}
}
};

View file

@ -300,11 +300,11 @@ public:
for (uint8 i = 0; i < 6; ++i) // unsummon challengers
if (AffrayChallenger[i])
if (Creature* creature = ObjectAccessor::GetCreature((*me), AffrayChallenger[i]))
creature->DespawnOrUnsummon(1);
creature->DespawnOrUnsummon(1ms);
if (BigWill) // unsummon bigWill
if (Creature* creature = ObjectAccessor::GetCreature((*me), BigWill))
creature->DespawnOrUnsummon(1);
creature->DespawnOrUnsummon(1ms);
}
void MoveInLineOfSight(Unit* who) override

View file

@ -486,7 +486,7 @@ public:
if (Creature* guard = me->GetMap()->GetCreature(_guardEluneGUID))
{
guard->GetMotionMaster()->MovePoint(0, wingThicketLocations[2].m_positionX, wingThicketLocations[2].m_positionY, wingThicketLocations[2].m_positionZ);
guard->DespawnOrUnsummon(4000);
guard->DespawnOrUnsummon(4s);
}
break;
case SAY_PRIESTESS_ALTAR_20:
@ -494,7 +494,7 @@ public:
if (Creature* priestess = me->GetMap()->GetCreature(_firstPriestessGUID))
{
priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[0].m_positionX, wingThicketLocations[0].m_positionY, wingThicketLocations[0].m_positionZ);
priestess->DespawnOrUnsummon(4000);
priestess->DespawnOrUnsummon(4s);
}
break;
case SAY_PRIESTESS_ALTAR_21:
@ -502,7 +502,7 @@ public:
if (Creature* priestess = me->GetMap()->GetCreature(_secondPriestessGUID))
{
priestess->GetMotionMaster()->MovePoint(0, wingThicketLocations[1].m_positionX, wingThicketLocations[1].m_positionY, wingThicketLocations[1].m_positionZ);
priestess->DespawnOrUnsummon(4000);
priestess->DespawnOrUnsummon(4s);
}
break;
case DATA_EVENT_END:
@ -526,7 +526,7 @@ public:
player->GroupEventHappens(QUEST_GUARDIANS_ALTAR, me);
Talk(SAY_RANSHALLA_END_2, player);
}
me->DespawnOrUnsummon(4000);
me->DespawnOrUnsummon(4s);
break;
}
}

View file

@ -1480,7 +1480,7 @@ public:
{
if (param == ACTION_SWITCH_PHASE)
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
}

View file

@ -379,7 +379,7 @@ public:
// Xinef: after soft reset npc is no longer present
if (me->GetInstanceScript()->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
void DoAction(int32 action) override

View file

@ -1322,7 +1322,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
};

View file

@ -409,7 +409,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(20000);
me->DespawnOrUnsummon(20s);
if (pInstance)
if (Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_PALETRESS)))
paletress->AI()->DoAction(1);
@ -722,7 +722,7 @@ public:
void JustDied(Unit* /*pKiller*/) override
{
me->DespawnOrUnsummon(10000);
me->DespawnOrUnsummon(10s);
if (pInstance)
pInstance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, 0);
}

View file

@ -131,7 +131,7 @@ public:
void EnterEvadeMode(EvadeReason why) override
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
ScriptedAI::EnterEvadeMode(why);
}

View file

@ -347,7 +347,7 @@ public:
void JustDied(Unit* /*pKiller*/) override
{
me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
me->DespawnOrUnsummon(10000);
me->DespawnOrUnsummon(10s);
if (pInstance)
pInstance->SetData(DATA_MOUNT_DIED, 0);
}

View file

@ -1128,7 +1128,7 @@ public:
if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID))
{
boss->GetMotionMaster()->MovePoint(0, SpawnPosition);
boss->DespawnOrUnsummon(3000);
boss->DespawnOrUnsummon(3s);
}
}
break;

View file

@ -574,7 +574,7 @@ public:
if (spell->Id == SPELL_SPIKE_FAIL)
{
me->RemoveAllAuras();
me->DespawnOrUnsummon(1500);
me->DespawnOrUnsummon(1500ms);
}
}

View file

@ -353,7 +353,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(10000);
me->DespawnOrUnsummon(10s);
}
void EnterEvadeMode(EvadeReason /*why*/) override
@ -434,7 +434,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(10000);
me->DespawnOrUnsummon(10s);
}
void EnterEvadeMode(EvadeReason /*why*/) override

View file

@ -710,7 +710,7 @@ public:
return;
if (urand(0, 2))
me->DespawnOrUnsummon(0);
me->DespawnOrUnsummon(0ms);
}
void MoveToNextPoint()
@ -884,7 +884,7 @@ class spell_valkyr_ball_periodic_dummy_aura : public AuraScript
creature->GetMotionMaster()->MoveIdle();
creature->CastSpell((Unit*)nullptr, creature->GetEntry() == NPC_CONCENTRATED_LIGHT ? SPELL_UNLEASHED_LIGHT : SPELL_UNLEASHED_DARK, false);
creature->SetDisplayId(11686);
creature->DespawnOrUnsummon(1500);
creature->DespawnOrUnsummon(1500ms);
}
}

View file

@ -348,9 +348,9 @@ public:
}
if (Creature* c = instance->GetCreature(NPC_AcidmawGUID))
c->DespawnOrUnsummon(10000);
c->DespawnOrUnsummon(10s);
if (Creature* c = instance->GetCreature(NPC_DreadscaleGUID))
c->DespawnOrUnsummon(10000);
c->DespawnOrUnsummon(10s);
if (AchievementTimer + 10 >= GameTime::GetGameTime().count())
DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_JORMUNGAR_ACHIEV);
AchievementTimer = 0;
@ -420,7 +420,7 @@ public:
for (ObjectGuid const& guid : NPC_ChampionGUIDs)
if (Creature* c = instance->GetCreature(guid))
c->DespawnOrUnsummon(15000);
c->DespawnOrUnsummon(15s);
NPC_ChampionGUIDs.clear();
if (Creature* c = instance->GetCreature(NPC_TirionGUID))
@ -1314,7 +1314,7 @@ public:
{
c->SetVisible(true);
c->AI()->Talk(SAY_STAGE_4_05);
c->DespawnOrUnsummon(0);
c->DespawnOrUnsummon(0ms);
}
break;

View file

@ -214,7 +214,7 @@ class spell_trollgore_corpse_explode_aura : public AuraScript
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Creature* target = GetTarget()->ToCreature())
target->DespawnOrUnsummon(1);
target->DespawnOrUnsummon(1ms);
}
void Register() override

View file

@ -89,7 +89,7 @@ class spell_dtk_raise_dead_aura : public AuraScript
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetUnitOwner()->ToCreature()->DespawnOrUnsummon(1);
GetUnitOwner()->ToCreature()->DespawnOrUnsummon(1ms);
GetUnitOwner()->SummonCreature(NPC_RISEN_DRAKKARI_WARRIOR, *GetUnitOwner());
}

View file

@ -242,7 +242,7 @@ public:
{
me->GetMotionMaster()->MoveIdle();
me->CastSpell(b, SPELL_CONSUME_SOUL, true);
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
return;
}

View file

@ -1153,7 +1153,7 @@ public:
ScriptedAI::EnterEvadeMode(why);
if (me->IsSummon())
me->ToTempSummon()->DespawnOrUnsummon(1);
me->ToTempSummon()->DespawnOrUnsummon(1ms);
}
};
};

View file

@ -506,7 +506,7 @@ class spell_exploding_orb_auto_grow_aura : public AuraScript
target->RemoveAurasDueToSpell(SPELL_AUTO_GROW);
target->RemoveAurasDueToSpell(SPELL_EXPLODING_ORB_VISUAL);
if (target->IsCreature())
target->ToCreature()->DespawnOrUnsummon(2000);
target->ToCreature()->DespawnOrUnsummon(2s);
}
}

View file

@ -341,7 +341,7 @@ public:
Unit::Kill(c, c, false);
}
c->DespawnOrUnsummon(10000);
c->DespawnOrUnsummon(10s);
}
pInstance->SetData(DATA_INSTANCE_PROGRESS, INSTANCE_PROGRESS_FINISHED_INTRO);
}
@ -1381,7 +1381,7 @@ class spell_pos_slave_trigger_closest : public SpellScript
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
if (Creature* c = target->ToCreature())
{
c->DespawnOrUnsummon(7000);
c->DespawnOrUnsummon(7s);
c->AI()->Talk(0, p);
c->m_Events.AddEvent(new SlaveRunEvent(*c), c->m_Events.CalculateTime(3000));
}
@ -1406,7 +1406,7 @@ class spell_pos_rimefang_frost_nova : public SpellScript
{
Unit::Kill(caster, target);
if (target->IsCreature())
target->ToCreature()->DespawnOrUnsummon(30000);
target->ToCreature()->DespawnOrUnsummon(30s);
}
}

View file

@ -308,7 +308,7 @@ public:
me->CastSpell(me, SPELL_FACE_ME, true);
me->CastSpell(me, SPELL_SURGE_VISUAL, true);
me->CastSpell(me, SPELL_MERGE, false);
me->DespawnOrUnsummon(2000);
me->DespawnOrUnsummon(2s);
events.Reset();
break;
}
@ -382,7 +382,7 @@ public:
{
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MoveCharge(1672.96f, 743.488f, 143.338f, 7.0f, POINT_MERGE);
me->DespawnOrUnsummon(1200);
me->DespawnOrUnsummon(1200ms);
}
}

View file

@ -133,7 +133,7 @@ public:
despawnTime = (summon->GetDistance(target) / 40.0f * 1000) + 500;
}
summon->DespawnOrUnsummon(despawnTime);
summon->DespawnOrUnsummon(Milliseconds(despawnTime));
}
uint32 GetData(uint32 /*type*/) const override

View file

@ -1213,7 +1213,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
void UpdateAI(uint32 diff) override
@ -1287,7 +1287,7 @@ public:
me->SetControlled(true, UNIT_STATE_ROOT);
me->StopMoving();
me->CastSpell(me, SPELL_FLAMES, true);
me->DespawnOrUnsummon(999);
me->DespawnOrUnsummon(999ms);
me->CastSpell(me, SPELL_FLAME_SPHERE_DEATH_EFFECT, true);
_exploded = true;
}
@ -1331,7 +1331,7 @@ public:
me->SetInCombatWithZone();
return;
}
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
void DamageDealt(Unit* target, uint32& damage, DamageEffectType /*damageType*/, SpellSchoolMask /*damageSchoolMask*/) override
@ -1424,7 +1424,7 @@ public:
case EVENT_BOMB_DESPAWN:
me->RemoveAllAuras();
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->DespawnOrUnsummon(exploded ? 5000 : 0);
me->DespawnOrUnsummon(exploded ? 5s : 0ms);
break;
case EVENT_CONTINUE_FALLING:
me->GetMotionMaster()->MovementExpired(false);

View file

@ -1030,7 +1030,7 @@ public:
me->GetMotionMaster()->MoveCharge(chargePos[_index].GetPositionX(), chargePos[_index].GetPositionY(), chargePos[_index].GetPositionZ(), 13.0f, POINT_CHARGE);
}
else if (action == ACTION_DESPAWN)
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
private:

View file

@ -668,7 +668,7 @@ public:
continue;
Creature* c = (*itr)->ToCreature();
if (c->GetEntry() == NPC_SKYBREAKER_MARINE || c->GetEntry() == NPC_SKYBREAKER_SERGEANT || c->GetEntry() == NPC_KOR_KRON_REAVER || c->GetEntry() == NPC_KOR_KRON_SERGEANT)
c->DespawnOrUnsummon(1);
c->DespawnOrUnsummon(1ms);
}
}
}
@ -880,7 +880,7 @@ public:
init.DisableTransportPathTransformations();
init.MovebyPath(path, 0);
init.Launch();
me->DespawnOrUnsummon(18000);
me->DespawnOrUnsummon(18s);
}
}
@ -1216,7 +1216,7 @@ public:
init.DisableTransportPathTransformations();
init.MovebyPath(path, 0);
init.Launch();
me->DespawnOrUnsummon(18000);
me->DespawnOrUnsummon(18s);
}
}

View file

@ -482,7 +482,7 @@ public:
minrange = summon->GetExactDist(p);
}
summon->ToTempSummon()->DespawnOrUnsummon(30000);
summon->ToTempSummon()->DespawnOrUnsummon(30s);
}
else
{
@ -949,7 +949,7 @@ public:
me->GetMotionMaster()->MovementExpired();
me->StopMoving();
me->SetControlled(true, UNIT_STATE_STUNNED);
me->DespawnOrUnsummon(500);
me->DespawnOrUnsummon(500ms);
break;
default:
break;
@ -977,7 +977,7 @@ public:
if (!me->GetVictim() || me->GetVictim()->GetGUID() != targetGUID)
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
return;
}

View file

@ -397,7 +397,7 @@ public:
trapped->NearTeleportTo(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ(), exitPos.GetOrientation(), false);
}
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
void JustDied(Unit* /*killer*/) override
@ -451,13 +451,13 @@ public:
}
else
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
return;
}
}
else
{
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
return;
}

View file

@ -352,7 +352,7 @@ public:
{
if (summon->GetEntry() != 38308 && summon->GetEntry() != 38309 && (!me->IsInCombat() || me->IsInEvadeMode()))
{
summon->DespawnOrUnsummon(1);
summon->DespawnOrUnsummon(1ms);
return;
}
@ -757,7 +757,7 @@ public:
if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PROFESSOR_PUTRICIDE)))
{
if (!professor->IsInCombat())
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
else
professor->AI()->JustSummoned(me);
}
@ -1056,7 +1056,7 @@ class spell_putricide_ooze_channel : public SpellScript
if (targets.empty())
{
FinishCast(SPELL_FAILED_NO_VALID_TARGETS);
GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update
GetCaster()->ToCreature()->DespawnOrUnsummon(1ms); // despawn next update
return;
}
@ -1491,7 +1491,7 @@ class spell_putricide_eat_ooze : public SpellScript
{
target->RemoveAurasDueToSpell(SPELL_GROW_STACKER);
target->RemoveAura(grow);
target->DespawnOrUnsummon(1);
target->DespawnOrUnsummon(1ms);
}
else
grow->ModStackAmount(-4);

View file

@ -211,7 +211,7 @@ public:
if (me->IsAlive() && me->IsInCombat() && !me->IsInEvadeMode())
summons.Summon(summon);
else
summon->DespawnOrUnsummon(1);
summon->DespawnOrUnsummon(1ms);
}
void KilledUnit(Unit* victim) override
@ -373,7 +373,7 @@ public:
{
if (Creature* rotface = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ROTFACE)))
rotface->AI()->SummonedCreatureDespawn(me);
me->DespawnOrUnsummon(0);
me->DespawnOrUnsummon(0ms);
}
void UpdateAI(uint32 diff) override
@ -798,7 +798,7 @@ class spell_rotface_unstable_ooze_explosion_suicide_aura : public AuraScript
target->SetVisible(false);
target->RemoveAllAuras();
//target->ToCreature()->DespawnOrUnsummon();
target->ToCreature()->DespawnOrUnsummon(60000);
target->ToCreature()->DespawnOrUnsummon(60s);
}
void Register() override

View file

@ -720,7 +720,7 @@ public:
player->RemoveAurasDueToSpell(SPELL_ICE_TOMB_DAMAGE);
player->RemoveAurasDueToSpell(SPELL_ASPHYXIATION);
player->RemoveAurasDueToSpell(SPELL_ICE_TOMB_UNTARGETABLE);
me->DespawnOrUnsummon(5000);
me->DespawnOrUnsummon(5s);
}
}

View file

@ -826,9 +826,9 @@ public:
me->SetDisableGravity(false);
me->GetMotionMaster()->MoveFall();
if (Creature* frostmourne = me->FindNearestCreature(NPC_FROSTMOURNE_TRIGGER, 50.0f))
frostmourne->DespawnOrUnsummon(1);
frostmourne->DespawnOrUnsummon(1ms);
if (Creature* terenas = me->FindNearestCreature(NPC_TERENAS_MENETHIL_OUTRO, 50.0f))
terenas->DespawnOrUnsummon(1);
terenas->DespawnOrUnsummon(1ms);
me->m_Events.AddEvent(new LichKingDeathEvent(*me), me->m_Events.CalculateTime(2500)); // die after spinning anim is over, so death anim is visible
me->m_Events.AddEvent(new LichKingMovieEvent(*me), me->m_Events.CalculateTime(11500));
@ -886,7 +886,7 @@ public:
break;
case NPC_VALKYR_SHADOWGUARD:
if (_phase == PHASE_THREE || events.HasTimeUntilEvent(EVENT_QUAKE_2))
summon->DespawnOrUnsummon(1);
summon->DespawnOrUnsummon(1ms);
break;
default:
break;
@ -2078,7 +2078,7 @@ class spell_the_lich_king_shadow_trap_periodic : public SpellScript
if (Aura* a = GetCaster()->GetAura(SPELL_SHADOW_TRAP_AURA))
a->SetDuration(0);
if (GetCaster()->IsCreature())
GetCaster()->ToCreature()->DespawnOrUnsummon(3000);
GetCaster()->ToCreature()->DespawnOrUnsummon(3s);
}
void Register() override
@ -2134,7 +2134,7 @@ public:
{
me->RemoveAllAuras();
me->CastSpell(me, SPELL_ICE_BURST, true);
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
targetGUID.Clear();
timer = 9999;
me->InterruptNonMeleeSpells(true);
@ -2238,7 +2238,7 @@ public:
if (Player* plr = ScriptedAI::SelectTargetFromPlayerList(100.0f, 0, true))
plr->CastSpell(me, SPELL_RAGING_SPIRIT_VISUAL_CLONE, true);
else
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
}
@ -2449,7 +2449,7 @@ public:
if (IsHeroic())
GoSiphon();
else
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
@ -2519,7 +2519,7 @@ public:
if (IsHeroic())
GoSiphon();
else
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
break;
case POINT_START_SIPHON:
@ -2883,7 +2883,7 @@ class spell_the_lich_king_vile_spirit_damage_target_search : public SpellScript
c->GetMotionMaster()->Clear(true);
c->StopMoving();
c->CastSpell((Unit*)nullptr, SPELL_SPIRIT_BURST, true);
c->DespawnOrUnsummon(3000);
c->DespawnOrUnsummon(3s);
c->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
}
}
@ -2999,7 +2999,7 @@ public:
_events.Reset();
me->RemoveAllAuras();
me->DespawnOrUnsummon(500);
me->DespawnOrUnsummon(500ms);
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_THE_LICH_KING)))
lichKing->AI()->SummonedCreatureDespawn(me);
@ -3050,7 +3050,7 @@ public:
case EVENT_DESPAWN_SELF:
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_THE_LICH_KING)))
lichKing->AI()->SummonedCreatureDespawn(me);
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
break;
default:
break;
@ -3098,7 +3098,7 @@ public:
{
_events.Reset();
me->CastSpell((Unit*)nullptr, SPELL_RESTORE_SOUL, false);
me->DespawnOrUnsummon(3000);
me->DespawnOrUnsummon(3s);
}
break;
}
@ -3118,14 +3118,14 @@ public:
if (Creature* warden = me->FindNearestCreature(NPC_SPIRIT_WARDEN, 20.0f))
{
warden->CastSpell((Unit*)nullptr, SPELL_DESTROY_SOUL, false);
warden->DespawnOrUnsummon(2000);
warden->DespawnOrUnsummon(2s);
}
me->CastSpell(me, SPELL_TERENAS_LOSES_INSIDE, false);
me->SetDisplayId(16946);
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->DespawnOrUnsummon(2000);
me->DespawnOrUnsummon(2s);
}
}
}
@ -3414,7 +3414,7 @@ public:
npc_lk_spirit_bombAI(Creature* creature) : NullCreatureAI(creature)
{
me->SetReactState(REACT_PASSIVE);
me->DespawnOrUnsummon(45000); // for safety
me->DespawnOrUnsummon(45s); // for safety
timer = 0;
}
@ -3447,7 +3447,7 @@ public:
timer = 0;
me->RemoveAllAuras();
me->CastSpell((Unit*)nullptr, SPELL_EXPLOSION, false);
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
else
timer -= diff;

View file

@ -177,14 +177,14 @@ private:
class DelayedCastEvent : public BasicEvent
{
public:
DelayedCastEvent(Creature* trigger, uint32 spellId, ObjectGuid originalCaster, uint32 despawnTime) : _trigger(trigger), _originalCaster(originalCaster), _spellId(spellId), _despawnTime(despawnTime)
DelayedCastEvent(Creature* trigger, uint32 spellId, ObjectGuid originalCaster, Milliseconds despawnTime) : _trigger(trigger), _originalCaster(originalCaster), _spellId(spellId), _despawnTime(despawnTime)
{
}
bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_trigger->CastSpell(_trigger, _spellId, false, nullptr, nullptr, _originalCaster);
if (_despawnTime)
if (_despawnTime > 0ms)
_trigger->DespawnOrUnsummon(_despawnTime);
return true;
}
@ -193,7 +193,7 @@ private:
Creature* _trigger;
ObjectGuid _originalCaster;
uint32 _spellId;
uint32 _despawnTime;
Milliseconds _despawnTime;
};
class AuraRemoveEvent : public BasicEvent
@ -406,7 +406,7 @@ public:
// this display id was found in sniff instead of the one on aura
me->SetDisplayId(11686);
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->DespawnOrUnsummon(4000);
me->DespawnOrUnsummon(4s);
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_VALITHRIA_LICH_KING)))
lichKing->CastSpell(lichKing, SPELL_SPAWN_CHEST, false);
_instance->SetData(DATA_WEEKLY_QUEST_ID, 0); // show hidden npc if necessary
@ -417,12 +417,12 @@ public:
{
if (summon->GetEntry() == NPC_DREAM_PORTAL_PRE_EFFECT)
{
summon->m_Events.AddEvent(new DelayedCastEvent(summon, SPELL_SUMMON_DREAM_PORTAL, me->GetGUID(), 6000), summon->m_Events.CalculateTime(15000));
summon->m_Events.AddEvent(new DelayedCastEvent(summon, SPELL_SUMMON_DREAM_PORTAL, me->GetGUID(), 6s), summon->m_Events.CalculateTime(15000));
summon->m_Events.AddEvent(new AuraRemoveEvent(summon, SPELL_DREAM_PORTAL_VISUAL_PRE), summon->m_Events.CalculateTime(15000));
}
else if (summon->GetEntry() == NPC_NIGHTMARE_PORTAL_PRE_EFFECT)
{
summon->m_Events.AddEvent(new DelayedCastEvent(summon, SPELL_SUMMON_NIGHTMARE_PORTAL, me->GetGUID(), 6000), summon->m_Events.CalculateTime(15000));
summon->m_Events.AddEvent(new DelayedCastEvent(summon, SPELL_SUMMON_NIGHTMARE_PORTAL, me->GetGUID(), 6s), summon->m_Events.CalculateTime(15000));
summon->m_Events.AddEvent(new AuraRemoveEvent(summon, SPELL_NIGHTMARE_PORTAL_VISUAL_PRE), summon->m_Events.CalculateTime(15000));
}
}
@ -750,9 +750,9 @@ public:
void JustSummoned(Creature* summon) override
{
if (summon->GetEntry() == NPC_COLUMN_OF_FROST)
summon->m_Events.AddEvent(new DelayedCastEvent(summon, SPELL_COLUMN_OF_FROST_DAMAGE, ObjectGuid::Empty, 8000), summon->m_Events.CalculateTime(2000));
summon->m_Events.AddEvent(new DelayedCastEvent(summon, SPELL_COLUMN_OF_FROST_DAMAGE, ObjectGuid::Empty, 8s), summon->m_Events.CalculateTime(2000));
else if (summon->GetEntry() == NPC_MANA_VOID)
summon->DespawnOrUnsummon(36000);
summon->DespawnOrUnsummon(36s);
}
void UpdateAI(uint32 diff) override
@ -886,7 +886,7 @@ public:
me->GetMotionMaster()->MoveIdle();
// must use originalCaster the same for all clouds to allow stacking
me->CastSpell(me, EMERALD_VIGOR, false, nullptr, nullptr, _instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER));
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
break;
default:
break;
@ -1054,7 +1054,7 @@ public:
timer = 0;
me->SetDisplayId(11686);
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->DespawnOrUnsummon(2000);
me->DespawnOrUnsummon(2s);
}
else
timer -= diff;
@ -1096,7 +1096,7 @@ public:
void JustSummoned(Creature* summon) override
{
if (me->GetInstanceScript() && me->GetInstanceScript()->GetBossState(DATA_VALITHRIA_DREAMWALKER) == DONE)
summon->DespawnOrUnsummon(1);
summon->DespawnOrUnsummon(1ms);
else if (Unit* target = SelectTargetFromPlayerList(200.0f))
summon->AI()->AttackStart(target);
}

View file

@ -534,12 +534,12 @@ public:
if (Creature* factionNPC = ObjectAccessor::GetCreature(*me, _factionNPC))
{
factionNPC->GetMotionMaster()->MovePath(factionNPC->GetSpawnId() * 10, false);
factionNPC->DespawnOrUnsummon(46500);
factionNPC->DespawnOrUnsummon(46500ms);
std::list<Creature*> followers;
factionNPC->GetCreaturesWithEntryInRange(followers, 30, _instance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? NPC_KOR_KRON_GENERAL : NPC_ALLIANCE_COMMANDER);
for (Creature* follower : followers)
{
follower->DespawnOrUnsummon(46500);
follower->DespawnOrUnsummon(46500ms);
}
}
me->setActive(false);
@ -1810,7 +1810,7 @@ public:
{
_vehicleCheckTimer = 500;
if (!me->GetVehicle())
me->DespawnOrUnsummon(100);
me->DespawnOrUnsummon(100ms);
}
else
_vehicleCheckTimer -= diff;
@ -2151,7 +2151,7 @@ class spell_svalna_remove_spear : public SpellScript
{
if (Unit* vehicle = target->GetVehicleBase())
vehicle->RemoveAurasDueToSpell(SPELL_IMPALING_SPEAR);
target->DespawnOrUnsummon(1);
target->DespawnOrUnsummon(1ms);
}
}

View file

@ -499,7 +499,7 @@ public:
break;
case NPC_INFILTRATOR_MINCHAR_BQ:
if (BloodQuickeningState == DONE)
creature->DespawnOrUnsummon(1);
creature->DespawnOrUnsummon(1ms);
break;
case NPC_MINCHAR_BEAM_STALKER:
if (BloodQuickeningState != DONE)
@ -661,7 +661,7 @@ public:
{
c->CastSpell(c, VOID_ZONE_VISUAL, true);
unit->SummonCreature(NPC_RISEN_DEATHSPEAKER_SERVANT, *unit, TEMPSUMMON_MANUAL_DESPAWN);
unit->ToCreature()->DespawnOrUnsummon(3000);
unit->ToCreature()->DespawnOrUnsummon(3s);
}
break;
default:

View file

@ -507,7 +507,7 @@ public:
{
if (!me->IsInCombat())
{
me->DespawnOrUnsummon(500);
me->DespawnOrUnsummon(500ms);
}
}
if (param == ACTION_GUARDIANS_OFF)

View file

@ -803,10 +803,10 @@ public:
{
case NPC_ARCANE_OVERLOAD:
summon->CastSpell(summon, SPELL_ARCANE_OVERLOAD_DMG, true);
summon->DespawnOrUnsummon(45000);
summon->DespawnOrUnsummon(45s);
break;
case NPC_STATIC_FIELD:
summon->DespawnOrUnsummon(20000);
summon->DespawnOrUnsummon(20s);
break;
}
}
@ -1018,7 +1018,7 @@ public:
me->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
me->RemoveAura(SPELL_POWER_SPARK_VISUAL);
me->CastSpell(me, SPELL_POWER_SPARK_GROUND_BUFF, true);
me->DespawnOrUnsummon(60000);
me->DespawnOrUnsummon(60s);
}
}
}
@ -1459,14 +1459,14 @@ public:
else if (pass && pass->IsPlayer() && me->IsAlive())
{
me->SetDisplayId(11686); // prevents nasty falling animation at despawn
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
}
void JustDied(Unit* /*killer*/) override
{
me->SetDisplayId(11686); // prevents nasty falling animation at despawn
me->DespawnOrUnsummon(1);
me->DespawnOrUnsummon(1ms);
}
};
};

View file

@ -29,7 +29,7 @@ bool EoEDrakeEnterVehicleEvent::Execute(uint64 /*eventTime*/, uint32 /*updateTim
p->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, &_owner, true);
return true;
}
_owner.DespawnOrUnsummon(1);
_owner.DespawnOrUnsummon(1ms);
return true;
}

View file

@ -150,7 +150,7 @@ struct boss_magus_telestra : public BossAI
if (spellInfo->Id >= SPELL_FIRE_MAGUS_DEATH && spellInfo->Id <= SPELL_ARCANE_MAGUS_DEATH && caster->ToCreature())
{
events.ScheduleEvent(EVENT_MAGUS_FAIL_ACHIEVEMENT, 5s);
caster->ToCreature()->DespawnOrUnsummon(1000);
caster->ToCreature()->DespawnOrUnsummon(1s);
if (++copiesDied >= 3)
{

View file

@ -387,7 +387,7 @@ public:
}
else
{
me->DespawnOrUnsummon(2050);
me->DespawnOrUnsummon(2050ms);
me->SetOrientation(2.5f);
me->SetSpeedRate(MOVE_FLIGHT, 1.0f);
Position pos = me->GetPosition();
@ -444,7 +444,7 @@ public:
}
else
{
me->DespawnOrUnsummon(2050);
me->DespawnOrUnsummon(2050ms);
me->SetOrientation(2.5f);
me->SetSpeedRate(MOVE_FLIGHT, 1.0f);
Position pos = me->GetPosition();
@ -461,7 +461,7 @@ public:
{
if (despawnTimer >= 5000)
{
me->DespawnOrUnsummon(2050);
me->DespawnOrUnsummon(2050ms);
me->SetOrientation(2.5f);
Position pos = me->GetPosition();
Position offset = { 10.0f, 10.0f, 12.0f, 0.0f };

View file

@ -269,7 +269,7 @@ public:
me->RemoveAllAuras();
me->CastSpell(me, SPELL_SPARK_DESPAWN, true);
me->DespawnOrUnsummon(1000);
me->DespawnOrUnsummon(1s);
}
}
};

Some files were not shown because too many files have changed in this diff Show more