aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2017-12-10 12:39:37 +0100
committerjackpoz <giacomopoz@gmail.com>2017-12-24 22:50:59 +0100
commit12701cb0c6c45eb105ad449eb9a56e76d84d691e (patch)
tree9c1cded0812cddb9f7daccac81ba434a413dd0f6 /src/server/scripts/Northrend
parent3a536260f8cd6565726bf82e56dcb58b513b6331 (diff)
Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp32
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp7
-rw-r--r--src/server/scripts/Northrend/zone_wintergrasp.cpp3
3 files changed, 22 insertions, 20 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 e344a3181fc..8dd5d0e6624 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
@@ -404,7 +404,7 @@ public:
return false;
bool summoned = false;
- time_t now = time(nullptr);
+ time_t now = GameTime::GetGameTime();
for (int32 i = first; i <= last; ++i)
{
if (_respawnCooldowns[i] > now)
@@ -432,7 +432,7 @@ public:
void ClearSlot(PassengerSlots slot)
{
_controlledSlots[slot].Clear();
- _respawnCooldowns[slot] = time(nullptr) + _slotInfo[slot].Cooldown;
+ _respawnCooldowns[slot] = GameTime::GetGameTime() + _slotInfo[slot].Cooldown;
}
bool SlotsNeedRefill(PassengerSlots first, PassengerSlots last) const
@@ -859,7 +859,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
_controller.SetTransport(creature->GetTransport());
me->SetRegenerateHealth(false);
me->m_CombatDistance = 70.0f;
- _firstMageCooldown = time(nullptr) + 60;
+ _firstMageCooldown = GameTime::GetGameTime() + 60;
_axethrowersYellCooldown = time_t(0);
_rocketeersYellCooldown = time_t(0);
}
@@ -869,7 +869,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
ScriptedAI::InitializeAI();
_events.Reset();
- _firstMageCooldown = time(nullptr) + 60;
+ _firstMageCooldown = GameTime::GetGameTime() + 60;
_axethrowersYellCooldown = time_t(0);
_rocketeersYellCooldown = time_t(0);
}
@@ -921,7 +921,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
}
else if (action == ACTION_SPAWN_MAGE)
{
- time_t now = time(nullptr);
+ time_t now = GameTime::GetGameTime();
if (_firstMageCooldown > now)
_events.ScheduleEvent(EVENT_SUMMON_MAGE, (_firstMageCooldown - now) * IN_MILLISECONDS);
else
@@ -1055,10 +1055,10 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
case EVENT_CHECK_RIFLEMAN:
if (_controller.SummonCreatures(SLOT_RIFLEMAN_1, Is25ManRaid() ? SLOT_RIFLEMAN_8 : SLOT_RIFLEMAN_4))
{
- if (_axethrowersYellCooldown < time(nullptr))
+ if (_axethrowersYellCooldown < GameTime::GetGameTime())
{
Talk(SAY_SAURFANG_AXETHROWERS);
- _axethrowersYellCooldown = time(nullptr) + 5;
+ _axethrowersYellCooldown = GameTime::GetGameTime() + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_RIFLEMAN, 1000);
@@ -1066,10 +1066,10 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
case EVENT_CHECK_MORTAR:
if (_controller.SummonCreatures(SLOT_MORTAR_1, Is25ManRaid() ? SLOT_MORTAR_4 : SLOT_MORTAR_2))
{
- if (_rocketeersYellCooldown < time(nullptr))
+ if (_rocketeersYellCooldown < GameTime::GetGameTime())
{
Talk(SAY_SAURFANG_ROCKETEERS);
- _rocketeersYellCooldown = time(nullptr) + 5;
+ _rocketeersYellCooldown = GameTime::GetGameTime() + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_MORTAR, 1000);
@@ -1128,7 +1128,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
_controller.SetTransport(creature->GetTransport());
me->SetRegenerateHealth(false);
me->m_CombatDistance = 70.0f;
- _firstMageCooldown = time(nullptr) + 60;
+ _firstMageCooldown = GameTime::GetGameTime() + 60;
_riflemanYellCooldown = time_t(0);
_mortarYellCooldown = time_t(0);
}
@@ -1138,7 +1138,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
ScriptedAI::InitializeAI();
_events.Reset();
- _firstMageCooldown = time(nullptr) + 60;
+ _firstMageCooldown = GameTime::GetGameTime() + 60;
_riflemanYellCooldown = time_t(0);
_mortarYellCooldown = time_t(0);
}
@@ -1190,7 +1190,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
}
else if (action == ACTION_SPAWN_MAGE)
{
- time_t now = time(nullptr);
+ time_t now = GameTime::GetGameTime();
if (_firstMageCooldown > now)
_events.ScheduleEvent(EVENT_SUMMON_MAGE, (_firstMageCooldown - now) * IN_MILLISECONDS);
else
@@ -1328,10 +1328,10 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
case EVENT_CHECK_RIFLEMAN:
if (_controller.SummonCreatures(SLOT_RIFLEMAN_1, Is25ManRaid() ? SLOT_RIFLEMAN_8 : SLOT_RIFLEMAN_4))
{
- if (_riflemanYellCooldown < time(nullptr))
+ if (_riflemanYellCooldown < GameTime::GetGameTime())
{
Talk(SAY_MURADIN_RIFLEMAN);
- _riflemanYellCooldown = time(nullptr) + 5;
+ _riflemanYellCooldown = GameTime::GetGameTime() + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_RIFLEMAN, 1000);
@@ -1339,10 +1339,10 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
case EVENT_CHECK_MORTAR:
if (_controller.SummonCreatures(SLOT_MORTAR_1, Is25ManRaid() ? SLOT_MORTAR_4 : SLOT_MORTAR_2))
{
- if (_mortarYellCooldown < time(nullptr))
+ if (_mortarYellCooldown < GameTime::GetGameTime())
{
Talk(SAY_MURADIN_MORTAR);
- _mortarYellCooldown = time(nullptr) + 5;
+ _mortarYellCooldown = GameTime::GetGameTime() + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_MORTAR, 1000);
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
index df562d81546..b301dfadb13 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "GameTime.h"
#include "InstanceScript.h"
#include "Map.h"
#include "vault_of_archavon.h"
@@ -65,13 +66,13 @@ class instance_vault_of_archavon : public InstanceMapScript
switch (type)
{
case DATA_ARCHAVON:
- ArchavonDeath = time(nullptr);
+ ArchavonDeath = GameTime::GetGameTime();
break;
case DATA_EMALON:
- EmalonDeath = time(nullptr);
+ EmalonDeath = GameTime::GetGameTime();
break;
case DATA_KORALON:
- KoralonDeath = time(nullptr);
+ KoralonDeath = GameTime::GetGameTime();
break;
default:
return true;
diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp
index 051b346c83e..45aaa4c6721 100644
--- a/src/server/scripts/Northrend/zone_wintergrasp.cpp
+++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp
@@ -22,6 +22,7 @@
#include "DBCStores.h"
#include "GameObject.h"
#include "GameObjectAI.h"
+#include "GameTime.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -309,7 +310,7 @@ class npc_wg_queue : public CreatureScript
else
{
uint32 timer = wintergrasp->GetTimer() / 1000;
- player->SendUpdateWorldState(4354, time(nullptr) + timer);
+ player->SendUpdateWorldState(4354, GameTime::GetGameTime() + timer);
if (timer < 15 * MINUTE)
{
AddGossipItemFor(player, GOSSIP_ICON_CHAT, player->GetSession()->GetTrinityString(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);