Core/Creatures: implemented most movement related static flags and migrated existing movement data into static flags

* implemented CREATURE_STATIC_FLAG_AQUATIC - creatures cannot leave liquids
* implemented CREATURE_STATIC_FLAG_AMPHIBIOUS - creatures can enter and leave liquids but remain on the ocean floor when swimming is not enabled until engaged
* implemented CREATURE_STATIC_FLAG_FLOATING - creatures have their gravity on spawn / reset disabled
* implemented CREATURE_STATIC_FLAG_SESSILE - creatures are rooted in place
* implemented CREATURE_STATIC_FLAG_CAN_SWIM - creature can swim in liquids
* implemented CREATURE_STATIC_FLAG_3_CANNOT_SWIM - Amphibious creatures cannot toggle on swimming
* implemented CREATURE_STATIC_FLAG_3_CANNOT_TURN - Creatures cannot turn at all
* implemented CREATURE_STATIC_FLAG_4_PREVENT_SWIM - Amphibious creatures won't toggle on swimming until their victim starts leaving the ocean floor
* partially implemented CREATURE_STATIC_FLAG_3_CANNOT_PENETRATE_WATER
* deprecated CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE as this flag was a hackfix to a wrong implementation that is now gone
Port From (https://github.com/TrinityCore/TrinityCore/commit/c541eda54d7e0dddeec329a6beac2948e0b0a40b)
This commit is contained in:
hondacrx
2024-02-29 17:08:30 -05:00
parent 4dded15a03
commit db05394d99
13 changed files with 207 additions and 204 deletions
+4 -14
View File
@@ -279,38 +279,28 @@ namespace Game.Entities
public class CreatureMovementData
{
public CreatureGroundMovementType Ground;
public CreatureFlightMovementType Flight;
public bool Swim;
public bool Rooted;
public bool HoverInitiallyEnabled;
public CreatureChaseMovementType Chase;
public CreatureRandomMovementType Random;
public uint InteractionPauseTimer;
public CreatureMovementData()
{
Ground = CreatureGroundMovementType.Run;
Flight = CreatureFlightMovementType.None;
Swim = true;
Rooted = false;
Chase = CreatureChaseMovementType.Run;
Random = CreatureRandomMovementType.Walk;
InteractionPauseTimer = WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer);
}
public bool IsGroundAllowed() { return Ground != CreatureGroundMovementType.None; }
public bool IsSwimAllowed() { return Swim; }
public bool IsFlightAllowed() { return Flight != CreatureFlightMovementType.None; }
public bool IsRooted() { return Rooted; }
public CreatureChaseMovementType GetChase() { return Chase; }
public CreatureRandomMovementType GetRandom() { return Random; }
public bool IsHoverInitiallyEnabled() { return HoverInitiallyEnabled; }
public uint GetInteractionPauseTimer() { return InteractionPauseTimer; }
public override string ToString()
{
return $"Ground: {Ground}, Swim: {Swim}, Flight: {Flight} {(Rooted ? ", Rooted" : "")}, Chase: {Chase}, Random: {Random}, InteractionPauseTimer: {InteractionPauseTimer}";
return $"HoverInitiallyEnabled: {HoverInitiallyEnabled}, Chase: {Chase}, Random: {Random}, InteractionPauseTimer: {InteractionPauseTimer}";
}
}