aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-07-14 01:35:25 +0200
committerPeter Keresztes Schmidt <carbenium@outlook.com>2020-07-17 17:05:55 +0200
commit896b68d5c297b06587645caebc98b704978ecaa7 (patch)
tree14952aaccd9419ce4e67831e12c81b988fc280f5 /src/server/scripts
parent235cdc2fd5c72e8dd8a91fb53a1b90babef24047 (diff)
Core/Time: Rename GetGameTime{System, Steady}Point methods
The names are a bit unhandy. Rename them (shorter but still meaningful). GetGameTimeSystemPoint() -> GetSystemTime() GetGameTimeSteadyPoint() -> Now() Also add 2 new typedefs: typedef std::chrono::steady_clock::time_point TimePoint; typedef std::chrono::system_clock::time_point SystemTimePoint; Closes #25042
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp16
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp12
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp4
3 files changed, 16 insertions, 16 deletions
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 044c99ebfd2..39a41dd1b10 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
@@ -854,7 +854,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
_controller.SetTransport(creature->GetTransport());
me->SetRegenerateHealth(false);
me->m_CombatDistance = 70.0f;
- _firstMageCooldown = GameTime::GetGameTimeSteadyPoint() + 60s;
+ _firstMageCooldown = GameTime::Now() + 60s;
_axethrowersYellCooldown = time_t(0);
_rocketeersYellCooldown = time_t(0);
}
@@ -864,7 +864,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
ScriptedAI::InitializeAI();
_events.Reset();
- _firstMageCooldown = GameTime::GetGameTimeSteadyPoint() + 60s;
+ _firstMageCooldown = GameTime::Now() + 60s;
_axethrowersYellCooldown = time_t(0);
_rocketeersYellCooldown = time_t(0);
}
@@ -916,7 +916,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
}
else if (action == ACTION_SPAWN_MAGE)
{
- std::chrono::steady_clock::time_point now = GameTime::GetGameTimeSteadyPoint();
+ TimePoint now = GameTime::Now();
if (_firstMageCooldown > now)
_events.ScheduleEvent(EVENT_SUMMON_MAGE, std::chrono::duration_cast<Milliseconds>(_firstMageCooldown - now));
else
@@ -1093,7 +1093,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
EventMap _events;
PassengerController _controller;
InstanceScript* _instance;
- std::chrono::steady_clock::time_point _firstMageCooldown;
+ TimePoint _firstMageCooldown;
time_t _axethrowersYellCooldown;
time_t _rocketeersYellCooldown;
};
@@ -1118,7 +1118,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
_controller.SetTransport(creature->GetTransport());
me->SetRegenerateHealth(false);
me->m_CombatDistance = 70.0f;
- _firstMageCooldown = GameTime::GetGameTimeSteadyPoint() + 60s;
+ _firstMageCooldown = GameTime::Now() + 60s;
_riflemanYellCooldown = time_t(0);
_mortarYellCooldown = time_t(0);
}
@@ -1128,7 +1128,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
ScriptedAI::InitializeAI();
_events.Reset();
- _firstMageCooldown = GameTime::GetGameTimeSteadyPoint() + 60s;
+ _firstMageCooldown = GameTime::Now() + 60s;
_riflemanYellCooldown = time_t(0);
_mortarYellCooldown = time_t(0);
}
@@ -1180,7 +1180,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
}
else if (action == ACTION_SPAWN_MAGE)
{
- std::chrono::steady_clock::time_point now = GameTime::GetGameTimeSteadyPoint();
+ TimePoint now = GameTime::Now();
if (_firstMageCooldown > now)
_events.ScheduleEvent(EVENT_SUMMON_MAGE, std::chrono::duration_cast<Milliseconds>(_firstMageCooldown - now));
else
@@ -1361,7 +1361,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
EventMap _events;
PassengerController _controller;
InstanceScript* _instance;
- std::chrono::steady_clock::time_point _firstMageCooldown;
+ TimePoint _firstMageCooldown;
time_t _riflemanYellCooldown;
time_t _mortarYellCooldown;
};
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 94c027853a4..1a2ffaec917 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -228,7 +228,7 @@ class spell_dru_eclipse : public AuraScript
if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 4)) // Starfire
return false;
- return _solarProcCooldownEnd <= GameTime::GetGameTimeSteadyPoint();
+ return _solarProcCooldownEnd <= GameTime::Now();
}
bool CheckLunar(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
@@ -241,14 +241,14 @@ class spell_dru_eclipse : public AuraScript
if (!roll_chance_i(60))
return false;
- return _lunarProcCooldownEnd <= GameTime::GetGameTimeSteadyPoint();
+ return _lunarProcCooldownEnd <= GameTime::Now();
}
void ProcSolar(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- _solarProcCooldownEnd = GameTime::GetGameTimeSteadyPoint() + Seconds(30);
+ _solarProcCooldownEnd = GameTime::Now() + 30s;
eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_SOLAR_PROC, aurEff);
}
@@ -256,7 +256,7 @@ class spell_dru_eclipse : public AuraScript
{
PreventDefaultAction();
- _lunarProcCooldownEnd = GameTime::GetGameTimeSteadyPoint() + Seconds(30);
+ _lunarProcCooldownEnd = GameTime::Now() + 30s;
eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_LUNAR_PROC, aurEff);
}
@@ -271,8 +271,8 @@ class spell_dru_eclipse : public AuraScript
OnEffectProc += AuraEffectProcFn(spell_dru_eclipse::ProcLunar, EFFECT_1, SPELL_AURA_DUMMY);
}
- std::chrono::steady_clock::time_point _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min();
- std::chrono::steady_clock::time_point _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min();
+ TimePoint _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min();
+ TimePoint _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min();
};
// 5229 - Enrage
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 20b942d5ba1..228ed4a74bb 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -1992,7 +1992,7 @@ class spell_pal_sacred_shield_dummy : public SpellScriptLoader
if (!caster)
return;
- std::chrono::steady_clock::time_point now = GameTime::GetGameTimeSteadyPoint();
+ TimePoint now = GameTime::Now();
if (_cooldownEnd > now)
return;
@@ -2010,7 +2010,7 @@ class spell_pal_sacred_shield_dummy : public SpellScriptLoader
}
// Cooldown tracking can't be done in DB because of T8 bonus
- std::chrono::steady_clock::time_point _cooldownEnd = std::chrono::steady_clock::time_point::min();
+ TimePoint _cooldownEnd = std::chrono::steady_clock::time_point::min();
};
AuraScript* GetAuraScript() const override