Core/Auras: Implemented SPELL_AURA_DISABLE_INERTIA (506)
Port From (https://github.com/TrinityCore/TrinityCore/commit/d945a118db6d2b423a77c419eb8dd7f4732802a2)
This commit is contained in:
@@ -395,6 +395,32 @@ namespace Game.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SetDisableInertia(bool disable)
|
||||
{
|
||||
if (disable == HasExtraUnitMovementFlag2(MovementFlags3.DisableInertia))
|
||||
return false;
|
||||
|
||||
if (disable)
|
||||
AddExtraUnitMovementFlag2(MovementFlags3.DisableInertia);
|
||||
else
|
||||
RemoveExtraUnitMovementFlag2(MovementFlags3.DisableInertia);
|
||||
|
||||
Player playerMover = GetUnitBeingMoved()?.ToPlayer();
|
||||
if (playerMover != null)
|
||||
{
|
||||
MoveSetFlag packet = new(disable ? ServerOpcodes.MoveDisableInertia : ServerOpcodes.MoveEnableInertia);
|
||||
packet.MoverGUID = GetGUID();
|
||||
packet.SequenceIndex = m_movementCounter++;
|
||||
playerMover.SendPacket(packet);
|
||||
|
||||
MoveUpdate moveUpdate = new();
|
||||
moveUpdate.Status = m_movementInfo;
|
||||
SendMessageToSet(moveUpdate, playerMover);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void JumpTo(float speedXY, float speedZ, float angle, Position dest = null)
|
||||
{
|
||||
if (dest != null)
|
||||
|
||||
Reference in New Issue
Block a user