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

@@ -168,7 +168,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras
${CMAKE_SOURCE_DIR}/src/server/game/Texts
${CMAKE_SOURCE_DIR}/src/server/game/Tickets
${CMAKE_SOURCE_DIR}/src/server/game/Time
${CMAKE_SOURCE_DIR}/src/server/game/Tools
${CMAKE_SOURCE_DIR}/src/server/game/Warden
${CMAKE_SOURCE_DIR}/src/server/game/Warden/Modules

View File

@@ -17,7 +17,6 @@ EndScriptData */
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "GameTime.h"
#include "ScriptMgr.h"
class ban_commandscript : public CommandScript
@@ -246,7 +245,7 @@ public:
time_t unbanDate = time_t(fields[3].GetUInt32());
bool active = false;
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= GameTime::GetGameTime()))
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(nullptr)))
active = true;
bool permanent = (fields[1].GetUInt64() == uint64(0));
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
@@ -294,7 +293,7 @@ public:
Field* fields = result->Fetch();
time_t unbanDate = time_t(fields[3].GetUInt32());
bool active = false;
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= GameTime::GetGameTime()))
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(nullptr)))
active = true;
bool permanent = (fields[1].GetUInt32() == uint32(0));
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);

View File

@@ -15,7 +15,6 @@ EndScriptData */
#include "GameEventMgr.h"
#include "Language.h"
#include "Player.h"
#include "GameTime.h"
#include "ScriptMgr.h"
class event_commandscript : public CommandScript
@@ -105,8 +104,8 @@ public:
std::string endTimeStr = TimeToTimestampStr(eventData.end);
uint32 delay = sGameEventMgr->NextCheck(eventId);
time_t nextTime = GameTime::GetGameTime() + delay;
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(GameTime::GetGameTime() + delay) : "-";
time_t nextTime = time(nullptr) + delay;
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(nullptr) + delay) : "-";
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE, true);
std::string lengthStr = secsToTimeString(eventData.length * MINUTE, true);

View File

@@ -19,7 +19,6 @@ EndScriptData */
#include "Chat.h"
#include "Language.h"
#include "Player.h"
#include "GameTime.h"
#include "Opcodes.h"
#include "Transport.h"
#include "GameObject.h"
@@ -311,7 +310,7 @@ public:
if (target)
{
int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - GameTime::GetGameTime());
int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - time(nullptr));
if (curRespawnDelay < 0)
curRespawnDelay = 0;

View File

