diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/Utilities/EventMap.cpp | 6 | ||||
-rw-r--r-- | src/common/Utilities/EventMap.h | 6 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp | 3 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Outland/BlackTemple/boss_illidan.cpp | 4 |
5 files changed, 12 insertions, 11 deletions
diff --git a/src/common/Utilities/EventMap.cpp b/src/common/Utilities/EventMap.cpp index 917ef02b575..e4a1b447579 100644 --- a/src/common/Utilities/EventMap.cpp +++ b/src/common/Utilities/EventMap.cpp @@ -146,11 +146,11 @@ void EventMap::CancelEventGroup(uint32 group) } } -uint32 EventMap::GetTimeUntilEvent(uint32 eventId) const +Milliseconds EventMap::GetTimeUntilEvent(uint32 eventId) const { for (std::pair<TimePoint const, uint32> const& itr : _eventMap) if (eventId == (itr.second & 0x0000FFFF)) - return std::chrono::duration_cast<Milliseconds>((itr.first - _time)).count(); + return std::chrono::duration_cast<Milliseconds>(itr.first - _time); - return std::numeric_limits<uint32>::max(); + return Milliseconds::max(); } diff --git a/src/common/Utilities/EventMap.h b/src/common/Utilities/EventMap.h index 8d69524f2be..81f06b33b51 100644 --- a/src/common/Utilities/EventMap.h +++ b/src/common/Utilities/EventMap.h @@ -219,11 +219,11 @@ public: /** * @name GetTimeUntilEvent - * @brief Returns time in milliseconds until next event. + * @brief Returns time as std::chrono type until next event. * @param eventId of the event. - * @return Time of next event. + * @return Time of next event. If event is not scheduled returns Milliseconds::max() */ - uint32 GetTimeUntilEvent(uint32 eventId) const; + Milliseconds GetTimeUntilEvent(uint32 eventId) const; private: /** diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index fb89fbf224b..465bfaffa40 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -186,7 +186,8 @@ public: switch (eventId) { case EVENT_IMPALE: - if (events.GetTimeUntilEvent(EVENT_LOCUST) < 5 * IN_MILLISECONDS) break; // don't chain impale tank -> locust swarm + if (events.GetTimeUntilEvent(EVENT_LOCUST) < 5s) + break; // don't chain impale tank -> locust swarm if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) DoCast(target, SPELL_IMPALE); else diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 775551819fb..3844e85d44b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -879,7 +879,7 @@ class boss_leviathan_mk_ii : public CreatureScript DoCastVictim(SPELL_SCRIPT_EFFECT_PLASMA_BLAST); events.RescheduleEvent(EVENT_PLASMA_BLAST, 30s, 45s, 0, PHASE_LEVIATHAN_MK_II); - if (events.GetTimeUntilEvent(EVENT_NAPALM_SHELL) < 9000) + if (events.GetTimeUntilEvent(EVENT_NAPALM_SHELL) < 9s) events.RescheduleEvent(EVENT_NAPALM_SHELL, 9s, 0, PHASE_LEVIATHAN_MK_II); // The actual spell is cast by the turret, we should not let it interrupt itself. break; case EVENT_SHOCK_BLAST: @@ -894,7 +894,7 @@ class boss_leviathan_mk_ii : public CreatureScript DoCastAOE(SPELL_FORCE_CAST_NAPALM_SHELL); events.RescheduleEvent(EVENT_NAPALM_SHELL, 6s, 15s, 0, PHASE_LEVIATHAN_MK_II); - if (events.GetTimeUntilEvent(EVENT_PLASMA_BLAST) < 2000) + if (events.GetTimeUntilEvent(EVENT_PLASMA_BLAST) < 2s) events.RescheduleEvent(EVENT_PLASMA_BLAST, 2s, 0, PHASE_LEVIATHAN_MK_II); // The actual spell is cast by the turret, we should not let it interrupt itself. break; case EVENT_MOVE_POINT_2: diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 9e05549923c..8a48275ce55 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -915,8 +915,8 @@ struct boss_illidan_stormrage : public BossAI if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 150.0f, true)) DoCast(target, SPELL_DARK_BARRAGE); events.RescheduleEvent(EVENT_EYE_BLAST, Seconds(5), GROUP_PHASE_2); - uint32 currentTime = events.GetTimeUntilEvent(EVENT_FLY_TO_RANDOM_PILLAR); - events.RescheduleEvent(EVENT_FLY_TO_RANDOM_PILLAR, Seconds(currentTime) + Seconds(30), GROUP_PHASE_2); + Milliseconds currentTime = events.GetTimeUntilEvent(EVENT_FLY_TO_RANDOM_PILLAR); + events.RescheduleEvent(EVENT_FLY_TO_RANDOM_PILLAR, currentTime + 30s, GROUP_PHASE_2); break; } case EVENT_FIREBALL: |