Core/Misc: Define / rename attributes and flags
Port From (https://github.com/TrinityCore/TrinityCore/commit/e72264cfbd4b3bd925a634d99ab1717a1c0a6b91)
This commit is contained in:
@@ -176,38 +176,38 @@ namespace Framework.Constants
|
||||
[Flags]
|
||||
public enum CreatureTypeFlags : uint
|
||||
{
|
||||
TameablePet = 0x01, // Makes the mob tameable (must also be a beast and have family set)
|
||||
GhostVisible = 0x02, // Creature are also visible for not alive player. Allow gossip interaction if npcflag allow?
|
||||
BossMob = 0x04, // Changes creature's visible level to "??" in the creature's portrait - Immune Knockback.
|
||||
DoNotPlayWoundParryAnimation = 0x08,
|
||||
HideFactionTooltip = 0x10,
|
||||
Unk5 = 0x20, // Sound related
|
||||
SpellAttackable = 0x40,
|
||||
CanInteractWhileDead = 0x80, // Player can interact with the creature if its dead (not player dead)
|
||||
HerbSkinningSkill = 0x100, // Can be looted by herbalist
|
||||
MiningSkinningSkill = 0x200, // Can be looted by miner
|
||||
DoNotLogDeath = 0x400, // Death event will not show up in combat log
|
||||
MountedCombatAllowed = 0x800, // Creature can remain mounted when entering combat
|
||||
CanAssist = 0x1000, // ? Can aid any player in combat if in range?
|
||||
IsPetBarUsed = 0x2000,
|
||||
MaskUID = 0x4000,
|
||||
EngineeringSkinningSkill = 0x8000, // Can be looted by engineer
|
||||
ExoticPet = 0x10000, // Can be tamed by hunter as exotic pet
|
||||
UseDefaultCollisionBox = 0x20000, // Collision related. (always using default collision box?)
|
||||
IsSiegeWeapon = 0x40000,
|
||||
CanCollideWithMissiles = 0x80000, // Projectiles can collide with this creature - interacts with TARGET_DEST_TRAJ
|
||||
HideNamePlate = 0x100000,
|
||||
DoNotPlayMountedAnimations = 0x200000,
|
||||
IsLinkAll = 0x400000,
|
||||
InteractOnlyWithCreator = 0x800000,
|
||||
DoNotPlayUnitEventSounds = 0x1000000,
|
||||
HasNoShadowBlob = 0x2000000,
|
||||
TreatAsRaidUnit = 0x4000000, //! Creature can be targeted by spells that require target to be in caster's party/raid
|
||||
ForceGossip = 0x8000000, // Allows the creature to display a single gossip option.
|
||||
Tameable = 0x00000001, // Makes The Mob Tameable (Must Also Be A Beast And Have Family Set)
|
||||
VisibleToGhosts = 0x00000002, // Creature Is Also Visible For Not Alive Player. Allows Gossip Interaction If Npcflag Allows?
|
||||
BossMob = 0x00000004, // Changes Creature'S Visible Level To "??" In The Creature'S Portrait - Immune Knockback.
|
||||
DoNotPlayWoundAnim = 0x00000008,
|
||||
NoFactionTooltip = 0x00000010,
|
||||
MoreAudible = 0x00000020, // Sound Related
|
||||
SpellAttackable = 0x00000040,
|
||||
InteractWhileDead = 0x00000080, // Player Can Interact With The Creature If Creature Is Dead (Not If Player Is Dead)
|
||||
SkinWithHerbalism = 0x00000100, // Can Be Looted By Herbalist
|
||||
SkinWithMining = 0x00000200, // Can Be Looted By Miner
|
||||
NoDeathMessage = 0x00000400, // Death Event Will Not Show Up In Combat Log
|
||||
AllowMountedCombat = 0x00000800, // Creature Can Remain Mounted When Entering Combat
|
||||
CanAssist = 0x00001000, // ? Can Aid Any Player In Combat If In Range?
|
||||
NoPetBar = 0x00002000,
|
||||
MaskUid = 0x00004000,
|
||||
SkinWithEngineering = 0x00008000, // Can Be Looted By Engineer
|
||||
TameableExotic = 0x00010000, // Can Be Tamed By Hunter As Exotic Pet
|
||||
UseModelCollisionSize = 0x00020000, // Collision Related. (Always Using Default Collision Box?)
|
||||
AllowInteractionWhileInCombat = 0x00040000,
|
||||
CollideWithMissiles = 0x00080000, // Projectiles Can Collide With This Creature - Interacts With TargetDestTraj
|
||||
NoNamePlate = 0x00100000,
|
||||
DoNotPlayMountedAnimations = 0x00200000,
|
||||
LinkAll = 0x00400000,
|
||||
InteractOnlyWithCreator = 0x00800000,
|
||||
DoNotPlayUnitEventSounds = 0x01000000,
|
||||
HasNoShadowBlob = 0x02000000,
|
||||
TreatAsRaidUnit = 0x04000000, //! Creature Can Be Targeted By Spells That Require Target To Be In Caster'S Party/Raid
|
||||
ForceGossip = 0x08000000, // Allows The Creature To Display A Single Gossip Option.
|
||||
DoNotSheathe = 0x10000000,
|
||||
DoNotTargetOnInteration = 0x20000000,
|
||||
DoNotTargetOnInteraction = 0x20000000,
|
||||
DoNotRenderObjectName = 0x40000000,
|
||||
UnitIsQuestBoss = 0x80000000 // Not verified
|
||||
QuestBoss = 0x80000000 // Not Verified
|
||||
}
|
||||
|
||||
[Flags]
|
||||
@@ -218,22 +218,22 @@ namespace Framework.Constants
|
||||
NoParry = 0x04, // Creature Can'T Parry
|
||||
NoParryHasten = 0x08, // Creature Can'T Counter-Attack At Parry
|
||||
NoBlock = 0x10, // Creature Can'T Block
|
||||
NoCrush = 0x20, // Creature Can'T Do Crush Attacks
|
||||
NoXpAtKill = 0x40, // Creature Kill Not Provide Xp
|
||||
NoCrushingBlows = 0x20, // Creature Can'T Do Crush Attacks
|
||||
NoXP = 0x40, // creature kill does not provide XP
|
||||
Trigger = 0x80, // Trigger Creature
|
||||
NoTaunt = 0x100, // Creature Is Immune To Taunt Auras And Effect Attack Me
|
||||
NoTaunt = 0x100, // Creature Is Immune To Taunt Auras And 'attack me' effects
|
||||
NoMoveFlagsUpdate = 0x200, // Creature won't update movement flags
|
||||
GhostVisibility = 0x400, // creature will be only visible for dead players
|
||||
GhostVisibility = 0x400, // creature will only be visible to dead players
|
||||
UseOffhandAttack = 0x800, // creature will use offhand attacks
|
||||
NoSellVendor = 0x1000, // players can't sell items to this vendor
|
||||
NoCombat = 0x2000, // creature is not allowed to enter combat
|
||||
IgnoreCombat = 0x2000, // creature is not allowed to enter combat
|
||||
Worldevent = 0x4000, // Custom Flag For World Event Creatures (Left Room For Merging)
|
||||
Guard = 0x8000, // Creature Is Guard
|
||||
Unused16 = 0x00010000,
|
||||
NoCrit = 0x20000, // Creature Can'T Do Critical Strikes
|
||||
NoSkillgain = 0x40000, // Creature Won'T Increase Weapon Skills
|
||||
TauntDiminish = 0x80000, // Taunt Is A Subject To Diminishing Returns On This Creautre
|
||||
AllDiminish = 0x100000, // Creature Is Subject To All Diminishing Returns As Player Are
|
||||
NoSkillGains = 0x40000, // creature won't increase weapon skills
|
||||
ObeysTauntDiminishingReturns = 0x80000, // Taunt is subject to diminishing returns on this creature
|
||||
AllDiminish = 0x100000, // creature is subject to all diminishing returns as players are
|
||||
NoPlayerDamageReq = 0x200000, // creature does not need to take player damage for kill credit
|
||||
Unused22 = 0x400000,
|
||||
Unused23 = 0x800000,
|
||||
|
||||
@@ -1643,7 +1643,7 @@ namespace Framework.Constants
|
||||
DispelAurasOnImmunity = 0x8000, // 15 Remove Auras On Immunity
|
||||
UnaffectedBySchoolImmune = 0x10000, // 16 On Immuniy
|
||||
UnautocastableByPet = 0x20000, // 17
|
||||
Unk18 = 0x40000, // 18 Stun, Polymorph, Daze, Hex
|
||||
PreventsAnim = 0x40000, // 18 Prevents Anim DESCRIPTION NYI, auras apply UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
|
||||
CantTargetSelf = 0x80000, // 19
|
||||
ReqComboPoints1 = 0x100000, // 20 Req Combo Points On Target
|
||||
Unk21 = 0x200000, // 21
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user