@@ -18,7 +18,6 @@ EndScriptData */
#include "InstanceScript.h"
#include "MapManager.h"
#include "Player.h"
#include "GameTime.h"
#include "Language.h"
class instance_commandscript : public CommandScript
@@ -72,7 +71,7 @@ public:
{
InstanceSave* save = itr->second.save;
uint32 resetTime = itr->second.extended ? save->GetExtendedResetTime() : save->GetResetTime();
uint32 ttr = (resetTime >= GameTime::GetGameTime() ? resetTime - GameTime::GetGameTime() : 0);
uint32 ttr = (resetTime >= time(nullptr) ? resetTime - time(nullptr) : 0);
std::string timeleft = GetTimeString(ttr);
handler->PSendSysMessage("map: %d, inst: %d, perm: %s, diff: %d, canReset: %s, TTR: %s%s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str(), (itr->second.extended ? " (extended)" : ""));
counter++;
@@ -116,7 +115,7 @@ public:
if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
{
uint32 resetTime = itr->second.extended ? save->GetExtendedResetTime() : save->GetResetTime();
uint32 ttr = (resetTime >= GameTime::GetGameTime() ? resetTime - GameTime::GetGameTime() : 0);
uint32 ttr = (resetTime >= time(nullptr) ? resetTime - time(nullptr) : 0);
std::string timeleft = GetTimeString(ttr);
handler->PSendSysMessage("unbinding map: %d, inst: %d, perm: %s, diff: %d, canReset: %s, TTR: %s%s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str(), (itr->second.extended ? " (extended)" : ""));
sInstanceSaveMgr->PlayerUnbindInstance(player->GetGUIDLow(), itr->first, Difficulty(i), true, player);

View File

@@ -22,7 +22,6 @@
#include "WeatherMgr.h"
#include "ace/INET_Addr.h"
#include "Player.h"
#include "GameTime.h"
#include "Pet.h"
#include "LFG.h"
#include "GroupMgr.h"
@@ -1998,11 +1997,11 @@ public:
// Output III. LANG_PINFO_BANNED if ban exists and is applied
if (banTime >= 0)
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - GameTime::GetGameTime(), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(nullptr), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
// Output IV. LANG_PINFO_MUTED if mute is applied
if (muteTime > 0)
handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason.c_str(), secsToTimeString(muteTime - GameTime::GetGameTime(), true).c_str(), muteBy.c_str());
handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason.c_str(), secsToTimeString(muteTime - time(nullptr), true).c_str(), muteBy.c_str());
// Output V. LANG_PINFO_ACC_ACCOUNT
handler->PSendSysMessage(LANG_PINFO_ACC_ACCOUNT, userName.c_str(), accId, security);
@@ -2241,7 +2240,7 @@ public:
if (target)
{
// Target is online, mute will be in effect right away.
int64 muteTime = GameTime::GetGameTime() + notSpeakTime * MINUTE;
int64 muteTime = time(nullptr) + notSpeakTime * MINUTE;
target->GetSession()->m_muteTime = muteTime;
stmt->setInt64(0, muteTime);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str());

View File

@@ -20,7 +20,6 @@ EndScriptData */
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
#include "CreatureAI.h"
#include "Player.h"
#include "GameTime.h"
#include "Pet.h"
struct NpcFlagText
@@ -720,7 +719,7 @@ public:
uint32 nativeid = target->GetNativeDisplayId();
uint32 Entry = target->GetEntry();
int64 curRespawnDelay = target->GetRespawnTimeEx()-GameTime::GetGameTime();
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(nullptr);
if (curRespawnDelay < 0)
curRespawnDelay = 0;
std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);

View File

@@ -15,8 +15,6 @@ EndScriptData */
#include "Config.h"
#include "Language.h"
#include "ObjectAccessor.h"
#include "GameTime.h"
#include "UpdateTime.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "GitRevision.h"
@@ -98,8 +96,8 @@ public:
uint32 activeSessionCount = sWorld->GetActiveSessionCount();
uint32 queuedSessionCount = sWorld->GetQueuedSessionCount();
uint32 connPeak = sWorld->GetMaxActiveSessionCount();
std::string uptime = secsToTimeString(GameTime::GetUptime());
uint32 updateTime = sWorldUpdateTime.GetLastUpdateTime();
std::string uptime = secsToTimeString(sWorld->GetUptime()).append(".");
uint32 updateTime = sWorld->GetUpdateTime();
uint32 avgUpdateTime = avgDiffTracker.getAverage();
handler->PSendSysMessage("%s", GitRevision::GetFullVersion());
@@ -357,7 +355,7 @@ public:
if (newTime < 0)
return false;
sWorldUpdateTime.SetRecordUpdateTimeInterval(newTime);
sWorld->SetRecordDiffInterval(newTime);
printf("Record diff every %u ms\n", newTime);
return true;

View File

@@ -9,7 +9,6 @@
#include "SpellScript.h"
#include "GameEventMgr.h"
#include "Group.h"
#include "GameTime.h"
#include "LFGMgr.h"
#include "PassiveAI.h"
#include "CellImpl.h"
@@ -436,7 +435,7 @@ class npc_brewfest_keg_reciver : public CreatureScript
{
if (Aura* aur = player->GetAura(SPELL_RAM_AURA))
{
int32 diff = aur->GetApplyTime() - (GameTime::GetGameTime()-(HOUR*18)+spellCooldown);
int32 diff = aur->GetApplyTime() - (time(NULL)-(HOUR*18)+spellCooldown);
if (diff > 10) // aura applied later
return;
@@ -844,7 +843,7 @@ class npc_dark_iron_attack_generator : public CreatureScript
bool AllowStart()
{
time_t curtime = GameTime::GetGameTime();
time_t curtime = time(NULL);
tm strDate;
ACE_OS::localtime_r(&curtime, &strDate);

View File

@@ -1,7 +1,6 @@
// Scripted by Xinef
#include "ScriptMgr.h"
#include "GameTime.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Spell.h"
@@ -185,7 +184,7 @@ class npc_midsummer_torch_target : public CreatureScript
Position pos;
pos.Relocate(posVec.at(num));
me->m_last_notify_position.Relocate(0.0f, 0.0f, 0.0f);
me->m_last_notify_mstime = GameTime::GetGameTimeMS() + 10000;
me->m_last_notify_mstime = World::GetGameTimeMS() + 10000;
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation());
}
@@ -301,7 +300,7 @@ public:
}
// Achievement
if ((GameTime::GetGameTime() - GetApplyTime()) > 60 && target->GetTypeId() == TYPEID_PLAYER)
if ((time(NULL) - GetApplyTime()) > 60 && target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58934, 0, target);
}
}

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);

View File

