diff options
| author | xinef1 <w.szyszko2@gmail.com> | 2017-03-02 02:19:25 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2019-08-17 20:04:14 +0200 |
| commit | 60663d1374beef3103f4787152654034fa4a8897 (patch) | |
| tree | 38e07d44442ad903a9729536942e8e253a072274 /src/server/scripts/Northrend | |
| parent | 98180ecdc179386270e93b80c0db8344b659557f (diff) | |
Ensure that all actions are compared to fixed point in time (ie. world update start) (#18910)
- Actions will not be dependent on processing moment
- Increased GameObjects cooldown resolution to milliseconds, fixes arming time of traps to be exactly one second and not something from range (1000, 1999)
- Created GameTime namespace and UpdateTime class and moved there some code out of world
(cherrypicked from 7567cafec84080d26ea513242a1f540a823b8f9d)
Diffstat (limited to 'src/server/scripts/Northrend')
4 files changed, 7 insertions, 4 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index d2f311b9082..dec0409d601 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1842,7 +1842,7 @@ class spell_icc_sprit_alarm : public SpellScriptLoader } if (GameObject* trap = GetCaster()->FindNearestGameObject(trapId, 5.0f)) - trap->SetRespawnTime(trap->GetGOInfo()->GetAutoCloseTime()); + trap->SetRespawnTime(trap->GetGOInfo()->GetAutoCloseTime() / IN_MILLISECONDS); std::list<Creature*> wards; GetCaster()->GetCreatureListWithEntryInGrid(wards, NPC_DEATHBOUND_WARD, 150.0f); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 6a9dac9f620..3d12ac2cf67 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -15,6 +15,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "GameTime.h" #include "ScriptMgr.h" #include "InstanceScript.h" #include "Log.h" @@ -339,7 +340,7 @@ struct boss_four_horsemen_baseAI : public BossAI } Talk(SAY_DEATH); - _timeDied = getMSTime(); + _timeDied = GameTime::GetGameTimeMS(); for (Horseman boss : horsemen) { if (Creature* cBoss = getHorsemanHandle(boss)) 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 27fb04e55eb..d320fd3cd38 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -18,6 +18,7 @@ #include "ScriptMgr.h" #include "GameEventMgr.h" +#include "GameTime.h" #include "InstanceScript.h" #include "MotionMaster.h" #include "nexus.h" @@ -171,7 +172,7 @@ public: while (time[i] != 0) ++i; - time[i] = sWorld->GetGameTime(); + time[i] = GameTime::GetGameTime(); if (i == 2 && (time[2] - time[1] < 5) && (time[1] - time[0] < 5)) ++splitPersonality; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index 40a49f5dfef..fde729203be 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -15,6 +15,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "GameTime.h" #include "ScriptMgr.h" #include "InstanceScript.h" #include "ObjectAccessor.h" @@ -197,7 +198,7 @@ class boss_ignis : public CreatureScript me->RemoveAuraFromStack(SPELL_STRENGHT); // Shattered Achievement - time_t secondKill = sWorld->GetGameTime(); + time_t secondKill = GameTime::GetGameTime(); if ((secondKill - _firstConstructKill) < 5) _shattered = true; _firstConstructKill = secondKill; |
