diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2018-04-23 20:33:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-23 20:33:14 +0200 |
| commit | 2a45418032233bc8779cdb44f9be6057c4b417c5 (patch) | |
| tree | 69e950abd81d8151512570df98354f5506950501 /src/server/scripts/Northrend | |
| parent | beb333738db0d493bf95994eb5557e174e5dd3a6 (diff) | |
Core/Movement: move MoveSplineInit (#21857)
The number of edge cases in which weirdness is seen on "effect movements" will be kinda reduced, plus consistency, plus movementInform on custom movement spline initalizations.
Diffstat (limited to 'src/server/scripts/Northrend')
6 files changed, 12 insertions, 26 deletions
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 482cf1cdd04..60b3c43a970 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -473,12 +473,10 @@ public: if (!_owner->IsAlive()) return true; - _owner->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, *_owner, false); - Movement::MoveSplineInit init(_owner); init.DisableTransportPathTransformations(); init.MoveTo(_dest.GetPositionX(), _dest.GetPositionY(), _dest.GetPositionZ(), false); - init.Launch(); + _owner->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_CHARGE_PREPATH, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE); return true; } @@ -569,12 +567,10 @@ struct gunship_npc_AI : public ScriptedAI me->GetTransport()->CalculatePassengerPosition(hx, hy, hz, &ho); me->SetHomePosition(hx, hy, hz, ho); - me->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, Slot->TargetPosition, false); - Movement::MoveSplineInit init(me); init.DisableTransportPathTransformations(); init.MoveTo(x, y, z, false); - init.Launch(); + me->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_CHARGE_PREPATH, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE); } } @@ -943,16 +939,11 @@ class npc_high_overlord_saurfang_igb : public CreatureScript } else if (action == ACTION_EXIT_SHIP) { - Position pos; - pos.Relocate(SaurfangExitPath[SaurfangExitPathSize - 1].x, SaurfangExitPath[SaurfangExitPathSize - 1].y, SaurfangExitPath[SaurfangExitPathSize - 1].z); - me->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, pos, false); - Movement::PointsArray path(SaurfangExitPath, SaurfangExitPath + SaurfangExitPathSize); - Movement::MoveSplineInit init(me); init.DisableTransportPathTransformations(); init.MovebyPath(path, 0); - init.Launch(); + me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE); me->DespawnOrUnsummon(18000); } @@ -1212,16 +1203,11 @@ class npc_muradin_bronzebeard_igb : public CreatureScript } else if (action == ACTION_EXIT_SHIP) { - Position pos; - pos.Relocate(MuradinExitPath[MuradinExitPathSize - 1].x, MuradinExitPath[MuradinExitPathSize - 1].y, MuradinExitPath[MuradinExitPathSize - 1].z); - me->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, pos, false); - Movement::PointsArray path(MuradinExitPath, MuradinExitPath + MuradinExitPathSize); - Movement::MoveSplineInit init(me); init.DisableTransportPathTransformations(); init.MovebyPath(path, 0); - init.Launch(); + me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE); me->DespawnOrUnsummon(18000); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 97f2079cbec..d974533d9ef 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -473,7 +473,7 @@ class npc_bone_spike : public CreatureScript Movement::MoveSplineInit init(passenger); init.DisableTransportPathTransformations(); init.MoveTo(-0.02206125f, -0.02132235f, 5.514783f, false); - init.Launch(); + passenger->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_SLOT_CONTROLLED); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 931244b95e4..671b781f86b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -351,12 +351,14 @@ class boss_algalon_the_observer : public CreatureScript me->SetDisableGravity(true); DoCast(me, SPELL_ARRIVAL, true); DoCast(me, SPELL_RIDE_THE_LIGHTNING, true); - me->GetMotionMaster()->MovePoint(POINT_ALGALON_LAND, AlgalonLandPos); + me->SetHomePosition(AlgalonLandPos); + Movement::MoveSplineInit init(me); init.MoveTo(AlgalonLandPos.GetPositionX(), AlgalonLandPos.GetPositionY(), AlgalonLandPos.GetPositionZ(), false); init.SetOrientationFixed(true); - init.Launch(); + me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_ALGALON_LAND, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE); + events.Reset(); events.SetPhase(PHASE_ROLE_PLAY); events.ScheduleEvent(EVENT_INTRO_1, 5000, 0, PHASE_ROLE_PLAY); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index a1f06e4df48..ae3d1b6eb01 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -337,7 +337,7 @@ struct boss_razorscale : public BossAI init.MovebyPath(path, 0); init.SetCyclic(); init.SetFly(); - init.Launch(); + me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE); } bool CanAIAttack(Unit const* target) const override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index 7c2ea2a09af..0f47cd67419 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -651,8 +651,6 @@ class boss_thorim : public CreatureScript summon->SetReactState(REACT_PASSIVE); summon->CastSpell(summon, SPELL_LIGHTNING_DESTRUCTION, true); - summon->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, LightningOrbPath[LightningOrbPathSize - 1], false); - Movement::PointsArray path; path.reserve(LightningOrbPathSize); std::transform(std::begin(LightningOrbPath), std::end(LightningOrbPath), std::back_inserter(path), [](Position const& pos) @@ -662,7 +660,7 @@ class boss_thorim : public CreatureScript Movement::MoveSplineInit init(summon); init.MovebyPath(path); - init.Launch(); + summon->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE); break; } case NPC_DARK_RUNE_CHAMPION: diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index b89a15b2809..0bb6b26baff 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -362,7 +362,7 @@ public: Movement::MoveSplineInit init(who); init.DisableTransportPathTransformations(); init.MoveTo(0.3320355f, 0.05355075f, 5.196949f, false); - init.Launch(); + who->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_SLOT_CONTROLLED); me->setActive(true); me->SetFarVisible(true); |
