Core/Auras: Implemented SPELL_AURA_MOVE_SET_CANT_SWIM and related new opcodes
Port From (https://github.com/TrinityCore/TrinityCore/commit/010550da224c446461b26bc4f38ee5cc35d4aa3d)
This commit is contained in:
@@ -87,5 +87,6 @@ namespace Framework.Constants
|
|||||||
DisableInertia = 0x01,
|
DisableInertia = 0x01,
|
||||||
CanAdvFly = 0x02,
|
CanAdvFly = 0x02,
|
||||||
AdvFlying = 0x04,
|
AdvFlying = 0x04,
|
||||||
|
CantSwim = 0x2000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1573,6 +1573,7 @@ namespace Framework.Constants
|
|||||||
MoveSetAdvFlyingPitchingRateUp = 0x2e40,
|
MoveSetAdvFlyingPitchingRateUp = 0x2e40,
|
||||||
MoveSetAdvFlyingSurfaceFriction = 0x2e42,
|
MoveSetAdvFlyingSurfaceFriction = 0x2e42,
|
||||||
MoveSetAdvFlyingTurnVelocityThreshold = 0x2e41,
|
MoveSetAdvFlyingTurnVelocityThreshold = 0x2e41,
|
||||||
|
MoveSetCantSwim = 0x2E07,
|
||||||
MoveSetCanAdvFly = 0x2e36,
|
MoveSetCanAdvFly = 0x2e36,
|
||||||
MoveSetCanFly = 0x2e05,
|
MoveSetCanFly = 0x2e05,
|
||||||
MoveSetCanTurnWhileFalling = 0x2e09,
|
MoveSetCanTurnWhileFalling = 0x2e09,
|
||||||
@@ -1625,6 +1626,7 @@ namespace Framework.Constants
|
|||||||
MoveSplineUnsetHover = 0x2e24,
|
MoveSplineUnsetHover = 0x2e24,
|
||||||
MoveTeleport = 0x2e04,
|
MoveTeleport = 0x2e04,
|
||||||
MoveUnroot = 0x2dfa,
|
MoveUnroot = 0x2dfa,
|
||||||
|
MoveUnsetCantSwim = 0x2E08,
|
||||||
MoveUnsetCanAdvFly = 0x2e37,
|
MoveUnsetCanAdvFly = 0x2e37,
|
||||||
MoveUnsetCanFly = 0x2e06,
|
MoveUnsetCanFly = 0x2e06,
|
||||||
MoveUnsetCanTurnWhileFalling = 0x2e0a,
|
MoveUnsetCanTurnWhileFalling = 0x2e0a,
|
||||||
|
|||||||
@@ -552,7 +552,7 @@ namespace Framework.Constants
|
|||||||
TriggerSpellOnStackAmount = 542, // NYI
|
TriggerSpellOnStackAmount = 542, // NYI
|
||||||
Unk543 = 543,
|
Unk543 = 543,
|
||||||
Unk544 = 544,
|
Unk544 = 544,
|
||||||
Unk545 = 545, // prevent swim
|
MoveSetCantSwim = 545,
|
||||||
Unk546 = 546,
|
Unk546 = 546,
|
||||||
Unk547 = 547,
|
Unk547 = 547,
|
||||||
Unk548 = 548,
|
Unk548 = 548,
|
||||||
|
|||||||
@@ -1596,6 +1596,32 @@ namespace Game.Entities
|
|||||||
RemoveNpcFlag(NPCFlags.SpellClick | NPCFlags.PlayerVehicle);
|
RemoveNpcFlag(NPCFlags.SpellClick | NPCFlags.PlayerVehicle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool SetMoveCantSwim(bool cantSwim)
|
||||||
|
{
|
||||||
|
if (cantSwim == HasExtraUnitMovementFlag2(MovementFlags3.CantSwim))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (cantSwim)
|
||||||
|
AddExtraUnitMovementFlag2(MovementFlags3.CantSwim);
|
||||||
|
else
|
||||||
|
RemoveExtraUnitMovementFlag2(MovementFlags3.CantSwim);
|
||||||
|
|
||||||
|
Player playerMover = GetUnitBeingMoved()?.ToPlayer();
|
||||||
|
if (playerMover != null)
|
||||||
|
{
|
||||||
|
MoveSetFlag packet = new(cantSwim ? ServerOpcodes.MoveSetCantSwim : ServerOpcodes.MoveUnsetCantSwim);
|
||||||
|
packet.MoverGUID = GetGUID();
|
||||||
|
packet.SequenceIndex = m_movementCounter++;
|
||||||
|
playerMover.SendPacket(packet);
|
||||||
|
|
||||||
|
MoveUpdate moveUpdate = new();
|
||||||
|
moveUpdate.Status = m_movementInfo;
|
||||||
|
SendMessageToSet(moveUpdate, playerMover);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void SendSetVehicleRecId(uint vehicleId)
|
void SendSetVehicleRecId(uint vehicleId)
|
||||||
{
|
{
|
||||||
Player player = ToPlayer();
|
Player player = ToPlayer();
|
||||||
|
|||||||
@@ -2408,6 +2408,22 @@ namespace Game.Spells
|
|||||||
target.SetDisableInertia(apply);
|
target.SetDisableInertia(apply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HandleSetCantSwim(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
|
{
|
||||||
|
if (!mode.HasAnyFlag(AuraEffectHandleModes.SendForClientMask))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Unit target = aurApp.GetTarget();
|
||||||
|
if (!apply)
|
||||||
|
{
|
||||||
|
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||||
|
if (target.HasAuraType(GetAuraType()))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
target.SetMoveCantSwim(apply);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************/
|
/****************************/
|
||||||
/*** THREAT ***/
|
/*** THREAT ***/
|
||||||
/****************************/
|
/****************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user