Core/Misc: Define / rename attributes and flags

Port From (https://github.com/TrinityCore/TrinityCore/commit/e72264cfbd4b3bd925a634d99ab1717a1c0a6b91)
This commit is contained in:
hondacrx
2022-05-26 16:25:16 -04:00
parent 0b1cde8396
commit 3cacc1ff68
8 changed files with 53 additions and 53 deletions
+4 -4
View File
@@ -424,7 +424,7 @@ namespace Game.Entities
ApplySpellImmune(0, SpellImmunity.Effect, SpellEffectName.AttackMe, true);
}
SetIgnoringCombat(cInfo.FlagsExtra.HasFlag(CreatureFlagsExtra.NoCombat));
SetIgnoringCombat(cInfo.FlagsExtra.HasFlag(CreatureFlagsExtra.IgnoreCombat));
LoadTemplateRoot();
InitializeMovementFlags();
@@ -850,7 +850,7 @@ namespace Game.Entities
}
// Allow players to see those units while dead, do it here (mayby altered by addon auras)
if (cinfo.TypeFlags.HasAnyFlag(CreatureTypeFlags.GhostVisible))
if (cinfo.TypeFlags.HasAnyFlag(CreatureTypeFlags.VisibleToGhosts))
m_serverSideVisibility.SetValue(ServerSideVisibilityType.Ghost, GhostVisibilityType.Alive | GhostVisibilityType.Ghost);
if (!CreateFromProto(guidlow, entry, data, vehId))
@@ -1056,7 +1056,7 @@ namespace Game.Entities
return !IsCritter()
&& !IsPet()
&& !IsTotem()
&& !GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.NoXpAtKill);
&& !GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.NoXP);
}
public override bool IsEngaged()
@@ -1071,7 +1071,7 @@ namespace Game.Entities
{
base.AtEngage(target);
if (!GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.MountedCombatAllowed))
if (!GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.AllowMountedCombat))
Dismount();
RefreshSwimmingFlag();
@@ -174,11 +174,11 @@ namespace Game.Entities
public SkillType GetRequiredLootSkill()
{
if (TypeFlags.HasAnyFlag(CreatureTypeFlags.HerbSkinningSkill))
if (TypeFlags.HasAnyFlag(CreatureTypeFlags.SkinWithHerbalism))
return SkillType.Herbalism;
else if (TypeFlags.HasAnyFlag(CreatureTypeFlags.MiningSkinningSkill))
else if (TypeFlags.HasAnyFlag(CreatureTypeFlags.SkinWithMining))
return SkillType.Mining;
else if (TypeFlags.HasAnyFlag(CreatureTypeFlags.EngineeringSkinningSkill))
else if (TypeFlags.HasAnyFlag(CreatureTypeFlags.SkinWithEngineering))
return SkillType.Engineering;
else
return SkillType.Skinning; // normal case
@@ -186,11 +186,11 @@ namespace Game.Entities
public bool IsExotic()
{
return (TypeFlags & CreatureTypeFlags.ExoticPet) != 0;
return (TypeFlags & CreatureTypeFlags.TameableExotic) != 0;
}
public bool IsTameable(bool canTameExotic)
{
if (CreatureType != CreatureType.Beast || Family == CreatureFamily.None || !TypeFlags.HasAnyFlag(CreatureTypeFlags.TameablePet))
if (CreatureType != CreatureType.Beast || Family == CreatureFamily.None || !TypeFlags.HasAnyFlag(CreatureTypeFlags.Tameable))
return false;
// if can tame exotic then can tame any tameable
+2 -2
View File
@@ -5508,11 +5508,11 @@ namespace Game.Entities
return null;
// Deathstate checks
if (!IsAlive() && !Convert.ToBoolean(creature.GetCreatureTemplate().TypeFlags & CreatureTypeFlags.GhostVisible))
if (!IsAlive() && !Convert.ToBoolean(creature.GetCreatureTemplate().TypeFlags & CreatureTypeFlags.VisibleToGhosts))
return null;
// alive or spirit healer
if (!creature.IsAlive() && !Convert.ToBoolean(creature.GetCreatureTemplate().TypeFlags & CreatureTypeFlags.CanInteractWhileDead))
if (!creature.IsAlive() && !Convert.ToBoolean(creature.GetCreatureTemplate().TypeFlags & CreatureTypeFlags.InteractWhileDead))
return null;
// appropriate npc type
+1 -1
View File
@@ -1313,7 +1313,7 @@ namespace Game.Entities
if (attackerLevel >= victimLevel + 4 &&
// can be from by creature (if can) or from controlled player that considered as creature
!IsControlledByPlayer() &&
!(GetTypeId() == TypeId.Unit && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.NoCrush)))
!(GetTypeId() == TypeId.Unit && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.NoCrushingBlows)))
{
// add 2% chance per level, min. is 15%
tmp = (int)(attackerLevel - victimLevel * 1000 - 1500);
+1 -1
View File
@@ -2285,7 +2285,7 @@ namespace Game.Entities
switch (group)
{
case DiminishingGroup.Taunt:
if (IsTypeId(TypeId.Unit) && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.TauntDiminish))
if (IsTypeId(TypeId.Unit) && ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.ObeysTauntDiminishingReturns))
{
DiminishingLevels diminish = previousLevel;
switch (diminish)
+1 -1
View File
@@ -1295,7 +1295,7 @@ namespace Game.Spells
Creature creatureTarget = unitTarget.ToCreature();
if (creatureTarget)
{
if (!creatureTarget.GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.CanCollideWithMissiles))
if (!creatureTarget.GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.CollideWithMissiles))
continue;
}
}