fix(Core/Unit): rework Walk/Run mode (#22988)

Co-authored-by: sudlud <sudlud@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
killerwife
2025-10-14 22:54:19 +02:00
committed by GitHub
parent c28f635408
commit 10d5a3c553
104 changed files with 373 additions and 362 deletions
@@ -552,6 +552,11 @@ void ScriptedAI::SetEquipmentSlots(bool loadDefault, int32 mainHand /*= EQUIP_NO
} }
} }
void ScriptedAI::SetRun(bool run)
{
me->SetWalk(!run);
}
enum eNPCs enum eNPCs
{ {
NPC_BROODLORD = 12017, NPC_BROODLORD = 12017,
@@ -227,6 +227,8 @@ struct ScriptedAI : public CreatureAI
// Called when AI is temporarily replaced or put back when possess is applied or removed // Called when AI is temporarily replaced or put back when possess is applied or removed
void OnPossess(bool /*apply*/) {} void OnPossess(bool /*apply*/) {}
void SetRun(bool run);
enum class Axis enum class Axis
{ {
AXIS_X, AXIS_X,
@@ -33,7 +33,6 @@ npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature),
MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
m_pQuestForEscort(nullptr), m_pQuestForEscort(nullptr),
m_bIsActiveAttacker(true), m_bIsActiveAttacker(true),
m_bIsRunning(false),
m_bCanInstantRespawn(false), m_bCanInstantRespawn(false),
m_bCanReturnToStart(false), m_bCanReturnToStart(false),
DespawnAtEnd(true), DespawnAtEnd(true),
@@ -186,9 +185,8 @@ void npc_escortAI::JustRespawned()
void npc_escortAI::ReturnToLastPoint() void npc_escortAI::ReturnToLastPoint()
{ {
float x, y, z, o; float x, y, z, o;
me->SetWalk(false);
me->GetHomePosition(x, y, z, o); me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z); me->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z, FORCED_MOVEMENT_RUN);
} }
void npc_escortAI::EnterEvadeMode(EvadeReason /*why*/) void npc_escortAI::EnterEvadeMode(EvadeReason /*why*/)
@@ -329,7 +327,6 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
{ {
LOG_DEBUG("scripts.ai", "EscortAI has returned to original position before combat"); LOG_DEBUG("scripts.ai", "EscortAI has returned to original position before combat");
me->SetWalk(!m_bIsRunning);
RemoveEscortState(STATE_ESCORT_RETURNING); RemoveEscortState(STATE_ESCORT_RETURNING);
if (!m_uiWPWaitTimer) if (!m_uiWPWaitTimer)
@@ -418,28 +415,8 @@ void npc_escortAI::FillPointMovementListForCreature()
} }
} }
void npc_escortAI::SetRun(bool on)
{
if (on)
{
if (!m_bIsRunning)
me->SetWalk(false);
else
LOG_DEBUG("scripts.ai", "EscortAI attempt to set run mode, but is already running.");
}
else
{
if (m_bIsRunning)
me->SetWalk(true);
else
LOG_DEBUG("scripts.ai", "EscortAI attempt to set walk mode, but is already walking.");
}
m_bIsRunning = on;
}
//TODO: get rid of this many variables passed in function. //TODO: get rid of this many variables passed in function.
void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, ObjectGuid playerGUID /* = ObjectGuid::Empty */, Quest const* quest /* = nullptr */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */) void npc_escortAI::Start(bool isActiveAttacker /* = true*/, ObjectGuid playerGUID /* = ObjectGuid::Empty */, Quest const* quest /* = nullptr */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
{ {
if (me->GetVictim()) if (me->GetVictim())
{ {
@@ -469,7 +446,6 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
//set variables //set variables
m_bIsActiveAttacker = isActiveAttacker; m_bIsActiveAttacker = isActiveAttacker;
m_bIsRunning = run;
m_uiPlayerGUID = playerGUID; m_uiPlayerGUID = playerGUID;
m_pQuestForEscort = quest; m_pQuestForEscort = quest;
@@ -495,17 +471,11 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
me->SetImmuneToNPC(false); me->SetImmuneToNPC(false);
} }
LOG_DEBUG("scripts.ai", "EscortAI started with {} waypoints. ActiveAttacker = {}, Run = {}, PlayerGUID = {}", LOG_DEBUG("scripts.ai", "EscortAI started with {} waypoints. ActiveAttacker = {}, PlayerGUID = {}",
uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID.ToString()); uint64(WaypointList.size()), m_bIsActiveAttacker, m_uiPlayerGUID.ToString());
CurrentWP = WaypointList.begin(); CurrentWP = WaypointList.begin();
//Set initial speed
if (m_bIsRunning)
me->SetWalk(false);
else
me->SetWalk(true);
AddEscortState(STATE_ESCORT_ESCORTING); AddEscortState(STATE_ESCORT_ESCORTING);
if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == ESCORT_MOTION_TYPE) if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == ESCORT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MovementExpired();
@@ -90,9 +90,8 @@ public:
virtual void WaypointReached(uint32 pointId) = 0; virtual void WaypointReached(uint32 pointId) = 0;
virtual void WaypointStart(uint32 /*pointId*/) {} virtual void WaypointStart(uint32 /*pointId*/) {}
void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = nullptr, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true); void Start(bool isActiveAttacker = true, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = nullptr, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
void SetRun(bool on = true);
void SetEscortPaused(bool on); void SetEscortPaused(bool on);
bool HasEscortState(uint32 escortState) { return (m_uiEscortState & escortState); } bool HasEscortState(uint32 escortState) { return (m_uiEscortState & escortState); }
@@ -130,7 +129,6 @@ private:
std::list<Escort_Waypoint>::iterator CurrentWP; std::list<Escort_Waypoint>::iterator CurrentWP;
bool m_bIsActiveAttacker; //obsolete, determined by faction. bool m_bIsActiveAttacker; //obsolete, determined by faction.
bool m_bIsRunning; //all creatures are walking by default (has flag MOVEMENTFLAG_WALK)
bool m_bCanInstantRespawn; //if creature should respawn instantly after escort over (if not, database respawntime are used) bool m_bCanInstantRespawn; //if creature should respawn instantly after escort over (if not, database respawntime are used)
bool m_bCanReturnToStart; //if creature can walk same path (loop) without despawn. Not for regular escort quests. bool m_bCanReturnToStart; //if creature can walk same path (loop) without despawn. Not for regular escort quests.
bool DespawnAtEnd; bool DespawnAtEnd;
+5 -26
View File
@@ -43,9 +43,6 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mCanRepeatPath = false; mCanRepeatPath = false;
// spawn in run mode
// Xinef: spawn in run mode and set mRun to run... this overrides SetWalk EVERYWHERE
mRun = true;
mEvadeDisabled = false; mEvadeDisabled = false;
mCanAutoAttack = true; mCanAutoAttack = true;
@@ -190,7 +187,7 @@ void SmartAI::GenerateWayPointArray(Movement::PointsArray* points)
} }
} }
void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker) void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat, Unit* invoker)
{ {
if (HasEscortState(SMART_ESCORT_ESCORTING)) if (HasEscortState(SMART_ESCORT_ESCORTING))
StopPath(); StopPath();
@@ -208,7 +205,6 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker)
{ {
AddEscortState(SMART_ESCORT_ESCORTING); AddEscortState(SMART_ESCORT_ESCORTING);
mCanRepeatPath = repeat; mCanRepeatPath = repeat;
SetRun(run);
if (invoker && invoker->IsPlayer()) if (invoker && invoker->IsPlayer())
{ {
@@ -219,7 +215,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker)
Movement::PointsArray pathPoints; Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints); GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints); me->GetMotionMaster()->MoveSplinePath(&pathPoints, forcedMovement);
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId()); GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId());
} }
} }
@@ -256,7 +252,6 @@ void SmartAI::PausePath(uint32 delay, bool forced)
if (forced && !mWPReached) if (forced && !mWPReached)
{ {
mForcedPaused = forced; mForcedPaused = forced;
SetRun(mRun);
if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == ESCORT_MOTION_TYPE) if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == ESCORT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MovementExpired();
@@ -362,7 +357,7 @@ void SmartAI::EndPath(bool fail)
if (mCanRepeatPath) if (mCanRepeatPath)
{ {
if (IsAIControlled()) if (IsAIControlled())
StartPath(mRun, GetScript()->GetPathId(), true); StartPath(FORCED_MOVEMENT_NONE, GetScript()->GetPathId(), true);
} }
else else
GetScript()->SetPathId(0); GetScript()->SetPathId(0);
@@ -373,8 +368,6 @@ void SmartAI::EndPath(bool fail)
void SmartAI::ResumePath() void SmartAI::ResumePath()
{ {
SetRun(mRun);
if (mLastWP) if (mLastWP)
{ {
Movement::PointsArray pathPoints; Movement::PointsArray pathPoints;
@@ -389,10 +382,9 @@ void SmartAI::ReturnToLastOOCPos()
if (!IsAIControlled()) if (!IsAIControlled())
return; return;
me->SetWalk(false);
float x, y, z, o; float x, y, z, o;
me->GetHomePosition(x, y, z, o); me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(SMART_ESCORT_LAST_OOC_POINT, x, y, z); me->GetMotionMaster()->MovePoint(SMART_ESCORT_LAST_OOC_POINT, x, y, z, FORCED_MOVEMENT_RUN);
} }
void SmartAI::UpdatePath(const uint32 diff) void SmartAI::UpdatePath(const uint32 diff)
@@ -469,7 +461,6 @@ void SmartAI::UpdatePath(const uint32 diff)
EndPath(); EndPath();
else if (GetNextWayPoint()) else if (GetNextWayPoint())
{ {
SetRun(mRun);
// xinef: if we have reached waypoint, and there is no working spline movement it means our splitted array has ended, make new one // xinef: if we have reached waypoint, and there is no working spline movement it means our splitted array has ended, make new one
if (me->movespline->Finalized()) if (me->movespline->Finalized())
ResumePath(); ResumePath();
@@ -629,7 +620,6 @@ void SmartAI::MovepointReached(uint32 id)
EndPath(); EndPath();
else if (GetNextWayPoint()) else if (GetNextWayPoint())
{ {
SetRun(mRun);
// xinef: if we have reached waypoint, and there is no working spline movement it means our splitted array has ended, make new one // xinef: if we have reached waypoint, and there is no working spline movement it means our splitted array has ended, make new one
if (me->movespline->Finalized()) if (me->movespline->Finalized())
ResumePath(); ResumePath();
@@ -675,7 +665,6 @@ void SmartAI::EnterEvadeMode(EvadeReason /*why*/)
GetScript()->ProcessEventsFor(SMART_EVENT_EVADE); //must be after aura clear so we can cast spells from db GetScript()->ProcessEventsFor(SMART_EVENT_EVADE); //must be after aura clear so we can cast spells from db
SetRun(mRun);
if (HasEscortState(SMART_ESCORT_ESCORTING)) if (HasEscortState(SMART_ESCORT_ESCORTING))
{ {
AddEscortState(SMART_ESCORT_RETURNING); AddEscortState(SMART_ESCORT_RETURNING);
@@ -850,7 +839,6 @@ void SmartAI::AttackStart(Unit* who)
{ {
if (!me->HasUnitState(UNIT_STATE_NO_COMBAT_MOVEMENT)) if (!me->HasUnitState(UNIT_STATE_NO_COMBAT_MOVEMENT))
{ {
SetRun(mRun);
MovementGeneratorType type = me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE); MovementGeneratorType type = me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE);
if (type == ESCORT_MOTION_TYPE || type == POINT_MOTION_TYPE) if (type == ESCORT_MOTION_TYPE || type == POINT_MOTION_TYPE)
{ {
@@ -952,9 +940,7 @@ void SmartAI::OnCharmed(bool /* apply */)
if (!charmed && !me->IsInEvadeMode()) if (!charmed && !me->IsInEvadeMode())
{ {
if (mCanRepeatPath) if (mCanRepeatPath)
StartPath(mRun, GetScript()->GetPathId(), true); StartPath(FORCED_MOVEMENT_NONE, GetScript()->GetPathId(), true);
else
me->SetWalk(!mRun);
if (Unit* charmer = me->GetCharmer()) if (Unit* charmer = me->GetCharmer())
AttackStart(charmer); AttackStart(charmer);
@@ -1002,12 +988,6 @@ ObjectGuid SmartAI::GetGUID(int32 /*id*/) const
return ObjectGuid::Empty; return ObjectGuid::Empty;
} }
void SmartAI::SetRun(bool run)
{
me->SetWalk(!run);
mRun = run;
}
void SmartAI::SetFly(bool fly) void SmartAI::SetFly(bool fly)
{ {
// xinef: set proper flag! // xinef: set proper flag!
@@ -1108,7 +1088,6 @@ void SmartAI::SetFollow(Unit* target, float dist, float angle, uint32 credit, ui
mFollowArrivedEntry = end; mFollowArrivedEntry = end;
mFollowArrivedAlive = !aliveState; // negate - 0 is alive mFollowArrivedAlive = !aliveState; // negate - 0 is alive
mFollowCreditType = creditType; mFollowCreditType = creditType;
SetRun(mRun);
me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle); me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle);
} }
+1 -5
View File
@@ -52,7 +52,7 @@ public:
bool IsAIControlled() const; bool IsAIControlled() const;
// Start moving to the desired MovePoint // Start moving to the desired MovePoint
void StartPath(bool run = false, uint32 path = 0, bool repeat = false, Unit* invoker = nullptr); void StartPath(ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, uint32 path = 0, bool repeat = false, Unit* invoker = nullptr);
bool LoadPath(uint32 entry); bool LoadPath(uint32 entry);
void PausePath(uint32 delay, bool forced = false); void PausePath(uint32 delay, bool forced = false);
void StopPath(uint32 DespawnTime = 0, uint32 quest = 0, bool fail = false); void StopPath(uint32 DespawnTime = 0, uint32 quest = 0, bool fail = false);
@@ -175,9 +175,6 @@ public:
// Called at movepoint reached // Called at movepoint reached
void MovepointReached(uint32 id); void MovepointReached(uint32 id);
// Makes the creature run/walk
void SetRun(bool run = true);
void SetFly(bool fly = true); void SetFly(bool fly = true);
void SetSwim(bool swim = true); void SetSwim(bool swim = true);
@@ -240,7 +237,6 @@ private:
uint32 mEscortNPCFlags; uint32 mEscortNPCFlags;
uint32 GetWPCount() { return mWayPoints ? mWayPoints->size() : 0; } uint32 GetWPCount() { return mWayPoints ? mWayPoints->size() : 0; }
bool mCanRepeatPath; bool mCanRepeatPath;
bool mRun;
bool mEvadeDisabled; bool mEvadeDisabled;
bool mCanAutoAttack; bool mCanAutoAttack;
bool mForcedPaused; bool mForcedPaused;
+13 -15
View File
@@ -1683,10 +1683,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{ {
if (IsCreature(target)) if (IsCreature(target))
{ {
if (IsSmart(target->ToCreature())) target->ToCreature()->SetWalk(e.action.setRun.run ? false : true);
CAST_AI(SmartAI, target->ToCreature()->AI())->SetRun(e.action.setRun.run);
else
target->ToCreature()->SetWalk(e.action.setRun.run ? false : true); // Xinef: reversed
} }
} }
@@ -1731,7 +1728,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!IsSmart()) if (!IsSmart())
break; break;
bool run = e.action.wpStart.run != 0; ForcedMovement forcedMovement = static_cast<ForcedMovement>(e.action.wpStart.forcedMovement);
uint32 entry = e.action.wpStart.pathID; uint32 entry = e.action.wpStart.pathID;
bool repeat = e.action.wpStart.repeat != 0; bool repeat = e.action.wpStart.repeat != 0;
@@ -1745,7 +1742,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
} }
me->SetReactState((ReactStates)e.action.wpStart.reactState); me->SetReactState((ReactStates)e.action.wpStart.reactState);
CAST_AI(SmartAI, me->AI())->StartPath(run, entry, repeat, unit); CAST_AI(SmartAI, me->AI())->StartPath(forcedMovement, entry, repeat, unit);
uint32 quest = e.action.wpStart.quest; uint32 quest = e.action.wpStart.quest;
uint32 DespawnTime = e.action.wpStart.despawnTime; uint32 DespawnTime = e.action.wpStart.despawnTime;
@@ -1854,8 +1851,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (TransportBase* trans = me->GetDirectTransport()) if (TransportBase* trans = me->GetDirectTransport())
trans->CalculatePassengerPosition(dest.x, dest.y, dest.z); trans->CalculatePassengerPosition(dest.x, dest.y, dest.z);
me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, dest.x, dest.y, dest.z, true, isForced, me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, dest.x, dest.y, dest.z, FORCED_MOVEMENT_NONE,
isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE, e.target.o); 0.f, e.target.o, true, isForced, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
break; break;
} }
@@ -1871,9 +1868,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
randomPoint.m_positionX, randomPoint.m_positionX,
randomPoint.m_positionY, randomPoint.m_positionY,
randomPoint.m_positionZ, randomPoint.m_positionZ,
true, FORCED_MOVEMENT_NONE,
isForced, 0.f, 0.f, true, isForced, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE
isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE
); );
} }
@@ -1897,7 +1893,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
else if (e.action.moveToPos.ContactDistance) else if (e.action.moveToPos.ContactDistance)
target->GetNearPoint(me, x, y, z, e.action.moveToPos.ContactDistance, 0, target->GetAngle(me)); target->GetNearPoint(me, x, y, z, e.action.moveToPos.ContactDistance, 0, target->GetAngle(me));
me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, x + e.target.x, y + e.target.y, z + e.target.z, true, isForced, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, x + e.target.x, y + e.target.y, z + e.target.z, FORCED_MOVEMENT_NONE,
0.f, 0.f, true, isForced, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
break; break;
} }
@@ -1914,7 +1911,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
SAIBool isForced = !e.action.moveToPosTarget.disableForceDestination; SAIBool isForced = !e.action.moveToPosTarget.disableForceDestination;
Creature* ctarget = target->ToCreature(); Creature* ctarget = target->ToCreature();
ctarget->GetMotionMaster()->MovePoint(e.action.moveToPosTarget.pointId, e.target.x, e.target.y, e.target.z, true, isForced, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); ctarget->GetMotionMaster()->MovePoint(e.action.moveToPosTarget.pointId, e.target.x, e.target.y, e.target.z, FORCED_MOVEMENT_NONE,
0.f, 0.f, true, isForced, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
} }
} }
@@ -2543,9 +2541,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (closestWpId) if (closestWpId)
{ {
bool repeat = e.action.startClosestWaypoint.repeat; bool repeat = e.action.startClosestWaypoint.repeat;
bool run = e.action.startClosestWaypoint.run; ForcedMovement forcedMovement = static_cast<ForcedMovement>(e.action.startClosestWaypoint.forcedMovement);
CAST_AI(SmartAI, creature->AI())->StartPath(repeat, closestWpId, run); CAST_AI(SmartAI, creature->AI())->StartPath(forcedMovement, closestWpId, repeat);
} }
} }
} }
@@ -1564,11 +1564,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false; return false;
} }
if (e.action.startClosestWaypoint.repeat > 1 || e.action.startClosestWaypoint.run > 1) if (e.action.startClosestWaypoint.repeat > 1 || e.action.startClosestWaypoint.forcedMovement >= FORCED_MOVEMENT_MAX)
{ {
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has invalid run ({}) or repeat ({}) parameter, must be 0 or 1.", LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has invalid forcedMovement ({}) or repeat ({}) parameter, must be 0 or 1.",
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(),
e.action.startClosestWaypoint.repeat, e.action.startClosestWaypoint.run); e.action.startClosestWaypoint.repeat, e.action.startClosestWaypoint.forcedMovement);
return false; return false;
} }
break; break;
@@ -1745,8 +1745,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false; return false;
} }
return IsSAIBoolValid(e, e.action.wpStart.run) && if (e.action.wpStart.forcedMovement >= FORCED_MOVEMENT_MAX)
IsSAIBoolValid(e, e.action.wpStart.repeat); {
LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses invalid forcedMovement {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.forcedMovement);
return false;
}
return IsSAIBoolValid(e, e.action.wpStart.repeat);
} }
case SMART_ACTION_CREATE_TIMED_EVENT: case SMART_ACTION_CREATE_TIMED_EVENT:
{ {
@@ -1041,7 +1041,7 @@ struct SmartAction
struct struct
{ {
SAIBool run; uint32 forcedMovement;
uint32 pathID; uint32 pathID;
SAIBool repeat; SAIBool repeat;
uint32 quest; uint32 quest;
@@ -1295,7 +1295,7 @@ struct SmartAction
uint32 pathId1; uint32 pathId1;
uint32 pathId2; uint32 pathId2;
uint32 repeat; uint32 repeat;
uint32 run; uint32 forcedMovement;
} startClosestWaypoint; } startClosestWaypoint;
struct struct
@@ -99,18 +99,18 @@ enum class CreatureFlightMovementType : uint8
enum class CreatureChaseMovementType : uint8 enum class CreatureChaseMovementType : uint8
{ {
Run, Run = 0,
CanWalk, CanWalk = 1,
AlwaysWalk, AlwaysWalk = 2,
Max Max
}; };
enum class CreatureRandomMovementType : uint8 enum class CreatureRandomMovementType : uint8
{ {
Walk, Walk = 0,
CanRun, CanRun = 1,
AlwaysRun, AlwaysRun = 2,
Max Max
}; };
+1 -3
View File
@@ -1677,9 +1677,7 @@ public:
void propagateSpeedChange() { GetMotionMaster()->propagateSpeedChange(); } void propagateSpeedChange() { GetMotionMaster()->propagateSpeedChange(); }
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 TransitTime, SplineFlags sf = SPLINEFLAG_WALK_MODE); // pussywizard: need to just send packet, with no movement/spline void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 TransitTime, SplineFlags sf = SPLINEFLAG_WALK_MODE); // pussywizard: need to just send packet, with no movement/spline
void MonsterMoveWithSpeed(float x, float y, float z, float speed); void MonsterMoveWithSpeed(float x, float y, float z, float speed); // Not to be used outside of cinematics
//void SetFacing(float ori, WorldObject* obj = nullptr);
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = nullptr);
virtual bool SetWalk(bool enable); virtual bool SetWalk(bool enable);
virtual bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true); virtual bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true);
+21 -24
View File
@@ -387,6 +387,7 @@ void MotionMaster::MoveBackwards(Unit* target, float dist)
Movement::MoveSplineInit init(_owner); Movement::MoveSplineInit init(_owner);
init.MoveTo(point.x, point.y, point.z, false); init.MoveTo(point.x, point.y, point.z, false);
init.SetWalk(true);
init.SetFacing(target); init.SetFacing(target);
init.SetOrientationInversed(); init.SetOrientationInversed();
init.Launch(); init.Launch();
@@ -469,7 +470,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
* *
* For transition movement between the ground and the air, use MoveLand or MoveTakeoff instead. * For transition movement between the ground and the air, use MoveLand or MoveTakeoff instead.
*/ */
void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generatePath, bool forceDestination, MovementSlot slot, float orientation /* = 0.0f*/) void MotionMaster::MovePoint(uint32 id, float x, float y, float z, ForcedMovement forcedMovement, float speed, float orientation, bool generatePath, bool forceDestination, MovementSlot slot)
{ {
if (_owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE)) if (_owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE))
return; return;
@@ -477,16 +478,16 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generate
if (_owner->IsPlayer()) if (_owner->IsPlayer())
{ {
LOG_DEBUG("movement.motionmaster", "Player ({}) targeted point (Id: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z); LOG_DEBUG("movement.motionmaster", "Player ({}) targeted point (Id: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, 0.0f, orientation, nullptr, generatePath, forceDestination), slot); Mutate(new PointMovementGenerator<Player>(id, x, y, z, forcedMovement, speed, orientation, nullptr, generatePath, forceDestination), slot);
} }
else else
{ {
LOG_DEBUG("movement.motionmaster", "Creature ({}) targeted point (ID: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z); LOG_DEBUG("movement.motionmaster", "Creature ({}) targeted point (ID: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, 0.0f, orientation, nullptr, generatePath, forceDestination), slot); Mutate(new PointMovementGenerator<Creature>(id, x, y, z, forcedMovement, speed, orientation, nullptr, generatePath, forceDestination), slot);
} }
} }
void MotionMaster::MoveSplinePath(Movement::PointsArray* path) void MotionMaster::MoveSplinePath(Movement::PointsArray* path, ForcedMovement forcedMovement)
{ {
// Xinef: do not allow to move with UNIT_FLAG_DISABLE_MOVE // Xinef: do not allow to move with UNIT_FLAG_DISABLE_MOVE
if (_owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE)) if (_owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE))
@@ -494,15 +495,15 @@ void MotionMaster::MoveSplinePath(Movement::PointsArray* path)
if (_owner->IsPlayer()) if (_owner->IsPlayer())
{ {
Mutate(new EscortMovementGenerator<Player>(path), MOTION_SLOT_ACTIVE); Mutate(new EscortMovementGenerator<Player>(forcedMovement, path), MOTION_SLOT_ACTIVE);
} }
else else
{ {
Mutate(new EscortMovementGenerator<Creature>(path), MOTION_SLOT_ACTIVE); Mutate(new EscortMovementGenerator<Creature>(forcedMovement, path), MOTION_SLOT_ACTIVE);
} }
} }
void MotionMaster::MoveSplinePath(uint32 path_id) void MotionMaster::MoveSplinePath(uint32 path_id, ForcedMovement forcedMovement)
{ {
// convert the path id to a Movement::PointsArray* // convert the path id to a Movement::PointsArray*
Movement::PointsArray* points = new Movement::PointsArray(); Movement::PointsArray* points = new Movement::PointsArray();
@@ -514,7 +515,7 @@ void MotionMaster::MoveSplinePath(uint32 path_id)
} }
// pass the new PointsArray* to the appropriate MoveSplinePath function // pass the new PointsArray* to the appropriate MoveSplinePath function
MoveSplinePath(points); MoveSplinePath(points, forcedMovement);
} }
/** /**
@@ -539,8 +540,8 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed /* = 0.0
} }
init.SetAnimation(Movement::ToGround); init.SetAnimation(Movement::ToGround);
init.Launch();
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); Mutate(new EffectMovementGenerator(init, id), MOTION_SLOT_ACTIVE);
} }
/** /**
@@ -569,16 +570,12 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed /* =
init.MoveTo(x, y, z); init.MoveTo(x, y, z);
if (speed > 0.0f) if (speed > 0.0f)
{
init.SetVelocity(speed); init.SetVelocity(speed);
}
if (!skipAnimation) if (!skipAnimation)
{
init.SetAnimation(Movement::ToFly); init.SetAnimation(Movement::ToFly);
}
init.Launch(); Mutate(new EffectMovementGenerator(init, id), MOTION_SLOT_ACTIVE);
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
} }
/** /**
@@ -612,8 +609,8 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa
init.SetParabolic(max_height, 0); init.SetParabolic(max_height, 0);
init.SetOrientationFixed(true); init.SetOrientationFixed(true);
init.SetVelocity(speedXY); init.SetVelocity(speedXY);
init.Launch();
Mutate(new EffectMovementGenerator(0), MOTION_SLOT_CONTROLLED); Mutate(new EffectMovementGenerator(init, 0), MOTION_SLOT_CONTROLLED);
} }
/** /**
@@ -652,8 +649,8 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee
init.SetVelocity(speedXY); init.SetVelocity(speedXY);
if (target) if (target)
init.SetFacing(target); init.SetFacing(target);
init.Launch();
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); Mutate(new EffectMovementGenerator(init, id), MOTION_SLOT_CONTROLLED);
} }
/** /**
@@ -695,8 +692,8 @@ void MotionMaster::MoveFall(uint32 id /*=0*/, bool addFlagForNPC)
Movement::MoveSplineInit init(_owner); Movement::MoveSplineInit init(_owner);
init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), tz + _owner->GetHoverHeight()); init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), tz + _owner->GetHoverHeight());
init.SetFall(); init.SetFall();
init.Launch();
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); Mutate(new EffectMovementGenerator(init, id), MOTION_SLOT_CONTROLLED);
} }
/** /**
@@ -713,12 +710,12 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id,
if (_owner->IsPlayer()) if (_owner->IsPlayer())
{ {
LOG_DEBUG("movement.motionmaster", "Player ({}) charge point (X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), x, y, z); LOG_DEBUG("movement.motionmaster", "Player ({}) charge point (X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED); Mutate(new PointMovementGenerator<Player>(id, x, y, z, FORCED_MOVEMENT_NONE, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED);
} }
else else
{ {
LOG_DEBUG("movement.motionmaster", "Creature ({}) charge point (X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), x, y, z); LOG_DEBUG("movement.motionmaster", "Creature ({}) charge point (X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED); Mutate(new PointMovementGenerator<Creature>(id, x, y, z, FORCED_MOVEMENT_NONE, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED);
} }
} }
+14 -5
View File
@@ -80,6 +80,15 @@ enum RotateDirection
ROTATE_DIRECTION_RIGHT ROTATE_DIRECTION_RIGHT
}; };
enum ForcedMovement
{
FORCED_MOVEMENT_NONE = 0,
FORCED_MOVEMENT_WALK = 1,
FORCED_MOVEMENT_RUN = 2,
FORCED_MOVEMENT_MAX
};
struct ChaseRange struct ChaseRange
{ {
ChaseRange(float range); ChaseRange(float range);
@@ -210,11 +219,11 @@ public:
void MoveForwards(Unit* target, float dist); void MoveForwards(Unit* target, float dist);
void MoveConfused(); void MoveConfused();
void MoveFleeing(Unit* enemy, uint32 time = 0); void MoveFleeing(Unit* enemy, uint32 time = 0);
void MovePoint(uint32 id, const Position& pos, bool generatePath = true, bool forceDestination = true) void MovePoint(uint32 id, const Position& pos, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, float speed = 0.f, bool generatePath = true, bool forceDestination = true)
{ MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath, forceDestination, MOTION_SLOT_ACTIVE, pos.GetOrientation()); } { MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, forcedMovement, speed, pos.GetOrientation(), generatePath, forceDestination, MOTION_SLOT_ACTIVE); }
void MovePoint(uint32 id, float x, float y, float z, bool generatePath = true, bool forceDestination = true, MovementSlot slot = MOTION_SLOT_ACTIVE, float orientation = 0.0f); void MovePoint(uint32 id, float x, float y, float z, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, float speed = 0.f, float orientation = 0.0f, bool generatePath = true, bool forceDestination = true, MovementSlot slot = MOTION_SLOT_ACTIVE);
void MoveSplinePath(Movement::PointsArray* path); void MoveSplinePath(Movement::PointsArray* path, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE);
void MoveSplinePath(uint32 path_id); void MoveSplinePath(uint32 path_id, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE);
// These two movement types should only be used with creatures having landing/takeoff animations // These two movement types should only be used with creatures having landing/takeoff animations
void MoveLand(uint32 id, Position const& pos, float speed = 0.0f); void MoveLand(uint32 id, Position const& pos, float speed = 0.0f);
@@ -146,6 +146,7 @@ bool ConfusedMovementGenerator<T>::DoUpdate(T* unit, uint32 diff)
float z = i_waypoints[i_nextMove][2]; float z = i_waypoints[i_nextMove][2];
Movement::MoveSplineInit init(unit); Movement::MoveSplineInit init(unit);
init.MoveTo(x, y, z, true); init.MoveTo(x, y, z, true);
init.SetWalk(true);
init.Launch(); init.Launch();
} }
} }
@@ -36,6 +36,11 @@ void EscortMovementGenerator<T>::DoInitialize(T* unit)
else if (m_precomputedPath.size()) else if (m_precomputedPath.size())
init.MovebyPath(m_precomputedPath); init.MovebyPath(m_precomputedPath);
if (_forcedMovement == FORCED_MOVEMENT_WALK)
init.SetWalk(true);
else if (_forcedMovement == FORCED_MOVEMENT_RUN)
init.SetWalk(false);
init.Launch(); init.Launch();
_splineId = unit->movespline->GetId(); _splineId = unit->movespline->GetId();
@@ -79,6 +84,11 @@ bool EscortMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)
init.MoveTo(m_precomputedPath[1].x, m_precomputedPath[1].y, m_precomputedPath[1].z, true); init.MoveTo(m_precomputedPath[1].x, m_precomputedPath[1].y, m_precomputedPath[1].z, true);
} }
if (_forcedMovement == FORCED_MOVEMENT_WALK)
init.SetWalk(true);
else if (_forcedMovement == FORCED_MOVEMENT_RUN)
init.SetWalk(false);
init.Launch(); init.Launch();
// Xinef: Override spline Id on recalculate launch // Xinef: Override spline Id on recalculate launch
_splineId = unit->movespline->GetId(); _splineId = unit->movespline->GetId();
@@ -24,7 +24,7 @@ template<class T>
class EscortMovementGenerator : public MovementGeneratorMedium< T, EscortMovementGenerator<T> > class EscortMovementGenerator : public MovementGeneratorMedium< T, EscortMovementGenerator<T> >
{ {
public: public:
EscortMovementGenerator(Movement::PointsArray* _path = nullptr) : i_recalculateSpeed(false) EscortMovementGenerator(ForcedMovement forcedMovement, Movement::PointsArray* _path = nullptr) : i_recalculateSpeed(false), _forcedMovement(forcedMovement)
{ {
if (_path) if (_path)
m_precomputedPath = *_path; m_precomputedPath = *_path;
@@ -46,6 +46,7 @@ private:
Movement::PointsArray m_precomputedPath; Movement::PointsArray m_precomputedPath;
uint32 _splineId; uint32 _splineId;
ForcedMovement _forcedMovement;
}; };
#endif #endif
@@ -31,8 +31,6 @@ void HomeMovementGenerator<Creature>::DoFinalize(Creature* owner)
owner->ClearUnitState(UNIT_STATE_EVADE); owner->ClearUnitState(UNIT_STATE_EVADE);
if (arrived) if (arrived)
{ {
// Xinef: npc run by default
//owner->SetWalk(true);
owner->LoadCreaturesAddon(true); owner->LoadCreaturesAddon(true);
owner->AI()->JustReachedHome(); owner->AI()->JustReachedHome();
} }
@@ -84,6 +84,11 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
if (speed > 0.0f) if (speed > 0.0f)
init.SetVelocity(speed); init.SetVelocity(speed);
if (_forcedMovement == FORCED_MOVEMENT_WALK)
init.SetWalk(true);
else if (_forcedMovement == FORCED_MOVEMENT_RUN)
init.SetWalk(false);
if (i_orientation > 0.0f) if (i_orientation > 0.0f)
{ {
init.SetFacing(i_orientation); init.SetFacing(i_orientation);
@@ -142,6 +147,11 @@ bool PointMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)
if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
init.SetVelocity(speed); init.SetVelocity(speed);
if (_forcedMovement == FORCED_MOVEMENT_WALK)
init.SetWalk(true);
else if (_forcedMovement == FORCED_MOVEMENT_RUN)
init.SetWalk(false);
if (i_orientation > 0.0f) if (i_orientation > 0.0f)
{ {
init.SetFacing(i_orientation); init.SetFacing(i_orientation);
@@ -228,6 +238,11 @@ bool EffectMovementGenerator::Update(Unit* unit, uint32)
return !unit->movespline->Finalized(); return !unit->movespline->Finalized();
} }
void EffectMovementGenerator::Initialize(Unit*)
{
i_spline.Launch();
}
void EffectMovementGenerator::Finalize(Unit* unit) void EffectMovementGenerator::Finalize(Unit* unit)
{ {
if (!unit->IsCreature()) if (!unit->IsCreature())
@@ -20,15 +20,16 @@
#include "Creature.h" #include "Creature.h"
#include "MovementGenerator.h" #include "MovementGenerator.h"
#include "MoveSplineInit.h"
template<class T> template<class T>
class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator<T> > class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator<T> >
{ {
public: public:
PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f, float orientation = 0.0f, const Movement::PointsArray* _path = nullptr, PointMovementGenerator(uint32 _id, float _x, float _y, float _z, ForcedMovement forcedMovement, float _speed = 0.0f, float orientation = 0.0f, const Movement::PointsArray* _path = nullptr,
bool generatePath = false, bool forceDestination = false, ObjectGuid chargeTargetGUID = ObjectGuid::Empty) bool generatePath = false, bool forceDestination = false, ObjectGuid chargeTargetGUID = ObjectGuid::Empty, bool reverseOrientation = false, ObjectGuid facingTargetGuid = ObjectGuid())
: id(_id), i_x(_x), i_y(_y), i_z(_z), speed(_speed), i_orientation(orientation), _generatePath(generatePath), _forceDestination(forceDestination), : id(_id), i_x(_x), i_y(_y), i_z(_z), speed(_speed), i_orientation(orientation), _generatePath(generatePath), _forceDestination(forceDestination), _reverseOrientation(reverseOrientation),
_chargeTargetGUID(chargeTargetGUID) _chargeTargetGUID(chargeTargetGUID), _forcedMovement(forcedMovement), _facingTargetGuid(facingTargetGuid)
{ {
if (_path) if (_path)
m_precomputedPath = *_path; m_precomputedPath = *_path;
@@ -55,14 +56,17 @@ private:
Movement::PointsArray m_precomputedPath; Movement::PointsArray m_precomputedPath;
bool _generatePath; bool _generatePath;
bool _forceDestination; bool _forceDestination;
bool _reverseOrientation;
ObjectGuid _chargeTargetGUID; ObjectGuid _chargeTargetGUID;
ForcedMovement _forcedMovement;
ObjectGuid _facingTargetGuid;
}; };
class AssistanceMovementGenerator : public PointMovementGenerator<Creature> class AssistanceMovementGenerator : public PointMovementGenerator<Creature>
{ {
public: public:
AssistanceMovementGenerator(float _x, float _y, float _z) : AssistanceMovementGenerator(float _x, float _y, float _z) :
PointMovementGenerator<Creature>(0, _x, _y, _z) {} PointMovementGenerator<Creature>(0, _x, _y, _z, FORCED_MOVEMENT_NONE) {}
MovementGeneratorType GetMovementGeneratorType() { return ASSISTANCE_MOTION_TYPE; } MovementGeneratorType GetMovementGeneratorType() { return ASSISTANCE_MOTION_TYPE; }
void Finalize(Unit*); void Finalize(Unit*);
@@ -72,14 +76,15 @@ public:
class EffectMovementGenerator : public MovementGenerator class EffectMovementGenerator : public MovementGenerator
{ {
public: public:
explicit EffectMovementGenerator(uint32 Id) : m_Id(Id) {} explicit EffectMovementGenerator(Movement::MoveSplineInit& spline, uint32 Id) : m_Id(Id), i_spline(spline) {}
void Initialize(Unit*) override {} void Initialize(Unit*) override;
void Finalize(Unit*) override; void Finalize(Unit*) override;
void Reset(Unit*) override {} void Reset(Unit*) override {}
bool Update(Unit*, uint32) override; bool Update(Unit*, uint32) override;
MovementGeneratorType GetMovementGeneratorType() override { return EFFECT_MOTION_TYPE; } MovementGeneratorType GetMovementGeneratorType() override { return EFFECT_MOTION_TYPE; }
private: private:
uint32 m_Id; uint32 m_Id;
Movement::MoveSplineInit i_spline;
}; };
#endif #endif
@@ -51,7 +51,21 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
creature->AddUnitState(UNIT_STATE_ROAMING_MOVE); creature->AddUnitState(UNIT_STATE_ROAMING_MOVE);
Movement::MoveSplineInit init(creature); Movement::MoveSplineInit init(creature);
init.MoveTo(_currDestPosition.GetPositionX(), _currDestPosition.GetPositionY(), _currDestPosition.GetPositionZ()); init.MoveTo(_currDestPosition.GetPositionX(), _currDestPosition.GetPositionY(), _currDestPosition.GetPositionZ());
init.SetWalk(true);
bool walk = true;
switch (creature->GetMovementTemplate().GetRandom())
{
case CreatureRandomMovementType::CanRun:
walk = creature->IsWalking();
break;
case CreatureRandomMovementType::AlwaysRun:
walk = false;
break;
default:
break;
}
init.SetWalk(walk);
init.Launch(); init.Launch();
if (creature->GetFormation() && creature->GetFormation()->GetLeader() == creature) if (creature->GetFormation() && creature->GetFormation()->GetLeader() == creature)
creature->GetFormation()->LeaderMoveTo(_currDestPosition.GetPositionX(), _currDestPosition.GetPositionY(), _currDestPosition.GetPositionZ(), 0); creature->GetFormation()->LeaderMoveTo(_currDestPosition.GetPositionX(), _currDestPosition.GetPositionY(), _currDestPosition.GetPositionZ(), 0);
@@ -270,7 +284,6 @@ template<>
void RandomMovementGenerator<Creature>::DoFinalize(Creature* creature) void RandomMovementGenerator<Creature>::DoFinalize(Creature* creature)
{ {
creature->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE); creature->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
creature->SetWalk(false);
} }
template<> template<>
@@ -365,7 +365,6 @@ void ChaseMovementGenerator<Creature>::DoInitialize(Creature* owner)
_lastTargetPosition.reset(); _lastTargetPosition.reset();
i_recheckDistance.Reset(0); i_recheckDistance.Reset(0);
i_leashExtensionTimer.Reset(owner->GetAttackTime(BASE_ATTACK)); i_leashExtensionTimer.Reset(owner->GetAttackTime(BASE_ATTACK));
owner->SetWalk(false);
owner->AddUnitState(UNIT_STATE_CHASE); owner->AddUnitState(UNIT_STATE_CHASE);
} }
@@ -56,7 +56,6 @@ void WaypointMovementGenerator<Creature>::DoInitialize(Creature* creature)
void WaypointMovementGenerator<Creature>::DoFinalize(Creature* creature) void WaypointMovementGenerator<Creature>::DoFinalize(Creature* creature)
{ {
creature->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE); creature->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
creature->SetWalk(false);
} }
void WaypointMovementGenerator<Creature>::DoReset(Creature* creature) void WaypointMovementGenerator<Creature>::DoReset(Creature* creature)
+1 -1
View File
@@ -442,7 +442,7 @@ void Map::ScriptsProcess()
if (step.script->MoveTo.TravelTime != 0) if (step.script->MoveTo.TravelTime != 0)
{ {
float speed = unit->GetDistance(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ) / ((float)step.script->MoveTo.TravelTime * 0.001f); float speed = unit->GetDistance(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ) / ((float)step.script->MoveTo.TravelTime * 0.001f);
unit->MonsterMoveWithSpeed(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, speed); unit->GetMotionMaster()->MovePoint(0, step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, FORCED_MOVEMENT_NONE, speed);
} }
else else
unit->NearTeleportTo(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, unit->GetOrientation()); unit->NearTeleportTo(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, unit->GetOrientation());
@@ -359,7 +359,7 @@ public:
case 0: case 0:
Talk(SAY_TEXT5); Talk(SAY_TEXT5);
HandleGameObject(DATA_ARENA4, false); HandleGameObject(DATA_ARENA4, false);
Start(false, false); Start(false);
eventTimer = 0; eventTimer = 0;
break; break;
case 1: case 1:
@@ -604,7 +604,7 @@ public:
creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false); creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false);
if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI())) if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI()))
escortAI->Start(false, false); escortAI->Start(false);
} }
} }
@@ -77,7 +77,9 @@ struct boss_quartermaster_zigris : public BossAI
{ {
if (me->IsWithinMeleeRange(me->GetVictim())) if (me->IsWithinMeleeRange(me->GetVictim()))
{ {
me->GetMotionMaster()->MoveBackwards(me->GetVictim(), 10.0f); float x, y, z;
me->GetNearPoint(me->GetVictim(), x, y, z, me->GetVictim()->GetBoundaryRadius(), 10.0f, me->GetAngle(me->GetVictim()));
me->GetMotionMaster()->MovePoint(0, x, y, z, FORCED_MOVEMENT_RUN); // TODO: Implement generic distancing on npc on target root
} }
} }
} }
@@ -430,7 +430,7 @@ public:
Talk(SAY_RAG_SUM_2); Talk(SAY_RAG_SUM_2);
// Next event will get triggered in MovementInform // Next event will get triggered in MovementInform
me->SetWalk(true); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(POINT_RAGNAROS_SUMMON, MajordomoMoveRagPos, true, false); me->GetMotionMaster()->MovePoint(POINT_RAGNAROS_SUMMON, MajordomoMoveRagPos, FORCED_MOVEMENT_NONE, 0.f, true, false);
break; break;
} }
case EVENT_RAGNAROS_SUMMON_2: case EVENT_RAGNAROS_SUMMON_2:
@@ -170,7 +170,7 @@ public:
if (m_uiEventId == EVENT_OZ) if (m_uiEventId == EVENT_OZ)
instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS); instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
Start(false, false); Start(false);
} }
void JustEngagedWith(Unit* /*who*/) override { } void JustEngagedWith(Unit* /*who*/) override { }
@@ -980,7 +980,7 @@ public:
{ {
carGUID = who->GetVehicleBase()->GetGUID(); carGUID = who->GetVehicleBase()->GetGUID();
InitWaypoint(); InitWaypoint();
Start(false, false, who->GetGUID()); Start(false, who->GetGUID());
SetDespawnAtFar(false); SetDespawnAtFar(false);
} }
@@ -660,14 +660,14 @@ public:
{ {
Position pos = LightOfDawnPos[first]; Position pos = LightOfDawnPos[first];
summon->SetHomePosition(pos); summon->SetHomePosition(pos);
summon->GetMotionMaster()->MovePoint(1, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, false); summon->GetMotionMaster()->MovePoint(1, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, true, false);
} }
first = first == 0 ? 1 : 0; first = first == 0 ? 1 : 0;
} }
Position pos = LightOfDawnPos[first]; Position pos = LightOfDawnPos[first];
me->SetHomePosition(pos); me->SetHomePosition(pos);
me->SetWalk(false); me->SetWalk(false);
me->GetMotionMaster()->MovePoint(1, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, true); me->GetMotionMaster()->MovePoint(1, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, true, true);
DoCastSelf(SPELL_THE_MIGHT_OF_MOGRAINE, true); DoCastSelf(SPELL_THE_MIGHT_OF_MOGRAINE, true);
break; break;
} }
@@ -691,7 +691,7 @@ public:
{ {
orbaz->SetReactState(REACT_PASSIVE); orbaz->SetReactState(REACT_PASSIVE);
orbaz->AI()->Talk(EMOTE_LIGHT_OF_DAWN04); orbaz->AI()->Talk(EMOTE_LIGHT_OF_DAWN04);
orbaz->GetMotionMaster()->MovePoint(2, LightOfDawnPos[2], true, true); orbaz->GetMotionMaster()->MovePoint(2, LightOfDawnPos[2], FORCED_MOVEMENT_NONE, 0.f, true, true);
orbaz->DespawnOrUnsummon(7s); orbaz->DespawnOrUnsummon(7s);
} }
@@ -1061,7 +1061,7 @@ public:
if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING)) if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING))
{ {
float o = me->GetAngle(tirion); float o = me->GetAngle(tirion);
tirion->GetMotionMaster()->MovePoint(4, me->GetPositionX() + 2.0f * cos(o), me->GetPositionY() + 2.0f * std::sin(o), me->GetPositionZ(), false); tirion->GetMotionMaster()->MovePoint(4, me->GetPositionX() + 2.0f * cos(o), me->GetPositionY() + 2.0f * std::sin(o), me->GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
tirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); tirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
tirion->SetFaction(FACTION_FRIENDLY); tirion->SetFaction(FACTION_FRIENDLY);
} }
@@ -304,7 +304,7 @@ struct npc_madrigosa : public NullCreatureAI
if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS)) if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS))
{ {
brutallus->SetDisableGravity(true); brutallus->SetDisableGravity(true);
brutallus->GetMotionMaster()->MovePoint(0, brutallus->GetPositionX(), brutallus->GetPositionY() - 30.0f, brutallus->GetPositionZ() + 15.0f, false, true); brutallus->GetMotionMaster()->MovePoint(0, brutallus->GetPositionX(), brutallus->GetPositionY() - 30.0f, brutallus->GetPositionZ() + 15.0f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false, true);
} }
events.ScheduleEvent(EVENT_MAD_15, 10s); events.ScheduleEvent(EVENT_MAD_15, 10s);
break; break;
@@ -205,7 +205,7 @@ struct boss_felmyst : public BossAI
// Summon Kalecgos (human form of kalecgos fight) // Summon Kalecgos (human form of kalecgos fight)
if (Creature* kalec = me->SummonCreature(NPC_KALECGOS_FELMYST, 1573.1461f, 755.20245f, 99.524956f, 3.595378f)) if (Creature* kalec = me->SummonCreature(NPC_KALECGOS_FELMYST, 1573.1461f, 755.20245f, 99.524956f, 3.595378f))
kalec->GetMotionMaster()->MovePoint(POINT_KALECGOS, 1474.2347f, 624.0703f, 29.32589f, false, true); kalec->GetMotionMaster()->MovePoint(POINT_KALECGOS, 1474.2347f, 624.0703f, 29.32589f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false, true);
} }
void ScheduleGroundAbilities() void ScheduleGroundAbilities()
@@ -312,9 +312,9 @@ struct boss_felmyst : public BossAI
++_strafeCount; ++_strafeCount;
_currentLane = urand(0, 2); _currentLane = urand(0, 2);
if (isRightSide) if (isRightSide)
me->GetMotionMaster()->MovePoint(POINT_LANE, RightSideLanes[_currentLane], false); me->GetMotionMaster()->MovePoint(POINT_LANE, RightSideLanes[_currentLane], FORCED_MOVEMENT_NONE, 0.f, false);
else else
me->GetMotionMaster()->MovePoint(POINT_LANE, LeftSideLanes[_currentLane], false); me->GetMotionMaster()->MovePoint(POINT_LANE, LeftSideLanes[_currentLane], FORCED_MOVEMENT_NONE, 0.f, false);
}, 5s); }, 5s);
break; break;
case POINT_LANE: case POINT_LANE:
@@ -328,9 +328,9 @@ struct boss_felmyst : public BossAI
DoCastSelf(SPELL_FELMYST_SPEED_BURST, true); DoCastSelf(SPELL_FELMYST_SPEED_BURST, true);
if (me->FindNearestCreature(NPC_WORLD_TRIGGER_RIGHT, 30.0f)) if (me->FindNearestCreature(NPC_WORLD_TRIGGER_RIGHT, 30.0f))
me->GetMotionMaster()->MovePoint(POINT_AIR_BREATH_END, LeftSideLanes[_currentLane], false); me->GetMotionMaster()->MovePoint(POINT_AIR_BREATH_END, LeftSideLanes[_currentLane], FORCED_MOVEMENT_NONE, 0.f, false);
else else
me->GetMotionMaster()->MovePoint(POINT_AIR_BREATH_END, RightSideLanes[_currentLane], false); me->GetMotionMaster()->MovePoint(POINT_AIR_BREATH_END, RightSideLanes[_currentLane], FORCED_MOVEMENT_NONE, 0.f, false);
}, 5s); }, 5s);
break; break;
case POINT_AIR_BREATH_END: case POINT_AIR_BREATH_END:
@@ -338,9 +338,9 @@ struct boss_felmyst : public BossAI
me->m_Events.AddEventAtOffset([&] { me->m_Events.AddEventAtOffset([&] {
if (me->FindNearestCreature(NPC_WORLD_TRIGGER_RIGHT, 30.0f)) if (me->FindNearestCreature(NPC_WORLD_TRIGGER_RIGHT, 30.0f))
me->GetMotionMaster()->MovePoint(POINT_AIR_UP, RightSide, false); me->GetMotionMaster()->MovePoint(POINT_AIR_UP, RightSide, FORCED_MOVEMENT_NONE, 0.f, false);
else else
me->GetMotionMaster()->MovePoint(POINT_AIR_UP, LeftSide, false); me->GetMotionMaster()->MovePoint(POINT_AIR_UP, LeftSide, FORCED_MOVEMENT_NONE, 0.f, false);
}, 2s); }, 2s);
break; break;
} }
@@ -729,25 +729,18 @@ struct npc_kalecgos_kj : public NullCreatureAI
if (summon->GetEntry() == NPC_SHATTERED_SUN_RIFTWAKER) if (summon->GetEntry() == NPC_SHATTERED_SUN_RIFTWAKER)
{ {
summon->CastSpell(summon, SPELL_TELEPORT_VISUAL, true); summon->CastSpell(summon, SPELL_TELEPORT_VISUAL, true);
Movement::MoveSplineInit init(summon);
if (summons.size() == 1) if (summons.size() == 1)
{ summon->GetMotionMaster()->MovePoint(0, 1727.08f, 656.82f, 28.37f, FORCED_MOVEMENT_NONE, 0.f, 5.14f, false, true);
init.MoveTo(1727.08f, 656.82f, 28.37f, false, true);
init.SetFacing(5.14f);
}
else else
{ summon->GetMotionMaster()->MovePoint(0, 1738.84f, 627.32f, 28.26f, FORCED_MOVEMENT_NONE, 0.f, 2.0f, false, true);
init.MoveTo(1738.84f, 627.32f, 28.26f, false, true);
init.SetFacing(2.0f);
}
init.Launch();
} }
else if (summon->GetEntry() == NPC_SHATTRATH_PORTAL_DUMMY) else if (summon->GetEntry() == NPC_SHATTRATH_PORTAL_DUMMY)
{ {
if (Creature* riftwaker = summon->FindNearestCreature(NPC_SHATTERED_SUN_RIFTWAKER, 10.0f)) if (Creature* riftwaker = summon->FindNearestCreature(NPC_SHATTERED_SUN_RIFTWAKER, 10.0f))
riftwaker->CastSpell(summon, SPELL_OPEN_PORTAL_FROM_SHATTRATH, false); riftwaker->CastSpell(summon, SPELL_OPEN_PORTAL_FROM_SHATTRATH, false);
summon->SetWalk(true); summon->SetWalk(true);
summon->GetMotionMaster()->MovePoint(0, summon->GetPositionX(), summon->GetPositionY(), summon->GetPositionZ() + 30.0f, false, true); summon->GetMotionMaster()->MovePoint(0, summon->GetPositionX(), summon->GetPositionY(), summon->GetPositionZ() + 30.0f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false, true);
} }
else if (summon->GetEntry() == NPC_INERT_PORTAL) else if (summon->GetEntry() == NPC_INERT_PORTAL)
summon->CastSpell(summon, SPELL_BOSS_ARCANE_PORTAL_STATE, true); summon->CastSpell(summon, SPELL_BOSS_ARCANE_PORTAL_STATE, true);
@@ -762,7 +755,7 @@ struct npc_kalecgos_kj : public NullCreatureAI
{ {
summon->CastSpell(summon, SPELL_TELEPORT_VISUAL, true); summon->CastSpell(summon, SPELL_TELEPORT_VISUAL, true);
summon->SetWalk(true); summon->SetWalk(true);
summon->GetMotionMaster()->MovePoint(0, 1710.15f, 639.23f, 27.311f, false, true); summon->GetMotionMaster()->MovePoint(0, 1710.15f, 639.23f, 27.311f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false, true);
} }
else if (summon->GetEntry() == NPC_THE_CORE_OF_ENTROPIUS) else if (summon->GetEntry() == NPC_THE_CORE_OF_ENTROPIUS)
summon->GetMotionMaster()->MovePoint(0, summon->GetPositionX(), summon->GetPositionY(), 30.0f); summon->GetMotionMaster()->MovePoint(0, summon->GetPositionX(), summon->GetPositionY(), 30.0f);
@@ -78,7 +78,7 @@ public:
break; break;
case 11: case 11:
Talk(SAY_PROGRESS_6, player); Talk(SAY_PROGRESS_6, player);
SetRun(); SetRun(true);
break; break;
case 19: case 19:
Talk(SAY_PROGRESS_7, player); Talk(SAY_PROGRESS_7, player);
@@ -106,7 +106,7 @@ public:
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{ {
Talk(SAY_PROGRESS_1, player); Talk(SAY_PROGRESS_1, player);
npc_escortAI::Start(false, false, player->GetGUID(), quest); npc_escortAI::Start(false, player->GetGUID(), quest);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
} }
} }
@@ -112,11 +112,11 @@ struct npc_cameron : public ScriptedAI
if (Creature* children = ObjectAccessor::GetCreature(*me, _childrenGUIDs[i])) if (Creature* children = ObjectAccessor::GetCreature(*me, _childrenGUIDs[i]))
{ {
children->SetWalk(true); children->SetWalk(true);
children->GetMotionMaster()->MovePoint(0, MovePosPositions[i], true, MovePosPositions[i].GetOrientation()); children->GetMotionMaster()->MovePoint(0, MovePosPositions[i]);
} }
} }
me->SetWalk(true); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(0, MovePosPositions.back(), true, MovePosPositions.back().GetOrientation()); me->GetMotionMaster()->MovePoint(0, MovePosPositions.back());
} }
void PathEndReached(uint32 pathId) override void PathEndReached(uint32 pathId) override
@@ -113,7 +113,7 @@ struct npc_ranger_lilatha : public npc_escortAI
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{ {
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, false, player->GetGUID()); npc_escortAI::Start(true, player->GetGUID());
} }
} }
}; };
@@ -132,7 +132,7 @@ public:
if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
go->UseDoorOrButton(); go->UseDoorOrButton();
npc_escortAI::Start(false, false, player->GetGUID(), quest); npc_escortAI::Start(false, player->GetGUID(), quest);
} }
} }
@@ -156,7 +156,7 @@ public:
case 17: case 17:
Talk(SAY_RIN_COMPLETE, player); Talk(SAY_RIN_COMPLETE, player);
player->GroupEventHappens(QUEST_RINJI_TRAPPED, me); player->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
SetRun(); SetRun(true);
postEventCount = 1; postEventCount = 1;
break; break;
} }
@@ -61,7 +61,7 @@ public:
if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION) if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION)
{ {
Talk(SAY_CORPORAL_1, player); Talk(SAY_CORPORAL_1, player);
npc_escortAI::Start(true, false, player->GetGUID(), quest); npc_escortAI::Start(true, player->GetGUID(), quest);
me->SetImmuneToNPC(false); me->SetImmuneToNPC(false);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
} }
@@ -111,7 +111,7 @@ public:
creature->AI()->Talk(SAY_QUESTACCEPT, player); creature->AI()->Talk(SAY_QUESTACCEPT, player);
if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
} }
return true; return true;
@@ -406,7 +406,7 @@ public:
{ {
if (Player* player = GetPlayerForEscort()) if (Player* player = GetPlayerForEscort())
{ {
CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, false, player->GetGUID()); CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, player->GetGUID());
CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f); CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f);
} }
} }
@@ -448,7 +448,7 @@ public:
{ {
if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true)) if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true))
{ {
CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, false, player->GetGUID()); CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, player->GetGUID());
CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f); CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f);
} }
return true; return true;
@@ -142,7 +142,7 @@ public:
{ {
summoned->SetDisableGravity(true); summoned->SetDisableGravity(true);
float speed = summoned->GetDistance(summoned->GetPositionX(), summoned->GetPositionY(), me->GetPositionZ() + 15.0f) / (1000.0f * 0.001f); float speed = summoned->GetDistance(summoned->GetPositionX(), summoned->GetPositionY(), me->GetPositionZ() + 15.0f) / (1000.0f * 0.001f);
summoned->MonsterMoveWithSpeed(summoned->GetPositionX(), summoned->GetPositionY(), me->GetPositionZ() + 15.0f, speed); summoned->GetMotionMaster()->MovePoint(0, summoned->GetPositionX(), summoned->GetPositionY(), me->GetPositionZ() + 15.0f, FORCED_MOVEMENT_NONE, speed);
summoned->CastSpell(summoned, SPELL_RIBBON_OF_SOULS, false); summoned->CastSpell(summoned, SPELL_RIBBON_OF_SOULS, false);
} }
} }
@@ -270,8 +270,7 @@ public:
if (EventMoveTimer <= diff) if (EventMoveTimer <= diff)
{ {
me->SetDisableGravity(true); me->SetDisableGravity(true);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f)); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, FORCED_MOVEMENT_NONE, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f));
me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation());
EventMove = false; EventMove = false;
} }
else EventMoveTimer -= diff; else EventMoveTimer -= diff;
@@ -917,7 +916,8 @@ public:
if (auto ai = CAST_AI(npc_varian_wrynn::npc_varian_wrynnAI, creature->AI())) if (auto ai = CAST_AI(npc_varian_wrynn::npc_varian_wrynnAI, creature->AI()))
{ {
ai->Start(true, true, player->GetGUID()); creature->SetWalk(false);
ai->Start(true, player->GetGUID());
if (Creature* jaina = GetClosestCreatureWithEntry(creature, NPC_JAINA, 50.0f)) if (Creature* jaina = GetClosestCreatureWithEntry(creature, NPC_JAINA, 50.0f))
ai->jainaGUID = jaina->GetGUID(); ai->jainaGUID = jaina->GetGUID();
else else
@@ -1218,27 +1218,27 @@ public:
{ {
case 0: case 0:
if (Unit* temp = me->SummonCreature(NPC_DOCTOR, AllianceSpawn[4].x - rand32() % 5, AllianceSpawn[4].y - rand32() % 5, AllianceSpawn[4].z, TEMPSUMMON_DEAD_DESPAWN)) if (Unit* temp = me->SummonCreature(NPC_DOCTOR, AllianceSpawn[4].x - rand32() % 5, AllianceSpawn[4].y - rand32() % 5, AllianceSpawn[4].z, TEMPSUMMON_DEAD_DESPAWN))
temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), false); temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
case 1: case 1:
if (Unit* temp = me->SummonCreature(NPC_CHEMIST, AllianceSpawn[4].x - rand32() % 5, AllianceSpawn[4].y - rand32() % 5, AllianceSpawn[4].z, TEMPSUMMON_DEAD_DESPAWN)) if (Unit* temp = me->SummonCreature(NPC_CHEMIST, AllianceSpawn[4].x - rand32() % 5, AllianceSpawn[4].y - rand32() % 5, AllianceSpawn[4].z, TEMPSUMMON_DEAD_DESPAWN))
temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), false); temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
case 2: case 2:
if (Unit* temp = me->SummonCreature(NPC_BETRAYER, AllianceSpawn[4].x - rand32() % 5, AllianceSpawn[4].y - rand32() % 5, AllianceSpawn[4].z, TEMPSUMMON_DEAD_DESPAWN)) if (Unit* temp = me->SummonCreature(NPC_BETRAYER, AllianceSpawn[4].x - rand32() % 5, AllianceSpawn[4].y - rand32() % 5, AllianceSpawn[4].z, TEMPSUMMON_DEAD_DESPAWN))
temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), false); temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
case 3: case 3:
if (Unit* temp = me->SummonCreature(NPC_DOCTOR, AllianceSpawn[5].x - rand32() % 5, AllianceSpawn[5].y - rand32() % 5, AllianceSpawn[5].z, TEMPSUMMON_DEAD_DESPAWN)) if (Unit* temp = me->SummonCreature(NPC_DOCTOR, AllianceSpawn[5].x - rand32() % 5, AllianceSpawn[5].y - rand32() % 5, AllianceSpawn[5].z, TEMPSUMMON_DEAD_DESPAWN))
temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), false); temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
case 4: case 4:
if (Unit* temp = me->SummonCreature(NPC_CHEMIST, AllianceSpawn[5].x - rand32() % 5, AllianceSpawn[5].y - rand32() % 5, AllianceSpawn[5].z, TEMPSUMMON_DEAD_DESPAWN)) if (Unit* temp = me->SummonCreature(NPC_CHEMIST, AllianceSpawn[5].x - rand32() % 5, AllianceSpawn[5].y - rand32() % 5, AllianceSpawn[5].z, TEMPSUMMON_DEAD_DESPAWN))
temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), false); temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
case 5: case 5:
if (Unit* temp = me->SummonCreature(NPC_BETRAYER, AllianceSpawn[5].x - rand32() % 5, AllianceSpawn[5].y - rand32() % 5, AllianceSpawn[5].z, TEMPSUMMON_DEAD_DESPAWN)) if (Unit* temp = me->SummonCreature(NPC_BETRAYER, AllianceSpawn[5].x - rand32() % 5, AllianceSpawn[5].y - rand32() % 5, AllianceSpawn[5].z, TEMPSUMMON_DEAD_DESPAWN))
temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), false); temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
} }
} }
@@ -1246,7 +1246,7 @@ public:
case 5: case 5:
for (uint8 i = 0; i < WAVE_MAXCOUNT; ++i) for (uint8 i = 0; i < WAVE_MAXCOUNT; ++i)
if (Unit* temp = me->SummonCreature(NPC_GUARDIAN, AllianceSpawn[6].x - rand32() % 5, AllianceSpawn[6].y - rand32() % 5, AllianceSpawn[6].z, TEMPSUMMON_DEAD_DESPAWN)) if (Unit* temp = me->SummonCreature(NPC_GUARDIAN, AllianceSpawn[6].x - rand32() % 5, AllianceSpawn[6].y - rand32() % 5, AllianceSpawn[6].z, TEMPSUMMON_DEAD_DESPAWN))
temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), false); temp->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
case 6: case 6:
if (Unit* temp = me->SummonCreature(NPC_BLIGHTWORM, AllianceSpawn[7].x, AllianceSpawn[7].y, AllianceSpawn[7].z, TEMPSUMMON_MANUAL_DESPAWN)) if (Unit* temp = me->SummonCreature(NPC_BLIGHTWORM, AllianceSpawn[7].x, AllianceSpawn[7].y, AllianceSpawn[7].z, TEMPSUMMON_MANUAL_DESPAWN))
@@ -1614,7 +1614,7 @@ public:
break; break;
case 22: case 22:
Talk(WRYNN_SAY_SEWERS_4); Talk(WRYNN_SAY_SEWERS_4);
SetRun(false); me->SetWalk(true);
if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
{ {
jaina->GetMotionMaster()->Clear(); jaina->GetMotionMaster()->Clear();
@@ -1665,7 +1665,7 @@ public:
JumpToNextStep(3 * IN_MILLISECONDS); JumpToNextStep(3 * IN_MILLISECONDS);
break; break;
case 31: case 31:
SetRun(true); me->SetWalk(false);
if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
jaina->GetMotionMaster()->MoveFollow(me, 1, 0); jaina->GetMotionMaster()->MoveFollow(me, 1, 0);
SetEscortPaused(false); SetEscortPaused(false);
@@ -1727,7 +1727,7 @@ public:
if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
{ {
jaina->GetMotionMaster()->Clear(); jaina->GetMotionMaster()->Clear();
jaina->GetMotionMaster()->MovePoint(0, AllianceWP[7].x, AllianceWP[7].y, AllianceWP[7].z, false); jaina->GetMotionMaster()->MovePoint(0, AllianceWP[7].x, AllianceWP[7].y, AllianceWP[7].z, FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
} }
JumpToNextStep(5 * IN_MILLISECONDS); JumpToNextStep(5 * IN_MILLISECONDS);
break; break;
@@ -1789,7 +1789,7 @@ public:
break; break;
case 54: case 54:
Talk(WRYNN_SAY_APO_7); Talk(WRYNN_SAY_APO_7);
SetRun(false); me->SetWalk(true);
JumpToNextStep(4 * IN_MILLISECONDS); JumpToNextStep(4 * IN_MILLISECONDS);
break; break;
case 55: case 55:
@@ -1845,7 +1845,7 @@ public:
JumpToNextStep(1.5 * IN_MILLISECONDS); JumpToNextStep(1.5 * IN_MILLISECONDS);
break; break;
case 65: case 65:
SetRun(true); me->SetWalk(false);
SetEscortPaused(false); SetEscortPaused(false);
JumpToNextStep(0.25 * IN_MILLISECONDS); JumpToNextStep(0.25 * IN_MILLISECONDS);
break; break;
@@ -2236,7 +2236,8 @@ public:
if (Creature* sylvannas = GetClosestCreatureWithEntry(creature, NPC_SYLVANAS, 50.0f)) if (Creature* sylvannas = GetClosestCreatureWithEntry(creature, NPC_SYLVANAS, 50.0f))
{ {
thrall_ai->sylvanasfollowGUID = sylvannas->GetGUID(); thrall_ai->sylvanasfollowGUID = sylvannas->GetGUID();
thrall_ai->Start(true, true, player->GetGUID()); creature->SetWalk(false);
thrall_ai->Start(true, player->GetGUID());
thrall_ai->SetDespawnAtEnd(false); thrall_ai->SetDespawnAtEnd(false);
thrall_ai->SetDespawnAtFar(false); thrall_ai->SetDespawnAtFar(false);
} }
@@ -2477,7 +2478,7 @@ public:
for (std::list<Creature*>::iterator itr = ThroneList.begin(); itr != ThroneList.end(); itr++) for (std::list<Creature*>::iterator itr = ThroneList.begin(); itr != ThroneList.end(); itr++)
(*itr)->DespawnOrUnsummon(); (*itr)->DespawnOrUnsummon();
SetEscortPaused(false); SetEscortPaused(false);
SetRun(false); me->SetWalk(true);
break; break;
} }
default: default:
@@ -2972,7 +2973,7 @@ public:
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
JumpToNextStep(0); JumpToNextStep(0);
SetRun(true); me->SetWalk(false);
if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID)) if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID))
{ {
sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 100, false); sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 100, false);
@@ -3005,7 +3006,7 @@ public:
for (std::list<Creature*>::iterator itr = PlagueList.begin(); itr != PlagueList.end(); itr++) for (std::list<Creature*>::iterator itr = PlagueList.begin(); itr != PlagueList.end(); itr++)
(*itr)->DespawnOrUnsummon(); (*itr)->DespawnOrUnsummon();
SetEscortPaused(false); SetEscortPaused(false);
SetRun(false); me->SetWalk(true);
if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID)) if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID))
sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 1000, false); sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 1000, false);
JumpToNextStep(3 * IN_MILLISECONDS); JumpToNextStep(3 * IN_MILLISECONDS);
@@ -3077,7 +3078,7 @@ public:
FollowThrall(); FollowThrall();
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(true); me->SetWalk(false);
Talk(THRALL_SAY_COURTYARD_4); Talk(THRALL_SAY_COURTYARD_4);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H, 0); UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 1); UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 1);
@@ -3182,7 +3183,7 @@ public:
SpawnWave(6); SpawnWave(6);
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(false); me->SetWalk(true);
JumpToNextStep(0 * IN_MILLISECONDS); JumpToNextStep(0 * IN_MILLISECONDS);
break; break;
} }
@@ -3226,7 +3227,7 @@ public:
FollowThrall(); FollowThrall();
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(false); me->SetWalk(true);
JumpToNextStep(0 * IN_MILLISECONDS); JumpToNextStep(0 * IN_MILLISECONDS);
break; break;
// Top of Undercity Discussion // Top of Undercity Discussion
@@ -3266,7 +3267,7 @@ public:
FollowThrall(); FollowThrall();
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(false); me->SetWalk(true);
JumpToNextStep(0 * IN_MILLISECONDS); JumpToNextStep(0 * IN_MILLISECONDS);
break; break;
case 63: case 63:
@@ -3284,7 +3285,7 @@ public:
FollowThrall(); FollowThrall();
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(false); me->SetWalk(true);
JumpToNextStep(0 * IN_MILLISECONDS); JumpToNextStep(0 * IN_MILLISECONDS);
break; break;
case 67: case 67:
@@ -3299,7 +3300,7 @@ public:
FollowThrall(); FollowThrall();
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(false); me->SetWalk(true);
JumpToNextStep(0 * IN_MILLISECONDS); JumpToNextStep(0 * IN_MILLISECONDS);
break; break;
// KHANOK - Valimathtas Intro // KHANOK - Valimathtas Intro
@@ -3475,7 +3476,7 @@ public:
FollowThrall(); FollowThrall();
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(false); me->SetWalk(true);
JumpToNextStep(0 * IN_MILLISECONDS); JumpToNextStep(0 * IN_MILLISECONDS);
break; break;
case 109: case 109:
@@ -3491,7 +3492,7 @@ public:
FollowThrall(); FollowThrall();
SetEscortPaused(false); SetEscortPaused(false);
bStepping = false; bStepping = false;
SetRun(true); me->SetWalk(false);
JumpToNextStep(0 * IN_MILLISECONDS); JumpToNextStep(0 * IN_MILLISECONDS);
break; break;
case 112: case 112:
@@ -3662,7 +3663,7 @@ public:
case 143: case 143:
if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID)) if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID))
{ {
sylvanas->GetMotionMaster()->MovePoint(0, 1289.48f, 314.33f, -57.32f, true); sylvanas->GetMotionMaster()->MovePoint(0, 1289.48f, 314.33f, -57.32f);
sylvanas->CastSpell(sylvanas, SPELL_LEAP_TO_PLATFORM); sylvanas->CastSpell(sylvanas, SPELL_LEAP_TO_PLATFORM);
} }
JumpToNextStep(10 * IN_MILLISECONDS); JumpToNextStep(10 * IN_MILLISECONDS);
@@ -3706,7 +3707,7 @@ public:
wrynn->SetImmuneToAll(true); wrynn->SetImmuneToAll(true);
wrynn->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); wrynn->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
wrynn->SetReactState(REACT_PASSIVE); wrynn->SetReactState(REACT_PASSIVE);
wrynn->GetMotionMaster()->MovePoint(0, 1302.543f, 359.472f, -67.295f, true); wrynn->GetMotionMaster()->MovePoint(0, 1302.543f, 359.472f, -67.295f);
} }
if (Creature* jaina = me->SummonCreature(NPC_JAINA, 1308.862f, 381.809f, -66.044243f, TEMPSUMMON_MANUAL_DESPAWN)) if (Creature* jaina = me->SummonCreature(NPC_JAINA, 1308.862f, 381.809f, -66.044243f, TEMPSUMMON_MANUAL_DESPAWN))
{ {
@@ -3807,7 +3808,7 @@ public:
{ {
SaurfangGUID = saurfang->GetGUID(); SaurfangGUID = saurfang->GetGUID();
saurfang->SetWalk(true); saurfang->SetWalk(true);
saurfang->GetMotionMaster()->MovePoint(0, 1300.862f, 353.670f, -66.187f, true); saurfang->GetMotionMaster()->MovePoint(0, 1300.862f, 353.670f, -66.187f);
} }
JumpToNextStep(7 * IN_MILLISECONDS); JumpToNextStep(7 * IN_MILLISECONDS);
break; break;
@@ -56,9 +56,9 @@ public:
if (quest->GetQuestId() == QUEST_TOME_VALOR) if (quest->GetQuestId() == QUEST_TOME_VALOR)
{ {
creature->AI()->Talk(SAY_DS_START); creature->AI()->Talk(SAY_DS_START);
creature->SetWalk(false);
if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI()))
pEscortAI->Start(true, true, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
} }
return true; return true;
@@ -62,7 +62,7 @@ public:
case 2: case 2:
if (me->HasStealthAura()) if (me->HasStealthAura())
me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
SetRun(); me->SetWalk(false);
me->SetFaction(FACTION_ENEMY); me->SetFaction(FACTION_ENEMY);
break; break;
} }
@@ -109,7 +109,7 @@ public:
me->GetThreatMgr().ClearAllThreat(); me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true); me->CombatStop(true);
SetRun(false); me->SetWalk(true);
} }
} }
} }
@@ -138,7 +138,7 @@ public:
pSlim->CastSpell(pSlim, SPELL_STEALTH, true); pSlim->CastSpell(pSlim, SPELL_STEALTH, true);
if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI())) if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest); pEscortAI->Start(false, player->GetGUID(), quest);
} }
return false; return false;
} }
@@ -678,19 +678,19 @@ public:
me->SummonCreature(NPC_JAINA, EventPos[EVENT_SRC_JAINA], TEMPSUMMON_DEAD_DESPAWN, 180000); me->SummonCreature(NPC_JAINA, EventPos[EVENT_SRC_JAINA], TEMPSUMMON_DEAD_DESPAWN, 180000);
if (Creature* uther = me->SummonCreature(NPC_UTHER, EventPos[EVENT_SRC_UTHER], TEMPSUMMON_DEAD_DESPAWN, 180000)) if (Creature* uther = me->SummonCreature(NPC_UTHER, EventPos[EVENT_SRC_UTHER], TEMPSUMMON_DEAD_DESPAWN, 180000))
{ {
uther->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_UTHER], false); uther->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_UTHER], FORCED_MOVEMENT_NONE, 0.f, false);
uther->SetTarget(me->GetGUID()); uther->SetTarget(me->GetGUID());
me->SetTarget(uther->GetGUID()); me->SetTarget(uther->GetGUID());
} }
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
if (Creature* horse = me->SummonCreature(NPC_HORSE_ESCORT, EventPos[EVENT_SRC_HORSE1 + i], TEMPSUMMON_DEAD_DESPAWN, 180000)) if (Creature* horse = me->SummonCreature(NPC_HORSE_ESCORT, EventPos[EVENT_SRC_HORSE1 + i], TEMPSUMMON_DEAD_DESPAWN, 180000))
horse->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_HORSE1 + i], false); horse->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_HORSE1 + i], FORCED_MOVEMENT_NONE, 0.f, false);
ScheduleNextEvent(currentEvent, 4s); ScheduleNextEvent(currentEvent, 4s);
break; break;
case EVENT_ACTION_PHASE1+1: case EVENT_ACTION_PHASE1+1:
// Start Event // Start Event
Start(true, false); Start(true);
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
SetDespawnAtFar(false); SetDespawnAtFar(false);
@@ -782,7 +782,7 @@ public:
{ {
Creature* summon = ObjectAccessor::GetCreature(*me, *i); Creature* summon = ObjectAccessor::GetCreature(*me, *i);
if (summon && summon->GetEntry() == NPC_HORSE_ESCORT) if (summon && summon->GetEntry() == NPC_HORSE_ESCORT)
summon->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], false); summon->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], FORCED_MOVEMENT_NONE, 0.f, false);
} }
ScheduleNextEvent(currentEvent, 1s); ScheduleNextEvent(currentEvent, 1s);
@@ -792,7 +792,7 @@ public:
{ {
uther->SetTarget(); uther->SetTarget();
uther->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); uther->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
uther->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], false); uther->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], FORCED_MOVEMENT_NONE, 0.f, false);
} }
ScheduleNextEvent(currentEvent, 1s); ScheduleNextEvent(currentEvent, 1s);
break; break;
@@ -801,7 +801,7 @@ public:
{ {
jaina->SetTarget(); jaina->SetTarget();
jaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); jaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
jaina->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], false); jaina->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], FORCED_MOVEMENT_NONE, 0.f, false);
} }
Talk(SAY_PHASE116); Talk(SAY_PHASE116);
ScheduleNextEvent(currentEvent, 2s); ScheduleNextEvent(currentEvent, 2s);
@@ -819,7 +819,7 @@ public:
if (Creature* jaina = GetEventNpc(NPC_JAINA)) if (Creature* jaina = GetEventNpc(NPC_JAINA))
{ {
jaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); jaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
jaina->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], false); jaina->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], FORCED_MOVEMENT_NONE, 0.f, false);
} }
summons.DespawnEntry(NPC_HORSE_ESCORT); summons.DespawnEntry(NPC_HORSE_ESCORT);
ScheduleNextEvent(currentEvent, 4s); ScheduleNextEvent(currentEvent, 4s);
@@ -1242,7 +1242,8 @@ void npc_arthas::npc_arthasAI::JustEngagedWith(Unit* /*who*/)
void npc_arthas::npc_arthasAI::ReorderInstance(uint32 data) void npc_arthas::npc_arthasAI::ReorderInstance(uint32 data)
{ {
Start(true, true); me->SetWalk(false);
Start(true);
SetEscortPaused(true); SetEscortPaused(true);
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
@@ -566,7 +566,8 @@ public:
me->SummonCreature(NPC_DURNHOLDE_MAGE, 2108.4856f, 189.93457f, 66.30494f, 2.6878f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS); me->SummonCreature(NPC_DURNHOLDE_MAGE, 2108.4856f, 189.93457f, 66.30494f, 2.6878f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS);
break; break;
case EVENT_START_WP: case EVENT_START_WP:
Start(true, true); me->SetWalk(false);
Start(true);
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
break; break;
case EVENT_SET_FACING: case EVENT_SET_FACING:
@@ -809,7 +810,7 @@ public:
if (Creature* epoch = summons.GetCreatureWithEntry(NPC_EPOCH_HUNTER)) if (Creature* epoch = summons.GetCreatureWithEntry(NPC_EPOCH_HUNTER))
{ {
epoch->SetImmuneToAll(false); epoch->SetImmuneToAll(false);
epoch->GetMotionMaster()->MovePoint(0, *me, false, true); epoch->GetMotionMaster()->MovePoint(0, *me, FORCED_MOVEMENT_NONE, 0.f, false, true);
} }
break; break;
case EVENT_THRALL_FACE_TARETHA: case EVENT_THRALL_FACE_TARETHA:
@@ -922,7 +923,8 @@ public:
void ReorderInstance(uint32 data) void ReorderInstance(uint32 data)
{ {
Start(true, true); me->SetWalk(false);
Start(true);
SetEscortPaused(true); SetEscortPaused(true);
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
@@ -1008,7 +1010,8 @@ public:
{ {
me->SetStandState(UNIT_STAND_STATE_STAND); me->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveAllAuras(); me->RemoveAllAuras();
Start(false, true); me->SetWalk(false);
Start(false);
} }
void WaypointReached(uint32 waypointId) override void WaypointReached(uint32 waypointId) override
@@ -118,7 +118,7 @@ struct npc_medivh_bm : public ScriptedAI
summon->CastSpell(summon, SPELL_BLACK_CRYSTAL, true); summon->CastSpell(summon, SPELL_BLACK_CRYSTAL, true);
Movement::MoveSplineInit init(summon); Movement::MoveSplineInit init(summon);
init.MovebyPath(_groundArray); init.MovebyPath(_groundArray);
init.SetCyclic(); init.SetCyclic(); // TODO: Add support for cyclic paths in motion master
init.Launch(); init.Launch();
} }
} }
@@ -209,7 +209,8 @@ struct npc_general_andorov : public npc_escortAI
_initialAttackTimer = 5 * IN_MILLISECONDS; _initialAttackTimer = 5 * IN_MILLISECONDS;
_paused = false; _paused = false;
Start(false, true); me->SetWalk(false);
Start(false);
me->SetImmuneToNPC(true); me->SetImmuneToNPC(true);
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
@@ -121,7 +121,7 @@ public:
{ {
Talk(SAY_MUG_START1); Talk(SAY_MUG_START1);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, false, player->GetGUID()); npc_escortAI::Start(true, player->GetGUID());
} }
} }
@@ -289,7 +289,7 @@ public:
case EVENT_START_ESCORT: case EVENT_START_ESCORT:
if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
{ {
npc_escortAI::Start(true, false, player->GetGUID()); npc_escortAI::Start(true, player->GetGUID());
} }
_events.ScheduleEvent(EVENT_STAND, 2s); _events.ScheduleEvent(EVENT_STAND, 2s);
break; break;
@@ -397,7 +397,7 @@ public:
if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2)
{ {
if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID()); pEscortAI->Start(false, player->GetGUID());
creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE);
} }
@@ -396,7 +396,8 @@ public:
case EVENT_RESTART_ESCORT: case EVENT_RESTART_ESCORT:
CheckCaravan(); CheckCaravan();
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
Start(true, true, ObjectGuid::Empty, 0, false, false, true); SetRun(true);
Start(true, ObjectGuid::Empty, 0, false, false, true);
break; break;
} }
@@ -384,7 +384,7 @@ public:
AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]); AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]);
} }
PlayerGUID = player->GetGUID(); PlayerGUID = player->GetGUID();
Start(true, false, PlayerGUID); Start(true, PlayerGUID);
} }
return; return;
} }
@@ -137,7 +137,7 @@ public:
if (quest->GetQuestId() == QUEST_PROTECT_KAYA) if (quest->GetQuestId() == QUEST_PROTECT_KAYA)
{ {
if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
creature->AI()->Talk(SAY_START); creature->AI()->Talk(SAY_START);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
+1 -1
View File
@@ -260,7 +260,7 @@ public:
float Radius = 10.0f; float Radius = 10.0f;
if (me->IsWithinDistInMap(who, Radius)) if (me->IsWithinDistInMap(who, Radius))
{ {
Start(false, false, who->GetGUID()); Start(false, who->GetGUID());
} }
} }
} }
@@ -55,7 +55,7 @@ public:
creature->AI()->Talk(SAY_GIL_START, player); creature->AI()->Talk(SAY_GIL_START, player);
if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI())) if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest); pEscortAI->Start(false, player->GetGUID(), quest);
} }
return true; return true;
} }
@@ -528,7 +528,7 @@ public:
break; break;
case 18: case 18:
Talk(SAY_PROGRESS_1, player); Talk(SAY_PROGRESS_1, player);
SetRun(); SetRun(true);
break; break;
} }
} }
@@ -594,7 +594,7 @@ public:
creature->SetFaction(FACTION_RATCHET); creature->SetFaction(FACTION_RATCHET);
creature->AI()->Talk(SAY_START); creature->AI()->Talk(SAY_START);
if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
} }
return true; return true;
} }
@@ -66,7 +66,7 @@ public:
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed
if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI())) if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest); pEscortAI->Start(false, player->GetGUID(), quest);
} }
return true; return true;
} }
@@ -148,7 +148,7 @@ public:
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); // guessed creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); // guessed
if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI())) if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest); pEscortAI->Start(false, player->GetGUID(), quest);
} }
return true; return true;
} }
@@ -48,7 +48,7 @@ public:
{ {
if (quest->GetQuestId() == QUEST_CHASING_AME) if (quest->GetQuestId() == QUEST_CHASING_AME)
{ {
CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(false, player->GetGUID());
creature->AI()->Talk(SAY_READY, player); creature->AI()->Talk(SAY_READY, player);
creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
// Change faction so mobs attack // Change faction so mobs attack
@@ -286,7 +286,7 @@ public:
creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI())) if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI()))
escortAI->Start(false, false, player->GetGUID(), quest); escortAI->Start(false, player->GetGUID(), quest);
return true; return true;
} }
@@ -258,7 +258,7 @@ public:
{ {
if (summon->GetEntry() != me->GetEntry()) if (summon->GetEntry() != me->GetEntry())
{ {
summon->GetMotionMaster()->MovePoint(0, *me, false); summon->GetMotionMaster()->MovePoint(0, *me, FORCED_MOVEMENT_NONE, 0.f, false);
summon->GetMotionMaster()->MoveFollow(me, 0.1f, 0.0f + M_PI * 0.3f * summons.size()); summon->GetMotionMaster()->MoveFollow(me, 0.1f, 0.0f + M_PI * 0.3f * summons.size());
} }
summons.Summon(summon); summons.Summon(summon);
@@ -173,7 +173,7 @@ struct boss_jedoga_shadowseeker : public BossAI
me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD);
me->SetDisableGravity(true); me->SetDisableGravity(true);
me->SetHover(true); me->SetHover(true);
me->GetMotionMaster()->MovePoint(POINT_INITIAL, JedogaPosition[0], false); me->GetMotionMaster()->MovePoint(POINT_INITIAL, JedogaPosition[0], FORCED_MOVEMENT_NONE, 0.f, false);
_Reset(); _Reset();
events.SetPhase(PHASE_NORMAL); events.SetPhase(PHASE_NORMAL);
@@ -247,7 +247,7 @@ struct boss_jedoga_shadowseeker : public BossAI
DespawnOOCSummons(); DespawnOOCSummons();
DoCastSelf(SPELL_HOVER_FALL); DoCastSelf(SPELL_HOVER_FALL);
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->GetMotionMaster()->MovePoint(POINT_DOWN, JedogaPosition[1], false); me->GetMotionMaster()->MovePoint(POINT_DOWN, JedogaPosition[1], FORCED_MOVEMENT_NONE, 0.f, false);
if (!combatSummonsSummoned) if (!combatSummonsSummoned)
{ {
@@ -397,7 +397,7 @@ struct boss_jedoga_shadowseeker : public BossAI
volunteerWork = false; volunteerWork = false;
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
DoCastSelf(SPELL_HOVER_FALL); DoCastSelf(SPELL_HOVER_FALL);
me->GetMotionMaster()->MovePoint(POINT_DOWN, JedogaPosition[1], false); me->GetMotionMaster()->MovePoint(POINT_DOWN, JedogaPosition[1], FORCED_MOVEMENT_NONE, 0.f, false);
} }
} }
break; break;
@@ -504,7 +504,7 @@ struct boss_jedoga_shadowseeker : public BossAI
summons.DespawnEntry(NPC_JEDOGA_CONTROLLER); summons.DespawnEntry(NPC_JEDOGA_CONTROLLER);
DoCastSelf(SPELL_HOVER_FALL); DoCastSelf(SPELL_HOVER_FALL);
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(POINT_DOWN, JedogaPosition[1], false); me->GetMotionMaster()->MovePoint(POINT_DOWN, JedogaPosition[1], FORCED_MOVEMENT_NONE, 0.f, false);
break; break;
} }
case EVENT_JEDGA_START_RITUAL: case EVENT_JEDGA_START_RITUAL:
@@ -663,7 +663,7 @@ struct npc_twilight_volunteer : public ScriptedAI
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
me->SetHomePosition(JedogaPosition[2]); me->SetHomePosition(JedogaPosition[2]);
me->SetWalk(true); me->SetWalk(true);
me->GetMotionMaster()->MovePoint(POINT_RITUAL, JedogaPosition[2], false); me->GetMotionMaster()->MovePoint(POINT_RITUAL, JedogaPosition[2], FORCED_MOVEMENT_NONE, 0.f, false);
if (Creature* jedoga = pInstance->GetCreature(DATA_JEDOGA_SHADOWSEEKER)) if (Creature* jedoga = pInstance->GetCreature(DATA_JEDOGA_SHADOWSEEKER))
{ {
@@ -210,7 +210,8 @@ public:
{ {
_lavaGoutCount = 0; _lavaGoutCount = 0;
AddWaypoints(); AddWaypoints();
Start(true, true); me->SetWalk(false);
Start(true);
} }
void JustEngagedWith(Unit* /*who*/) override void JustEngagedWith(Unit* /*who*/) override
@@ -144,7 +144,7 @@ public:
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->AttackStop(); me->AttackStop();
me->SetDisableGravity(true); me->SetDisableGravity(true);
me->GetMotionMaster()->MovePoint(POINT_TAKEOFF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 6.0f, false); me->GetMotionMaster()->MovePoint(POINT_TAKEOFF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 6.0f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
events.ScheduleEvent(EVENT_FLIGHT, 50s); events.ScheduleEvent(EVENT_FLIGHT, 50s);
events.DelayEvents(15s); events.DelayEvents(15s);
events.ScheduleEvent(EVENT_AIR_MOVEMENT, 2s); events.ScheduleEvent(EVENT_AIR_MOVEMENT, 2s);
@@ -163,10 +163,10 @@ public:
events.ScheduleEvent(EVENT_FLAME_BREATH, 20s, 30s); events.ScheduleEvent(EVENT_FLAME_BREATH, 20s, 30s);
break; break;
case EVENT_AIR_MOVEMENT: case EVENT_AIR_MOVEMENT:
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, 3155.51f, 683.844f, 95.0f, false); me->GetMotionMaster()->MovePoint(POINT_FLIGHT, 3155.51f, 683.844f, 95.0f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
case EVENT_LAND_BACK: case EVENT_LAND_BACK:
me->GetMotionMaster()->MovePoint(POINT_LAND, 3151.07f, 636.443f, 80.0f, false); me->GetMotionMaster()->MovePoint(POINT_LAND, 3151.07f, 636.443f, 80.0f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
break; break;
case EVENT_LAND_GROUND: case EVENT_LAND_GROUND:
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
@@ -607,7 +607,8 @@ public:
break; break;
} }
Start(false, true); me->SetWalk(false);
Start(false);
uiWaypoint = uiType; uiWaypoint = uiType;
} }
@@ -339,7 +339,8 @@ public:
void Reset() override void Reset() override
{ {
Start(false, true, ObjectGuid::Empty, nullptr); me->SetWalk(false);
Start(false, ObjectGuid::Empty, nullptr);
SetDespawnAtEnd(true); SetDespawnAtEnd(true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true); me->SetImmuneToAll(true);
@@ -549,7 +549,8 @@ public:
return; return;
} }
Start(false, true); me->SetWalk(false);
Start(false);
} }
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
@@ -571,7 +571,7 @@ public:
pInstance->HandleGameObject(pInstance->GetGuidData(GO_ARTHAS_DOOR), true); pInstance->HandleGameObject(pInstance->GetGuidData(GO_ARTHAS_DOOR), true);
pLichKing->SetVisible(true); pLichKing->SetVisible(true);
pLichKing->GetMotionMaster()->MovePoint(0, LichKingMoveMidlelThronePos, false); pLichKing->GetMotionMaster()->MovePoint(0, LichKingMoveMidlelThronePos, FORCED_MOVEMENT_NONE, 0.f, false);
} }
@@ -618,7 +618,7 @@ public:
if (Creature* pLichKing = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_LICH_KING_EVENT))) if (Creature* pLichKing = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_LICH_KING_EVENT)))
{ {
pLichKing->SetVisible(true); pLichKing->SetVisible(true);
pLichKing->GetMotionMaster()->MovePoint(0, LichKingMoveThronePos, false); pLichKing->GetMotionMaster()->MovePoint(0, LichKingMoveThronePos, FORCED_MOVEMENT_NONE, 0.f, false);
} }
events.ScheduleEvent(EVENT_INTRO_LK_2_1, 1s); events.ScheduleEvent(EVENT_INTRO_LK_2_1, 1s);
break; break;
@@ -709,7 +709,7 @@ public:
case EVENT_INTRO_LK_5_2: case EVENT_INTRO_LK_5_2:
if (Creature* pLichKing = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_LICH_KING_EVENT))) if (Creature* pLichKing = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_LICH_KING_EVENT)))
{ {
pLichKing->GetMotionMaster()->MovePoint(0, LichKingMoveAwayPos, false); pLichKing->GetMotionMaster()->MovePoint(0, LichKingMoveAwayPos, FORCED_MOVEMENT_NONE, 0.f, false);
} }
break; break;
@@ -763,11 +763,11 @@ public:
{ {
Talk(SAY_SYLVANAS_INTRO_END); Talk(SAY_SYLVANAS_INTRO_END);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
me->GetMotionMaster()->MovePoint(0, LichKingMoveAwayPos, false); me->GetMotionMaster()->MovePoint(0, LichKingMoveAwayPos, FORCED_MOVEMENT_NONE, 0.f, false);
} }
if (Creature* pLoralen = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_DARK_RANGER_LORALEN))) if (Creature* pLoralen = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_DARK_RANGER_LORALEN)))
{ {
pLoralen->GetMotionMaster()->MovePoint(0, LoralenFollowLk1, false); pLoralen->GetMotionMaster()->MovePoint(0, LoralenFollowLk1, FORCED_MOVEMENT_NONE, 0.f, false);
} }
events.ScheduleEvent(EVENT_INTRO_LK_10, 1s + 500ms); events.ScheduleEvent(EVENT_INTRO_LK_10, 1s + 500ms);
break; break;
@@ -775,7 +775,7 @@ public:
case EVENT_INTRO_LK_10: case EVENT_INTRO_LK_10:
if (Creature* pLoralen = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_DARK_RANGER_LORALEN))) if (Creature* pLoralen = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_DARK_RANGER_LORALEN)))
{ {
pLoralen->GetMotionMaster()->MovePoint(0, LoralenFollowLk2, false); pLoralen->GetMotionMaster()->MovePoint(0, LoralenFollowLk2, FORCED_MOVEMENT_NONE, 0.f, false);
} }
events.ScheduleEvent(EVENT_INTRO_LK_11, 2s); events.ScheduleEvent(EVENT_INTRO_LK_11, 2s);
@@ -784,7 +784,7 @@ public:
case EVENT_INTRO_LK_11: case EVENT_INTRO_LK_11:
if (Creature* pLoralen = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_DARK_RANGER_LORALEN))) if (Creature* pLoralen = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_DARK_RANGER_LORALEN)))
{ {
pLoralen->GetMotionMaster()->MovePoint(0, LoralenFollowLk3, false); pLoralen->GetMotionMaster()->MovePoint(0, LoralenFollowLk3, FORCED_MOVEMENT_NONE, 0.f, false);
} }
events.ScheduleEvent(EVENT_INTRO_LK_12, 5s + 500ms); events.ScheduleEvent(EVENT_INTRO_LK_12, 5s + 500ms);
break; break;
@@ -796,7 +796,7 @@ public:
} }
if (Creature* pLoralen = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_DARK_RANGER_LORALEN))) if (Creature* pLoralen = pInstance->instance->GetCreature(pInstance->GetGuidData(NPC_DARK_RANGER_LORALEN)))
{ {
pLoralen->GetMotionMaster()->MovePoint(0, LoralenFollowLkFinal, false); pLoralen->GetMotionMaster()->MovePoint(0, LoralenFollowLkFinal, FORCED_MOVEMENT_NONE, 0.f, false);
} }
events.ScheduleEvent(EVENT_INTRO_LK_13, 2s); events.ScheduleEvent(EVENT_INTRO_LK_13, 2s);
break; break;
@@ -674,14 +674,14 @@ public:
switch (events.ExecuteEvent()) switch (events.ExecuteEvent())
{ {
case 1: case 1:
me->GetMotionMaster()->MovePoint(2, PTSTyrannusWaitPos1, false); me->GetMotionMaster()->MovePoint(2, PTSTyrannusWaitPos1, FORCED_MOVEMENT_NONE, 0.f, false);
break; break;
case 2: case 2:
me->SetFacingTo(PTSTyrannusWaitPos1.GetOrientation()); me->SetFacingTo(PTSTyrannusWaitPos1.GetOrientation());
me->setActive(false); me->setActive(false);
break; break;
case 3: case 3:
me->GetMotionMaster()->MovePoint(3, PTSTyrannusWaitPos2, false); me->GetMotionMaster()->MovePoint(3, PTSTyrannusWaitPos2, FORCED_MOVEMENT_NONE, 0.f, false);
break; break;
case 4: case 4:
me->SetFacingTo(PTSTyrannusWaitPos2.GetOrientation()); me->SetFacingTo(PTSTyrannusWaitPos2.GetOrientation());
@@ -690,7 +690,7 @@ public:
me->GetMotionMaster()->MoveTakeoff(10, me->GetPositionX() + 2.0f * cos(me->GetOrientation()), me->GetPositionY() + 2.0f * std::sin(me->GetOrientation()), me->GetPositionZ() + 30.0f, 7.0f); me->GetMotionMaster()->MoveTakeoff(10, me->GetPositionX() + 2.0f * cos(me->GetOrientation()), me->GetPositionY() + 2.0f * std::sin(me->GetOrientation()), me->GetPositionZ() + 30.0f, 7.0f);
break; break;
case 6: case 6:
me->GetMotionMaster()->MovePoint(4, PTSTyrannusWaitPos3, false); me->GetMotionMaster()->MovePoint(4, PTSTyrannusWaitPos3, FORCED_MOVEMENT_NONE, 0.f, false);
break; break;
case 30: case 30:
{ {
@@ -1355,7 +1355,7 @@ public:
} }
} }
if (minDist < 200.0f * 200.0f) if (minDist < 200.0f * 200.0f)
_owner.GetMotionMaster()->MovePoint(0, slaveFreePos[pointId], true, false); _owner.GetMotionMaster()->MovePoint(0, slaveFreePos[pointId], FORCED_MOVEMENT_NONE, 0.f, true, false);
return true; return true;
} }
@@ -58,7 +58,7 @@ public:
void InitializeAI() override void InitializeAI() override
{ {
BossAI::InitializeAI(); BossAI::InitializeAI();
me->GetMotionMaster()->MovePoint(POINT_START, 1638.55f, 919.76f, 104.95f, false); me->GetMotionMaster()->MovePoint(POINT_START, 1638.55f, 919.76f, 104.95f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
me->SetHomePosition(1642.712f, 934.646f, 107.205f, 0.767f); me->SetHomePosition(1642.712f, 934.646f, 107.205f, 0.767f);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
} }
@@ -583,7 +583,7 @@ public:
{ {
me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY);
me->SetDisableGravity(false); me->SetDisableGravity(false);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 10.0f); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), 539.2917f, FORCED_MOVEMENT_NONE, 10.0f);
for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr)
(*itr)->AI()->DoAction(ACTION_DESPAWN); (*itr)->AI()->DoAction(ACTION_DESPAWN);
@@ -845,7 +845,7 @@ public:
{ {
me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY);
me->SetDisableGravity(false); me->SetDisableGravity(false);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 10.0f); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), 539.2917f, FORCED_MOVEMENT_NONE, 10.0f);
for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr)
(*itr)->AI()->DoAction(ACTION_DESPAWN); (*itr)->AI()->DoAction(ACTION_DESPAWN);
@@ -503,7 +503,7 @@ public:
float x, y, z, o; float x, y, z, o;
_dest.GetPosition(x, y, z, o); _dest.GetPosition(x, y, z, o);
_owner->GetTransport()->CalculatePassengerPosition(x, y, z, &o); _owner->GetTransport()->CalculatePassengerPosition(x, y, z, &o);
_owner->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, x, y, z, false); _owner->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, x, y, z, FORCED_MOVEMENT_NONE, 0.f, false);
return true; return true;
} }
@@ -915,7 +915,7 @@ public:
{ {
float x, y, z, o; float x, y, z, o;
me->GetHomePosition(x, y, z, o); me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(0, x, y, z, false); me->GetMotionMaster()->MovePoint(0, x, y, z, FORCED_MOVEMENT_NONE, 0.f, false);
} }
} }
else else
@@ -1072,7 +1072,7 @@ public:
{ {
float x, y, z, o; float x, y, z, o;
me->GetHomePosition(x, y, z, o); me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(0, x, y, z, false); me->GetMotionMaster()->MovePoint(0, x, y, z, FORCED_MOVEMENT_NONE, 0.f, false);
} }
} }
} }
@@ -1251,7 +1251,7 @@ public:
{ {
float x, y, z, o; float x, y, z, o;
me->GetHomePosition(x, y, z, o); me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(0, x, y, z, false); me->GetMotionMaster()->MovePoint(0, x, y, z, FORCED_MOVEMENT_NONE, 0.f, false);
} }
} }
else else
@@ -1411,7 +1411,7 @@ public:
{ {
float x, y, z, o; float x, y, z, o;
me->GetHomePosition(x, y, z, o); me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(0, x, y, z, false); me->GetMotionMaster()->MovePoint(0, x, y, z, FORCED_MOVEMENT_NONE, 0.f, false);
} }
} }
} }
@@ -1518,7 +1518,7 @@ struct gunship_npc_AI : public ScriptedAI
me->SetTransportHomePosition(Slot->TargetPosition); me->SetTransportHomePosition(Slot->TargetPosition);
me->GetTransport()->CalculatePassengerPosition(x, y, z, &o); me->GetTransport()->CalculatePassengerPosition(x, y, z, &o);
me->SetHomePosition(x, y, z, o); me->SetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, x, y, z, false); me->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, x, y, z, FORCED_MOVEMENT_NONE, 0.f, false);
} }
} }
@@ -2565,7 +2565,7 @@ public:
me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD);
me->SetCanFly(false); me->SetCanFly(false);
me->SetDisableGravity(false); me->SetDisableGravity(false);
me->GetMotionMaster()->MovePoint(POINT_DROP_PLAYER, _destPoint, false); me->GetMotionMaster()->MovePoint(POINT_DROP_PLAYER, _destPoint, FORCED_MOVEMENT_NONE, 0.f, false);
me->SetDisableGravity(true, true); me->SetDisableGravity(true, true);
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
break; break;
@@ -934,7 +934,8 @@ public:
case EVENT_START_PATHING: case EVENT_START_PATHING:
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(false); me->SetImmuneToAll(false);
Start(true, true); me->SetWalk(false);
Start(true);
break; break;
case EVENT_SCOURGE_STRIKE: case EVENT_SCOURGE_STRIKE:
DoCastVictim(SPELL_SCOURGE_STRIKE); DoCastVictim(SPELL_SCOURGE_STRIKE);
@@ -3347,7 +3348,7 @@ public:
if (Creature* broodling = me->SummonCreature(NPC_NERUBAR_BROODLING, me->GetPositionX() + cos(o) * dist, me->GetPositionY() + std::sin(o) * dist, 250.0f, Position::NormalizeOrientation(o - M_PI))) if (Creature* broodling = me->SummonCreature(NPC_NERUBAR_BROODLING, me->GetPositionX() + cos(o) * dist, me->GetPositionY() + std::sin(o) * dist, 250.0f, Position::NormalizeOrientation(o - M_PI)))
{ {
broodling->CastSpell(broodling, SPELL_WEB_BEAM2, false); broodling->CastSpell(broodling, SPELL_WEB_BEAM2, false);
broodling->GetMotionMaster()->MovePoint(POINT_ENTER_COMBAT, broodling->GetPositionX(), broodling->GetPositionY(), 213.03f, false); broodling->GetMotionMaster()->MovePoint(POINT_ENTER_COMBAT, broodling->GetPositionX(), broodling->GetPositionY(), 213.03f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false);
} }
} }
@@ -745,7 +745,7 @@ public:
if (Creature* cr = me->SummonCreature(NPC_LIVING_POISON, entry.Start, TEMPSUMMON_TIMED_DESPAWN, entry.DespawnTime)) if (Creature* cr = me->SummonCreature(NPC_LIVING_POISON, entry.Start, TEMPSUMMON_TIMED_DESPAWN, entry.DespawnTime))
{ {
cr->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); cr->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
cr->GetMotionMaster()->MovePoint(0, entry.End, false); cr->GetMotionMaster()->MovePoint(0, entry.End, FORCED_MOVEMENT_NONE, 0.f, false);
} }
_events.Repeat(5s); _events.Repeat(5s);
@@ -521,7 +521,7 @@ public:
} }
//pPlayer->ClearUnitState(UNIT_STATE_ONVEHICLE); //pPlayer->ClearUnitState(UNIT_STATE_ONVEHICLE);
Movement::MoveSplineInit init(pPlayer); Movement::MoveSplineInit init(pPlayer); // TODO: has to be removed and handled with vehicle exit and vehicle enter code
init.MoveTo(CenterPos.GetPositionX(), CenterPos.GetPositionY(), CenterPos.GetPositionZ()); init.MoveTo(CenterPos.GetPositionX(), CenterPos.GetPositionY(), CenterPos.GetPositionZ());
init.SetFacing(pPlayer->GetOrientation()); init.SetFacing(pPlayer->GetOrientation());
init.SetTransportExit(); init.SetTransportExit();
@@ -898,9 +898,9 @@ public:
{ {
Player* plr = pass->ToPlayer(); Player* plr = pass->ToPlayer();
float speed = plr->GetDistance(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()) / (1.0f * 0.001f); float speed = plr->GetDistance(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()) / (1.0f * 0.001f);
plr->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), speed); plr->SetDisableGravity(false); // packet only would lead to issues elsewhere
plr->GetMotionMaster()->MoveCharge(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), speed);
plr->RemoveAura(SPELL_FREEZE_ANIM); plr->RemoveAura(SPELL_FREEZE_ANIM);
plr->SetDisableGravity(false, true);
plr->SetGuidValue(PLAYER_FARSIGHT, ObjectGuid::Empty); plr->SetGuidValue(PLAYER_FARSIGHT, ObjectGuid::Empty);
sScriptMgr->AnticheatSetCanFlybyServer(plr, false); sScriptMgr->AnticheatSetCanFlybyServer(plr, false);
@@ -998,7 +998,7 @@ public:
MoveTimer = 0; MoveTimer = 0;
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->DisableSpline(); me->DisableSpline();
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.05f, 7.0f); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.05f, FORCED_MOVEMENT_NONE, 7.0f);
break; break;
} }
} }
@@ -1013,8 +1013,7 @@ public:
MoveTimer = 0; MoveTimer = 0;
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->DisableSpline(); me->DisableSpline();
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), 100.0f); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), FORCED_MOVEMENT_NONE, 100.0f);
me->SetPosition(me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), me->GetOrientation());
me->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); me->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
me->RemoveAura(SPELL_POWER_SPARK_VISUAL); me->RemoveAura(SPELL_POWER_SPARK_VISUAL);
me->CastSpell(me, SPELL_POWER_SPARK_GROUND_BUFF, true); me->CastSpell(me, SPELL_POWER_SPARK_GROUND_BUFF, true);
@@ -138,7 +138,7 @@ public:
AddWaypoint(13, 1281.2f, -26.8f, 33.5f, 0); AddWaypoint(13, 1281.2f, -26.8f, 33.5f, 0);
AddWaypoint(14, 1262, -26.9f, 33.5f, 0); AddWaypoint(14, 1262, -26.9f, 33.5f, 0);
Start(true, false, ObjectGuid::Empty, nullptr, false, true); Start(true, ObjectGuid::Empty, nullptr, false, true);
} }
InstanceScript* m_pInstance; InstanceScript* m_pInstance;
@@ -391,7 +391,8 @@ public:
switch (action) switch (action)
{ {
case ACTION_START_ESCORT_EVENT: case ACTION_START_ESCORT_EVENT:
Start(false, true, ObjectGuid::Empty, 0, true, false); me->SetWalk(false);
Start(false, ObjectGuid::Empty, 0, true, false);
Talk(SAY_BRANN_ESCORT_START); Talk(SAY_BRANN_ESCORT_START);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
@@ -456,7 +457,8 @@ public:
door->SetGoState(GO_STATE_READY); door->SetGoState(GO_STATE_READY);
break; break;
case ACTION_OPEN_DOOR: case ACTION_OPEN_DOOR:
Start(false, true, ObjectGuid::Empty, 0, true, false); me->SetWalk(false);
Start(false, ObjectGuid::Empty, 0, true, false);
SetNextWaypoint(34, false); SetNextWaypoint(34, false);
SetEscortPaused(false); SetEscortPaused(false);
me->RemoveAura(58506); me->RemoveAura(58506);
@@ -571,7 +573,7 @@ public:
if (speed < tooFarAwaySpeed) if (speed < tooFarAwaySpeed)
speed = tooFarAwaySpeed; speed = tooFarAwaySpeed;
darkMatterTarget->MonsterMoveWithSpeed(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), speed); darkMatterTarget->GetMotionMaster()->MovePoint(0, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), FORCED_MOVEMENT_NONE, speed);
if (darkMatterTarget->GetDistance(plr) < 15.0f) if (darkMatterTarget->GetDistance(plr) < 15.0f)
{ {
@@ -805,7 +805,7 @@ public:
case EVENT_LIGHTNING_LAND: case EVENT_LIGHTNING_LAND:
{ {
float speed = me->GetDistance(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()) / (1000.0f * 0.001f); float speed = me->GetDistance(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()) / (1000.0f * 0.001f);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), speed); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), FORCED_MOVEMENT_NONE, speed);
events.ScheduleEvent(EVENT_LAND_LAND, 1s); events.ScheduleEvent(EVENT_LAND_LAND, 1s);
break; break;
} }
@@ -381,8 +381,7 @@ public:
{ {
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
TurnGates(true, false); TurnGates(true, false);
me->MonsterMoveWithSpeed(homePos.GetPositionX(), homePos.GetPositionY(), homePos.GetPositionZ(), 100.0f); me->GetMotionMaster()->MovePoint(0, homePos.GetPositionX(), homePos.GetPositionY(), homePos.GetPositionZ(), FORCED_MOVEMENT_NONE, 100.0f);
me->UpdatePosition(homePos);
_speakTimer = 60000; _speakTimer = 60000;
} }
else if (_speakTimer > 63500) else if (_speakTimer > 63500)
@@ -1090,7 +1089,7 @@ public:
{ {
summons.DespawnAll(); summons.DespawnAll();
_spellTimer = 0; _spellTimer = 0;
Start(false, false, ObjectGuid::Empty, nullptr, false, true); Start(false, ObjectGuid::Empty, nullptr, false, true);
if (Aura* aur = me->AddAura(SPELL_FREYA_DUMMY_YELLOW, me)) if (Aura* aur = me->AddAura(SPELL_FREYA_DUMMY_YELLOW, me))
{ {
aur->SetMaxDuration(-1); aur->SetMaxDuration(-1);
@@ -601,7 +601,7 @@ public:
{ {
me->EnterVehicle(VX001, 4); me->EnterVehicle(VX001, 4);
float speed = ACU->GetDistance(2737.75f, 2574.22f, 381.34f) / 2.0f; float speed = ACU->GetDistance(2737.75f, 2574.22f, 381.34f) / 2.0f;
ACU->MonsterMoveWithSpeed(2737.75f, 2574.22f, 381.34f, speed); ACU->GetMotionMaster()->MovePoint(0, 2737.75f, 2574.22f, 381.34f, FORCED_MOVEMENT_NONE, speed);
ACU->SetPosition(2737.75f, 2574.22f, 381.34f, M_PI); ACU->SetPosition(2737.75f, 2574.22f, 381.34f, M_PI);
events.ScheduleEvent(EVENT_SAY_VX001_DEAD, 2s); events.ScheduleEvent(EVENT_SAY_VX001_DEAD, 2s);
break; break;
@@ -1681,8 +1681,7 @@ public:
me->InterruptNonMeleeSpells(false); me->InterruptNonMeleeSpells(false);
me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE); me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE);
me->MonsterMoveWithSpeed(2744.65f, 2569.46f, 381.34f, me->GetDistance(2744.65f, 2569.46f, 381.34f)); me->GetMotionMaster()->MovePoint(0, 2744.65f, 2569.46f, 381.34f);
me->UpdatePosition(2744.65f, 2569.46f, 381.34f, M_PI, false);
if (Creature* c = GetMimiron()) if (Creature* c = GetMimiron())
c->AI()->SetData(0, 3); c->AI()->SetData(0, 3);
@@ -1740,8 +1739,7 @@ public:
} }
float speed = me->GetExactDist(x, y, 381.34f); float speed = me->GetExactDist(x, y, 381.34f);
me->MonsterMoveWithSpeed(x, y, 381.34f, speed); me->GetMotionMaster()->MovePoint(0, x, y, 381.34f, FORCED_MOVEMENT_NONE, speed);
me->UpdatePosition(x, y, 381.34f, me->GetAngle(victim), false);
if (mc) if (mc)
{ {
mc->AI()->SetData(0, 0); mc->AI()->SetData(0, 0);
@@ -1793,14 +1791,12 @@ public:
case EVENT_MAGNETIC_CORE_PULL_DOWN: case EVENT_MAGNETIC_CORE_PULL_DOWN:
me->CastSpell(me, SPELL_MAGNETIC_CORE, true); me->CastSpell(me, SPELL_MAGNETIC_CORE, true);
me->CastSpell(me, SPELL_SPINNING, true); me->CastSpell(me, SPELL_SPINNING, true);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 365.34f, me->GetExactDist(me->GetPositionX(), me->GetPositionY(), 365.34f)); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), 365.34f, FORCED_MOVEMENT_NONE, me->GetExactDist(me->GetPositionX(), me->GetPositionY(), 365.34f));
me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), 365.34f, me->GetOrientation(), false);
events.ScheduleEvent(EVENT_MAGNETIC_CORE_FREE, 20s); events.ScheduleEvent(EVENT_MAGNETIC_CORE_FREE, 20s);
break; break;
case EVENT_MAGNETIC_CORE_FREE: case EVENT_MAGNETIC_CORE_FREE:
me->RemoveAura(SPELL_SPINNING); me->RemoveAura(SPELL_SPINNING);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 381.34f, me->GetDistance(me->GetPositionX(), me->GetPositionY(), 381.34f)); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), 381.34f, FORCED_MOVEMENT_NONE, me->GetDistance(me->GetPositionX(), me->GetPositionY(), 381.34f));
me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), 381.34f, me->GetOrientation(), false);
events.ScheduleEvent(EVENT_MAGNETIC_CORE_REMOVE_IMMOBILIZE, 1s); events.ScheduleEvent(EVENT_MAGNETIC_CORE_REMOVE_IMMOBILIZE, 1s);
break; break;
case EVENT_MAGNETIC_CORE_REMOVE_IMMOBILIZE: case EVENT_MAGNETIC_CORE_REMOVE_IMMOBILIZE:
@@ -1960,7 +1956,7 @@ public:
void SetData(uint32 /*id*/, uint32 /*value*/) override void SetData(uint32 /*id*/, uint32 /*value*/) override
{ {
me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 100.0f, false, true); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 100.0f, FORCED_MOVEMENT_NONE, 0.f, false, true);
} }
void UpdateAI(uint32 /*diff*/) override void UpdateAI(uint32 /*diff*/) override
@@ -683,7 +683,7 @@ public:
{ {
razorscale->AI()->AttackStart(player); razorscale->AI()->AttackStart(player);
razorscale->GetMotionMaster()->MoveIdle(); razorscale->GetMotionMaster()->MoveIdle();
razorscale->GetMotionMaster()->MovePoint(POINT_RAZORSCALE_INIT, 588.0f, -178.0f, 490.0f, false, false); razorscale->GetMotionMaster()->MovePoint(POINT_RAZORSCALE_INIT, 588.0f, -178.0f, 490.0f, FORCED_MOVEMENT_NONE, 0.f, 0.f, false, false);
} }
} }
} }
@@ -934,7 +934,8 @@ public:
{ {
InitWaypoint(); InitWaypoint();
Reset(); Reset();
Start(false, true); me->SetWalk(false);
Start(false);
} }
uint32 Timer; uint32 Timer;
@@ -1020,7 +1021,8 @@ public:
{ {
InitWaypoint(); InitWaypoint();
Reset(); Reset();
Start(false, true); me->SetWalk(false);
Start(false);
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
} }
@@ -937,7 +937,8 @@ public:
{ {
InitWaypoint(); InitWaypoint();
Reset(); Reset();
Start(false, true, ObjectGuid::Empty, nullptr, false, true); me->SetWalk(false);
Start(false, ObjectGuid::Empty, nullptr, false, true);
} }
uint32 _checkTimer; uint32 _checkTimer;
@@ -372,7 +372,8 @@ struct violet_hold_trashAI : public npc_escortAI
break; break;
} }
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
Start(true, true); me->SetWalk(false);
Start(true);
} }
npc_escortAI::UpdateAI(diff); npc_escortAI::UpdateAI(diff);
@@ -1111,7 +1112,8 @@ public:
break; break;
} }
SetDespawnAtEnd(false); SetDespawnAtEnd(false);
Start(true, true); me->SetWalk(false);
Start(true);
} }
if (bOpening) if (bOpening)
@@ -464,7 +464,7 @@ public:
go->UseDoorOrButton(); go->UseDoorOrButton();
if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI())) if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
return true; return true;
@@ -914,7 +914,7 @@ public:
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
creature->SetStandState(UNIT_STAND_STATE_STAND); creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_1, player); creature->AI()->Talk(SAY_1, player);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
} }
return true; return true;
} }
@@ -995,7 +995,8 @@ public:
{ {
creature->SetStandState(UNIT_STAND_STATE_STAND); creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_BONKER_2, player); creature->AI()->Talk(SAY_BONKER_2, player);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, player->GetGUID()); creature->SetWalk(false);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
} }
return true; return true;
} }
@@ -1884,7 +1885,7 @@ public:
if (Creature* leryssa = ObjectAccessor::GetCreature(*me, _leryssaGUID)) if (Creature* leryssa = ObjectAccessor::GetCreature(*me, _leryssaGUID))
{ {
leryssa->SetWalk(false); leryssa->SetWalk(false);
leryssa->MonsterMoveWithSpeed(3726.751f, 3568.1633f, 477.44086f, leryssa->GetSpeed(MOVE_RUN)); leryssa->GetMotionMaster()->MovePoint(0, 3726.751f, 3568.1633f, 477.44086f, FORCED_MOVEMENT_RUN);
} }
_events.ScheduleEvent(EVENT_THASSARIAN_SCRIPT_23, 2s); _events.ScheduleEvent(EVENT_THASSARIAN_SCRIPT_23, 2s);
break; break;
@@ -117,7 +117,7 @@ struct npc_preparations_for_war_vehicle : public NullCreatureAI
} }
} }
else else
me->GetMotionMaster()->MovePoint(0, x, y, z, false, false); me->GetMotionMaster()->MovePoint(0, x, y, z, FORCED_MOVEMENT_NONE, 0.f, 0.f, false, false);
break; break;
} }
} }
@@ -592,7 +592,7 @@ struct npc_minigob_manabonk : public ScriptedAI
case EVENT_MOVE: case EVENT_MOVE:
{ {
Position pos = me->GetRandomNearPosition((urand(15, 40))); Position pos = me->GetRandomNearPosition((urand(15, 40)));
me->GetMotionMaster()->MovePoint(0, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true); me->GetMotionMaster()->MovePoint(0, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
} }
events.ScheduleEvent(EVENT_DESPAWN_VISUAL, 3s); events.ScheduleEvent(EVENT_DESPAWN_VISUAL, 3s);
events.ScheduleEvent(EVENT_DESPAWN, 4s); events.ScheduleEvent(EVENT_DESPAWN, 4s);
@@ -207,7 +207,7 @@ public:
Mrfloppy->GetMotionMaster()->MoveFollow(creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); Mrfloppy->GetMotionMaster()->MoveFollow(creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
if (npc_escortAI* pEscortAI = CAST_AI(npc_emily::npc_emilyAI, (creature->AI()))) if (npc_escortAI* pEscortAI = CAST_AI(npc_emily::npc_emilyAI, (creature->AI())))
pEscortAI->Start(true, false, player->GetGUID()); pEscortAI->Start(true, player->GetGUID());
} }
return true; return true;
} }
@@ -191,7 +191,7 @@ public:
if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE) if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE)
{ {
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
} }
return true; return true;
} }
@@ -309,7 +309,7 @@ public:
return; return;
me->SetWalk(true); me->SetWalk(true);
Start(false, false, summonerGUID); Start(false, summonerGUID);
} }
void WaypointReached(uint32 waypointId) override void WaypointReached(uint32 waypointId) override
@@ -523,11 +523,8 @@ public:
{ {
soul->SetCanFly(true); soul->SetCanFly(true);
soul->SetVisible(true); soul->SetVisible(true);
Movement::MoveSplineInit init(soul);
init.MoveTo(soul->GetPositionX(), soul->GetPositionY(), soul->GetPositionZ() + 5.0f);
init.SetVelocity(1.0f);
init.Launch();
soul->CastSpell(soul, 64462, true); // Drown soul->CastSpell(soul, 64462, true); // Drown
soul->GetMotionMaster()->MovePoint(0, soul->GetPositionX(), soul->GetPositionY(), soul->GetPositionZ() + 5.0f, FORCED_MOVEMENT_NONE, 1.f);
} }
events.ScheduleEvent(EVENT_SCENE_1, 6s); events.ScheduleEvent(EVENT_SCENE_1, 6s);
break; break;
@@ -718,7 +715,7 @@ public:
Talk(0); Talk(0);
events.Reset(); events.Reset();
summons.DespawnAll(); summons.DespawnAll();
Start(false, false); Start(false);
int8 i = -1; int8 i = -1;
std::list<Creature*> cList; std::list<Creature*> cList;
@@ -605,7 +605,7 @@ public:
creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f); creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
pEscortAI->Start(false, false, player->GetGUID()); pEscortAI->Start(false, player->GetGUID());
creature->AI()->Talk(SAY_WP_1); creature->AI()->Talk(SAY_WP_1);
} }
} }
@@ -57,7 +57,8 @@ struct npc_frosthound : public npc_escortAI
{ {
me->SetFaction(who->GetFaction()); me->SetFaction(who->GetFaction());
me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true); me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true);
Start(false, true, who->GetGUID()); me->SetWalk(false);
Start(false, who->GetGUID());
Talk(TALK_EMOTE_FROSTHOUND_SNIFF, me); Talk(TALK_EMOTE_FROSTHOUND_SNIFF, me);
} }
} }
@@ -246,7 +247,8 @@ public:
void RollPath() void RollPath()
{ {
me->SetEntry(NPC_TIME_LOST_PROTO_DRAKE); me->SetEntry(NPC_TIME_LOST_PROTO_DRAKE);
Start(true, true, ObjectGuid::Empty, 0, false, true, true); me->SetWalk(false);
Start(true, ObjectGuid::Empty, 0, false, true, true);
SetNextWaypoint(urand(0, 250), true); SetNextWaypoint(urand(0, 250), true);
me->UpdateEntry(roll_chance_i(25) ? NPC_TIME_LOST_PROTO_DRAKE : NPC_VYRAGOSA, 0, false); me->UpdateEntry(roll_chance_i(25) ? NPC_TIME_LOST_PROTO_DRAKE : NPC_VYRAGOSA, 0, false);
} }
@@ -912,7 +914,10 @@ public:
if (who->IsPlayer()) if (who->IsPlayer())
{ {
if (apply) if (apply)
Start(false, true, who->GetGUID()); {
me->SetWalk(false);
Start(false, who->GetGUID());
}
} }
} }
@@ -507,7 +507,7 @@ struct boss_illidan_stormrage : public BossAI
Talk(SAY_ILLIDAN_EYE_BLAST); Talk(SAY_ILLIDAN_EYE_BLAST);
me->SummonCreature(NPC_ILLIDAN_DB_TARGET, eyeBeamPos[beamPosId], TEMPSUMMON_TIMED_DESPAWN, 30000); me->SummonCreature(NPC_ILLIDAN_DB_TARGET, eyeBeamPos[beamPosId], TEMPSUMMON_TIMED_DESPAWN, 30000);
if (Creature* trigger = summons.GetCreatureWithEntry(NPC_ILLIDAN_DB_TARGET)) if (Creature* trigger = summons.GetCreatureWithEntry(NPC_ILLIDAN_DB_TARGET))
trigger->GetMotionMaster()->MovePoint(0, eyeBeamPos[beamPosId + MAX_EYE_BEAM_POS], false, true); trigger->GetMotionMaster()->MovePoint(0, eyeBeamPos[beamPosId + MAX_EYE_BEAM_POS], FORCED_MOVEMENT_NONE, 0.f, false, true);
// Reposition // Reposition
me->m_Events.AddEventAtOffset([&] { me->m_Events.AddEventAtOffset([&] {
@@ -515,7 +515,7 @@ struct boss_illidan_stormrage : public BossAI
me->InterruptNonMeleeSpells(false); me->InterruptNonMeleeSpells(false);
me->SetControlled(false, UNIT_STATE_ROOT); me->SetControlled(false, UNIT_STATE_ROOT);
CycleBeamPos(beamPosId); CycleBeamPos(beamPosId);
me->GetMotionMaster()->MovePoint(POINT_ILLIDAN_HOVER, airHoverPos[beamPosId], false, true); me->GetMotionMaster()->MovePoint(POINT_ILLIDAN_HOVER, airHoverPos[beamPosId], FORCED_MOVEMENT_NONE, 0.f, false, true);
}, 20s, GROUP_PHASE_FLYING); }, 20s, GROUP_PHASE_FLYING);
}); });
// Check for Phase Transition // Check for Phase Transition
@@ -301,7 +301,7 @@ public:
Talk(SUFF_SAY_RECAP); Talk(SUFF_SAY_RECAP);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), false); me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), FORCED_MOVEMENT_NONE, 0.f, false);
scheduler.CancelAll(); scheduler.CancelAll();
} }
} }
@@ -408,7 +408,7 @@ public:
Talk(DESI_SAY_RECAP); Talk(DESI_SAY_RECAP);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->Clear(); me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), false); me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), FORCED_MOVEMENT_NONE, 0.f, false);
scheduler.CancelAll(); scheduler.CancelAll();
} }
} }
@@ -139,7 +139,7 @@ struct boss_fathomlord_karathress : public BossAI
if (Creature* olum = instance->GetCreature(DATA_SEER_OLUM)) if (Creature* olum = instance->GetCreature(DATA_SEER_OLUM))
{ {
olum->SetWalk(true); olum->SetWalk(true);
olum->GetMotionMaster()->MovePoint(0, olumWalk, false); olum->GetMotionMaster()->MovePoint(0, olumWalk, FORCED_MOVEMENT_NONE, 0.f, false);
olum->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); olum->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
olum->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); olum->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
} }
@@ -93,7 +93,7 @@ struct boss_lady_vashj : public BossAI
scheduler.CancelAll(); scheduler.CancelAll();
me->CastStop(); me->CastStop();
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), true, true); me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), FORCED_MOVEMENT_NONE, 0.f, true, true);
}); });
} }
@@ -102,7 +102,7 @@ struct boss_vazruden_the_herald : public BossAI
if (summon->GetEntry() == NPC_HELLFIRE_SENTRY && summons.size() == 0) if (summon->GetEntry() == NPC_HELLFIRE_SENTRY && summons.size() == 0)
{ {
Talk(SAY_INTRO); Talk(SAY_INTRO);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 85.0f, false); me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 85.0f, FORCED_MOVEMENT_NONE, 0.f, false);
_JustEngagedWith(); _JustEngagedWith();
} }
else if (summons.size() == 0) else if (summons.size() == 0)
@@ -163,7 +163,7 @@ struct boss_nazan : public ScriptedAI
_scheduler.CancelAll(); _scheduler.CancelAll();
_scheduler.Schedule(5ms, GROUP_PHASE_1, [this](TaskContext context) _scheduler.Schedule(5ms, GROUP_PHASE_1, [this](TaskContext context)
{ {
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, NazanPos[urand(0, 2)], false); me->GetMotionMaster()->MovePoint(POINT_FLIGHT, NazanPos[urand(0, 2)], FORCED_MOVEMENT_NONE, 0.f, false);
_scheduler.DelayAll(7s); _scheduler.DelayAll(7s);
context.Repeat(30s); context.Repeat(30s);
}).Schedule(5s, GROUP_PHASE_1, [this](TaskContext context) }).Schedule(5s, GROUP_PHASE_1, [this](TaskContext context)
@@ -193,7 +193,7 @@ struct boss_nazan : public ScriptedAI
Talk(EMOTE_NAZAN); Talk(EMOTE_NAZAN);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->InterruptNonMeleeSpells(true); me->InterruptNonMeleeSpells(true);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 81.2f, false); me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 81.2f, FORCED_MOVEMENT_NONE, 0.f, false);
} }
} }
@@ -140,7 +140,7 @@ struct boss_alar : public BossAI
_noQuillTimes = 0; _noQuillTimes = 0;
_platformRoll = RAND(0, 1); _platformRoll = RAND(0, 1);
_platform = _platformRoll ? 0 : 3; _platform = _platformRoll ? 0 : 3;
me->GetMotionMaster()->MovePoint(POINT_QUILL, alarPoints[POINT_QUILL], false, true); me->GetMotionMaster()->MovePoint(POINT_QUILL, alarPoints[POINT_QUILL], FORCED_MOVEMENT_NONE, 0.f, false, true);
_platformMoveRepeatTimer = 16s; _platformMoveRepeatTimer = 16s;
} }
else else
@@ -150,7 +150,7 @@ struct boss_alar : public BossAI
me->SetOrientation(alarPoints[_platform].GetOrientation()); me->SetOrientation(alarPoints[_platform].GetOrientation());
SpawnPhoenixes(1, me); SpawnPhoenixes(1, me);
} }
me->GetMotionMaster()->MovePoint(POINT_PLATFORM, alarPoints[_platform], false, true); me->GetMotionMaster()->MovePoint(POINT_PLATFORM, alarPoints[_platform], FORCED_MOVEMENT_NONE, 0.f, false, true);
_platform = (_platform+1)%4; _platform = (_platform+1)%4;
_platformMoveRepeatTimer = 30s; _platformMoveRepeatTimer = 30s;
} }
@@ -258,7 +258,7 @@ struct boss_alar : public BossAI
}, 30s); }, 30s);
ScheduleTimedEvent(34s, [&] ScheduleTimedEvent(34s, [&]
{ {
me->GetMotionMaster()->MovePoint(POINT_DIVE, alarPoints[POINT_DIVE], false, true); me->GetMotionMaster()->MovePoint(POINT_DIVE, alarPoints[POINT_DIVE], FORCED_MOVEMENT_NONE, 0.f, false, true);
scheduler.DelayAll(15s); scheduler.DelayAll(15s);
}, 57s); }, 57s);
@@ -655,7 +655,7 @@ struct boss_kaelthas : public BossAI
me->AttackStop(); me->AttackStop();
me->CastStop(); me->CastStop();
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, me->GetHomePosition(), true, true); me->GetMotionMaster()->MovePoint(POINT_MIDDLE, me->GetHomePosition(), FORCED_MOVEMENT_NONE, 0.f, true, true);
} }
}); });
ScheduleTimedEvent(1s, [&] ScheduleTimedEvent(1s, [&]
@@ -171,7 +171,7 @@ public:
npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature) npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature)
{ {
if (creature->GetOwner() && creature->GetOwner()->IsPlayer()) if (creature->GetOwner() && creature->GetOwner()->IsPlayer())
Start(false, false, creature->GetOwner()->GetGUID()); Start(false, creature->GetOwner()->GetGUID());
creature->SetSpeed(MOVE_WALK, 1.5f); creature->SetSpeed(MOVE_WALK, 1.5f);
DoCast(SPELL_GUIDED_BY_THE_SPIRITS); DoCast(SPELL_GUIDED_BY_THE_SPIRITS);
Reset(); Reset();
@@ -209,7 +209,7 @@ public:
{ {
ryga->SetWalk(true); ryga->SetWalk(true);
ryga->SetSpeed(MOVE_WALK, 1.0f); ryga->SetSpeed(MOVE_WALK, 1.0f);
ryga->GetMotionMaster()->MovePoint(0, 515.877991f, 3885.67627f, 190.470535f, true); ryga->GetMotionMaster()->MovePoint(0, 515.877991f, 3885.67627f, 190.470535f, FORCED_MOVEMENT_NONE, 0.f, true);
Reset(); Reset();
} }
} }
@@ -234,7 +234,7 @@ public:
ryga->SetStandState(UNIT_STAND_STATE_STAND); ryga->SetStandState(UNIT_STAND_STATE_STAND);
ryga->SetWalk(true); ryga->SetWalk(true);
ryga->SetSpeed(MOVE_WALK, 1.0f); ryga->SetSpeed(MOVE_WALK, 1.0f);
ryga->GetMotionMaster()->MovePoint(0, 504.59201f, 3882.12988f, 192.156006f, true); ryga->GetMotionMaster()->MovePoint(0, 504.59201f, 3882.12988f, 192.156006f, FORCED_MOVEMENT_NONE, 0.f, true);
Reset(); Reset();
} }
} }
@@ -312,7 +312,7 @@ public:
{ {
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
me->SetFaction(FACTION_ESCORTEE_H_PASSIVE); me->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
npc_escortAI::Start(true, false, player->GetGUID()); npc_escortAI::Start(true, player->GetGUID());
} }
} }
+4 -4
View File
@@ -65,7 +65,7 @@ public:
{ {
creature->SetStandState(UNIT_STAND_STATE_STAND); creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE);
EscortAI->Start(true, false, player->GetGUID(), quest); EscortAI->Start(true, player->GetGUID(), quest);
creature->AI()->Talk(SAY_MAG_START); creature->AI()->Talk(SAY_MAG_START);
creature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0] + 2.5f, m_afAmbushA[1] - 2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); creature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0] + 2.5f, m_afAmbushA[1] - 2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
@@ -133,7 +133,7 @@ public:
if (Player* player = GetPlayerForEscort()) if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me); player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
SetRun(); SetRun(true);
break; break;
} }
} }
@@ -306,7 +306,7 @@ public:
void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override
{ {
me->SetStandState(UNIT_STAND_STATE_STAND); me->SetStandState(UNIT_STAND_STATE_STAND);
Start(true, false, guid); Start(true, guid);
Talk(SAY_KUR_START); Talk(SAY_KUR_START);
me->SummonCreature(NPC_KUR_MURK_RAIDER, kurenaiAmbushA[0] + 2.5f, kurenaiAmbushA[1] - 2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000); me->SummonCreature(NPC_KUR_MURK_RAIDER, kurenaiAmbushA[0] + 2.5f, kurenaiAmbushA[1] - 2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
@@ -361,7 +361,7 @@ public:
if (Player* player = GetPlayerForEscort()) if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me); player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me);
SetRun(); SetRun(true);
break; break;
} }
} }
@@ -103,7 +103,8 @@ public:
{ {
if (type == DATA_START_ENCOUNTER) if (type == DATA_START_ENCOUNTER)
{ {
Start(true, true, playerGUID); me->SetWalk(false);
Start(true, playerGUID);
SetEscortPaused(true); SetEscortPaused(true);
started = true; started = true;
@@ -605,7 +606,7 @@ public:
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->AI()->Talk(SAY_BESSY_0); creature->AI()->Talk(SAY_BESSY_0);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
} }
return true; return true;
} }
@@ -771,7 +772,7 @@ public:
if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI())) if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI()))
{ {
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
pEscortAI->Start(false, false, player->GetGUID()); pEscortAI->Start(false, player->GetGUID());
} }
} }
return true; return true;

Some files were not shown because too many files have changed in this diff Show More