diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 7a009d0ae..bbef2c4a7 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -552,6 +552,11 @@ void ScriptedAI::SetEquipmentSlots(bool loadDefault, int32 mainHand /*= EQUIP_NO } } +void ScriptedAI::SetRun(bool run) +{ + me->SetWalk(!run); +} + enum eNPCs { NPC_BROODLORD = 12017, diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index c5c71af9f..d3a13f300 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -227,6 +227,8 @@ struct ScriptedAI : public CreatureAI // Called when AI is temporarily replaced or put back when possess is applied or removed void OnPossess(bool /*apply*/) {} + void SetRun(bool run); + enum class Axis { AXIS_X, diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index ddabc130f..7fe07cf1e 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -33,7 +33,6 @@ npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), m_pQuestForEscort(nullptr), m_bIsActiveAttacker(true), - m_bIsRunning(false), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), DespawnAtEnd(true), @@ -186,9 +185,8 @@ void npc_escortAI::JustRespawned() void npc_escortAI::ReturnToLastPoint() { float x, y, z, o; - me->SetWalk(false); 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*/) @@ -329,7 +327,6 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId) { LOG_DEBUG("scripts.ai", "EscortAI has returned to original position before combat"); - me->SetWalk(!m_bIsRunning); RemoveEscortState(STATE_ESCORT_RETURNING); 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. -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()) { @@ -469,7 +446,6 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false //set variables m_bIsActiveAttacker = isActiveAttacker; - m_bIsRunning = run; m_uiPlayerGUID = playerGUID; m_pQuestForEscort = quest; @@ -495,17 +471,11 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false me->SetImmuneToNPC(false); } - LOG_DEBUG("scripts.ai", "EscortAI started with {} waypoints. ActiveAttacker = {}, Run = {}, PlayerGUID = {}", - uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID.ToString()); + LOG_DEBUG("scripts.ai", "EscortAI started with {} waypoints. ActiveAttacker = {}, PlayerGUID = {}", + uint64(WaypointList.size()), m_bIsActiveAttacker, m_uiPlayerGUID.ToString()); CurrentWP = WaypointList.begin(); - //Set initial speed - if (m_bIsRunning) - me->SetWalk(false); - else - me->SetWalk(true); - AddEscortState(STATE_ESCORT_ESCORTING); if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == ESCORT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h index 1332837ff..32b51126d 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h @@ -90,9 +90,8 @@ public: virtual void WaypointReached(uint32 pointId) = 0; 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); bool HasEscortState(uint32 escortState) { return (m_uiEscortState & escortState); } @@ -130,7 +129,6 @@ private: std::list::iterator CurrentWP; 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_bCanReturnToStart; //if creature can walk same path (loop) without despawn. Not for regular escort quests. bool DespawnAtEnd; diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index fc130cca4..b9a78c6d9 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -43,9 +43,6 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) mCanRepeatPath = false; - // spawn in run mode - // Xinef: spawn in run mode and set mRun to run... this overrides SetWalk EVERYWHERE - mRun = true; mEvadeDisabled = false; 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)) StopPath(); @@ -208,7 +205,6 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker) { AddEscortState(SMART_ESCORT_ESCORTING); mCanRepeatPath = repeat; - SetRun(run); if (invoker && invoker->IsPlayer()) { @@ -219,7 +215,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker) Movement::PointsArray pathPoints; GenerateWayPointArray(&pathPoints); - me->GetMotionMaster()->MoveSplinePath(&pathPoints); + me->GetMotionMaster()->MoveSplinePath(&pathPoints, forcedMovement); 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) { mForcedPaused = forced; - SetRun(mRun); if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == ESCORT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -362,7 +357,7 @@ void SmartAI::EndPath(bool fail) if (mCanRepeatPath) { if (IsAIControlled()) - StartPath(mRun, GetScript()->GetPathId(), true); + StartPath(FORCED_MOVEMENT_NONE, GetScript()->GetPathId(), true); } else GetScript()->SetPathId(0); @@ -373,8 +368,6 @@ void SmartAI::EndPath(bool fail) void SmartAI::ResumePath() { - SetRun(mRun); - if (mLastWP) { Movement::PointsArray pathPoints; @@ -389,10 +382,9 @@ void SmartAI::ReturnToLastOOCPos() if (!IsAIControlled()) return; - me->SetWalk(false); float 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) @@ -469,7 +461,6 @@ void SmartAI::UpdatePath(const uint32 diff) EndPath(); 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 if (me->movespline->Finalized()) ResumePath(); @@ -629,7 +620,6 @@ void SmartAI::MovepointReached(uint32 id) EndPath(); 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 if (me->movespline->Finalized()) 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 - SetRun(mRun); if (HasEscortState(SMART_ESCORT_ESCORTING)) { AddEscortState(SMART_ESCORT_RETURNING); @@ -850,7 +839,6 @@ void SmartAI::AttackStart(Unit* who) { if (!me->HasUnitState(UNIT_STATE_NO_COMBAT_MOVEMENT)) { - SetRun(mRun); MovementGeneratorType type = me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE); if (type == ESCORT_MOTION_TYPE || type == POINT_MOTION_TYPE) { @@ -952,9 +940,7 @@ void SmartAI::OnCharmed(bool /* apply */) if (!charmed && !me->IsInEvadeMode()) { if (mCanRepeatPath) - StartPath(mRun, GetScript()->GetPathId(), true); - else - me->SetWalk(!mRun); + StartPath(FORCED_MOVEMENT_NONE, GetScript()->GetPathId(), true); if (Unit* charmer = me->GetCharmer()) AttackStart(charmer); @@ -1002,12 +988,6 @@ ObjectGuid SmartAI::GetGUID(int32 /*id*/) const return ObjectGuid::Empty; } -void SmartAI::SetRun(bool run) -{ - me->SetWalk(!run); - mRun = run; -} - void SmartAI::SetFly(bool fly) { // xinef: set proper flag! @@ -1108,7 +1088,6 @@ void SmartAI::SetFollow(Unit* target, float dist, float angle, uint32 credit, ui mFollowArrivedEntry = end; mFollowArrivedAlive = !aliveState; // negate - 0 is alive mFollowCreditType = creditType; - SetRun(mRun); me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle); } diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index 48d0eda37..d8ac699dc 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -52,7 +52,7 @@ public: bool IsAIControlled() const; // 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); void PausePath(uint32 delay, bool forced = false); void StopPath(uint32 DespawnTime = 0, uint32 quest = 0, bool fail = false); @@ -175,9 +175,6 @@ public: // Called at movepoint reached void MovepointReached(uint32 id); - // Makes the creature run/walk - void SetRun(bool run = true); - void SetFly(bool fly = true); void SetSwim(bool swim = true); @@ -240,7 +237,6 @@ private: uint32 mEscortNPCFlags; uint32 GetWPCount() { return mWayPoints ? mWayPoints->size() : 0; } bool mCanRepeatPath; - bool mRun; bool mEvadeDisabled; bool mCanAutoAttack; bool mForcedPaused; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 1a64641e9..38febbc9f 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1683,10 +1683,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (IsCreature(target)) { - if (IsSmart(target->ToCreature())) - CAST_AI(SmartAI, target->ToCreature()->AI())->SetRun(e.action.setRun.run); - else - target->ToCreature()->SetWalk(e.action.setRun.run ? false : true); // Xinef: reversed + target->ToCreature()->SetWalk(e.action.setRun.run ? false : true); } } @@ -1731,7 +1728,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!IsSmart()) break; - bool run = e.action.wpStart.run != 0; + ForcedMovement forcedMovement = static_cast(e.action.wpStart.forcedMovement); uint32 entry = e.action.wpStart.pathID; 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); - 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 DespawnTime = e.action.wpStart.despawnTime; @@ -1854,8 +1851,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (TransportBase* trans = me->GetDirectTransport()) trans->CalculatePassengerPosition(dest.x, dest.y, dest.z); - me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, dest.x, dest.y, dest.z, true, isForced, - isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE, e.target.o); + me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, dest.x, dest.y, dest.z, FORCED_MOVEMENT_NONE, + 0.f, e.target.o, true, isForced, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); break; } @@ -1871,9 +1868,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u randomPoint.m_positionX, randomPoint.m_positionY, randomPoint.m_positionZ, - true, - isForced, - isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE + FORCED_MOVEMENT_NONE, + 0.f, 0.f, true, isForced, 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) 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; } @@ -1914,7 +1911,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u SAIBool isForced = !e.action.moveToPosTarget.disableForceDestination; 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) { bool repeat = e.action.startClosestWaypoint.repeat; - bool run = e.action.startClosestWaypoint.run; + ForcedMovement forcedMovement = static_cast(e.action.startClosestWaypoint.forcedMovement); - CAST_AI(SmartAI, creature->AI())->StartPath(repeat, closestWpId, run); + CAST_AI(SmartAI, creature->AI())->StartPath(forcedMovement, closestWpId, repeat); } } } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 59490f556..47c5c9166 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -1564,11 +1564,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); 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.action.startClosestWaypoint.repeat, e.action.startClosestWaypoint.run); + e.action.startClosestWaypoint.repeat, e.action.startClosestWaypoint.forcedMovement); return false; } break; @@ -1745,8 +1745,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; } - return IsSAIBoolValid(e, e.action.wpStart.run) && - IsSAIBoolValid(e, e.action.wpStart.repeat); + if (e.action.wpStart.forcedMovement >= FORCED_MOVEMENT_MAX) + { + 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: { diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 47b0d4796..9e6c15522 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1041,7 +1041,7 @@ struct SmartAction struct { - SAIBool run; + uint32 forcedMovement; uint32 pathID; SAIBool repeat; uint32 quest; @@ -1295,7 +1295,7 @@ struct SmartAction uint32 pathId1; uint32 pathId2; uint32 repeat; - uint32 run; + uint32 forcedMovement; } startClosestWaypoint; struct diff --git a/src/server/game/Entities/Creature/CreatureData.h b/src/server/game/Entities/Creature/CreatureData.h index 4ca6cda4a..be5216698 100644 --- a/src/server/game/Entities/Creature/CreatureData.h +++ b/src/server/game/Entities/Creature/CreatureData.h @@ -99,18 +99,18 @@ enum class CreatureFlightMovementType : uint8 enum class CreatureChaseMovementType : uint8 { - Run, - CanWalk, - AlwaysWalk, + Run = 0, + CanWalk = 1, + AlwaysWalk = 2, Max }; enum class CreatureRandomMovementType : uint8 { - Walk, - CanRun, - AlwaysRun, + Walk = 0, + CanRun = 1, + AlwaysRun = 2, Max }; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 290282510..78c2dddce 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1677,9 +1677,7 @@ public: 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 MonsterMoveWithSpeed(float x, float y, float z, float speed); - //void SetFacing(float ori, WorldObject* obj = nullptr); - //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = nullptr); + void MonsterMoveWithSpeed(float x, float y, float z, float speed); // Not to be used outside of cinematics virtual bool SetWalk(bool enable); virtual bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true); diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 2b2aba6ef..c229abdbc 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -387,6 +387,7 @@ void MotionMaster::MoveBackwards(Unit* target, float dist) Movement::MoveSplineInit init(_owner); init.MoveTo(point.x, point.y, point.z, false); + init.SetWalk(true); init.SetFacing(target); init.SetOrientationInversed(); 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. */ -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)) return; @@ -477,16 +478,16 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generate if (_owner->IsPlayer()) { LOG_DEBUG("movement.motionmaster", "Player ({}) targeted point (Id: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z); - Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, orientation, nullptr, generatePath, forceDestination), slot); + Mutate(new PointMovementGenerator(id, x, y, z, forcedMovement, speed, orientation, nullptr, generatePath, forceDestination), slot); } else { LOG_DEBUG("movement.motionmaster", "Creature ({}) targeted point (ID: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z); - Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, orientation, nullptr, generatePath, forceDestination), slot); + Mutate(new PointMovementGenerator(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 if (_owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE)) @@ -494,15 +495,15 @@ void MotionMaster::MoveSplinePath(Movement::PointsArray* path) if (_owner->IsPlayer()) { - Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); + Mutate(new EscortMovementGenerator(forcedMovement, path), MOTION_SLOT_ACTIVE); } else { - Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); + Mutate(new EscortMovementGenerator(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* 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 - 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.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); if (speed > 0.0f) - { init.SetVelocity(speed); - } if (!skipAnimation) - { init.SetAnimation(Movement::ToFly); - } - init.Launch(); - Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); + + Mutate(new EffectMovementGenerator(init, id), MOTION_SLOT_ACTIVE); } /** @@ -612,8 +609,8 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa init.SetParabolic(max_height, 0); init.SetOrientationFixed(true); 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); if (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); init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), tz + _owner->GetHoverHeight()); 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()) { LOG_DEBUG("movement.motionmaster", "Player ({}) charge point (X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), x, y, z); - Mutate(new PointMovementGenerator(id, x, y, z, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED); + Mutate(new PointMovementGenerator(id, x, y, z, FORCED_MOVEMENT_NONE, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED); } else { LOG_DEBUG("movement.motionmaster", "Creature ({}) charge point (X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), x, y, z); - Mutate(new PointMovementGenerator(id, x, y, z, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED); + Mutate(new PointMovementGenerator(id, x, y, z, FORCED_MOVEMENT_NONE, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED); } } diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 0fcf5abae..bc4cc996b 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -80,6 +80,15 @@ enum RotateDirection ROTATE_DIRECTION_RIGHT }; +enum ForcedMovement +{ + FORCED_MOVEMENT_NONE = 0, + FORCED_MOVEMENT_WALK = 1, + FORCED_MOVEMENT_RUN = 2, + + FORCED_MOVEMENT_MAX +}; + struct ChaseRange { ChaseRange(float range); @@ -210,11 +219,11 @@ public: void MoveForwards(Unit* target, float dist); void MoveConfused(); void MoveFleeing(Unit* enemy, uint32 time = 0); - void MovePoint(uint32 id, const Position& pos, bool generatePath = true, bool forceDestination = true) - { MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath, forceDestination, MOTION_SLOT_ACTIVE, pos.GetOrientation()); } - 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 MoveSplinePath(Movement::PointsArray* path); - void MoveSplinePath(uint32 path_id); + 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, forcedMovement, speed, pos.GetOrientation(), generatePath, forceDestination, MOTION_SLOT_ACTIVE); } + 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, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE); + void MoveSplinePath(uint32 path_id, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE); // 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); diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 6d3d1007c..e650ed63a 100644 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -146,6 +146,7 @@ bool ConfusedMovementGenerator::DoUpdate(T* unit, uint32 diff) float z = i_waypoints[i_nextMove][2]; Movement::MoveSplineInit init(unit); init.MoveTo(x, y, z, true); + init.SetWalk(true); init.Launch(); } } diff --git a/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.cpp index 14133dbe2..3fcfa93d3 100644 --- a/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.cpp @@ -36,6 +36,11 @@ void EscortMovementGenerator::DoInitialize(T* unit) else if (m_precomputedPath.size()) init.MovebyPath(m_precomputedPath); + if (_forcedMovement == FORCED_MOVEMENT_WALK) + init.SetWalk(true); + else if (_forcedMovement == FORCED_MOVEMENT_RUN) + init.SetWalk(false); + init.Launch(); _splineId = unit->movespline->GetId(); @@ -79,6 +84,11 @@ bool EscortMovementGenerator::DoUpdate(T* unit, uint32 /*diff*/) 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(); // Xinef: Override spline Id on recalculate launch _splineId = unit->movespline->GetId(); diff --git a/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.h b/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.h index edb410b8a..7a175ed8f 100644 --- a/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.h @@ -24,7 +24,7 @@ template class EscortMovementGenerator : public MovementGeneratorMedium< T, EscortMovementGenerator > { public: - EscortMovementGenerator(Movement::PointsArray* _path = nullptr) : i_recalculateSpeed(false) + EscortMovementGenerator(ForcedMovement forcedMovement, Movement::PointsArray* _path = nullptr) : i_recalculateSpeed(false), _forcedMovement(forcedMovement) { if (_path) m_precomputedPath = *_path; @@ -46,6 +46,7 @@ private: Movement::PointsArray m_precomputedPath; uint32 _splineId; + ForcedMovement _forcedMovement; }; #endif diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index be1667e5b..60cf4f41e 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -31,8 +31,6 @@ void HomeMovementGenerator::DoFinalize(Creature* owner) owner->ClearUnitState(UNIT_STATE_EVADE); if (arrived) { - // Xinef: npc run by default - //owner->SetWalk(true); owner->LoadCreaturesAddon(true); owner->AI()->JustReachedHome(); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index fdce94248..ab8f85009 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -84,6 +84,11 @@ void PointMovementGenerator::DoInitialize(T* unit) if (speed > 0.0f) 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) { init.SetFacing(i_orientation); @@ -142,6 +147,11 @@ bool PointMovementGenerator::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 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) { init.SetFacing(i_orientation); @@ -228,6 +238,11 @@ bool EffectMovementGenerator::Update(Unit* unit, uint32) return !unit->movespline->Finalized(); } +void EffectMovementGenerator::Initialize(Unit*) +{ + i_spline.Launch(); +} + void EffectMovementGenerator::Finalize(Unit* unit) { if (!unit->IsCreature()) diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index f19e04d42..f9941e9b8 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -20,15 +20,16 @@ #include "Creature.h" #include "MovementGenerator.h" +#include "MoveSplineInit.h" template class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator > { public: - PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f, float orientation = 0.0f, const Movement::PointsArray* _path = nullptr, - bool generatePath = false, bool forceDestination = false, ObjectGuid chargeTargetGUID = ObjectGuid::Empty) - : id(_id), i_x(_x), i_y(_y), i_z(_z), speed(_speed), i_orientation(orientation), _generatePath(generatePath), _forceDestination(forceDestination), - _chargeTargetGUID(chargeTargetGUID) + 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 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), _reverseOrientation(reverseOrientation), + _chargeTargetGUID(chargeTargetGUID), _forcedMovement(forcedMovement), _facingTargetGuid(facingTargetGuid) { if (_path) m_precomputedPath = *_path; @@ -55,14 +56,17 @@ private: Movement::PointsArray m_precomputedPath; bool _generatePath; bool _forceDestination; + bool _reverseOrientation; ObjectGuid _chargeTargetGUID; + ForcedMovement _forcedMovement; + ObjectGuid _facingTargetGuid; }; class AssistanceMovementGenerator : public PointMovementGenerator { public: AssistanceMovementGenerator(float _x, float _y, float _z) : - PointMovementGenerator(0, _x, _y, _z) {} + PointMovementGenerator(0, _x, _y, _z, FORCED_MOVEMENT_NONE) {} MovementGeneratorType GetMovementGeneratorType() { return ASSISTANCE_MOTION_TYPE; } void Finalize(Unit*); @@ -72,14 +76,15 @@ public: class EffectMovementGenerator : public MovementGenerator { public: - explicit EffectMovementGenerator(uint32 Id) : m_Id(Id) {} - void Initialize(Unit*) override {} + explicit EffectMovementGenerator(Movement::MoveSplineInit& spline, uint32 Id) : m_Id(Id), i_spline(spline) {} + void Initialize(Unit*) override; void Finalize(Unit*) override; void Reset(Unit*) override {} bool Update(Unit*, uint32) override; MovementGeneratorType GetMovementGeneratorType() override { return EFFECT_MOTION_TYPE; } private: uint32 m_Id; + Movement::MoveSplineInit i_spline; }; #endif diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 5d904d31a..239117d4a 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -51,7 +51,21 @@ void RandomMovementGenerator::_setRandomLocation(Creature* creature) creature->AddUnitState(UNIT_STATE_ROAMING_MOVE); Movement::MoveSplineInit init(creature); 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(); if (creature->GetFormation() && creature->GetFormation()->GetLeader() == creature) creature->GetFormation()->LeaderMoveTo(_currDestPosition.GetPositionX(), _currDestPosition.GetPositionY(), _currDestPosition.GetPositionZ(), 0); @@ -270,7 +284,6 @@ template<> void RandomMovementGenerator::DoFinalize(Creature* creature) { creature->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE); - creature->SetWalk(false); } template<> diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 4dfc68828..b8ee76d29 100644 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -365,7 +365,6 @@ void ChaseMovementGenerator::DoInitialize(Creature* owner) _lastTargetPosition.reset(); i_recheckDistance.Reset(0); i_leashExtensionTimer.Reset(owner->GetAttackTime(BASE_ATTACK)); - owner->SetWalk(false); owner->AddUnitState(UNIT_STATE_CHASE); } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index be3c0d57f..ce93e485b 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -56,7 +56,6 @@ void WaypointMovementGenerator::DoInitialize(Creature* creature) void WaypointMovementGenerator::DoFinalize(Creature* creature) { creature->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE); - creature->SetWalk(false); } void WaypointMovementGenerator::DoReset(Creature* creature) diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index f09223b75..8f9184da9 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -442,7 +442,7 @@ void Map::ScriptsProcess() 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); - 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 unit->NearTeleportTo(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, unit->GetOrientation()); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp index 4691fb367..d95e3b124 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp @@ -359,7 +359,7 @@ public: case 0: Talk(SAY_TEXT5); HandleGameObject(DATA_ARENA4, false); - Start(false, false); + Start(false); eventTimer = 0; break; case 1: @@ -604,7 +604,7 @@ public: creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false); if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI())) - escortAI->Start(false, false); + escortAI->Start(false); } } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp index 16c7f0db4..45af53d9b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -77,7 +77,9 @@ struct boss_quartermaster_zigris : public BossAI { 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 } } } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp index 0a51970c4..769a43deb 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -430,7 +430,7 @@ public: Talk(SAY_RAG_SUM_2); // Next event will get triggered in MovementInform 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; } case EVENT_RAGNAROS_SUMMON_2: diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 955b26e4c..dcb58c365 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -170,7 +170,7 @@ public: if (m_uiEventId == EVENT_OZ) instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS); - Start(false, false); + Start(false); } void JustEngagedWith(Unit* /*who*/) override { } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 13ebb5664..eebdc7b9f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -980,7 +980,7 @@ public: { carGUID = who->GetVehicleBase()->GetGUID(); InitWaypoint(); - Start(false, false, who->GetGUID()); + Start(false, who->GetGUID()); SetDespawnAtFar(false); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 54a367f8f..60a91416b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -660,14 +660,14 @@ public: { Position pos = LightOfDawnPos[first]; 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; } Position pos = LightOfDawnPos[first]; me->SetHomePosition(pos); 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); break; } @@ -691,7 +691,7 @@ public: { orbaz->SetReactState(REACT_PASSIVE); 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); } @@ -1061,7 +1061,7 @@ public: if (Creature* tirion = GetEntryFromSummons(NPC_HIGHLORD_TIRION_FORDRING)) { 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->SetFaction(FACTION_FRIENDLY); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index bcfc6b6b8..3034bb96e 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -304,7 +304,7 @@ struct npc_madrigosa : public NullCreatureAI if (Creature* brutallus = instance->GetCreature(DATA_BRUTALLUS)) { 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); break; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 241ec277a..29bf02409 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -205,7 +205,7 @@ struct boss_felmyst : public BossAI // Summon Kalecgos (human form of kalecgos fight) 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() @@ -312,9 +312,9 @@ struct boss_felmyst : public BossAI ++_strafeCount; _currentLane = urand(0, 2); if (isRightSide) - me->GetMotionMaster()->MovePoint(POINT_LANE, RightSideLanes[_currentLane], false); + me->GetMotionMaster()->MovePoint(POINT_LANE, RightSideLanes[_currentLane], FORCED_MOVEMENT_NONE, 0.f, false); else - me->GetMotionMaster()->MovePoint(POINT_LANE, LeftSideLanes[_currentLane], false); + me->GetMotionMaster()->MovePoint(POINT_LANE, LeftSideLanes[_currentLane], FORCED_MOVEMENT_NONE, 0.f, false); }, 5s); break; case POINT_LANE: @@ -328,9 +328,9 @@ struct boss_felmyst : public BossAI DoCastSelf(SPELL_FELMYST_SPEED_BURST, true); 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 - 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); break; case POINT_AIR_BREATH_END: @@ -338,9 +338,9 @@ struct boss_felmyst : public BossAI me->m_Events.AddEventAtOffset([&] { 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 - me->GetMotionMaster()->MovePoint(POINT_AIR_UP, LeftSide, false); + me->GetMotionMaster()->MovePoint(POINT_AIR_UP, LeftSide, FORCED_MOVEMENT_NONE, 0.f, false); }, 2s); break; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index d331a9658..f48af4456 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -729,25 +729,18 @@ struct npc_kalecgos_kj : public NullCreatureAI if (summon->GetEntry() == NPC_SHATTERED_SUN_RIFTWAKER) { summon->CastSpell(summon, SPELL_TELEPORT_VISUAL, true); - Movement::MoveSplineInit init(summon); + if (summons.size() == 1) - { - init.MoveTo(1727.08f, 656.82f, 28.37f, false, true); - init.SetFacing(5.14f); - } + summon->GetMotionMaster()->MovePoint(0, 1727.08f, 656.82f, 28.37f, FORCED_MOVEMENT_NONE, 0.f, 5.14f, false, true); else - { - init.MoveTo(1738.84f, 627.32f, 28.26f, false, true); - init.SetFacing(2.0f); - } - init.Launch(); + summon->GetMotionMaster()->MovePoint(0, 1738.84f, 627.32f, 28.26f, FORCED_MOVEMENT_NONE, 0.f, 2.0f, false, true); } else if (summon->GetEntry() == NPC_SHATTRATH_PORTAL_DUMMY) { if (Creature* riftwaker = summon->FindNearestCreature(NPC_SHATTERED_SUN_RIFTWAKER, 10.0f)) riftwaker->CastSpell(summon, SPELL_OPEN_PORTAL_FROM_SHATTRATH, false); 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) 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->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) summon->GetMotionMaster()->MovePoint(0, summon->GetPositionX(), summon->GetPositionY(), 30.0f); diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp index 376e74667..a7162ffc8 100644 --- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp @@ -78,7 +78,7 @@ public: break; case 11: Talk(SAY_PROGRESS_6, player); - SetRun(); + SetRun(true); break; case 19: Talk(SAY_PROGRESS_7, player); @@ -106,7 +106,7 @@ public: if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) { 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); } } diff --git a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp index 45184f838..b92bcb616 100644 --- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp @@ -112,11 +112,11 @@ struct npc_cameron : public ScriptedAI if (Creature* children = ObjectAccessor::GetCreature(*me, _childrenGUIDs[i])) { children->SetWalk(true); - children->GetMotionMaster()->MovePoint(0, MovePosPositions[i], true, MovePosPositions[i].GetOrientation()); + children->GetMotionMaster()->MovePoint(0, MovePosPositions[i]); } } me->SetWalk(true); - me->GetMotionMaster()->MovePoint(0, MovePosPositions.back(), true, MovePosPositions.back().GetOrientation()); + me->GetMotionMaster()->MovePoint(0, MovePosPositions.back()); } void PathEndReached(uint32 pathId) override diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index da2cb493e..09eaaed42 100644 --- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -113,7 +113,7 @@ struct npc_ranger_lilatha : public npc_escortAI if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) { me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); - npc_escortAI::Start(true, false, player->GetGUID()); + npc_escortAI::Start(true, player->GetGUID()); } } }; diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index 4659c2b79..dc1326932 100644 --- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -132,7 +132,7 @@ public: if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) go->UseDoorOrButton(); - npc_escortAI::Start(false, false, player->GetGUID(), quest); + npc_escortAI::Start(false, player->GetGUID(), quest); } } @@ -156,7 +156,7 @@ public: case 17: Talk(SAY_RIN_COMPLETE, player); player->GroupEventHappens(QUEST_RINJI_TRAPPED, me); - SetRun(); + SetRun(true); postEventCount = 1; break; } diff --git a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp index bbf103752..b0783d371 100644 --- a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp @@ -61,7 +61,7 @@ public: if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION) { Talk(SAY_CORPORAL_1, player); - npc_escortAI::Start(true, false, player->GetGUID(), quest); + npc_escortAI::Start(true, player->GetGUID(), quest); me->SetImmuneToNPC(false); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); } diff --git a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp index 27abbc0b7..12f120398 100644 --- a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp @@ -111,7 +111,7 @@ public: creature->AI()->Talk(SAY_QUESTACCEPT, player); 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; diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp index cbf88ba9a..d8203ed9f 100644 --- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp @@ -406,7 +406,7 @@ public: { 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); } } @@ -448,7 +448,7 @@ public: { 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); } return true; diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 6931fa59c..ad627959f 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -142,7 +142,7 @@ public: { summoned->SetDisableGravity(true); 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); } } @@ -270,8 +270,7 @@ public: if (EventMoveTimer <= diff) { 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->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); + 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)); EventMove = false; } else EventMoveTimer -= diff; @@ -917,7 +916,8 @@ public: 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)) ai->jainaGUID = jaina->GetGUID(); else @@ -1218,27 +1218,27 @@ public: { 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)) - 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; 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)) - 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; 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)) - 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; 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)) - 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; 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)) - 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; 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)) - 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; } } @@ -1246,7 +1246,7 @@ public: case 5: 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)) - 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; case 6: 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; case 22: Talk(WRYNN_SAY_SEWERS_4); - SetRun(false); + me->SetWalk(true); if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) { jaina->GetMotionMaster()->Clear(); @@ -1665,7 +1665,7 @@ public: JumpToNextStep(3 * IN_MILLISECONDS); break; case 31: - SetRun(true); + me->SetWalk(false); if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) jaina->GetMotionMaster()->MoveFollow(me, 1, 0); SetEscortPaused(false); @@ -1727,7 +1727,7 @@ public: if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) { 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); break; @@ -1789,7 +1789,7 @@ public: break; case 54: Talk(WRYNN_SAY_APO_7); - SetRun(false); + me->SetWalk(true); JumpToNextStep(4 * IN_MILLISECONDS); break; case 55: @@ -1845,7 +1845,7 @@ public: JumpToNextStep(1.5 * IN_MILLISECONDS); break; case 65: - SetRun(true); + me->SetWalk(false); SetEscortPaused(false); JumpToNextStep(0.25 * IN_MILLISECONDS); break; @@ -2236,7 +2236,8 @@ public: if (Creature* sylvannas = GetClosestCreatureWithEntry(creature, NPC_SYLVANAS, 50.0f)) { 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->SetDespawnAtFar(false); } @@ -2477,7 +2478,7 @@ public: for (std::list::iterator itr = ThroneList.begin(); itr != ThroneList.end(); itr++) (*itr)->DespawnOrUnsummon(); SetEscortPaused(false); - SetRun(false); + me->SetWalk(true); break; } default: @@ -2972,7 +2973,7 @@ public: SetEscortPaused(false); bStepping = false; JumpToNextStep(0); - SetRun(true); + me->SetWalk(false); if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID)) { sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 100, false); @@ -3005,7 +3006,7 @@ public: for (std::list::iterator itr = PlagueList.begin(); itr != PlagueList.end(); itr++) (*itr)->DespawnOrUnsummon(); SetEscortPaused(false); - SetRun(false); + me->SetWalk(true); if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID)) sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 1000, false); JumpToNextStep(3 * IN_MILLISECONDS); @@ -3077,7 +3078,7 @@ public: FollowThrall(); SetEscortPaused(false); bStepping = false; - SetRun(true); + me->SetWalk(false); Talk(THRALL_SAY_COURTYARD_4); UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H, 0); UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 1); @@ -3182,7 +3183,7 @@ public: SpawnWave(6); SetEscortPaused(false); bStepping = false; - SetRun(false); + me->SetWalk(true); JumpToNextStep(0 * IN_MILLISECONDS); break; } @@ -3226,7 +3227,7 @@ public: FollowThrall(); SetEscortPaused(false); bStepping = false; - SetRun(false); + me->SetWalk(true); JumpToNextStep(0 * IN_MILLISECONDS); break; // Top of Undercity Discussion @@ -3266,7 +3267,7 @@ public: FollowThrall(); SetEscortPaused(false); bStepping = false; - SetRun(false); + me->SetWalk(true); JumpToNextStep(0 * IN_MILLISECONDS); break; case 63: @@ -3284,7 +3285,7 @@ public: FollowThrall(); SetEscortPaused(false); bStepping = false; - SetRun(false); + me->SetWalk(true); JumpToNextStep(0 * IN_MILLISECONDS); break; case 67: @@ -3299,7 +3300,7 @@ public: FollowThrall(); SetEscortPaused(false); bStepping = false; - SetRun(false); + me->SetWalk(true); JumpToNextStep(0 * IN_MILLISECONDS); break; // KHANOK - Valimathtas Intro @@ -3475,7 +3476,7 @@ public: FollowThrall(); SetEscortPaused(false); bStepping = false; - SetRun(false); + me->SetWalk(true); JumpToNextStep(0 * IN_MILLISECONDS); break; case 109: @@ -3491,7 +3492,7 @@ public: FollowThrall(); SetEscortPaused(false); bStepping = false; - SetRun(true); + me->SetWalk(false); JumpToNextStep(0 * IN_MILLISECONDS); break; case 112: @@ -3662,7 +3663,7 @@ public: case 143: 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); } JumpToNextStep(10 * IN_MILLISECONDS); @@ -3706,7 +3707,7 @@ public: wrynn->SetImmuneToAll(true); wrynn->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); 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)) { @@ -3807,7 +3808,7 @@ public: { SaurfangGUID = saurfang->GetGUID(); 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); break; diff --git a/src/server/scripts/EasternKingdoms/zone_westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp index 6d54a0cc2..fe7125376 100644 --- a/src/server/scripts/EasternKingdoms/zone_westfall.cpp +++ b/src/server/scripts/EasternKingdoms/zone_westfall.cpp @@ -56,9 +56,9 @@ public: if (quest->GetQuestId() == QUEST_TOME_VALOR) { creature->AI()->Talk(SAY_DS_START); - + creature->SetWalk(false); 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; diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index 911841181..97efd21c6 100644 --- a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp @@ -62,7 +62,7 @@ public: case 2: if (me->HasStealthAura()) me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); - SetRun(); + me->SetWalk(false); me->SetFaction(FACTION_ENEMY); break; } @@ -109,7 +109,7 @@ public: me->GetThreatMgr().ClearAllThreat(); me->CombatStop(true); - SetRun(false); + me->SetWalk(true); } } } @@ -138,7 +138,7 @@ public: 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())) - pEscortAI->Start(false, false, player->GetGUID(), quest); + pEscortAI->Start(false, player->GetGUID(), quest); } return false; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index f3a825a37..cd5818bfe 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -678,19 +678,19 @@ public: 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)) { - 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()); me->SetTarget(uther->GetGUID()); } for (int i = 0; i < 3; ++i) 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); break; case EVENT_ACTION_PHASE1+1: // Start Event - Start(true, false); + Start(true); SetDespawnAtEnd(false); SetDespawnAtFar(false); @@ -782,7 +782,7 @@ public: { Creature* summon = ObjectAccessor::GetCreature(*me, *i); 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); @@ -792,7 +792,7 @@ public: { uther->SetTarget(); 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); break; @@ -801,7 +801,7 @@ public: { jaina->SetTarget(); 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); ScheduleNextEvent(currentEvent, 2s); @@ -819,7 +819,7 @@ public: if (Creature* jaina = GetEventNpc(NPC_JAINA)) { 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); ScheduleNextEvent(currentEvent, 4s); @@ -1242,7 +1242,8 @@ void npc_arthas::npc_arthasAI::JustEngagedWith(Unit* /*who*/) void npc_arthas::npc_arthasAI::ReorderInstance(uint32 data) { - Start(true, true); + me->SetWalk(false); + Start(true); SetEscortPaused(true); SetDespawnAtEnd(false); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index 9cca30b58..141fe70d8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -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); break; case EVENT_START_WP: - Start(true, true); + me->SetWalk(false); + Start(true); SetDespawnAtEnd(false); break; case EVENT_SET_FACING: @@ -809,7 +810,7 @@ public: if (Creature* epoch = summons.GetCreatureWithEntry(NPC_EPOCH_HUNTER)) { epoch->SetImmuneToAll(false); - epoch->GetMotionMaster()->MovePoint(0, *me, false, true); + epoch->GetMotionMaster()->MovePoint(0, *me, FORCED_MOVEMENT_NONE, 0.f, false, true); } break; case EVENT_THRALL_FACE_TARETHA: @@ -922,7 +923,8 @@ public: void ReorderInstance(uint32 data) { - Start(true, true); + me->SetWalk(false); + Start(true); SetEscortPaused(true); SetDespawnAtEnd(false); @@ -1008,7 +1010,8 @@ public: { me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveAllAuras(); - Start(false, true); + me->SetWalk(false); + Start(false); } void WaypointReached(uint32 waypointId) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 72895bb9f..e0114b616 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -118,7 +118,7 @@ struct npc_medivh_bm : public ScriptedAI summon->CastSpell(summon, SPELL_BLACK_CRYSTAL, true); Movement::MoveSplineInit init(summon); init.MovebyPath(_groundArray); - init.SetCyclic(); + init.SetCyclic(); // TODO: Add support for cyclic paths in motion master init.Launch(); } } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index 319bb5e2a..21e505b3d 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -209,7 +209,8 @@ struct npc_general_andorov : public npc_escortAI _initialAttackTimer = 5 * IN_MILLISECONDS; _paused = false; - Start(false, true); + me->SetWalk(false); + Start(false); me->SetImmuneToNPC(true); me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp index e7131c5fd..c4d2c80a6 100644 --- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp +++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp @@ -121,7 +121,7 @@ public: { Talk(SAY_MUG_START1); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); - npc_escortAI::Start(true, false, player->GetGUID()); + npc_escortAI::Start(true, player->GetGUID()); } } diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index 7069cd381..b2f46e194 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -289,7 +289,7 @@ public: case EVENT_START_ESCORT: 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); break; diff --git a/src/server/scripts/Kalimdor/zone_darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp index f0b5791e7..02b0ae885 100644 --- a/src/server/scripts/Kalimdor/zone_darkshore.cpp +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp @@ -397,7 +397,7 @@ public: if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) { 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); } diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp index 782e25034..c6a6ecd93 100644 --- a/src/server/scripts/Kalimdor/zone_desolace.cpp +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp @@ -396,7 +396,8 @@ public: case EVENT_RESTART_ESCORT: CheckCaravan(); SetDespawnAtEnd(false); - Start(true, true, ObjectGuid::Empty, 0, false, false, true); + SetRun(true); + Start(true, ObjectGuid::Empty, 0, false, false, true); break; } diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index 2bf790318..8ef469fe1 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -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]); } PlayerGUID = player->GetGUID(); - Start(true, false, PlayerGUID); + Start(true, PlayerGUID); } return; } diff --git a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp index 6f8323126..e84655243 100644 --- a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp @@ -137,7 +137,7 @@ public: if (quest->GetQuestId() == QUEST_PROTECT_KAYA) { 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->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 88c7eb7e4..bf080107b 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -260,7 +260,7 @@ public: float Radius = 10.0f; if (me->IsWithinDistInMap(who, Radius)) { - Start(false, false, who->GetGUID()); + Start(false, who->GetGUID()); } } } diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 7cd22ac07..984180386 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -55,7 +55,7 @@ public: creature->AI()->Talk(SAY_GIL_START, player); 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; } @@ -528,7 +528,7 @@ public: break; case 18: Talk(SAY_PROGRESS_1, player); - SetRun(); + SetRun(true); break; } } @@ -594,7 +594,7 @@ public: creature->SetFaction(FACTION_RATCHET); creature->AI()->Talk(SAY_START); 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; } diff --git a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp index 2a80cd90e..5a3de8eda 100644 --- a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp @@ -66,7 +66,7 @@ public: creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed 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; } @@ -148,7 +148,7 @@ public: creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); // guessed 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; } diff --git a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp index 131baf868..4ccf3b6b3 100644 --- a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp @@ -48,7 +48,7 @@ public: { 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->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); // Change faction so mobs attack diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index e3a14d203..4339da183 100644 --- a/src/server/scripts/Kalimdor/zone_winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -286,7 +286,7 @@ public: creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); if (npc_ranshallaAI* escortAI = dynamic_cast(creature->AI())) - escortAI->Start(false, false, player->GetGUID(), quest); + escortAI->Start(false, player->GetGUID(), quest); return true; } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 4aa00764c..8f66ac8ce 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -258,7 +258,7 @@ public: { 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()); } summons.Summon(summon); diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp index 574db0338..d342ea786 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp @@ -173,7 +173,7 @@ struct boss_jedoga_shadowseeker : public BossAI me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); me->SetDisableGravity(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(); events.SetPhase(PHASE_NORMAL); @@ -247,7 +247,7 @@ struct boss_jedoga_shadowseeker : public BossAI DespawnOOCSummons(); DoCastSelf(SPELL_HOVER_FALL); 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) { @@ -397,7 +397,7 @@ struct boss_jedoga_shadowseeker : public BossAI volunteerWork = false; me->GetMotionMaster()->Clear(); 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; @@ -504,7 +504,7 @@ struct boss_jedoga_shadowseeker : public BossAI summons.DespawnEntry(NPC_JEDOGA_CONTROLLER); DoCastSelf(SPELL_HOVER_FALL); 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; } case EVENT_JEDGA_START_RITUAL: @@ -663,7 +663,7 @@ struct npc_twilight_volunteer : public ScriptedAI me->GetMotionMaster()->Clear(); me->SetHomePosition(JedogaPosition[2]); 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)) { diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp index f55d5f49a..1707433e6 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -210,7 +210,8 @@ public: { _lavaGoutCount = 0; AddWaypoints(); - Start(true, true); + me->SetWalk(false); + Start(true); } void JustEngagedWith(Unit* /*who*/) override diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 26a0cf54d..7b6aa9e8f 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -144,7 +144,7 @@ public: me->SetReactState(REACT_PASSIVE); me->AttackStop(); 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.DelayEvents(15s); events.ScheduleEvent(EVENT_AIR_MOVEMENT, 2s); @@ -163,10 +163,10 @@ public: events.ScheduleEvent(EVENT_FLAME_BREATH, 20s, 30s); break; 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; 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; case EVENT_LAND_GROUND: me->SetReactState(REACT_AGGRESSIVE); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index 2386bdd34..3aea12fb0 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -607,7 +607,8 @@ public: break; } - Start(false, true); + me->SetWalk(false); + Start(false); uiWaypoint = uiType; } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index aa99e4da4..497b0c42d 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -339,7 +339,8 @@ public: void Reset() override { - Start(false, true, ObjectGuid::Empty, nullptr); + me->SetWalk(false); + Start(false, ObjectGuid::Empty, nullptr); SetDespawnAtEnd(true); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetImmuneToAll(true); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 6f1a3620f..7262a5528 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -549,7 +549,8 @@ public: return; } - Start(false, true); + me->SetWalk(false); + Start(false); } void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index f3ba31fc2..db638f0a0 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -571,7 +571,7 @@ public: pInstance->HandleGameObject(pInstance->GetGuidData(GO_ARTHAS_DOOR), 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))) { 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); break; @@ -709,7 +709,7 @@ public: case EVENT_INTRO_LK_5_2: 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; @@ -763,11 +763,11 @@ public: { Talk(SAY_SYLVANAS_INTRO_END); 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))) { - 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); break; @@ -775,7 +775,7 @@ public: case EVENT_INTRO_LK_10: 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); @@ -784,7 +784,7 @@ public: case EVENT_INTRO_LK_11: 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); break; @@ -796,7 +796,7 @@ public: } 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); break; diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index bebf2da81..805f21e46 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -674,14 +674,14 @@ public: switch (events.ExecuteEvent()) { case 1: - me->GetMotionMaster()->MovePoint(2, PTSTyrannusWaitPos1, false); + me->GetMotionMaster()->MovePoint(2, PTSTyrannusWaitPos1, FORCED_MOVEMENT_NONE, 0.f, false); break; case 2: me->SetFacingTo(PTSTyrannusWaitPos1.GetOrientation()); me->setActive(false); break; case 3: - me->GetMotionMaster()->MovePoint(3, PTSTyrannusWaitPos2, false); + me->GetMotionMaster()->MovePoint(3, PTSTyrannusWaitPos2, FORCED_MOVEMENT_NONE, 0.f, false); break; case 4: 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); break; case 6: - me->GetMotionMaster()->MovePoint(4, PTSTyrannusWaitPos3, false); + me->GetMotionMaster()->MovePoint(4, PTSTyrannusWaitPos3, FORCED_MOVEMENT_NONE, 0.f, false); break; case 30: { @@ -1355,7 +1355,7 @@ public: } } 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; } diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index ef11e32a6..17d923c5e 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -58,7 +58,7 @@ public: void InitializeAI() override { 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->SetReactState(REACT_PASSIVE); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index b6915138c..fdf316579 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -583,7 +583,7 @@ public: { me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); 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::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); @@ -845,7 +845,7 @@ public: { me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); 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::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index fd4f2208d..3eda17921 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -503,7 +503,7 @@ public: float x, y, z, o; _dest.GetPosition(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; } @@ -915,7 +915,7 @@ public: { float 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 @@ -1072,7 +1072,7 @@ public: { float 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; 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 @@ -1411,7 +1411,7 @@ public: { float 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->GetTransport()->CalculatePassengerPosition(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); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 5a88d28a4..0b04ad795 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -2565,7 +2565,7 @@ public: me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); me->SetCanFly(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->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); break; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index cac4c599f..34069295d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -934,7 +934,8 @@ public: case EVENT_START_PATHING: me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->SetImmuneToAll(false); - Start(true, true); + me->SetWalk(false); + Start(true); break; case EVENT_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))) { 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); } } diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index 894ee5960..002566c6e 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -745,7 +745,7 @@ public: if (Creature* cr = me->SummonCreature(NPC_LIVING_POISON, entry.Start, TEMPSUMMON_TIMED_DESPAWN, entry.DespawnTime)) { 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); diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 3ac5974b5..2b49ebf29 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -521,7 +521,7 @@ public: } //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.SetFacing(pPlayer->GetOrientation()); init.SetTransportExit(); @@ -898,9 +898,9 @@ public: { Player* plr = pass->ToPlayer(); 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->SetDisableGravity(false, true); plr->SetGuidValue(PLAYER_FARSIGHT, ObjectGuid::Empty); sScriptMgr->AnticheatSetCanFlybyServer(plr, false); @@ -998,7 +998,7 @@ public: MoveTimer = 0; me->GetMotionMaster()->MoveIdle(); 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; } } @@ -1013,8 +1013,7 @@ public: MoveTimer = 0; me->GetMotionMaster()->MoveIdle(); me->DisableSpline(); - me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), 100.0f); - me->SetPosition(me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), me->GetOrientation()); + me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), FORCED_MOVEMENT_NONE, 100.0f); me->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); me->RemoveAura(SPELL_POWER_SPARK_VISUAL); me->CastSpell(me, SPELL_POWER_SPARK_GROUND_BUFF, true); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index f4d8c5719..7f4a5e038 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -138,7 +138,7 @@ public: AddWaypoint(13, 1281.2f, -26.8f, 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; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp index 51cd73619..809245c98 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp @@ -391,7 +391,8 @@ public: switch (action) { 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); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetReactState(REACT_AGGRESSIVE); @@ -456,7 +457,8 @@ public: door->SetGoState(GO_STATE_READY); break; 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); SetEscortPaused(false); me->RemoveAura(58506); @@ -571,7 +573,7 @@ public: if (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) { diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index 29eb6cb58..88b114633 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -805,7 +805,7 @@ public: case EVENT_LIGHTNING_LAND: { 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); break; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index a0a17863e..07e1ac92f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -381,8 +381,7 @@ public: { me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); TurnGates(true, false); - me->MonsterMoveWithSpeed(homePos.GetPositionX(), homePos.GetPositionY(), homePos.GetPositionZ(), 100.0f); - me->UpdatePosition(homePos); + me->GetMotionMaster()->MovePoint(0, homePos.GetPositionX(), homePos.GetPositionY(), homePos.GetPositionZ(), FORCED_MOVEMENT_NONE, 100.0f); _speakTimer = 60000; } else if (_speakTimer > 63500) @@ -1090,7 +1089,7 @@ public: { summons.DespawnAll(); _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)) { aur->SetMaxDuration(-1); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 7a157ba5a..d7ba40cde 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -601,7 +601,7 @@ public: { me->EnterVehicle(VX001, 4); 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); events.ScheduleEvent(EVENT_SAY_VX001_DEAD, 2s); break; @@ -1681,8 +1681,7 @@ public: me->InterruptNonMeleeSpells(false); me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE); - me->MonsterMoveWithSpeed(2744.65f, 2569.46f, 381.34f, me->GetDistance(2744.65f, 2569.46f, 381.34f)); - me->UpdatePosition(2744.65f, 2569.46f, 381.34f, M_PI, false); + me->GetMotionMaster()->MovePoint(0, 2744.65f, 2569.46f, 381.34f); if (Creature* c = GetMimiron()) c->AI()->SetData(0, 3); @@ -1740,8 +1739,7 @@ public: } float speed = me->GetExactDist(x, y, 381.34f); - me->MonsterMoveWithSpeed(x, y, 381.34f, speed); - me->UpdatePosition(x, y, 381.34f, me->GetAngle(victim), false); + me->GetMotionMaster()->MovePoint(0, x, y, 381.34f, FORCED_MOVEMENT_NONE, speed); if (mc) { mc->AI()->SetData(0, 0); @@ -1793,14 +1791,12 @@ public: case EVENT_MAGNETIC_CORE_PULL_DOWN: me->CastSpell(me, SPELL_MAGNETIC_CORE, true); me->CastSpell(me, SPELL_SPINNING, true); - me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 365.34f, me->GetExactDist(me->GetPositionX(), me->GetPositionY(), 365.34f)); - me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), 365.34f, me->GetOrientation(), false); + me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), 365.34f, FORCED_MOVEMENT_NONE, me->GetExactDist(me->GetPositionX(), me->GetPositionY(), 365.34f)); events.ScheduleEvent(EVENT_MAGNETIC_CORE_FREE, 20s); break; case EVENT_MAGNETIC_CORE_FREE: me->RemoveAura(SPELL_SPINNING); - me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 381.34f, me->GetDistance(me->GetPositionX(), me->GetPositionY(), 381.34f)); - me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), 381.34f, me->GetOrientation(), false); + me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), 381.34f, FORCED_MOVEMENT_NONE, me->GetDistance(me->GetPositionX(), me->GetPositionY(), 381.34f)); events.ScheduleEvent(EVENT_MAGNETIC_CORE_REMOVE_IMMOBILIZE, 1s); break; case EVENT_MAGNETIC_CORE_REMOVE_IMMOBILIZE: @@ -1960,7 +1956,7 @@ public: 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 diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 8d9dae387..1b3377350 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -683,7 +683,7 @@ public: { razorscale->AI()->AttackStart(player); 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); } } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index 88fa0c12e..006798aeb 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -934,7 +934,8 @@ public: { InitWaypoint(); Reset(); - Start(false, true); + me->SetWalk(false); + Start(false); } uint32 Timer; @@ -1020,7 +1021,8 @@ public: { InitWaypoint(); Reset(); - Start(false, true); + me->SetWalk(false); + Start(false); SetDespawnAtEnd(false); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index a944101a1..c26a9ff05 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -937,7 +937,8 @@ public: { InitWaypoint(); Reset(); - Start(false, true, ObjectGuid::Empty, nullptr, false, true); + me->SetWalk(false); + Start(false, ObjectGuid::Empty, nullptr, false, true); } uint32 _checkTimer; diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 12165fbac..3489764e9 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -372,7 +372,8 @@ struct violet_hold_trashAI : public npc_escortAI break; } SetDespawnAtEnd(false); - Start(true, true); + me->SetWalk(false); + Start(true); } npc_escortAI::UpdateAI(diff); @@ -1111,7 +1112,8 @@ public: break; } SetDespawnAtEnd(false); - Start(true, true); + me->SetWalk(false); + Start(true); } if (bOpening) diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index eefd5f448..21f81d4ef 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -464,7 +464,7 @@ public: go->UseDoorOrButton(); 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); return true; @@ -914,7 +914,7 @@ public: creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); creature->SetStandState(UNIT_STAND_STATE_STAND); 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; } @@ -995,7 +995,8 @@ public: { creature->SetStandState(UNIT_STAND_STATE_STAND); 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; } @@ -1884,7 +1885,7 @@ public: if (Creature* leryssa = ObjectAccessor::GetCreature(*me, _leryssaGUID)) { 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); break; diff --git a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp index 1fb9ff67b..ac3aa4ef2 100644 --- a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp +++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp @@ -117,7 +117,7 @@ struct npc_preparations_for_war_vehicle : public NullCreatureAI } } 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; } } diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index d34530709..e561a8e07 100644 --- a/src/server/scripts/Northrend/zone_dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp @@ -592,7 +592,7 @@ struct npc_minigob_manabonk : public ScriptedAI case EVENT_MOVE: { 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, 4s); diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index c6354f6d3..50c4518be 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -207,7 +207,7 @@ public: Mrfloppy->GetMotionMaster()->MoveFollow(creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); 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; } diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index ddcd03de7..fcd725290 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -191,7 +191,7 @@ public: if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE) { 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; } @@ -309,7 +309,7 @@ public: return; me->SetWalk(true); - Start(false, false, summonerGUID); + Start(false, summonerGUID); } void WaypointReached(uint32 waypointId) override diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index fce6523ee..3a23551cf 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -523,11 +523,8 @@ public: { soul->SetCanFly(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->GetMotionMaster()->MovePoint(0, soul->GetPositionX(), soul->GetPositionY(), soul->GetPositionZ() + 5.0f, FORCED_MOVEMENT_NONE, 1.f); } events.ScheduleEvent(EVENT_SCENE_1, 6s); break; @@ -718,7 +715,7 @@ public: Talk(0); events.Reset(); summons.DespawnAll(); - Start(false, false); + Start(false); int8 i = -1; std::list cList; diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 100a90a86..07bdfc2e9 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -605,7 +605,7 @@ public: creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); - pEscortAI->Start(false, false, player->GetGUID()); + pEscortAI->Start(false, player->GetGUID()); creature->AI()->Talk(SAY_WP_1); } } diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 16bfe5925..b61003bca 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -57,7 +57,8 @@ struct npc_frosthound : public npc_escortAI { me->SetFaction(who->GetFaction()); 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); } } @@ -246,7 +247,8 @@ public: void RollPath() { 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); me->UpdateEntry(roll_chance_i(25) ? NPC_TIME_LOST_PROTO_DRAKE : NPC_VYRAGOSA, 0, false); } @@ -912,7 +914,10 @@ public: if (who->IsPlayer()) { if (apply) - Start(false, true, who->GetGUID()); + { + me->SetWalk(false); + Start(false, who->GetGUID()); + } } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 93ae31450..c774c1a5e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -507,7 +507,7 @@ struct boss_illidan_stormrage : public BossAI Talk(SAY_ILLIDAN_EYE_BLAST); me->SummonCreature(NPC_ILLIDAN_DB_TARGET, eyeBeamPos[beamPosId], TEMPSUMMON_TIMED_DESPAWN, 30000); 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 me->m_Events.AddEventAtOffset([&] { @@ -515,7 +515,7 @@ struct boss_illidan_stormrage : public BossAI me->InterruptNonMeleeSpells(false); me->SetControlled(false, UNIT_STATE_ROOT); 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); }); // Check for Phase Transition diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index 70e52726a..7b2d93442 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -301,7 +301,7 @@ public: Talk(SUFF_SAY_RECAP); me->SetReactState(REACT_PASSIVE); 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(); } } @@ -408,7 +408,7 @@ public: Talk(DESI_SAY_RECAP); me->SetReactState(REACT_PASSIVE); 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(); } } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index a9cd28a60..319e588f7 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -139,7 +139,7 @@ struct boss_fathomlord_karathress : public BossAI if (Creature* olum = instance->GetCreature(DATA_SEER_OLUM)) { 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_QUESTGIVER); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index d631825a7..da30b3d03 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -93,7 +93,7 @@ struct boss_lady_vashj : public BossAI scheduler.CancelAll(); me->CastStop(); 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); }); } diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index b95e01b3e..864d18a9a 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -102,7 +102,7 @@ struct boss_vazruden_the_herald : public BossAI if (summon->GetEntry() == NPC_HELLFIRE_SENTRY && summons.size() == 0) { 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(); } else if (summons.size() == 0) @@ -163,7 +163,7 @@ struct boss_nazan : public ScriptedAI _scheduler.CancelAll(); _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); context.Repeat(30s); }).Schedule(5s, GROUP_PHASE_1, [this](TaskContext context) @@ -193,7 +193,7 @@ struct boss_nazan : public ScriptedAI Talk(EMOTE_NAZAN); me->SetReactState(REACT_PASSIVE); 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); } } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index dab0d0590..5d0ace11b 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -140,7 +140,7 @@ struct boss_alar : public BossAI _noQuillTimes = 0; _platformRoll = RAND(0, 1); _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; } else @@ -150,7 +150,7 @@ struct boss_alar : public BossAI me->SetOrientation(alarPoints[_platform].GetOrientation()); 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; _platformMoveRepeatTimer = 30s; } @@ -258,7 +258,7 @@ struct boss_alar : public BossAI }, 30s); 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); }, 57s); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index c12b5af84..0a1e1d064 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -655,7 +655,7 @@ struct boss_kaelthas : public BossAI me->AttackStop(); me->CastStop(); 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, [&] diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 66a12acc6..9438aa808 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -171,7 +171,7 @@ public: npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature) { if (creature->GetOwner() && creature->GetOwner()->IsPlayer()) - Start(false, false, creature->GetOwner()->GetGUID()); + Start(false, creature->GetOwner()->GetGUID()); creature->SetSpeed(MOVE_WALK, 1.5f); DoCast(SPELL_GUIDED_BY_THE_SPIRITS); Reset(); @@ -209,7 +209,7 @@ public: { ryga->SetWalk(true); 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(); } } @@ -234,7 +234,7 @@ public: ryga->SetStandState(UNIT_STAND_STATE_STAND); ryga->SetWalk(true); 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(); } } @@ -312,7 +312,7 @@ public: { me->SetReactState(REACT_AGGRESSIVE); me->SetFaction(FACTION_ESCORTEE_H_PASSIVE); - npc_escortAI::Start(true, false, player->GetGUID()); + npc_escortAI::Start(true, player->GetGUID()); } } diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 863ed3eb2..87051cbc5 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -65,7 +65,7 @@ public: { creature->SetStandState(UNIT_STAND_STATE_STAND); 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->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()) player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me); - SetRun(); + SetRun(true); break; } } @@ -306,7 +306,7 @@ public: void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override { me->SetStandState(UNIT_STAND_STATE_STAND); - Start(true, false, guid); + Start(true, guid); 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); @@ -361,7 +361,7 @@ public: if (Player* player = GetPlayerForEscort()) player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me); - SetRun(); + SetRun(true); break; } } diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 71cb5064b..d53cf6c33 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -103,7 +103,8 @@ public: { if (type == DATA_START_ENCOUNTER) { - Start(true, true, playerGUID); + me->SetWalk(false); + Start(true, playerGUID); SetEscortPaused(true); started = true; @@ -605,7 +606,7 @@ public: creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); 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; } @@ -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())) { creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); - pEscortAI->Start(false, false, player->GetGUID()); + pEscortAI->Start(false, player->GetGUID()); } } return true; diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index 41acc4612..fe7d81d4e 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -617,7 +617,7 @@ public: { case EVENT_WALK_TO_MUTTON: me->SetWalk(true); - me->GetMotionMaster()->MovePoint(1, x, y, z, true); + me->GetMotionMaster()->MovePoint(1, x, y, z); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER); break; diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index 29382d6ae..045e4cfb7 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -246,7 +246,7 @@ public: Player* player = summoner->ToPlayer(); if (player && player->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) - Start(false, false, summoner->GetGUID()); + Start(false, summoner->GetGUID()); } void Reset() override { } diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index d44d7f506..ba19c737e 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -473,7 +473,7 @@ public: { if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) { - CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); + CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID()); creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); } return true; diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 6e7e5a578..af5e033a2 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1421,7 +1421,8 @@ public: break; } - Start(false, true); + me->SetWalk(true); + Start(false); } else EnterEvadeMode(); //something went wrong