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]
|
[Flags]
|
||||||
public enum CreatureTypeFlags : uint
|
public enum CreatureTypeFlags : uint
|
||||||
{
|
{
|
||||||
TameablePet = 0x01, // Makes the mob tameable (must also be a beast and have family set)
|
Tameable = 0x00000001, // 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?
|
VisibleToGhosts = 0x00000002, // Creature Is Also Visible For Not Alive Player. Allows Gossip Interaction If Npcflag Allows?
|
||||||
BossMob = 0x04, // Changes creature's visible level to "??" in the creature's portrait - Immune Knockback.
|
BossMob = 0x00000004, // Changes Creature'S Visible Level To "??" In The Creature'S Portrait - Immune Knockback.
|
||||||
DoNotPlayWoundParryAnimation = 0x08,
|
DoNotPlayWoundAnim = 0x00000008,
|
||||||
HideFactionTooltip = 0x10,
|
NoFactionTooltip = 0x00000010,
|
||||||
Unk5 = 0x20, // Sound related
|
MoreAudible = 0x00000020, // Sound Related
|
||||||
SpellAttackable = 0x40,
|
SpellAttackable = 0x00000040,
|
||||||
CanInteractWhileDead = 0x80, // Player can interact with the creature if its dead (not player dead)
|
InteractWhileDead = 0x00000080, // Player Can Interact With The Creature If Creature Is Dead (Not If Player Is Dead)
|
||||||
HerbSkinningSkill = 0x100, // Can be looted by herbalist
|
SkinWithHerbalism = 0x00000100, // Can Be Looted By Herbalist
|
||||||
MiningSkinningSkill = 0x200, // Can be looted by miner
|
SkinWithMining = 0x00000200, // Can Be Looted By Miner
|
||||||
DoNotLogDeath = 0x400, // Death event will not show up in combat log
|
NoDeathMessage = 0x00000400, // Death Event Will Not Show Up In Combat Log
|
||||||
MountedCombatAllowed = 0x800, // Creature can remain mounted when entering combat
|
AllowMountedCombat = 0x00000800, // Creature Can Remain Mounted When Entering Combat
|
||||||
CanAssist = 0x1000, // ? Can aid any player in combat if in range?
|
CanAssist = 0x00001000, // ? Can Aid Any Player In Combat If In Range?
|
||||||
IsPetBarUsed = 0x2000,
|
NoPetBar = 0x00002000,
|
||||||
MaskUID = 0x4000,
|
MaskUid = 0x00004000,
|
||||||
EngineeringSkinningSkill = 0x8000, // Can be looted by engineer
|
SkinWithEngineering = 0x00008000, // Can Be Looted By Engineer
|
||||||
ExoticPet = 0x10000, // Can be tamed by hunter as exotic pet
|
TameableExotic = 0x00010000, // Can Be Tamed By Hunter As Exotic Pet
|
||||||
UseDefaultCollisionBox = 0x20000, // Collision related. (always using default collision box?)
|
UseModelCollisionSize = 0x00020000, // Collision Related. (Always Using Default Collision Box?)
|
||||||
IsSiegeWeapon = 0x40000,
|
AllowInteractionWhileInCombat = 0x00040000,
|
||||||
CanCollideWithMissiles = 0x80000, // Projectiles can collide with this creature - interacts with TARGET_DEST_TRAJ
|
CollideWithMissiles = 0x00080000, // Projectiles Can Collide With This Creature - Interacts With TargetDestTraj
|
||||||
HideNamePlate = 0x100000,
|
NoNamePlate = 0x00100000,
|
||||||
DoNotPlayMountedAnimations = 0x200000,
|
DoNotPlayMountedAnimations = 0x00200000,
|
||||||
IsLinkAll = 0x400000,
|
LinkAll = 0x00400000,
|
||||||
InteractOnlyWithCreator = 0x800000,
|
InteractOnlyWithCreator = 0x00800000,
|
||||||
DoNotPlayUnitEventSounds = 0x1000000,
|
DoNotPlayUnitEventSounds = 0x01000000,
|
||||||
HasNoShadowBlob = 0x2000000,
|
HasNoShadowBlob = 0x02000000,
|
||||||
TreatAsRaidUnit = 0x4000000, //! Creature can be targeted by spells that require target to be in caster's party/raid
|
TreatAsRaidUnit = 0x04000000, //! 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.
|
ForceGossip = 0x08000000, // Allows The Creature To Display A Single Gossip Option.
|
||||||
DoNotSheathe = 0x10000000,
|
DoNotSheathe = 0x10000000,
|
||||||
DoNotTargetOnInteration = 0x20000000,
|
DoNotTargetOnInteraction = 0x20000000,
|
||||||
DoNotRenderObjectName = 0x40000000,
|
DoNotRenderObjectName = 0x40000000,
|
||||||
UnitIsQuestBoss = 0x80000000 // Not verified
|
QuestBoss = 0x80000000 // Not Verified
|
||||||
}
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
@@ -218,22 +218,22 @@ namespace Framework.Constants
|
|||||||
NoParry = 0x04, // Creature Can'T Parry
|
NoParry = 0x04, // Creature Can'T Parry
|
||||||
NoParryHasten = 0x08, // Creature Can'T Counter-Attack At Parry
|
NoParryHasten = 0x08, // Creature Can'T Counter-Attack At Parry
|
||||||
NoBlock = 0x10, // Creature Can'T Block
|
NoBlock = 0x10, // Creature Can'T Block
|
||||||
NoCrush = 0x20, // Creature Can'T Do Crush Attacks
|
NoCrushingBlows = 0x20, // Creature Can'T Do Crush Attacks
|
||||||
NoXpAtKill = 0x40, // Creature Kill Not Provide Xp
|
NoXP = 0x40, // creature kill does not provide XP
|
||||||
Trigger = 0x80, // Trigger Creature
|
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
|
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
|
UseOffhandAttack = 0x800, // creature will use offhand attacks
|
||||||
NoSellVendor = 0x1000, // players can't sell items to this vendor
|
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)
|
Worldevent = 0x4000, // Custom Flag For World Event Creatures (Left Room For Merging)
|
||||||
Guard = 0x8000, // Creature Is Guard
|
Guard = 0x8000, // Creature Is Guard
|
||||||
Unused16 = 0x00010000,
|
Unused16 = 0x00010000,
|
||||||
NoCrit = 0x20000, // Creature Can'T Do Critical Strikes
|
NoCrit = 0x20000, // Creature Can'T Do Critical Strikes
|
||||||
NoSkillgain = 0x40000, // Creature Won'T Increase Weapon Skills
|
NoSkillGains = 0x40000, // creature won't increase weapon skills
|
||||||
TauntDiminish = 0x80000, // Taunt Is A Subject To Diminishing Returns On This Creautre
|
ObeysTauntDiminishingReturns = 0x80000, // Taunt is subject to diminishing returns on this creature
|
||||||
AllDiminish = 0x100000, // Creature Is Subject To All Diminishing Returns As Player Are
|
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
|
NoPlayerDamageReq = 0x200000, // creature does not need to take player damage for kill credit
|
||||||
Unused22 = 0x400000,
|
Unused22 = 0x400000,
|
||||||
Unused23 = 0x800000,
|
Unused23 = 0x800000,
|
||||||
|
|||||||
@@ -1643,7 +1643,7 @@ namespace Framework.Constants
|
|||||||
DispelAurasOnImmunity = 0x8000, // 15 Remove Auras On Immunity
|
DispelAurasOnImmunity = 0x8000, // 15 Remove Auras On Immunity
|
||||||
UnaffectedBySchoolImmune = 0x10000, // 16 On Immuniy
|
UnaffectedBySchoolImmune = 0x10000, // 16 On Immuniy
|
||||||
UnautocastableByPet = 0x20000, // 17
|
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
|
CantTargetSelf = 0x80000, // 19
|
||||||
ReqComboPoints1 = 0x100000, // 20 Req Combo Points On Target
|
ReqComboPoints1 = 0x100000, // 20 Req Combo Points On Target
|
||||||
Unk21 = 0x200000, // 21
|
Unk21 = 0x200000, // 21
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ namespace Game.Entities
|
|||||||
ApplySpellImmune(0, SpellImmunity.Effect, SpellEffectName.AttackMe, true);
|
ApplySpellImmune(0, SpellImmunity.Effect, SpellEffectName.AttackMe, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetIgnoringCombat(cInfo.FlagsExtra.HasFlag(CreatureFlagsExtra.NoCombat));
|
SetIgnoringCombat(cInfo.FlagsExtra.HasFlag(CreatureFlagsExtra.IgnoreCombat));
|
||||||
|
|
||||||
LoadTemplateRoot();
|
LoadTemplateRoot();
|
||||||
InitializeMovementFlags();
|
InitializeMovementFlags();
|
||||||
@@ -850,7 +850,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allow players to see those units while dead, do it here (mayby altered by addon auras)
|
// 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);
|
m_serverSideVisibility.SetValue(ServerSideVisibilityType.Ghost, GhostVisibilityType.Alive | GhostVisibilityType.Ghost);
|
||||||
|
|
||||||
if (!CreateFromProto(guidlow, entry, data, vehId))
|
if (!CreateFromProto(guidlow, entry, data, vehId))
|
||||||
@@ -1056,7 +1056,7 @@ namespace Game.Entities
|
|||||||
return !IsCritter()
|
return !IsCritter()
|
||||||
&& !IsPet()
|
&& !IsPet()
|
||||||
&& !IsTotem()
|
&& !IsTotem()
|
||||||
&& !GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.NoXpAtKill);
|
&& !GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.NoXP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsEngaged()
|
public override bool IsEngaged()
|
||||||
@@ -1071,7 +1071,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
base.AtEngage(target);
|
base.AtEngage(target);
|
||||||
|
|
||||||
if (!GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.MountedCombatAllowed))
|
if (!GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.AllowMountedCombat))
|
||||||
Dismount();
|
Dismount();
|
||||||
|
|
||||||
RefreshSwimmingFlag();
|
RefreshSwimmingFlag();
|
||||||
|
|||||||
@@ -174,11 +174,11 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public SkillType GetRequiredLootSkill()
|
public SkillType GetRequiredLootSkill()
|
||||||
{
|
{
|
||||||
if (TypeFlags.HasAnyFlag(CreatureTypeFlags.HerbSkinningSkill))
|
if (TypeFlags.HasAnyFlag(CreatureTypeFlags.SkinWithHerbalism))
|
||||||
return SkillType.Herbalism;
|
return SkillType.Herbalism;
|
||||||
else if (TypeFlags.HasAnyFlag(CreatureTypeFlags.MiningSkinningSkill))
|
else if (TypeFlags.HasAnyFlag(CreatureTypeFlags.SkinWithMining))
|
||||||
return SkillType.Mining;
|
return SkillType.Mining;
|
||||||
else if (TypeFlags.HasAnyFlag(CreatureTypeFlags.EngineeringSkinningSkill))
|
else if (TypeFlags.HasAnyFlag(CreatureTypeFlags.SkinWithEngineering))
|
||||||
return SkillType.Engineering;
|
return SkillType.Engineering;
|
||||||
else
|
else
|
||||||
return SkillType.Skinning; // normal case
|
return SkillType.Skinning; // normal case
|
||||||
@@ -186,11 +186,11 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public bool IsExotic()
|
public bool IsExotic()
|
||||||
{
|
{
|
||||||
return (TypeFlags & CreatureTypeFlags.ExoticPet) != 0;
|
return (TypeFlags & CreatureTypeFlags.TameableExotic) != 0;
|
||||||
}
|
}
|
||||||
public bool IsTameable(bool canTameExotic)
|
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;
|
return false;
|
||||||
|
|
||||||
// if can tame exotic then can tame any tameable
|
// if can tame exotic then can tame any tameable
|
||||||
|
|||||||
@@ -5508,11 +5508,11 @@ namespace Game.Entities
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
// Deathstate checks
|
// Deathstate checks
|
||||||
if (!IsAlive() && !Convert.ToBoolean(creature.GetCreatureTemplate().TypeFlags & CreatureTypeFlags.GhostVisible))
|
if (!IsAlive() && !Convert.ToBoolean(creature.GetCreatureTemplate().TypeFlags & CreatureTypeFlags.VisibleToGhosts))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// alive or spirit healer
|
// 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;
|
return null;
|
||||||
|
|
||||||
// appropriate npc type
|
// appropriate npc type
|
||||||
|
|||||||
@@ -1313,7 +1313,7 @@ namespace Game.Entities
|
|||||||
if (attackerLevel >= victimLevel + 4 &&
|
if (attackerLevel >= victimLevel + 4 &&
|
||||||
// can be from by creature (if can) or from controlled player that considered as creature
|
// can be from by creature (if can) or from controlled player that considered as creature
|
||||||
!IsControlledByPlayer() &&
|
!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%
|
// add 2% chance per level, min. is 15%
|
||||||
tmp = (int)(attackerLevel - victimLevel * 1000 - 1500);
|
tmp = (int)(attackerLevel - victimLevel * 1000 - 1500);
|
||||||
|
|||||||
@@ -2285,7 +2285,7 @@ namespace Game.Entities
|
|||||||
switch (group)
|
switch (group)
|
||||||
{
|
{
|
||||||
case DiminishingGroup.Taunt:
|
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;
|
DiminishingLevels diminish = previousLevel;
|
||||||
switch (diminish)
|
switch (diminish)
|
||||||
|
|||||||
@@ -1295,7 +1295,7 @@ namespace Game.Spells
|
|||||||
Creature creatureTarget = unitTarget.ToCreature();
|
Creature creatureTarget = unitTarget.ToCreature();
|
||||||
if (creatureTarget)
|
if (creatureTarget)
|
||||||
{
|
{
|
||||||
if (!creatureTarget.GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.CanCollideWithMissiles))
|
if (!creatureTarget.GetCreatureTemplate().TypeFlags.HasAnyFlag(CreatureTypeFlags.CollideWithMissiles))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user