aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp16
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h4
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp2
3 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 1775549d4dc..1178b2301ed 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -33,7 +33,7 @@ enum Points
POINT_HOME = 0xFFFFFE
};
-EscortAI::EscortAI(Creature* creature) : ScriptedAI(creature), _pauseTimer(2500), _playerCheckTimer(1000), _escortState(STATE_ESCORT_NONE), _maxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
+EscortAI::EscortAI(Creature* creature) : ScriptedAI(creature), _pauseTimer(2500ms), _playerCheckTimer(1000), _escortState(STATE_ESCORT_NONE), _maxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
_escortQuest(nullptr), _activeAttacker(true), _running(false), _instantRespawn(false), _returnToStart(false), _despawnAtEnd(true), _despawnAtFar(true), _manualPath(false),
_hasImmuneToNPCFlags(false), _started(false), _ended(false), _resume(false)
{
@@ -79,7 +79,7 @@ void EscortAI::InitializeAI()
SetCombatMovement(true);
// add a small delay before going to first waypoint, normal in near all cases
- _pauseTimer = 2000;
+ _pauseTimer = 2s;
if (me->GetFaction() != me->GetCreatureTemplate()->faction)
me->RestoreFaction();
@@ -123,8 +123,8 @@ void EscortAI::MovementInform(uint32 type, uint32 id)
if (type == POINT_MOTION_TYPE)
{
- if (!_pauseTimer)
- _pauseTimer = 2000;
+ if (_pauseTimer == 0s)
+ _pauseTimer = 2s;
// continue waypoint movement
if (id == POINT_LAST_POINT)
@@ -151,7 +151,7 @@ void EscortAI::MovementInform(uint32 type, uint32 id)
{
_started = false;
_ended = true;
- _pauseTimer = 1000;
+ _pauseTimer = 1s;
}
}
}
@@ -161,11 +161,11 @@ void EscortAI::UpdateAI(uint32 diff)
// Waypoint Updating
if (HasEscortState(STATE_ESCORT_ESCORTING) && !me->IsEngaged() && !HasEscortState(STATE_ESCORT_RETURNING))
{
- if (_pauseTimer <= diff)
+ if (_pauseTimer.count() <= diff)
{
if (!HasEscortState(STATE_ESCORT_PAUSED))
{
- _pauseTimer = 0;
+ _pauseTimer = 0s;
if (_ended)
{
@@ -208,7 +208,7 @@ void EscortAI::UpdateAI(uint32 diff)
}
}
else
- _pauseTimer -= diff;
+ _pauseTimer -= Milliseconds(diff);
}
// Check if player or any member of his group is within range
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
index ef0a3ec47f5..ce37b3dfe73 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -53,7 +53,7 @@ struct TC_GAME_API EscortAI : public ScriptedAI
void SetRun(bool on = true);
void SetEscortPaused(bool on);
- void SetPauseTimer(uint32 Timer) { _pauseTimer = Timer; }
+ void SetPauseTimer(Milliseconds timer) { _pauseTimer = timer; }
bool HasEscortState(uint32 escortState) { return (_escortState & escortState) != 0; }
bool IsEscorted() const override { return !_playerGUID.IsEmpty(); }
void SetMaxPlayerDistance(float newMax) { _maxPlayerDistance = newMax; }
@@ -76,7 +76,7 @@ struct TC_GAME_API EscortAI : public ScriptedAI
void RemoveEscortState(uint32 escortState) { _escortState &= ~escortState; }
ObjectGuid _playerGUID;
- uint32 _pauseTimer;
+ Milliseconds _pauseTimer;
uint32 _playerCheckTimer;
uint32 _escortState;
float _maxPlayerDistance;
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index d21bdd972ee..5c8d5120f35 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -1622,7 +1622,7 @@ public:
_events.ScheduleEvent(EVENT_TALK_1, Seconds(2));
_events.CancelEvent(EVENT_OOC_TALK);
Start(true, true, player->GetGUID());
- SetPauseTimer(12 * IN_MILLISECONDS);
+ SetPauseTimer(12s);
}
}