Revert "Core/Movement: merged smooth waypoints (commit: 05fb27dae4)"

This reverts commit 6dddfc812c.
This commit is contained in:
Ovahlord
2018-03-27 22:04:30 +02:00
parent d2b2dc8fca
commit 53e989dcd3
16 changed files with 630 additions and 606 deletions

View File

@@ -18,7 +18,6 @@
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "SpellScript.h"
#include "PassiveAI.h"
#include "GameObjectAI.h"
@@ -871,15 +870,11 @@ class npc_brann_bronzebeard_algalon : public CreatureScript
public:
npc_brann_bronzebeard_algalon() : CreatureScript("npc_brann_bronzebeard_algalon") { }
struct npc_brann_bronzebeard_algalonAI : public npc_escortAI
struct npc_brann_bronzebeard_algalonAI : public CreatureAI
{
npc_brann_bronzebeard_algalonAI(Creature* creature) : npc_escortAI(creature)
npc_brann_bronzebeard_algalonAI(Creature* creature) : CreatureAI(creature)
{
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());
_currentPoint = 0;
}
void DoAction(int32 action) override
@@ -887,12 +882,14 @@ class npc_brann_bronzebeard_algalon : public CreatureScript
switch (action)
{
case ACTION_START_INTRO:
_currentPoint = 0;
_events.Reset();
Start(false, true);
me->SetWalk(false);
_events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1);
break;
case ACTION_FINISH_INTRO:
Talk(SAY_BRANN_ALGALON_INTRO_2);
SetEscortPaused(false);
_events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1);
break;
case ACTION_OUTRO:
me->GetMotionMaster()->MovePoint(POINT_BRANN_OUTRO, BrannOutroPos[1]);
@@ -902,27 +899,37 @@ class npc_brann_bronzebeard_algalon : public CreatureScript
}
}
void WaypointReached(uint32 pointId) override
void MovementInform(uint32 movementType, uint32 pointId) override
{
if (movementType != POINT_MOTION_TYPE)
return;
uint32 delay = 1;
_currentPoint = pointId + 1;
switch (pointId)
{
case 2:
SetEscortPaused(true);
_events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 8000);
SetRun(false);
break;
delay = 8000;
me->SetWalk(true); break;
case 5:
SetRun(true);
SetEscortPaused(true);
me->SetWalk(false);
Talk(SAY_BRANN_ALGALON_INTRO_1);
_events.ScheduleEvent(EVENT_SUMMON_ALGALON, 7500);
break;
return;
case 9:
me->DespawnOrUnsummon(1);
return;
case POINT_BRANN_OUTRO:
case POINT_BRANN_OUTRO_END:
return;
}
_events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, delay);
}
void UpdateAI(uint32 diff) override
{
npc_escortAI::UpdateAI(diff);
UpdateVictim();
if (_events.Empty())
return;
@@ -934,7 +941,8 @@ class npc_brann_bronzebeard_algalon : public CreatureScript
switch (eventId)
{
case EVENT_BRANN_MOVE_INTRO:
SetEscortPaused(false);
if (_currentPoint < MAX_BRANN_WAYPOINTS_INTRO)
me->GetMotionMaster()->MovePoint(_currentPoint, BrannIntroWaypoint[_currentPoint]);
break;
case EVENT_SUMMON_ALGALON:
if (Creature* algalon = me->GetMap()->SummonCreature(NPC_ALGALON, AlgalonSummonPos))
@@ -952,6 +960,7 @@ class npc_brann_bronzebeard_algalon : public CreatureScript
private:
EventMap _events;
uint32 _currentPoint;
};
CreatureAI* GetAI(Creature* creature) const override