Core/Creatures: Allow toggling CREATURE_STATIC_FLAG_FLOATING, CREATURE_STATIC_FLAG_SESSILE and CREATURE_STATIC_FLAG_3_CANNOT_PENETRATE_WATER
Port From (https://github.com/TrinityCore/TrinityCore/commit/d3738024587aa618826318fec7bcc6fe15d1f0e2)
This commit is contained in:
@@ -3332,12 +3332,15 @@ namespace Game.Entities
|
||||
|
||||
// Returns true if CREATURE_STATIC_FLAG_FLOATING is set which is disabling the gravity of the creature on spawn and reset
|
||||
public bool IsFloating() { return _staticFlags.HasFlag(CreatureStaticFlags.Floating); }
|
||||
public void SetFloating(bool floating) { _staticFlags.ApplyFlag(CreatureStaticFlags.Floating, floating); SetDisableGravity(floating); }
|
||||
|
||||
// Returns true if CREATURE_STATIC_FLAG_SESSILE is set which permanently roots the creature in place
|
||||
public bool IsSessile() { return _staticFlags.HasFlag(CreatureStaticFlags.Sessile); }
|
||||
public void SetSessile(bool sessile) { _staticFlags.ApplyFlag(CreatureStaticFlags.Sessile, sessile); SetControlled(sessile, UnitState.Root); }
|
||||
|
||||
// Returns true if CREATURE_STATIC_FLAG_3_CANNOT_PENETRATE_WATER is set which does not allow the creature to go below liquid surfaces
|
||||
public bool CannotPenetrateWater() { return _staticFlags.HasFlag(CreatureStaticFlags3.CannotPenetrateWater); }
|
||||
public void SetCannotPenetrateWater(bool cannotPenetrateWater) { _staticFlags.ApplyFlag(CreatureStaticFlags3.CannotPenetrateWater, cannotPenetrateWater); }
|
||||
|
||||
// Returns true if CREATURE_STATIC_FLAG_3_CANNOT_SWIM is set which prevents 'Amphibious' creatures from swimming when engaged
|
||||
public bool IsSwimDisabled() { return _staticFlags.HasFlag(CreatureStaticFlags3.CannotSwim); }
|
||||
|
||||
Reference in New Issue
Block a user