diff options
| author | Riztazz <felianther15@gmail.com> | 2016-11-25 00:31:10 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald.trinity@gmail.com> | 2018-02-11 15:53:32 +0100 |
| commit | 05fb27dae4e8af859e01e5b9e52b082cba217657 (patch) | |
| tree | da858a540a26344d3e6af66017d46d7b1df7eb71 /src/server/scripts | |
| parent | 27cdd4b257d01005d9e342b39a4fdf76567d13cf (diff) | |
[3.3.5][master] Core/Movement: Smooth movement #13467 (#18020)
Implement smooth movement for all waypoint pathing and escortai
(cherry picked from commit 28050f338dfc66e0c40b6a3915bf96e38e0613e5)
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp | 1 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp | 48 |
2 files changed, 20 insertions, 29 deletions
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp index 09f7f8e7c07..9dc5d5bed5b 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp @@ -15,6 +15,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "AreaBoundary.h" #include "ScriptMgr.h" #include "Creature.h" #include "forge_of_souls.h" 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 a0a390f9aa5..6aeaafbd4ec 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 @@ -27,6 +27,7 @@ #include "PassiveAI.h" #include "Player.h" #include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" #include "Spell.h" #include "SpellInfo.h" #include "SpellScript.h" @@ -876,11 +877,15 @@ class npc_brann_bronzebeard_algalon : public CreatureScript public: npc_brann_bronzebeard_algalon() : CreatureScript("npc_brann_bronzebeard_algalon") { } - struct npc_brann_bronzebeard_algalonAI : public CreatureAI + struct npc_brann_bronzebeard_algalonAI : public npc_escortAI { - npc_brann_bronzebeard_algalonAI(Creature* creature) : CreatureAI(creature) + npc_brann_bronzebeard_algalonAI(Creature* creature) : npc_escortAI(creature) { - _currentPoint = 0; + SetDespawnAtEnd(false); + SetDespawnAtFar(false); + + for (uint8 i = 0; i < MAX_BRANN_WAYPOINTS_INTRO; ++i) + AddWaypoint(i, BrannIntroWaypoint[i].GetPositionX(), BrannIntroWaypoint[i].GetPositionY(), BrannIntroWaypoint[i].GetPositionZ()); } void DoAction(int32 action) override @@ -888,14 +893,12 @@ class npc_brann_bronzebeard_algalon : public CreatureScript switch (action) { case ACTION_START_INTRO: - _currentPoint = 0; _events.Reset(); - me->SetWalk(false); - _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1); + Start(false, true); break; case ACTION_FINISH_INTRO: Talk(SAY_BRANN_ALGALON_INTRO_2); - _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1); + SetEscortPaused(false); break; case ACTION_OUTRO: me->GetMotionMaster()->MovePoint(POINT_BRANN_OUTRO, BrannOutroPos[1]); @@ -905,38 +908,27 @@ class npc_brann_bronzebeard_algalon : public CreatureScript } } - void MovementInform(uint32 movementType, uint32 pointId) override + void WaypointReached(uint32 pointId) override { - if (movementType != POINT_MOTION_TYPE) - return; - - uint32 delay = 1; - _currentPoint = pointId + 1; switch (pointId) { case 2: - delay = 8000; - me->SetWalk(true); + SetEscortPaused(true); + _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 8000); + SetRun(false); break; case 5: - me->SetWalk(false); + SetRun(true); + SetEscortPaused(true); Talk(SAY_BRANN_ALGALON_INTRO_1); _events.ScheduleEvent(EVENT_SUMMON_ALGALON, 7500); - return; - case 9: - me->DespawnOrUnsummon(1); - return; - case POINT_BRANN_OUTRO: - case POINT_BRANN_OUTRO_END: - return; + break; } - - _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, delay); } void UpdateAI(uint32 diff) override { - UpdateVictim(); + npc_escortAI::UpdateAI(diff); if (_events.Empty()) return; @@ -948,8 +940,7 @@ class npc_brann_bronzebeard_algalon : public CreatureScript switch (eventId) { case EVENT_BRANN_MOVE_INTRO: - if (_currentPoint < MAX_BRANN_WAYPOINTS_INTRO) - me->GetMotionMaster()->MovePoint(_currentPoint, BrannIntroWaypoint[_currentPoint]); + SetEscortPaused(false); break; case EVENT_SUMMON_ALGALON: if (Creature* algalon = me->GetMap()->SummonCreature(NPC_ALGALON, AlgalonSummonPos)) @@ -967,7 +958,6 @@ class npc_brann_bronzebeard_algalon : public CreatureScript private: EventMap _events; - uint32 _currentPoint; }; CreatureAI* GetAI(Creature* creature) const override |
