Revert "feat(core): Ensure that all actions are compared to fixed point in time (#1236) (#1458)" (#1471)

This reverts commit 51b8773528.
This commit is contained in:
Nefertumm
2019-02-15 15:14:49 -03:00
committed by GitHub
parent 23e7ae6a2f
commit c15206fc15
108 changed files with 509 additions and 933 deletions

View File

@@ -6,7 +6,6 @@
#include "ScriptedCreature.h"
#include "trial_of_the_crusader.h"
#include "Group.h"
#include "GameTime.h"
#include "Player.h"
#define CLEANUP_CHECK_INTERVAL 5000
@@ -323,7 +322,7 @@ public:
c->DespawnOrUnsummon(10000);
if( Creature* c = instance->GetCreature(NPC_DreadscaleGUID) )
c->DespawnOrUnsummon(10000);
if( AchievementTimer+10 >= GameTime::GetGameTime() )
if( AchievementTimer+10 >= time(NULL) )
DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_JORMUNGAR_ACHIEV);
AchievementTimer = 0;
@@ -340,7 +339,7 @@ public:
}
else // first one died, start timer for achievement
{
AchievementTimer = GameTime::GetGameTime();
AchievementTimer = time(NULL);
}
}
else
@@ -429,14 +428,14 @@ public:
HandleGameObject(GO_EnterGateGUID, true);
if( AchievementTimer+60 >= GameTime::GetGameTime() )
if( AchievementTimer+60 >= time(NULL) )
DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_RESILIENCE_WILL_FIX_IT_CREDIT);
AchievementTimer = 0;
SaveToDB();
}
else if( Counter == 1 )
AchievementTimer = GameTime::GetGameTime();
AchievementTimer = time(NULL);
}
break;
case TYPE_FACTION_CHAMPIONS_START:

View File

