From 3cacc1ff6885ea1f46ca0396cc752d4db34cf05a Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 26 May 2022 16:25:16 -0400 Subject: [PATCH] Core/Misc: Define / rename attributes and flags Port From (https://github.com/TrinityCore/TrinityCore/commit/e72264cfbd4b3bd925a634d99ab1717a1c0a6b91) --- Source/Framework/Constants/CreatureConst.cs | 76 +++++++++---------- .../Framework/Constants/Spells/SpellConst.cs | 2 +- Source/Game/Entities/Creature/Creature.cs | 8 +- Source/Game/Entities/Creature/CreatureData.cs | 10 +-- Source/Game/Entities/Player/Player.cs | 4 +- Source/Game/Entities/Unit/Unit.Combat.cs | 2 +- Source/Game/Entities/Unit/Unit.Spells.cs | 2 +- Source/Game/Spells/Spell.cs | 2 +- 8 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Source/Framework/Constants/CreatureConst.cs b/Source/Framework/Constants/CreatureConst.cs index 268ba1968..138635fce 100644 --- a/Source/Framework/Constants/CreatureConst.cs +++ b/Source/Framework/Constants/CreatureConst.cs @@ -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, diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 8c0e5d896..3e4717a4c 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -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 diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index eee8875f7..5e55f224e 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -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(); diff --git a/Source/Game/Entities/Creature/CreatureData.cs b/Source/Game/Entities/Creature/CreatureData.cs index f12d0a4aa..e5023c9c2 100644 --- a/Source/Game/Entities/Creature/CreatureData.cs +++ b/Source/Game/Entities/Creature/CreatureData.cs @@ -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 diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index a7271b0fe..3ef159ed6 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -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 diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index 66b8172be..ce160f24c 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -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); diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index 907941c2b..d993e8fee 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -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) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 5612490e5..986fcd5a6 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -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; } }