Core/Movement: MotionMaster reimplementation

Port From (https://github.com/TrinityCore/TrinityCore/commit/426f9f2f92b26fbb68e7cda9290ccbd586c6af4e)
This commit is contained in:
hondacrx
2021-09-29 18:24:37 -04:00
parent cf13f32062
commit a968772bad
47 changed files with 1954 additions and 1227 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ namespace Scripts.Pets
float x = me.GetPositionX() + 20 * (float)Math.Cos(me.GetOrientation());
float y = me.GetPositionY() + 20 * (float)Math.Sin(me.GetOrientation());
float z = me.GetPositionZ() + 40;
me.GetMotionMaster().Clear(false);
me.GetMotionMaster().Clear();
me.GetMotionMaster().MovePoint(0, x, y, z);
// Despawn as soon as possible
+2 -2
View File
@@ -189,8 +189,8 @@ namespace Scripts.Pets
me.CombatStop(true);
if (owner && !me.HasUnitState(UnitState.Follow))
{
me.GetMotionMaster().Clear(false);
me.GetMotionMaster().MoveFollow(owner, SharedConst.PetFollowDist, me.GetFollowAngle(), MovementSlot.Active);
me.GetMotionMaster().Clear();
me.GetMotionMaster().MoveFollow(owner, SharedConst.PetFollowDist, me.GetFollowAngle());
}
}
}
+2 -2
View File
@@ -186,13 +186,13 @@ namespace Scripts.World.EmeraldDragons
if (target)
{
_roamTimer = RandomHelper.URand(15000, 30000);
me.GetMotionMaster().Clear(false);
me.GetMotionMaster().Clear();
me.GetMotionMaster().MoveChase(target, 0.2f);
}
else
{
_roamTimer = 2500;
me.GetMotionMaster().Clear(false);
me.GetMotionMaster().Clear();
me.GetMotionMaster().MoveRandom(25.0f);
}
// Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it
+1 -1
View File
@@ -2323,7 +2323,7 @@ namespace Scripts.World.NpcSpecial
init.DisableTransportPathTransformations();
init.MoveTo(x, y, z, false);
init.SetFacing(o);
who.GetMotionMaster().LaunchMoveSpline(init, EventId.VehicleBoard, MovementSlot.Controlled);
who.GetMotionMaster().LaunchMoveSpline(init, EventId.VehicleBoard, MovementGeneratorPriority.Highest);
who.m_Events.AddEvent(new CastFoodSpell(who, SpellIds.ChairSpells[who.GetEntry()]), who.m_Events.CalculateTime(1000));
Creature creature = who.ToCreature();
if (creature)