@@ -3,7 +3,6 @@
*/
#include "ScriptMgr.h"
#include "GameTime.h"
#include "InstanceScript.h"
#include "the_botanica.h"
@@ -151,7 +150,7 @@ class spell_botanica_shift_form : public SpellScriptLoader
{
if (SpellInfo const* spellInfo = eventInfo.GetDamageInfo()->GetSpellInfo())
{
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > GameTime::GetGameTime())
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > time(NULL))
return false;
uint32 form = 0;
@@ -167,7 +166,7 @@ class spell_botanica_shift_form : public SpellScriptLoader
if (form)
{
_swapTime = GameTime::GetGameTime() + 6;
_swapTime = time(NULL) + 6;
_lastSchool = spellInfo->GetSchoolMask();
GetUnitOwner()->RemoveAurasDueToSpell(_lastForm);
_lastForm = form;

View File

@@ -22,7 +22,6 @@
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "GameTime.h"
#include "InstanceScript.h"
#include "LFGMgr.h"
#include "Pet.h"
@@ -2651,12 +2650,12 @@ class spell_gen_turkey_marker : public SpellScriptLoader
{
if (GetStackAmount() > stackAmount)
{
_applyTimes.push_back(GameTime::GetGameTimeMS());
_applyTimes.push_back(World::GetGameTimeMS());
stackAmount++;
}
// pop stack if it expired for us
if (_applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
if (_applyTimes.front() + GetMaxDuration() < World::GetGameTimeMS())
{
stackAmount--;
ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE);

View File

@@ -17,7 +17,6 @@
#include "SpellAuraEffects.h"
#include "SkillDiscovery.h"
#include "Battleground.h"
#include "GameTime.h"
class spell_item_massive_seaforium_charge : public SpellScriptLoader
{
@@ -3093,7 +3092,7 @@ class spell_item_crystal_prison_dummy_dnd : public SpellScriptLoader
if (Creature* target = GetHitCreature())
if (target->isDead() && !target->IsPet())
{
GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0, 0, 0, 0, uint32(target->GetRespawnTime()-GameTime::GetGameTime()));
GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0, 0, 0, 0, uint32(target->GetRespawnTime()-time(NULL)));
target->DespawnOrUnsummon();
}
}

View File

@@ -26,7 +26,6 @@ EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "Player.h"
#include "GameTime.h"
#include "SpellMgr.h"
// Ours
@@ -383,7 +382,7 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript
{
uint32 triggerId = trigger->entry;
// Second trigger happened too early after first, skip for now
if (GameTime::GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN)
if (sWorld->GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN)
return false;
switch (triggerId)
@@ -400,7 +399,7 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript
break;
}
_triggerTimes[triggerId] = GameTime::GetGameTime();
_triggerTimes[triggerId] = sWorld->GetGameTime();
return false;
}
@@ -440,7 +439,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
return false;
uint32 triggerId = trigger->entry;
if (GameTime::GetGameTime() - _triggerTimes[trigger->entry] < SUMMON_COOLDOWN)
if (sWorld->GetGameTime() - _triggerTimes[trigger->entry] < SUMMON_COOLDOWN)
return false;
switch (triggerId)
@@ -469,7 +468,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
player->AddAura(SPELL_A52_NEURALYZER, player);
_triggerTimes[trigger->entry] = GameTime::GetGameTime();
_triggerTimes[trigger->entry] = sWorld->GetGameTime();
return false;
}

View File

@@ -36,7 +36,6 @@ EndContentData */
#include "GameObjectAI.h"
#include "Spell.h"
#include "Player.h"
#include "GameTime.h"
#include "WorldSession.h"
// Ours
@@ -837,7 +836,7 @@ class go_inconspicuous_landmark : public GameObjectScript
public:
go_inconspicuous_landmark() : GameObjectScript("go_inconspicuous_landmark")
{
_lastUsedTime = GameTime::GetGameTime();
_lastUsedTime = time(NULL);
}
bool OnGossipHello(Player* player, GameObject* /*go*/)
@@ -845,10 +844,10 @@ class go_inconspicuous_landmark : public GameObjectScript
if (player->HasItemCount(ITEM_CUERGOS_KEY))
return true;
if (_lastUsedTime > GameTime::GetGameTime())
if (_lastUsedTime > time(NULL))
return true;
_lastUsedTime = GameTime::GetGameTime() + MINUTE;
_lastUsedTime = time(NULL) + MINUTE;
player->CastSpell(player, SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB, true);
return true;
}

View File

@@ -33,7 +33,6 @@ EndContentData */
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "World.h"
#include "GameTime.h"
#include "CreatureTextMgr.h"
#include "PassiveAI.h"
#include "GameEventMgr.h"
@@ -109,7 +108,7 @@ public:
{
case EVENT_CLEARWATER_ANNOUNCE:
{
time_t curtime = GameTime::GetGameTime();
time_t curtime = time(NULL);
tm strdate;
ACE_OS::localtime_r(&curtime, &strdate);
@@ -254,7 +253,7 @@ public:
{
case EVENT_RIGGLE_ANNOUNCE:
{
time_t curtime = GameTime::GetGameTime();
time_t curtime = time(NULL);
tm strdate;
ACE_OS::localtime_r(&curtime, &strdate);
if (!startWarning && strdate.tm_hour == 14 && strdate.tm_min == 0)