Updates some enums
Port From (https://github.com/TrinityCore/TrinityCore)
This commit is contained in:
@@ -42,14 +42,14 @@ namespace Framework.Constants
|
||||
RareElite = 2,
|
||||
WorldBoss = 3,
|
||||
Rare = 4,
|
||||
Unknown = 5 // found in 2.2.3 for 2 mobs
|
||||
EliteTrivial = 5 // found in 2.2.3 for 2 mobs
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum UnitFlags : uint
|
||||
{
|
||||
ServerControlled = 0x01,
|
||||
NonAttackable = 0x02,
|
||||
NonAttackable = 0x02, // not attackable, set when creature starts to cast spells with SPELL_EFFECT_SPAWN and cast time, removed when spell hits caster, original name is UNIT_FLAG_SPAWNING. Rename when it will be removed from all scripts
|
||||
RemoveClientControl = 0x04, // This is a legacy flag used to disable movement player's movement while controlling other units, SMSG_CLIENT_CONTROL replaces this functionality clientside now. CONFUSED and FLEEING flags have the same effect on client movement asDISABLE_MOVE_CONTROL in addition to preventing spell casts/autoattack (they all allow climbing steeper hills and emotes while moving)
|
||||
PlayerControlled = 0x08, //controlled by player, use _IMMUNE_TO_PC instead of _IMMUNE_TO_NPC
|
||||
Rename = 0x10,
|
||||
@@ -60,7 +60,7 @@ namespace Framework.Constants
|
||||
ImmuneToNpc = 0x200,
|
||||
Looting = 0x400,
|
||||
PetInCombat = 0x800,
|
||||
Pvp = 0x1000,
|
||||
PvpEnabling = 0x1000,
|
||||
Silenced = 0x2000,
|
||||
CantSwim = 0x4000,
|
||||
CanSwim = 0x8000, // shows swim animation in water
|
||||
@@ -68,7 +68,7 @@ namespace Framework.Constants
|
||||
Pacified = 0x20000,
|
||||
Stunned = 0x40000,
|
||||
InCombat = 0x80000,
|
||||
TaxiFlight = 0x100000,
|
||||
OnTaxi = 0x100000,
|
||||
Disarmed = 0x200000,
|
||||
Confused = 0x400000,
|
||||
Fleeing = 0x800000,
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Game.Entities
|
||||
bool _regenerateHealth; // Set on creation
|
||||
bool _regenerateHealthLock; // Dynamically set
|
||||
|
||||
bool _isMissingSwimmingFlagOutOfCombat;
|
||||
bool _isMissingCanSwimFlagOutOfCombat;
|
||||
|
||||
public ulong m_PlayerDamageReq;
|
||||
public float m_SightDistance;
|
||||
|
||||
@@ -1074,7 +1074,7 @@ namespace Game.Entities
|
||||
if (!GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.AllowMountedCombat))
|
||||
Dismount();
|
||||
|
||||
RefreshSwimmingFlag();
|
||||
RefreshCanSwimFlag();
|
||||
|
||||
if (IsPet() || IsGuardian()) // update pets' speed for catchup OOC speed
|
||||
{
|
||||
@@ -2593,20 +2593,20 @@ namespace Game.Entities
|
||||
return GetMovementTemplate().IsSwimAllowed();
|
||||
}
|
||||
|
||||
public void RefreshSwimmingFlag(bool recheck = false)
|
||||
public void RefreshCanSwimFlag(bool recheck = false)
|
||||
{
|
||||
if (!_isMissingSwimmingFlagOutOfCombat || recheck)
|
||||
_isMissingSwimmingFlagOutOfCombat = !HasUnitFlag(UnitFlags.CanSwim);
|
||||
if (!_isMissingCanSwimFlagOutOfCombat || recheck)
|
||||
_isMissingCanSwimFlagOutOfCombat = !HasUnitFlag(UnitFlags.CanSwim);
|
||||
|
||||
// Check if the creature has UNIT_FLAG_SWIMMING and add it if it's missing
|
||||
// Check if the creature has UNIT_FLAG_CAN_SWIM and add it if it's missing
|
||||
// Creatures must be able to chase a target in water if they can enter water
|
||||
if (_isMissingSwimmingFlagOutOfCombat && CanEnterWater())
|
||||
if (_isMissingCanSwimFlagOutOfCombat && CanEnterWater())
|
||||
AddUnitFlag(UnitFlags.CanSwim);
|
||||
}
|
||||
|
||||
public bool HasSwimmingFlagOutOfCombat()
|
||||
public bool HasCanSwimFlagOutOfCombat()
|
||||
{
|
||||
return !_isMissingSwimmingFlagOutOfCombat;
|
||||
return !_isMissingCanSwimFlagOutOfCombat;
|
||||
}
|
||||
|
||||
public void AllLootRemovedFromCorpse()
|
||||
|
||||
@@ -2525,7 +2525,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
// check flags
|
||||
if (unitTarget != null && unitTarget.HasUnitFlag(UnitFlags.NonAttackable | UnitFlags.TaxiFlight | UnitFlags.NotAttackable1 | UnitFlags.NonAttackable2))
|
||||
if (unitTarget != null && unitTarget.HasUnitFlag(UnitFlags.NonAttackable | UnitFlags.OnTaxi | UnitFlags.NotAttackable1 | UnitFlags.NonAttackable2))
|
||||
return false;
|
||||
|
||||
Unit unitOrOwner = unit;
|
||||
@@ -2676,7 +2676,7 @@ namespace Game.Entities
|
||||
return false;
|
||||
|
||||
// check flags for negative spells
|
||||
if (isNegativeSpell && unitTarget != null && unitTarget.HasUnitFlag(UnitFlags.NonAttackable | UnitFlags.TaxiFlight | UnitFlags.NotAttackable1 | UnitFlags.NonAttackable2))
|
||||
if (isNegativeSpell && unitTarget != null && unitTarget.HasUnitFlag(UnitFlags.NonAttackable | UnitFlags.OnTaxi | UnitFlags.NotAttackable1 | UnitFlags.NonAttackable2))
|
||||
return false;
|
||||
|
||||
if (isNegativeSpell || bySpell == null || !bySpell.HasAttribute(SpellAttr6.AssistIgnoreImmuneFlag))
|
||||
|
||||
@@ -5981,7 +5981,7 @@ namespace Game.Entities
|
||||
UnitFlags.PetInCombat | UnitFlags.Silenced | UnitFlags.Pacified |
|
||||
UnitFlags.Stunned | UnitFlags.InCombat | UnitFlags.Disarmed |
|
||||
UnitFlags.Confused | UnitFlags.Fleeing | UnitFlags.Uninteractible |
|
||||
UnitFlags.Skinnable | UnitFlags.Mount | UnitFlags.TaxiFlight);
|
||||
UnitFlags.Skinnable | UnitFlags.Mount | UnitFlags.OnTaxi);
|
||||
AddUnitFlag(UnitFlags.PlayerControlled); // must be set
|
||||
|
||||
AddUnitFlag2(UnitFlags2.RegeneratePower);// must be set
|
||||
@@ -7133,7 +7133,7 @@ namespace Game.Entities
|
||||
{
|
||||
m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
|
||||
Dismount();
|
||||
RemoveUnitFlag(UnitFlags.RemoveClientControl | UnitFlags.TaxiFlight);
|
||||
RemoveUnitFlag(UnitFlags.RemoveClientControl | UnitFlags.OnTaxi);
|
||||
}
|
||||
|
||||
public void ContinueTaxiFlight()
|
||||
|
||||
@@ -425,7 +425,7 @@ namespace Game.Entities
|
||||
|
||||
Creature creature = ToCreature();
|
||||
if (creature != null)
|
||||
creature.RefreshSwimmingFlag();
|
||||
creature.RefreshCanSwimFlag();
|
||||
|
||||
if (!IsPlayer() || !charmer.IsPlayer())
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Game.Movement
|
||||
RemoveFlag(MovementGeneratorFlags.Deactivated);
|
||||
|
||||
owner.CombatStopWithPets();
|
||||
owner.AddUnitFlag(UnitFlags.RemoveClientControl | UnitFlags.TaxiFlight);
|
||||
owner.AddUnitFlag(UnitFlags.RemoveClientControl | UnitFlags.OnTaxi);
|
||||
|
||||
uint end = GetPathAtMapEnd();
|
||||
uint currentNodeId = GetCurrentNode();
|
||||
@@ -139,7 +139,7 @@ namespace Game.Movement
|
||||
uint taxiNodeId = owner.m_taxi.GetTaxiDestination();
|
||||
owner.m_taxi.ClearTaxiDestinations();
|
||||
owner.Dismount();
|
||||
owner.RemoveUnitFlag(UnitFlags.RemoveClientControl | UnitFlags.TaxiFlight);
|
||||
owner.RemoveUnitFlag(UnitFlags.RemoveClientControl | UnitFlags.OnTaxi);
|
||||
|
||||
if (owner.m_taxi.Empty())
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Game.AI
|
||||
|
||||
if (movementInform && HasFlag(MovementGeneratorFlags.InformEnabled))
|
||||
{
|
||||
if (!owner.HasSwimmingFlagOutOfCombat())
|
||||
if (!owner.HasCanSwimFlagOutOfCombat())
|
||||
owner.RemoveUnitFlag(UnitFlags.CanSwim);
|
||||
|
||||
owner.SetSpawnHealth();
|
||||
|
||||
Reference in New Issue
Block a user