diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 12698c35d..f338e7789 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -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; diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index cadd3b9f4..72686bf6a 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -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; diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 30373f2f6..7a009d0ae 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -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); diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index f3d9e11a5..c5c71af9f 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -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 exec, Milliseconds repeatMin, Milliseconds repeatMax = 0s, uint32 uniqueId = 0); - void ScheduleTimedEvent(Milliseconds timerMax, std::function exec, Milliseconds repeatMin, Milliseconds repeatMax = 0s, uint32 uniqueId = 0) { ScheduleTimedEvent(0s, timerMax, exec, repeatMin, repeatMax, uniqueId); }; + void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function exec, Milliseconds repeatMin, Milliseconds repeatMax = 0ms, uint32 uniqueId = 0); + void ScheduleTimedEvent(Milliseconds timerMax, std::function 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 exec, uint32 uniqueId) { ScheduleTimedEvent(0s, timer, exec, 0s, 0s, uniqueId); }; + void ScheduleUniqueTimedEvent(Milliseconds timer, std::function 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 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 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 _exec; diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index c1dead666..fc130cca4 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -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; diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index c0a4f5536..89eef49ae 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -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(); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index fe39491c0..451975e1b 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -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() diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 950bc5367..93baba17a 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -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; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 4bad8703e..08d2abdc5 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -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) { diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index dc3316226..f730f99e2 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -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; } diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index e737bab11..9190202d4 100644 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -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 diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a8cb733de..6823182dd 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 1e57a5649..ef7ca602d 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -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(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1fbbf0d9c..0495dd9e8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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 diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 3d5115e7f..efc2d7aac 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -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 diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index e7389b4d1..f09223b75 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -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: diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a95f99367..7c0cd6c45 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -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; } diff --git a/src/server/game/Time/UpdateTime.cpp b/src/server/game/Time/UpdateTime.cpp index 3b584a615..cebb105df 100644 --- a/src/server/game/Time/UpdateTime.cpp +++ b/src/server/game/Time/UpdateTime.cpp @@ -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) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp index 54809c6e5..8c5af306e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp @@ -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; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 614976c5a..712f9c5a2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -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); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.cpp index 9d1d0033e..73afa5f04 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.cpp @@ -199,7 +199,7 @@ class spell_mc_play_dead_aura : public AuraScript else { Unit::Kill(creatureTarget, creatureTarget); - creatureTarget->DespawnOrUnsummon(14000); + creatureTarget->DespawnOrUnsummon(14s); } } diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp index b1afd209a..bfc418d00 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp @@ -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); } } } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 3b5092fab..fa32df818 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -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 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index cf45992a8..955b26e4c 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -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: diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 403782eed..0e04c702c 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -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()); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index c8244d493..13ebb5664 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -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); } } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index d77e5756e..54a367f8f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -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; } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp index b58ad2de3..4634ead0e 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -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 diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index b41f44548..bcfc6b6b8 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -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; } } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index c9b0ad3f1..241ec277a 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -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 diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 40352f301..d331a9658 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -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; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 863954f0f..d2cc53486 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -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); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index b33a057db..7add91965 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -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() diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 39fca29ff..4b28c85fe 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -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 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 7046c02a2..4b90e0ea2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -355,7 +355,7 @@ public: if (arlokk->IsAlive()) arlokk->GetAI()->SetData(_sideData, 0); } - me->DespawnOrUnsummon(4000); + me->DespawnOrUnsummon(4s); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index ad623291f..7ba24407f 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -641,7 +641,7 @@ public: { DoCast(target, SPELL_REVIVE); } - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } } diff --git a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp index d7d06ac3f..14a1aa6b7 100644 --- a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp @@ -64,7 +64,7 @@ struct boss_twilight_corrupter : public ScriptedAI { if (creature->IsAlive() && me->GetGUID() != creature->GetGUID()) { - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); break; } } diff --git a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp index 6f9246e3f..5357b8e14 100644 --- a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp @@ -262,7 +262,7 @@ public: if (Unit* creature = summon->GetSummonerUnit()) creature->GetAI()->DoAction(1); - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } void JustDied(Unit*) override diff --git a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp index 246a1246f..c3d7edd07 100644 --- a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp @@ -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); diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index efd608da0..6931fa59c 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -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::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; diff --git a/src/server/scripts/Events/brewfest.cpp b/src/server/scripts/Events/brewfest.cpp index 84138e5d3..c743ed245 100644 --- a/src/server/scripts/Events/brewfest.cpp +++ b/src/server/scripts/Events/brewfest.cpp @@ -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); } } } diff --git a/src/server/scripts/Events/hallows_end.cpp b/src/server/scripts/Events/hallows_end.cpp index a7a2d2b64..5bda46f13 100644 --- a/src/server/scripts/Events/hallows_end.cpp +++ b/src/server/scripts/Events/hallows_end.cpp @@ -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 unitList; me->GetCreaturesWithEntryInRange(unitList, 100.0f, NPC_PUMPKIN_FIEND); for (std::list::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()) diff --git a/src/server/scripts/Events/love_in_air.cpp b/src/server/scripts/Events/love_in_air.cpp index 6c5a2aedb..6a22e8e83 100644 --- a/src/server/scripts/Events/love_in_air.cpp +++ b/src/server/scripts/Events/love_in_air.cpp @@ -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); } } } diff --git a/src/server/scripts/Events/winter_veil.cpp b/src/server/scripts/Events/winter_veil.cpp index 6a66ed29e..a1a53a042 100644 --- a/src/server/scripts/Events/winter_veil.cpp +++ b/src/server/scripts/Events/winter_veil.cpp @@ -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); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp index d5983c7ea..854b43b38 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp @@ -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); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index bf7f18c2a..bc066fd1f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -80,7 +80,7 @@ public: if (finished) { Talk(SAY_OUTRO); - me->DespawnOrUnsummon(20000); + me->DespawnOrUnsummon(20s); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index b26ec632a..f3a825a37 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -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); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index 961ec2c7b..dbb18cf28 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -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); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index 271cb6c22..9cca30b58 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -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); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp index 21f51ca78..bde93d514 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp @@ -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; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 0f08fb9be..72895bb9f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -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); } } diff --git a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp index 398bc8764..bd741c248 100644 --- a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp +++ b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp @@ -58,7 +58,7 @@ public: case NPC_HIGHBORNE_SUMMONER: if (_pylonsState == ALL_PYLONS_OFF) { - creature->DespawnOrUnsummon(5000); + creature->DespawnOrUnsummon(5s); } else { diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 2dfebf46b..0bd0febc7 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -115,7 +115,7 @@ public: void JustDied(Unit* /*killer*/) override { - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); } void sQuestAccept(Player* /*player*/, Quest const* quest) override diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index fa7c56048..9c5669d50 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -231,7 +231,7 @@ struct npc_buru_egg : public ScriptedAI } } - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); } void UpdateAI(uint32 /*diff*/) override { } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index f7ec9c838..2d97ba3da 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -310,7 +310,7 @@ public: me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE); DoFinalSpell(); Talk(EMOTE_DEVOURED); - me->DespawnOrUnsummon(3000); + me->DespawnOrUnsummon(3s); return; } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 43d741174..40019ccc0 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -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) { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index eab24db58..cdad23d67 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -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); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp index 2d7cfb40b..ca26d56cc 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp @@ -474,7 +474,7 @@ struct npc_ahnqiraji_critter : public ScriptedAI { if (me->GetEntry() == NPC_QIRAJI_SCORPION) { - me->DespawnOrUnsummon(5 * IN_MILLISECONDS); + me->DespawnOrUnsummon(5s); } } diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index bd6543ffb..f24a4592b 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -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; diff --git a/src/server/scripts/Kalimdor/zone_darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp index 0efe73836..f0b5791e7 100644 --- a/src/server/scripts/Kalimdor/zone_darkshore.cpp +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp @@ -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); } } } diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp index 94fb1505f..782e25034 100644 --- a/src/server/scripts/Kalimdor/zone_desolace.cpp +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp @@ -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); } } }; diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 2624709fc..7cd22ac07 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -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 diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index d1e516fe0..e3a14d203 100644 --- a/src/server/scripts/Kalimdor/zone_winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -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; } } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 3b0c79d63..51f872bb7 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -1480,7 +1480,7 @@ public: { if (param == ACTION_SWITCH_PHASE) { - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index ae4769284..56f0cc672 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -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 diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index b5456dff7..d3107d148 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -1322,7 +1322,7 @@ public: void JustDied(Unit* /*killer*/) override { - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index cd4cf6eb8..2386bdd34 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -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); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 95e711122..aa99e4da4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -131,7 +131,7 @@ public: void EnterEvadeMode(EvadeReason why) override { - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); ScriptedAI::EnterEvadeMode(why); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 68e8cb649..6f1a3620f 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -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); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp index 3342edfb0..1f3cc4eaf 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp @@ -1128,7 +1128,7 @@ public: if (Creature* boss = instance->GetCreature(NPC_ArgentChampionGUID)) { boss->GetMotionMaster()->MovePoint(0, SpawnPosition); - boss->DespawnOrUnsummon(3000); + boss->DespawnOrUnsummon(3s); } } break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 55410eea2..54b33f2b6 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -574,7 +574,7 @@ public: if (spell->Id == SPELL_SPIKE_FAIL) { me->RemoveAllAuras(); - me->DespawnOrUnsummon(1500); + me->DespawnOrUnsummon(1500ms); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 67cd96d41..8e82e9cb4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -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 diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 2eb540e02..aa2028a22 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -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); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 71dcb5e85..ad3c4cdb4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -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; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index 809896977..78defb706 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -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 diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index a8f22adf8..e5190c5ed 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -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()); } diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index 7feed77da..80d04808d 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -242,7 +242,7 @@ public: { me->GetMotionMaster()->MoveIdle(); me->CastSpell(b, SPELL_CONSUME_SOUL, true); - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); return; } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 66e3444e7..f3ba31fc2 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -1153,7 +1153,7 @@ public: ScriptedAI::EnterEvadeMode(why); if (me->IsSummon()) - me->ToTempSummon()->DespawnOrUnsummon(1); + me->ToTempSummon()->DespawnOrUnsummon(1ms); } }; }; diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 21e50018b..f18fecfa2 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -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); } } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index a432db0e2..bebf2da81 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -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); } } diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 7b11623c5..c9caba5eb 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -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); } } diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index 3df618cd4..492ceb008 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -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 diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index afc11c5cc..78baeb7eb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -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); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 8610c2e34..b6915138c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -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: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index c9cfe56d4..fd4f2208d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -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); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 54b279510..45dc33219 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -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; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 509ff92fb..53a73a8fe 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -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; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index a7f0794fa..cdcc90960 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -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); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index cd3a73fdf..ef366c707 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -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 diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 2dc55ae95..82ae8c8d3 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -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); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index b33567ca0..5a88d28a4 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -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; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 75bdea092..4fa36acac 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -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); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 74221610a..cac4c599f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -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 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); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 667a92218..dbc3974ee 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -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: diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 7cf70c4b4..384ffda0f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -507,7 +507,7 @@ public: { if (!me->IsInCombat()) { - me->DespawnOrUnsummon(500); + me->DespawnOrUnsummon(500ms); } } if (param == ACTION_GUARDIANS_OFF) diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 39c3faf62..3ac5974b5 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -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); } }; }; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp index 4f4b09b75..17de5127f 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp @@ -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; } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index 5926c11b6..e41c190ae 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -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) { diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 01cdb73fb..87d4b4b80 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -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 }; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index 752ef36a3..e19997426 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -269,7 +269,7 @@ public: me->RemoveAllAuras(); me->CastSpell(me, SPELL_SPARK_DESPAWN, true); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } } }; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index c64594b11..8d7c3dfdd 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -378,7 +378,7 @@ public: volkhan->AI()->DoAction(ACTION_DESTROYED); me->CastSpell(me, me->GetMap()->IsHeroic() ? SPELL_SHATTER_H : SPELL_SHATTER_N, true); - me->DespawnOrUnsummon(500); + me->DespawnOrUnsummon(500ms); } } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp index b0dd3d79f..51cd73619 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp @@ -594,7 +594,7 @@ public: if (Creature* darkMatterTarget = ObjectAccessor::GetCreature(*me, darkMatterTargetGUID)) { darkMatterTarget->CastSpell(darkMatterTarget, darkMatterTarget->GetMap()->IsHeroic() ? SPELL_DARK_MATTER_H : SPELL_DARK_MATTER, true); - darkMatterTarget->DespawnOrUnsummon(500); + darkMatterTarget->DespawnOrUnsummon(500ms); } break; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index a11c0e291..8a7db94e6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -443,7 +443,7 @@ public: if (me->IsInCombat()) events.ScheduleEvent(EVENT_DESPAWN_ALGALON_4, 26s); events.ScheduleEvent(EVENT_DESPAWN_ALGALON_5, 32s); - me->DespawnOrUnsummon(39000); + me->DespawnOrUnsummon(39s); me->SetReactState(REACT_PASSIVE); me->AttackStop(); @@ -795,7 +795,7 @@ public: case EVENT_OUTRO_11: me->SetStandState(UNIT_STAND_STATE_STAND); me->CastSpell(me, SPELL_TELEPORT, false); - me->DespawnOrUnsummon(3000); + me->DespawnOrUnsummon(3s); break; case EVENT_DESPAWN_ALGALON_1: Talk(SAY_ALGALON_DESPAWN_1); @@ -812,7 +812,7 @@ public: case EVENT_DESPAWN_ALGALON_5: me->SetStandState(UNIT_STAND_STATE_STAND); me->CastSpell(me, SPELL_TELEPORT, false); - me->DespawnOrUnsummon(3000); + me->DespawnOrUnsummon(3s); break; case EVENT_CHECK_HERALD_ITEMS: if (!DoCheckHeraldOfTheTitans()) @@ -886,7 +886,7 @@ public: events.ScheduleEvent(EVENT_SUMMON_ALGALON, 7500ms); return; case 10: - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); return; case POINT_BRANN_OUTRO: case POINT_BRANN_OUTRO_END: @@ -1025,10 +1025,10 @@ public: instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_ID_SUPERMASSIVE_START); caster->CastSpell((Unit*)nullptr, SPELL_BLACK_HOLE_CREDIT, TRIGGERED_FULL_MASK); - caster->ToCreature()->DespawnOrUnsummon(1); - me->DespawnOrUnsummon(1); + caster->ToCreature()->DespawnOrUnsummon(1ms); + me->DespawnOrUnsummon(1ms); if (Creature* voidZone = caster->FindNearestCreature(NPC_ALGALON_VOID_ZONE_VISUAL_STALKER, 10.0f)) - voidZone->DespawnOrUnsummon(1); + voidZone->DespawnOrUnsummon(1ms); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index 9df9798ec..29eb6cb58 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -579,7 +579,7 @@ public: if (Player* target = SelectTargetFromPlayerList(150)) me->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f); else - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } void MovementInform(uint32 type, uint32 /*id*/) override @@ -588,7 +588,7 @@ public: { _boomed = true; me->CastSpell(me, SPELL_LIGHTNING_BLAST, true); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } } }; @@ -902,7 +902,7 @@ class spell_assembly_rune_of_summoning_aura : public AuraScript void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (TempSummon* summ = GetTarget()->ToTempSummon()) - summ->DespawnOrUnsummon(1); + summ->DespawnOrUnsummon(1ms); } void Register() override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 3a30bbc84..a4b1ef675 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -393,7 +393,7 @@ public: else { summons.DespawnAll(); - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } if (_feralEssenceStack) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 77d1053fc..a0a17863e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -748,7 +748,7 @@ public: _despawnTimer = 0; if (Vehicle* veh = me->GetVehicle()) if (veh->GetPassenger(0) == me || veh->GetPassenger(1) == me) - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } } @@ -1157,7 +1157,7 @@ public: _beamTimer = 0; _removeTimer = 1; - me->DespawnOrUnsummon(5 * IN_MILLISECONDS); + me->DespawnOrUnsummon(5s); } } if (_removeTimer) @@ -1364,7 +1364,7 @@ public: liquid->CastSpell(liquid, SPELL_DUST_CLOUD_IMPACT, true); } - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } } @@ -1750,7 +1750,7 @@ class spell_vehicle_grab_pyrite : public SpellScript target->CastSpell(seat, GetEffectValue()); if (target->IsCreature()) - target->ToCreature()->DespawnOrUnsummon(1300); + target->ToCreature()->DespawnOrUnsummon(1300ms); } } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index df194ce32..9bb1d122a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -1024,7 +1024,7 @@ public: { me->RemoveAurasDueToSpell(SPELL_AUTO_GROW); me->CastSpell(me, me->GetMap()->Is25ManRaid() ? SPELL_LIFEBINDER_HEAL_25 : SPELL_LIFEBINDER_HEAL_10, true); - me->DespawnOrUnsummon(2000); + me->DespawnOrUnsummon(2s); _healTimer = 0; } } @@ -1063,7 +1063,7 @@ public: if (_despawnTimer >= 22000) { me->RemoveAurasDueToSpell(SPELL_AUTO_GROW); - me->DespawnOrUnsummon(2200); + me->DespawnOrUnsummon(2200ms); _despawnTimer = 0; } } @@ -1203,7 +1203,7 @@ public: if (Unit* target = SelectTargetFromPlayerList(80)) AttackStart(target); else - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); events.Repeat(10s); break; } @@ -1250,7 +1250,7 @@ public: if (_explodeTimer >= 11000) { me->CastSpell(me, me->GetMap()->Is25ManRaid() ? SPELL_NATURE_BOMB_DAMAGE_25 : SPELL_NATURE_BOMB_DAMAGE_10, false); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); _explodeTimer = 0; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 664565e88..cb7d6c500 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -450,7 +450,7 @@ public: void JustDied(Unit* /*killer*/) override { - me->DespawnOrUnsummon(3000); + me->DespawnOrUnsummon(3s); if (pInstance) if (Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX))) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index b318a0920..013418f22 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -704,18 +704,18 @@ public: if (Unit* s = me->ToTempSummon()->GetSummonerUnit()) { if ((s->IsPlayer() && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER)) || (s->IsCreature() && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))) - me->DespawnOrUnsummon(2000); + me->DespawnOrUnsummon(2s); else if (s->IsPlayer()) if (InstanceScript* instanceScript = me->GetInstanceScript()) if (instanceScript->GetData(TYPE_HODIR) == NOT_STARTED) { s->CastSpell(s, SPELL_FLASH_FREEZE_INSTAKILL, true); - me->DespawnOrUnsummon(2000); + me->DespawnOrUnsummon(2s); } } else { - me->DespawnOrUnsummon(2000); + me->DespawnOrUnsummon(2s); } } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 34f5cf155..b9a12638b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -339,9 +339,9 @@ public: go->SetLootRecipient(me); } if (Creature* arm = ObjectAccessor::GetCreature(*me, _left)) - arm->DespawnOrUnsummon(3000); // visual + arm->DespawnOrUnsummon(3s); // visual if (Creature* arm = ObjectAccessor::GetCreature(*me, _right)) - arm->DespawnOrUnsummon(3000); // visual + arm->DespawnOrUnsummon(3s); // visual me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetDisableGravity(true); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index f9497a46b..7a157ba5a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -740,17 +740,17 @@ public: LMK2->InterruptNonMeleeSpells(false); LMK2->AttackStop(); LMK2->AI()->SetData(1, 0); - LMK2->DespawnOrUnsummon(7000); + LMK2->DespawnOrUnsummon(7s); LMK2->SetReactState(REACT_PASSIVE); VX001->InterruptNonMeleeSpells(false); VX001->AttackStop(); VX001->AI()->SetData(1, 0); - VX001->DespawnOrUnsummon(7000); + VX001->DespawnOrUnsummon(7s); VX001->SetReactState(REACT_PASSIVE); ACU->InterruptNonMeleeSpells(false); ACU->AttackStop(); ACU->AI()->SetData(1, 0); - ACU->DespawnOrUnsummon(7000); + ACU->DespawnOrUnsummon(7s); ACU->SetReactState(REACT_PASSIVE); Position exitPos = me->GetPosition(); @@ -1221,7 +1221,7 @@ public: if (p->GetEntry() == NPC_LEVIATHAN_MKII_CANNON && !apply) { Unit::Kill(p, p); - p->ToCreature()->DespawnOrUnsummon(6000); + p->ToCreature()->DespawnOrUnsummon(6s); } } @@ -1343,7 +1343,7 @@ public: for (uint8 i = 0; i < 2; ++i) if (Unit* r = vk->GetPassenger(5 + i)) if (r->IsCreature()) - r->ToCreature()->DespawnOrUnsummon(1); + r->ToCreature()->DespawnOrUnsummon(1ms); } void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override @@ -1555,7 +1555,7 @@ public: void PassengerBoarded(Unit* p, int8 /*seat*/, bool apply) override { if (p->GetEntry() == NPC_ROCKET_VISUAL && !apply) - p->ToCreature()->DespawnOrUnsummon(8000); + p->ToCreature()->DespawnOrUnsummon(8s); } void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override @@ -2015,7 +2015,7 @@ public: if (despawnTimer <= diff) { despawnTimer = 60000; - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } else despawnTimer -= diff; @@ -2081,7 +2081,7 @@ public: bot->CastSpell(bot, SPELL_EMERGENCY_MODE, true); } - me->DespawnOrUnsummon(500); + me->DespawnOrUnsummon(500ms); timer = 99999; } else @@ -2346,7 +2346,7 @@ public: CAST_AI(npc_ulduar_flames_initial::npc_ulduar_flames_initialAI, c->AI())->RemoveFlame(me->GetGUID()); me->RemoveAllAuras(); - me->DespawnOrUnsummon(2500); + me->DespawnOrUnsummon(2500ms); } break; case SPELL_VX001_FROST_BOMB: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index d2b1aee4c..88fa0c12e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -859,7 +859,7 @@ public: else if (param == ACTION_SIF_TRANSFORM) { me->CastSpell(me, SPELL_SIF_TRANSFORM, true); - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); events.Reset(); _allowCast = false; } @@ -875,7 +875,7 @@ public: { case EVENT_SIF_FINISH_DOMINION: Talk(SAY_SIF_HM_MISSED); - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); break; case EVENT_SIF_START_TALK: Talk(SAY_SIF_AGGRO); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 750df991f..1286139c3 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -611,7 +611,7 @@ public: if (!urand(0, 2)) pXT002->AI()->Talk(EMOTE_SCRAPBOT); - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } } @@ -657,7 +657,7 @@ public: if (Unit* target = SelectTargetFromPlayerList(200)) AttackStart(target); else - me->DespawnOrUnsummon(500); + me->DespawnOrUnsummon(500ms); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 00e44dfe9..a944101a1 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -1807,7 +1807,7 @@ public: } me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } private: diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index a3d0626fa..41a35a583 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -80,7 +80,7 @@ struct npc_frost_tomb : public NullCreatureAI if (PrisonerGUID) if (Unit* p = ObjectAccessor::GetUnit(*me, PrisonerGUID)) p->RemoveAurasDueToSpell(SPELL_FROST_TOMB_AURA); - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); } void UpdateAI(uint32 /*diff*/) override diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index 6ac9bdbf3..326ac6e7a 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -344,7 +344,7 @@ public: if (Creature* pIchoron = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_ICHORON_GUID))) if (pIchoron->AI()) pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_KILLED); - me->DespawnOrUnsummon(2500); + me->DespawnOrUnsummon(2500ms); } void AttackStart(Unit* /*who*/) override {} diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp index f372215ff..7cfab3ed2 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp @@ -135,7 +135,7 @@ public: if (me->GetDistance(c) < 3.0f) { c->CastSpell(me, SPELL_ARCANE_POWER, false); - c->DespawnOrUnsummon(8000); + c->DespawnOrUnsummon(8s); found = true; } if (found) diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index f7ec86e1b..65263e655 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -222,7 +222,7 @@ public: if (Creature* c = pInstance->instance->GetCreature(SummonedGUID)) c->DespawnOrUnsummon(); } - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); } void SummonedCreatureDespawn(Creature* pSummoned) override diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 812bbe05c..12165fbac 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -205,7 +205,7 @@ public: break; case EVENT_SUMMON_SABOTEOUR: DoSummon(NPC_SABOTEOUR, me, 2.0f, 0, TEMPSUMMON_CORPSE_DESPAWN); - me->DespawnOrUnsummon(3000); + me->DespawnOrUnsummon(3s); break; } @@ -1136,7 +1136,7 @@ public: me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetDisplayId(11686); me->CastSpell(me, SPELL_TELEPORT_VISUAL, true); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } ++count; } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 2ff4dc6d2..eefd5f448 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -63,7 +63,7 @@ class spell_q11919_q11940_drake_hunt_aura : public AuraScript GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true); owner->SetFaction(FACTION_FRIENDLY); owner->SetImmuneToAll(true); - owner->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS); + owner->DespawnOrUnsummon(180s); } void Register() override diff --git a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp index a211b2202..1fb9ff67b 100644 --- a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp +++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp @@ -44,7 +44,7 @@ struct npc_preparations_for_war_vehicle : public NullCreatureAI WPPath* path = sSmartWaypointMgr->GetPath(me->GetEntry()); if (!path || path->empty()) { - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); return; } @@ -108,7 +108,7 @@ struct npc_preparations_for_war_vehicle : public NullCreatureAI if (me->GetDistance2d(x, y) < 10.0f) { - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); if (Vehicle* vehicle = me->GetVehicleKit()) if (Unit* passenger = vehicle->GetPassenger(0)) { diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index b8e657602..b406df171 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -491,9 +491,9 @@ public: HideNozdormu(); if (Creature* cr = GetCopy()) cr->AI()->Talk(SAY_HOURGLASS_END_2, GetPlayer()); - me->DespawnOrUnsummon(500); + me->DespawnOrUnsummon(500ms); if (GetCopy()) - GetCopy()->DespawnOrUnsummon(500); + GetCopy()->DespawnOrUnsummon(500ms); break; } } @@ -626,7 +626,7 @@ public: { Talk(0); me->RemoveAllAuras(); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); if (TempSummon* summon = me->ToTempSummon()) if (Unit* owner = summon->GetSummonerUnit()) if (Player* player = owner->ToPlayer()) @@ -726,7 +726,7 @@ public: } case EVENT_TAKE_OFF: { - me->DespawnOrUnsummon(4050); + me->DespawnOrUnsummon(4050ms); me->SetOrientation(2.5f); me->SetSpeedRate(MOVE_FLIGHT, 1.0f); Position pos = me->GetPosition(); @@ -1055,12 +1055,12 @@ public: if (fromReset) { if (Creature* c = me->FindNearestCreature(NPC_SAC_LIGHTS_VENGEANCE, 150.0f, true)) - c->DespawnOrUnsummon(1); + c->DespawnOrUnsummon(1ms); if (Creature* c = me->FindNearestCreature(NPC_SAC_LIGHTS_VENGEANCE_VEH_1, 150.0f, true)) c->RemoveAllAuras(); } if (Creature* c = me->FindNearestCreature(NPC_SAC_LIGHTS_VENGEANCE_VEH_2, 150.0f, true)) - c->DespawnOrUnsummon(1); + c->DespawnOrUnsummon(1ms); if (GameObject* go = me->FindNearestGameObject(GO_SAC_LIGHTS_VENGEANCE_1, 150.0f)) go->Delete(); if (GameObject* go = me->FindNearestGameObject(GO_SAC_LIGHTS_VENGEANCE_2, 150.0f)) @@ -1289,18 +1289,18 @@ public: { c->CastSpell(v, SPELL_SAC_KILL_VEGARD, true); v->SetDisplayId(11686); - v->DespawnOrUnsummon(1000); + v->DespawnOrUnsummon(1s); b->CastSpell(b, SPELL_SAC_HOLY_BOMB_EXPLOSION, true); b->CastSpell(b, SPELL_SAC_SUMMON_GO_2, true); if (Unit* vb = c->GetVehicleBase()) { if (Unit* pass = vb->GetVehicleKit()->GetPassenger(0)) if (pass->IsCreature()) - pass->ToCreature()->DespawnOrUnsummon(1); + pass->ToCreature()->DespawnOrUnsummon(1ms); vb->RemoveAllAuras(); - vb->ToCreature()->DespawnOrUnsummon(1); + vb->ToCreature()->DespawnOrUnsummon(1ms); } - c->ToCreature()->DespawnOrUnsummon(1); + c->ToCreature()->DespawnOrUnsummon(1ms); } } break; @@ -1325,7 +1325,7 @@ public: if (spell->Id == SPELL_SAC_REPEL_HAMMER && target->IsCreature()) { target->CastSpell((Unit*)nullptr, SPELL_SAC_THROW_HAMMER, true); - target->ToCreature()->DespawnOrUnsummon(1); + target->ToCreature()->DespawnOrUnsummon(1ms); if (Unit* c = target->GetVehicleBase()) c->RemoveAurasDueToSpell(SPELL_SAC_HOLY_ZONE_AURA); } @@ -1559,7 +1559,7 @@ public: void JustDied(Unit* /*killer*/) override { Talk(1); - me->DespawnOrUnsummon(10000); + me->DespawnOrUnsummon(10s); if (Creature* c = me->FindNearestCreature(NPC_SAC_LICH_KING, 200.0f, true)) c->AI()->SetData(3, 3); } @@ -2062,7 +2062,7 @@ class spell_q12096_q12092_dummy : public SpellScript { tree->CastSpell(player, SPELL_CREATE_ITEM_BARK); tree->AI()->Talk(SAY_WALKER_FRIENDLY, player); - tree->DespawnOrUnsummon(1000); + tree->DespawnOrUnsummon(1s); } else if (roll == 0) // enemy version { @@ -2321,7 +2321,7 @@ class spell_dragonblight_devour_ghoul_periodic : public AuraScript if (GetUnitOwner() && GetUnitOwner()->ToCreature()) { GetUnitOwner()->ExitVehicle(); - GetUnitOwner()->ToCreature()->DespawnOrUnsummon(2000); + GetUnitOwner()->ToCreature()->DespawnOrUnsummon(2s); } } diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index 1084acac0..c6354f6d3 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -590,77 +590,77 @@ public: if (me->GetPositionY() == -2835.11f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); - me->DespawnOrUnsummon(20000); + me->DespawnOrUnsummon(20s); } if (me->GetPositionY() == -2981.89f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); - me->DespawnOrUnsummon(18000); + me->DespawnOrUnsummon(18s); } if (me->GetPositionY() == -2934.44f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); - me->DespawnOrUnsummon(9000); + me->DespawnOrUnsummon(9s); } if (me->GetPositionY() == -3020.99f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); - me->DespawnOrUnsummon(22000); + me->DespawnOrUnsummon(22s); } if (me->GetPositionY() == -2964.73f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_2, false); - me->DespawnOrUnsummon(15000); + me->DespawnOrUnsummon(15s); } if (me->GetPositionY() == -2940.50f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); - me->DespawnOrUnsummon(20000); + me->DespawnOrUnsummon(20s); } if (me->GetPositionY() == -2847.93f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); - me->DespawnOrUnsummon(30000); + me->DespawnOrUnsummon(30s); } if (me->GetPositionY() == -2835.31f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); - me->DespawnOrUnsummon(27000); + me->DespawnOrUnsummon(27s); } if (me->GetPositionY() == -2822.20f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); - me->DespawnOrUnsummon(25000); + me->DespawnOrUnsummon(25s); } if (me->GetPositionY() == -2846.31f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); - me->DespawnOrUnsummon(21000); + me->DespawnOrUnsummon(21s); } if (me->GetPositionY() == -2897.23f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); - me->DespawnOrUnsummon(15000); + me->DespawnOrUnsummon(15s); } if (me->GetPositionY() == -2886.01f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); - me->DespawnOrUnsummon(25000); + me->DespawnOrUnsummon(25s); } if (me->GetPositionY() == -2906.89f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); - me->DespawnOrUnsummon(25000); + me->DespawnOrUnsummon(25s); } if (me->GetPositionY() == -3048.94f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_2, false); - me->DespawnOrUnsummon(30000); + me->DespawnOrUnsummon(30s); } if (me->GetPositionY() == -2961.08f) { me->GetMotionMaster()->MovePath(WOUNDED_MOVE_2, false); - me->DespawnOrUnsummon(25000); + me->DespawnOrUnsummon(25s); } break; case EVENT_CLEAVE: @@ -871,7 +871,7 @@ public: { if (_following) if (!me->HasAura(SPELL_FROG_LOVE)) - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); _events.Update(diff); @@ -898,7 +898,7 @@ public: break; case EVENT_LAKEFROG_5: Talk(SAY_MAIDEN_1); - me->DespawnOrUnsummon(4000); + me->DespawnOrUnsummon(4s); break; default: break; diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 6022af4bc..ddcd03de7 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -44,9 +44,9 @@ public: if (Creature* cow = me->FindNearestCreature(24797, 5.0f, true)) { me->CastSpell(me, 44460, true); - me->DespawnOrUnsummon(10000); + me->DespawnOrUnsummon(10s); cow->CastSpell(cow, 44460, true); - cow->DespawnOrUnsummon(10000); + cow->DespawnOrUnsummon(10s); if (me->IsSummon()) if (Unit* owner = me->ToTempSummon()->GetSummonerUnit()) owner->CastSpell(owner, 44463, true); diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index d9b5d1ab5..fce6523ee 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -501,7 +501,7 @@ public: events.RescheduleEvent(EVENT_SOUL_COAX, 5s); } else - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); break; case EVENT_SOUL_COAX: Talk(SAY_ARETE_1); @@ -580,14 +580,14 @@ public: if (Creature* soul = ObjectAccessor::GetCreature(*me, _landgrenSoulGUID)) { soul->AI()->Talk(SAY_SOUL_4); - soul->DespawnOrUnsummon(2000); + soul->DespawnOrUnsummon(2s); } events.ScheduleEvent(EVENT_SCENE_10, 3s); break; case EVENT_SCENE_10: me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_QUESTGIVER); Talk(SAY_ARETE_6); - me->DespawnOrUnsummon(60000); + me->DespawnOrUnsummon(60s); break; } } @@ -796,7 +796,7 @@ public: summon->SetUInt32Value(UNIT_NPC_EMOTESTATE, param); break; case ACTION_SUMMON_DESPAWN: - summon->DespawnOrUnsummon(param); + summon->DespawnOrUnsummon(Milliseconds(param)); break; case ACTION_SUMMON_ORIENTATION: summon->SetFacingTo(param / 100.0f); @@ -1022,9 +1022,9 @@ public: { if (summon->GetEntry() == NPC_TIRION_LICH_KING) summon->CastSpell(summon, SPELL_LICH_KINGS_FURY, false); - summon->DespawnOrUnsummon(summon->GetEntry() == NPC_TIRION_LICH_KING ? 10000 : 4000); + summon->DespawnOrUnsummon(summon->GetEntry() == NPC_TIRION_LICH_KING ? 10s : 4s); } - me->DespawnOrUnsummon(10000); + me->DespawnOrUnsummon(10s); break; } } @@ -1310,14 +1310,14 @@ public: turret->HandleSpellClick(owner, 0); return; } - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); break; case EVENT_START_FLIGHT: { WPPath* path = sSmartWaypointMgr->GetPath(me->GetEntry()); if (!path || path->empty()) { - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); return; } @@ -1342,7 +1342,7 @@ public: // Check if path is finished if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != ESCORT_MOTION_TYPE) { - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); return; } @@ -1381,7 +1381,7 @@ public: station->RemoveAurasDueToSpell(SPELL_INFRA_GREEN_SHIELD); } if (!playerPresent) - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } events.ScheduleEvent(EVENT_SYNCHRONIZE_SHIELDS, 1s); break; diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index d43a29a5e..16bfe5925 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -159,7 +159,7 @@ public: me->RemoveAllAurasExceptType(SPELL_AURA_MECHANIC_IMMUNITY); Talk(1); caster->ToPlayer()->KilledMonsterCredit(me->GetEntry()); - me->DespawnOrUnsummon(8000); + me->DespawnOrUnsummon(8s); me->GetMotionMaster()->MoveJump(8721.94f, -1955, 963, 70.0f, 30.0f); } } @@ -1149,13 +1149,13 @@ public: } else { - me->DespawnOrUnsummon(100); + me->DespawnOrUnsummon(100ms); } break; case 24: if (me->GetEntry() == NPC_PROPELLED_DEVICE_1) { - me->DespawnOrUnsummon(100); + me->DespawnOrUnsummon(100ms); } break; default: diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 8b36a3106..3a91af290 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -591,7 +591,7 @@ public: // pointer check not needed DoCast(rageclaw, SPELL_FREE_RAGECLAW, true); _rageclawGUID.Clear(); - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } void SpellHit(Unit* caster, SpellInfo const* spell) override @@ -660,7 +660,7 @@ public: DoCast(me, SPELL_UNSHACKLED, true); Talk(SAY_RAGECLAW); me->GetMotionMaster()->MoveRandom(10); - me->DespawnOrUnsummon(10000); + me->DespawnOrUnsummon(10s); } } }; @@ -755,7 +755,7 @@ public: case EVENT_RECRUIT_2: me->SetWalk(true); me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + (cos(_heading) * 10), me->GetPositionY() + (std::sin(_heading) * 10), me->GetPositionZ()); - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); break; default: break; diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 2941b05da..93ae31450 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1436,7 +1436,7 @@ class spell_illidan_parasitic_shadowfiend_trigger : public SpellScript { PreventHitDefaultEffect(effIndex); if (Creature* target = GetHitCreature()) - target->DespawnOrUnsummon(1); + target->DespawnOrUnsummon(1ms); } void Register() override @@ -1692,7 +1692,7 @@ class spell_illidan_cage_trap : public SpellScript if (GetCaster()->GetExactDist2d(target) < 4.0f) { target->AI()->DoAction(ACTION_ILLIDAN_CAGED); - GetCaster()->ToCreature()->DespawnOrUnsummon(1); + GetCaster()->ToCreature()->DespawnOrUnsummon(1ms); if (GameObject* gobject = GetCaster()->FindNearestGameObject(GO_CAGE_TRAP, 10.0f)) gobject->SetLootState(GO_JUST_DEACTIVATED); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index 79d68ebfa..70e52726a 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -107,7 +107,7 @@ public: { summoner->GetAI()->DoAction(_action); _owner.SetStandState(UNIT_STAND_STATE_SUBMERGED); - _owner.DespawnOrUnsummon(200); + _owner.DespawnOrUnsummon(200ms); } return true; } diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 39e772386..a8c18e4aa 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -391,7 +391,7 @@ struct npc_creature_generator_akama : public ScriptedAI void SummonedCreatureDies(Creature* summon, Unit*) override { spawnCounter--; - summon->DespawnOrUnsummon(10000); + summon->DespawnOrUnsummon(10s); summons.Despawn(summon); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 8ec98b72f..a9cd28a60 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -269,7 +269,7 @@ struct boss_fathomguard_sharkkis : public ScriptedAI { me->CastSpell(karathress, SPELL_POWER_OF_SHARKKIS, true); karathress->AI()->Talk(SAY_GAIN_ABILITY2); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } } @@ -452,7 +452,7 @@ struct boss_fathomguard_tidalvess : public ScriptedAI { me->CastSpell(karathress, SPELL_POWER_OF_TIDALVESS, true); karathress->AI()->Talk(SAY_GAIN_ABILITY1); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } } @@ -546,7 +546,7 @@ struct boss_fathomguard_caribdis : public ScriptedAI { me->CastSpell(karathress, SPELL_POWER_OF_CARIBDIS, true); karathress->AI()->Talk(SAY_GAIN_ABILITY3); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index 7ac8263d3..9d25ba77d 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -88,7 +88,7 @@ struct boss_the_lurker_below : public BossAI pool->SetRespawnTime(10); pool->SaveRespawnTime(10); } - me->DespawnOrUnsummon(2000); + me->DespawnOrUnsummon(2s); } void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*type*/, SpellSchoolMask /*school*/) override diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp index 1551d7c81..15b91e685 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp @@ -234,7 +234,7 @@ class spell_serpentshrine_cavern_serpentshrine_parasite_trigger : public SpellSc { PreventHitDefaultEffect(effIndex); if (Creature* target = GetHitCreature()) - target->DespawnOrUnsummon(1); + target->DespawnOrUnsummon(1ms); } void Register() override diff --git a/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp b/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp index c1d2c7d42..9f837911c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp @@ -619,7 +619,7 @@ struct npc_ahune_ice_spear_bunny : public ScriptedAI _scheduler.Schedule(2500ms, [this](TaskContext /*task*/) { DoCastSelf(SPELL_ICE_SPEAR_DELAY); - me->DespawnOrUnsummon(3500); + me->DespawnOrUnsummon(3500ms); }); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp index 73beb4eb0..a8b98b64c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp @@ -123,7 +123,7 @@ struct npc_underbog_mushroom : public ScriptedAI context.Schedule(4s, [this](TaskContext /*context*/) { me->RemoveAurasDueToSpell(SPELL_GROW); - me->DespawnOrUnsummon(2000); + me->DespawnOrUnsummon(2s); }); } else diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 26a0c780b..b95e01b3e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -155,7 +155,7 @@ struct boss_nazan : public ScriptedAI void EnterEvadeMode(EvadeReason /*why*/) override { - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } void JustEngagedWith(Unit*) override @@ -262,7 +262,7 @@ struct boss_vazruden : public ScriptedAI void EnterEvadeMode(EvadeReason /*why*/) override { Talk(SAY_WIPE); - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); } void JustEngagedWith(Unit*) override diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index e37234663..df645e4ec 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -284,7 +284,7 @@ struct npc_target_trigger : public ScriptedAI _scheduler.Schedule(5s, [this](TaskContext /*context*/) { DoCastSelf(SPELL_DEBRIS_DAMAGE); - me->DespawnOrUnsummon(6000); + me->DespawnOrUnsummon(6s); }); } } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index ba032cb9e..c12b5af84 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -1013,7 +1013,7 @@ class spell_kaelthas_flame_strike : public AuraScript { GetUnitOwner()->RemoveAllAuras(); GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FLAME_STRIKE_DAMAGE, true); - GetUnitOwner()->ToCreature()->DespawnOrUnsummon(2000); + GetUnitOwner()->ToCreature()->DespawnOrUnsummon(2s); } void Register() override diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index 81e4b4b5a..f9f862fd3 100644 --- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -116,7 +116,7 @@ public: if (Creature* bunny = GetClosestCreatureWithEntry(me, NPC_EXPLOSION_BUNNY, 200.0f)) bunny->CastSpell(nullptr, SPELL_EXPLOSION, TRIGGERED_NONE); if (Creature* cannon = ObjectAccessor::GetCreature(*me, CannonGUID)) - cannon->DespawnOrUnsummon(5000); + cannon->DespawnOrUnsummon(5s); } me->SummonGameObject(GO_BIG_FIRE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 60); @@ -460,7 +460,7 @@ public: Talk(SAY_SPELL_INFLUENCE, who); /// @todo Move the below to updateAI and run if this statement == true DoCast(who, SPELL_DISPELLING_ANALYSIS, true); - bird->DespawnOrUnsummon(2000); + bird->DespawnOrUnsummon(2s); } } } @@ -775,7 +775,7 @@ public: if (GameObject* relic = me->FindNearestGameObject(large ? GO_APEXIS_MONUMENT : GO_APEXIS_RELIC, searchDistance)) relic->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } /* @@ -1086,7 +1086,7 @@ public: // Spell 37392 does not exist in dbc, manually spawning me->SummonCreature(NPC_OSCILLATING_FREQUENCY_SCANNER_TOP_BUNNY, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 50000); me->SummonGameObject(GO_OSCILLATING_FREQUENCY_SCANNER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 50); - me->DespawnOrUnsummon(50000); + me->DespawnOrUnsummon(50s); } timer = 500; diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 7f462f79e..863ed3eb2 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -464,7 +464,7 @@ public: player->KilledMonsterCredit(NPC_MAGHAR_PRISONER); prisoner->AI()->Talk(SAY_FREE, player); - prisoner->DespawnOrUnsummon(6000); + prisoner->DespawnOrUnsummon(6s); } return true; diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp index 805e50000..40c92b673 100644 --- a/src/server/scripts/Pet/pet_generic.cpp +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -327,7 +327,7 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI creature->CastSpell(creature, spellId, true); player->AddSpellCooldown(spellId, 0, 3 * MINUTE * IN_MILLISECONDS); player->AddSpellCooldown(player->GetTeamId(true) ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S, 0, 3 * MINUTE * IN_MILLISECONDS + 4 * HOUR * IN_MILLISECONDS); - creature->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS); + creature->DespawnOrUnsummon(180s); } return true; } @@ -388,7 +388,7 @@ struct npc_pet_gen_target_following_bomb : public NullCreatureAI if (me->GetDistance(target) < 3.0f) { me->CastSpell(me, bombSpellId, false); - me->DespawnOrUnsummon(500); + me->DespawnOrUnsummon(500ms); } } else if (!me->HasUnitState(UNIT_STATE_FOLLOW)) @@ -557,7 +557,7 @@ struct npc_pet_gen_imp_in_a_bottle : public NullCreatureAI if (_talkTimer >= 5000) { _talkTimer = 0; - me->DespawnOrUnsummon(1); + me->DespawnOrUnsummon(1ms); if (!_hasParty) Talk(0, ObjectAccessor::GetPlayer(*me, _ownerGUID)); else if (Player* player = ObjectAccessor::GetPlayer(*me, _ownerGUID)) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index fcd58e2f7..a3a62ae7e 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3706,7 +3706,7 @@ class spell_gen_despawn_self : public SpellScript void HandleDummy(SpellEffIndex effIndex) { if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_SCRIPT_EFFECT) - GetCaster()->ToCreature()->DespawnOrUnsummon(1); + GetCaster()->ToCreature()->DespawnOrUnsummon(1ms); } void Register() override diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index d3325403a..8ec480ca0 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -302,7 +302,7 @@ class spell_hun_taming_the_beast : public AuraScript { if (Unit* target = GetTarget()) if (Creature* creature = target->ToCreature()) - creature->DespawnOrUnsummon(1); + creature->DespawnOrUnsummon(1ms); } void Register() override diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 5b458f44c..e99d56478 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -347,7 +347,7 @@ class spell_item_rocket_chicken : public AuraScript { if (roll_chance_i(5)) { - GetTarget()->ToCreature()->DespawnOrUnsummon(8000); + GetTarget()->ToCreature()->DespawnOrUnsummon(8s); GetTarget()->Kill(GetTarget(), GetTarget()); } else if (roll_chance_i(50)) @@ -468,7 +468,7 @@ class spell_item_toxic_wasteling : public SpellScript GetCaster()->GetMotionMaster()->MoveIdle(); GetCaster()->ToCreature()->SetHomePosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f); GetCaster()->GetMotionMaster()->MoveJump(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 12.0f, 3.0f, 1); - target->DespawnOrUnsummon(1500); + target->DespawnOrUnsummon(1500ms); } } @@ -505,7 +505,7 @@ class spell_item_lil_xt : public SpellScript return; if (GetCaster()->IsCreature() && GetCaster()->ToCreature()->AI()) GetCaster()->ToCreature()->AI()->Talk(2); - target->DespawnOrUnsummon(500); + target->DespawnOrUnsummon(500ms); } void Register() override diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 704a35424..9020cb991 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -68,7 +68,7 @@ class spell_q11065_wrangle_some_aether_rays_aura : public AuraScript { cr->CastSpell(player, 40926, true); cr->GetMotionMaster()->MoveFollow(player, 5.0f, 2 * M_PI * rand_norm()); - ar->ToCreature()->DespawnOrUnsummon(500); + ar->ToCreature()->DespawnOrUnsummon(500ms); } } } @@ -756,10 +756,10 @@ private: uint32 _originalEntry; uint32 _newEntry; bool _shouldAttack; - uint32 _despawnTime; + Milliseconds _despawnTime; public: - spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime = 0) : + spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, Milliseconds despawnTime = 0ms) : SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry), _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { } @@ -772,7 +772,7 @@ public: if (_shouldAttack && creatureTarget->IsAIEnabled) creatureTarget->AI()->AttackStart(GetCaster()); - if (_despawnTime) + if (_despawnTime > 0ms) creatureTarget->DespawnOrUnsummon(_despawnTime); } } @@ -900,10 +900,11 @@ enum Quests6124_6129Data NPC_SICKLY_GAZELLE = 12296, NPC_CURED_GAZELLE = 12297, NPC_SICKLY_DEER = 12298, - NPC_CURED_DEER = 12299, - DESPAWN_TIME = 30000 + NPC_CURED_DEER = 12299 }; +constexpr Milliseconds DESPAWN_TIME = 30s; + class spell_q6124_6129_apply_salve : public SpellScript { PrepareSpellScript(spell_q6124_6129_apply_salve); @@ -1372,7 +1373,7 @@ class spell_q12937_relief_for_the_fallen : public AuraScript if (target && target->ToCreature()) { caster->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER); - target->ToCreature()->DespawnOrUnsummon(5000); + target->ToCreature()->DespawnOrUnsummon(5s); target->SetStandState(UNIT_STAND_STATE_STAND); target->ToCreature()->AI()->Talk(TALK_FALLEN_EARTHEN_HEALED); @@ -1513,7 +1514,7 @@ class spell_q9874_liquid_fire : public SpellScript { caster->KilledMonsterCredit(NPC_VILLAGER_KILL_CREDIT); target->CastSpell(target, SPELL_FLAMES, true); - target->DespawnOrUnsummon(20000); + target->DespawnOrUnsummon(20s); } } @@ -1560,7 +1561,7 @@ class spell_q12805_lifeblood_dummy : public SpellScript caster->KilledMonsterCredit(NPC_SHARD_KILL_CREDIT); target->CastSpell(target, uint32(GetEffectValue()), true); - target->DespawnOrUnsummon(2000); + target->DespawnOrUnsummon(2s); } void Register() override @@ -2144,7 +2145,7 @@ class spell_q12690_burst_at_the_seams : public SpellScript void HandleScript(SpellEffIndex /*effIndex*/) { - GetCaster()->ToCreature()->DespawnOrUnsummon(2 * IN_MILLISECONDS); + GetCaster()->ToCreature()->DespawnOrUnsummon(2s); } void Register() override diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 458984900..6caf5982d 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -476,7 +476,7 @@ public: if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid.GetCounter()) { me->CastSpell((Unit*)nullptr, SPELL_DARK_OFFERING, false); - me->DespawnOrUnsummon(1000); + me->DespawnOrUnsummon(1s); } } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 8b92bed07..b28ffaade 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -283,7 +283,7 @@ public: for (std::list::const_iterator itr = cList.begin(); itr != cList.end(); ++itr) { player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE); - (*itr)->DespawnOrUnsummon(urand(45000, 60000)); + (*itr)->DespawnOrUnsummon(randtime(45s, 60s)); (*itr)->GetMotionMaster()->MoveFollow(player, 1.0f, frand(0.0f, 2 * M_PI), MOTION_SLOT_CONTROLLED); } } @@ -1694,7 +1694,7 @@ public: for (std::list::const_iterator itr = childrenList.begin(); itr != childrenList.end(); ++itr) { player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID()); - (*itr)->DespawnOrUnsummon(5000); + (*itr)->DespawnOrUnsummon(5s); (*itr)->GetMotionMaster()->MovePoint(1, go->GetPositionX() + 5, go->GetPositionY(), go->GetPositionZ()); (*itr)->AI()->Talk(SAY_FREE_0); (*itr)->GetMotionMaster()->Clear(); diff --git a/src/server/scripts/World/npc_stave_of_ancients.cpp b/src/server/scripts/World/npc_stave_of_ancients.cpp index 2c318f274..159ff1e72 100644 --- a/src/server/scripts/World/npc_stave_of_ancients.cpp +++ b/src/server/scripts/World/npc_stave_of_ancients.cpp @@ -42,7 +42,7 @@ void NPCStaveQuestAI::RevealForm() { me->UpdateEntry(GetFormEntry("evil")); me->SetFullHealth(); - me->DespawnOrUnsummon(900000); + me->DespawnOrUnsummon(900s); } } @@ -373,7 +373,7 @@ public: SetHomePosition(); me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1); me->SetImmuneToAll(true); - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); break; } events.Repeat(2s); @@ -476,7 +476,7 @@ public: { if (flaggedForDespawn) { - me->DespawnOrUnsummon(0); + me->DespawnOrUnsummon(0ms); flaggedForDespawn = false; } } @@ -640,7 +640,7 @@ public: } else { - Precious()->DespawnOrUnsummon(0); + Precious()->DespawnOrUnsummon(0ms); } } @@ -765,9 +765,9 @@ public: me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1); me->SetImmuneToAll(true); - Precious()->DespawnOrUnsummon(5000); + Precious()->DespawnOrUnsummon(5s); - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); break; } events.Repeat(2s); @@ -978,7 +978,7 @@ public: me->CombatStop(true); me->Say(NELSON_DESPAWN_SAY); me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); break; } events.Repeat(2s); @@ -1149,7 +1149,7 @@ public: me->CombatStop(true); me->Say(FRANKLIN_DESPAWN_SAY); me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); - me->DespawnOrUnsummon(5000); + me->DespawnOrUnsummon(5s); break; } events.Repeat(2s);