Core/Movement: FormationMovementGenerator

Use own movement generator for creatures following on a formation.
First step of implementation, huge room for improvement.

Closes #19422

(cherry picked from commit 46221b6dc1)
This commit is contained in:
ccrs
2017-04-09 14:13:29 +02:00
committed by funjoker
parent c31f875cc8
commit 84df2c57a3
9 changed files with 210 additions and 17 deletions

View File

@@ -30,6 +30,7 @@
#include "WaypointMovementGenerator.h"
#include "RandomMovementGenerator.h"
#include "SplineChainMovementGenerator.h"
#include "FormationMovementGenerator.h"
#include "MoveSpline.h"
#include "MoveSplineInit.h"
#include "PathGenerator.h"
@@ -711,6 +712,15 @@ void MotionMaster::MoveRotate(uint32 time, RotateDirection direction)
Mutate(new RotateMovementGenerator(time, direction), MOTION_SLOT_ACTIVE);
}
void MotionMaster::MoveFormation(uint32 id, Position destination, uint32 moveType, bool forceRun /*= false*/, bool forceOrientation /*= false*/)
{
if (_owner->GetTypeId() == TYPEID_UNIT)
{
TC_LOG_DEBUG("misc", "MotionMaster::MoveFormation: Creature (Entry: %u %s) targeted point (Id: %u X: %f Y: %f Z: %f).", _owner->GetEntry(), _owner->GetGUID().ToString().c_str(), id, destination.GetPositionX(), destination.GetPositionY(), destination.GetPositionZ());
Mutate(new FormationMovementGenerator(id, destination, moveType, forceRun, forceOrientation), MOTION_SLOT_ACTIVE);
}
}
/******************** Private methods ********************/
void MotionMaster::pop()