fix(Core/Movement): add creature formation movement generator (#25030)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com>
This commit is contained in:
sogladev
2026-03-08 17:41:42 +01:00
committed by GitHub
parent 04fbeec3c2
commit 4f3e5ca591
19 changed files with 402 additions and 86 deletions
+12
View File
@@ -21,6 +21,7 @@
#include "CreatureAISelector.h"
#include "EscortMovementGenerator.h"
#include "FleeingMovementGenerator.h"
#include "FormationMovementGenerator.h"
#include "GameTime.h"
#include "HomeMovementGenerator.h"
#include "IdleMovementGenerator.h"
@@ -466,6 +467,17 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
}
}
void MotionMaster::MoveFormation(Unit* leader, float dist, float angle, uint32 point1, uint32 point2)
{
if (!leader || leader == _owner || _owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE))
return;
if (!_owner->IsCreature())
return;
Mutate(new FormationMovementGenerator(leader, dist, angle, point1, point2), MOTION_SLOT_IDLE);
}
/**
* @brief The unit will move to a specific point. Doesn't work with UNIT_FLAG_DISABLE_MOVE
*