@@ -7,7 +7,6 @@
#include "ScriptedGossip.h"
#include "trial_of_the_crusader.h"
#include "Player.h"
#include "GameTime.h"
enum MenuTexts
{

View File

@@ -11,7 +11,6 @@
#include "TransportMgr.h"
#include "Vehicle.h"
#include "icecrown_citadel.h"
#include "GameTime.h"
enum Texts
{
@@ -407,7 +406,7 @@ public:
return false;
bool summoned = false;
time_t now = GameTime::GetGameTime();
time_t now = time(NULL);
for (int32 i = first; i <= last; ++i)
{
if (_respawnCooldowns[i] > now)
@@ -443,7 +442,7 @@ public:
void ClearSlot(PassengerSlots slot)
{
_controlledSlots[slot] = 0;
_respawnCooldowns[slot] = GameTime::GetGameTime() + _slotInfo[slot].Cooldown;
_respawnCooldowns[slot] = time(NULL) + _slotInfo[slot].Cooldown;
}
private:
@@ -732,7 +731,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
_controller.ResetSlots(TEAM_HORDE, creature->GetTransport()->ToMotionTransport());
me->SetRegeneratingHealth(false);
me->m_CombatDistance = 70.0f;
_firstMageCooldown = GameTime::GetGameTime() + 45;
_firstMageCooldown = time(NULL) + 45;
_axethrowersYellCooldown = time_t(0);
_rocketeersYellCooldown = time_t(0);
checkTimer = 1000;
@@ -797,7 +796,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
}
else if (action == ACTION_SPAWN_MAGE)
{
time_t now = GameTime::GetGameTime();
time_t now = time(NULL);
if (_firstMageCooldown > now)
_events.ScheduleEvent(EVENT_SUMMON_MAGE, (_firstMageCooldown - now) * IN_MILLISECONDS);
else
@@ -972,10 +971,10 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
case EVENT_CHECK_RIFLEMAN:
if (_controller.SummonCreatures(me, SLOT_RIFLEMAN_1, Is25ManRaid() ? SLOT_RIFLEMAN_8 : SLOT_RIFLEMAN_4))
{
if (_axethrowersYellCooldown < GameTime::GetGameTime())
if (_axethrowersYellCooldown < time(NULL))
{
Talk(SAY_SAURFANG_AXETHROWERS);
_axethrowersYellCooldown = GameTime::GetGameTime() + 5;
_axethrowersYellCooldown = time(NULL) + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_RIFLEMAN, 1500);
@@ -983,10 +982,10 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
case EVENT_CHECK_MORTAR:
if (_controller.SummonCreatures(me, SLOT_MORTAR_1, Is25ManRaid() ? SLOT_MORTAR_4 : SLOT_MORTAR_2))
{
if (_rocketeersYellCooldown < GameTime::GetGameTime())
if (_rocketeersYellCooldown < time(NULL))
{
Talk(SAY_SAURFANG_ROCKETEERS);
_rocketeersYellCooldown = GameTime::GetGameTime() + 5;
_rocketeersYellCooldown = time(NULL) + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_MORTAR, 1500);
@@ -1067,7 +1066,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
_controller.ResetSlots(TEAM_ALLIANCE, creature->GetTransport()->ToMotionTransport());
me->SetRegeneratingHealth(false);
me->m_CombatDistance = 70.0f;
_firstMageCooldown = GameTime::GetGameTime() + 45;
_firstMageCooldown = time(NULL) + 45;
_riflemanYellCooldown = time_t(0);
_mortarYellCooldown = time_t(0);
checkTimer = 1000;
@@ -1133,7 +1132,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
}
else if (action == ACTION_SPAWN_MAGE)
{
time_t now = GameTime::GetGameTime();
time_t now = time(NULL);
if (_firstMageCooldown > now)
_events.ScheduleEvent(EVENT_SUMMON_MAGE, (_firstMageCooldown - now) * IN_MILLISECONDS);
else
@@ -1311,10 +1310,10 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
case EVENT_CHECK_RIFLEMAN:
if (_controller.SummonCreatures(me, SLOT_RIFLEMAN_1, Is25ManRaid() ? SLOT_RIFLEMAN_8 : SLOT_RIFLEMAN_4))
{
if (_riflemanYellCooldown < GameTime::GetGameTime())
if (_riflemanYellCooldown < time(NULL))
{
Talk(SAY_MURADIN_RIFLEMAN);
_riflemanYellCooldown = GameTime::GetGameTime() + 5;
_riflemanYellCooldown = time(NULL) + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_RIFLEMAN, 1500);
@@ -1322,10 +1321,10 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
case EVENT_CHECK_MORTAR:
if (_controller.SummonCreatures(me, SLOT_MORTAR_1, Is25ManRaid() ? SLOT_MORTAR_4 : SLOT_MORTAR_2))
{
if (_mortarYellCooldown < GameTime::GetGameTime())
if (_mortarYellCooldown < time(NULL))
{
Talk(SAY_MURADIN_MORTAR);
_mortarYellCooldown = GameTime::GetGameTime() + 5;
_mortarYellCooldown = time(NULL) + 5;
}
}
_events.ScheduleEvent(EVENT_CHECK_MORTAR, 1500);

View File

@@ -5,7 +5,6 @@
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "GameTime.h"
#include "GridNotifiers.h"
#include "icecrown_citadel.h"
#include "Player.h"
@@ -949,7 +948,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader
if (!spellInfo)
return false;
uint32 currMSTime = GameTime::GetGameTimeMS();
uint32 currMSTime = World::GetGameTimeMS();
std::map<uint32, uint32>::iterator itr = _lastMSTimeForSpell.find(spellInfo->Id);
if (itr != _lastMSTimeForSpell.end())
{

View File

@@ -8,7 +8,6 @@
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "Spell.h"
#include "GameTime.h"
#include "Vehicle.h"
#include "Unit.h"
#include "Cell.h"
@@ -687,9 +686,9 @@ class boss_the_lich_king : public CreatureScript
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() == TYPEID_PLAYER && !me->IsInEvadeMode() && _phase != PHASE_OUTRO && _lastTalkTimeKill+5 < GameTime::GetGameTime())
if (victim->GetTypeId() == TYPEID_PLAYER && !me->IsInEvadeMode() && _phase != PHASE_OUTRO && _lastTalkTimeKill+5 < time(NULL))
{
_lastTalkTimeKill = GameTime::GetGameTime();
_lastTalkTimeKill = time(NULL);
Talk(SAY_LK_KILL);
}
}
@@ -718,7 +717,7 @@ class boss_the_lich_king : public CreatureScript
events.RescheduleEvent(EVENT_START_ATTACK, 1000);
EntryCheckPredicate pred(NPC_STRANGULATE_VEHICLE);
summons.DoAction(ACTION_TELEPORT_BACK, pred);
if (!IsHeroic() && _phase != PHASE_OUTRO && me->IsInCombat() && _lastTalkTimeBuff+5 <= GameTime::GetGameTime())
if (!IsHeroic() && _phase != PHASE_OUTRO && me->IsInCombat() && _lastTalkTimeBuff+5 <= time(NULL))
Talk(SAY_LK_FROSTMOURNE_ESCAPE);
}
break;
@@ -875,9 +874,9 @@ class boss_the_lich_king : public CreatureScript
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
{
if (spell->Id == HARVESTED_SOUL_BUFF && me->IsInCombat() && !IsHeroic() && _phase != PHASE_OUTRO && _lastTalkTimeBuff+5 <= GameTime::GetGameTime())
if (spell->Id == HARVESTED_SOUL_BUFF && me->IsInCombat() && !IsHeroic() && _phase != PHASE_OUTRO && _lastTalkTimeBuff+5 <= time(NULL))
{
_lastTalkTimeBuff = GameTime::GetGameTime();
_lastTalkTimeBuff = time(NULL);
Talk(SAY_LK_FROSTMOURNE_KILL);
}
}

View File

@@ -5,7 +5,6 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "GameTime.h"
#include "ulduar.h"
#include "Vehicle.h"
#include "SpellAuras.h"
@@ -262,10 +261,10 @@ public:
if (id == 1337)
{
if (lastShatterMSTime)
if (getMSTimeDiff(lastShatterMSTime, GameTime::GetGameTimeMS()) <= 5000)
if (getMSTimeDiff(lastShatterMSTime, World::GetGameTimeMS()) <= 5000)
bShattered = true;
lastShatterMSTime = GameTime::GetGameTimeMS();
lastShatterMSTime = World::GetGameTimeMS();
}
}

View File

@@ -5,7 +5,6 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "GameTime.h"
#include "ulduar.h"
#include "Vehicle.h"
#include "Spell.h"
@@ -453,7 +452,7 @@ public:
case EVENT_SPAWN_FLAMES_INITIAL:
{
if (changeAllowedFlameSpreadTime)
allowedFlameSpreadTime = GameTime::GetGameTime();
allowedFlameSpreadTime = time(NULL);
std::vector<Player*> pg;
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
@@ -2237,7 +2236,7 @@ public:
bool Load()
{
lastMSTime = GameTime::GetGameTimeMS();
lastMSTime = World::GetGameTimeMS();
lastOrientation = -1.0f;
return true;
}
@@ -2248,14 +2247,14 @@ public:
{
if (c->GetTypeId() != TYPEID_UNIT)
return;
uint32 diff = getMSTimeDiff(lastMSTime, GameTime::GetGameTimeMS());
uint32 diff = getMSTimeDiff(lastMSTime, World::GetGameTimeMS());
if (lastOrientation == -1.0f)
{
lastOrientation = (c->ToCreature()->AI()->GetData(0)*2*M_PI)/100.0f;
diff = 0;
}
float new_o = Position::NormalizeOrientation(lastOrientation-(M_PI/60)*(diff/250.0f));
lastMSTime = GameTime::GetGameTimeMS();
lastMSTime = World::GetGameTimeMS();
lastOrientation = new_o;
c->SetOrientation(new_o);
c->SetFacingTo(new_o);
@@ -2317,7 +2316,7 @@ public:
{
npc_ulduar_flames_initialAI(Creature *pCreature) : NullCreatureAI(pCreature)
{
CreateTime = GameTime::GetGameTime();
CreateTime = time(NULL);
events.Reset();
events.ScheduleEvent(EVENT_FLAMES_SPREAD, 5750);
if( Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, me->GetPositionX(), me->GetPositionY(), 364.32f, 0.0f) )

View File

@@ -7,7 +7,6 @@
#include "ulduar.h"
#include "Vehicle.h"
#include "Player.h"
#include "GameTime.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Transport.h"
@@ -888,10 +887,10 @@ public:
}
else if (unit->GetTypeId() == TYPEID_UNIT && unit->GetAreaId() == 4656 /*Conservatory of Life*/)
{
if (GameTime::GetGameTime() > (m_conspeedatoryAttempt + DAY))
if (time(NULL) > (m_conspeedatoryAttempt + DAY))
{
DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, 21597 /*CON-SPEED-ATORY_TIMED_CRITERIA*/);
m_conspeedatoryAttempt = GameTime::GetGameTime();
m_conspeedatoryAttempt = time(NULL);
SaveToDB();
}
}

View File

@@ -11,7 +11,6 @@
#include "BattlefieldMgr.h"
#include "SpellAuras.h"
#include "Player.h"
#include "GameTime.h"
/* Vault of Archavon encounters:
1 - Archavon the Stone Watcher event
@@ -180,13 +179,13 @@ class instance_vault_of_archavon : public InstanceMapScript
switch (type)
{
case EVENT_ARCHAVON:
ArchavonDeath = GameTime::GetGameTime();
ArchavonDeath = time(NULL);
break;
case EVENT_EMALON:
EmalonDeath = GameTime::GetGameTime();
EmalonDeath = time(NULL);
break;
case EVENT_KORALON:
KoralonDeath = GameTime::GetGameTime();
KoralonDeath = time(NULL);
break;
default:
return;

View File

@@ -29,7 +29,6 @@
#include "Player.h"
#include "PoolMgr.h"
#include "GameGraveyard.h"
#include "GameTime.h"
#include "World.h"
#define GOSSIP_HELLO_DEMO1 "Build catapult."
@@ -295,7 +294,7 @@ class npc_wg_queue : public CreatureScript
else
{
uint32 timer = wintergrasp->GetTimer() / 1000;
player->SendUpdateWorldState(4354, GameTime::GetGameTime() + timer);
player->SendUpdateWorldState(4354, time(NULL) + timer);
if (timer < 15 * MINUTE)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Queue for Wintergrasp.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);