From d93c4fc3cbe6d9f8504ebaa06f69f5630d06653a Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 28 Mar 2021 14:44:49 -0400 Subject: [PATCH] Core/Spells: Updated spell shapeshift form flags enum Port From (https://github.com/TrinityCore/TrinityCore/commit/6db27c58b97a028026e0159109fbf20f6132e6b5) --- Source/Framework/Constants/CliDBConst.cs | 26 ++++++++++++++------- Source/Framework/Constants/UnitConst.cs | 11 ++++++++- Source/Game/Entities/Player/Player.Items.cs | 1 - Source/Game/Entities/Unit/Unit.cs | 2 +- Source/Game/Spells/SpellInfo.cs | 6 ++--- 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Source/Framework/Constants/CliDBConst.cs b/Source/Framework/Constants/CliDBConst.cs index 46860d9f0..a857cb335 100644 --- a/Source/Framework/Constants/CliDBConst.cs +++ b/Source/Framework/Constants/CliDBConst.cs @@ -1701,15 +1701,23 @@ namespace Framework.Constants public enum SpellShapeshiftFormFlags { - IsNotAShapeshift = 0x0001, - CannotCancel = 0x0002, // Player Cannot Cancel The Aura Giving This Shapeshift - CanInteract = 0x0008, // If The Form Does Not Have IsNotAShapeshift Then This Flag Must Be Present To Allow Npc Interaction - CanEquipItems = 0x0040, // If The Form Does Not Have IsNotAShapeshift Then This Flag Allows Equipping Items Without ItemFlagUsableWhenShapeshifted - CanUseItems = 0x0080, // If The Form Does Not Have IsNotAShapeshift Then This Flag Allows Using Items Without ItemFlagUsableWhenShapeshifted - CanAutoUnshift = 0x0100, // Clientside - PreventLfgTeleport = 0x0200, - PreventUsingOwnSkills = 0x0400, // Prevents Using Spells That Don'T Have Any Shapeshift Requirement - PreventEmoteSounds = 0x1000a + Stance = 0x01, + NotToggleable = 0x02, // player cannot cancel the aura giving this shapeshift + PersistOnDeath = 0x04, + CanInteractNPC = 0x08, // if the form does not have SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT then this flag must be present to allow NPC interaction + DontUseWeapon = 0x10, + + CanUseEquippedItems = 0x40, // if the form does not have SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT then this flag allows equipping items without ITEM_FLAG_USABLE_WHEN_SHAPESHIFTED + CanUseItems = 0x80, // if the form does not have SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT then this flag allows using items without ITEM_FLAG_USABLE_WHEN_SHAPESHIFTED + DontAutoUnshift = 0x100, // clientside + ConsideredDead = 0x200, + CanOnlyCastShapeshiftSpells = 0x400, // prevents using spells that don't have any shapeshift requirement + StanceCancelsAtFlightmaster = 0x800, + NoEmoteSounds = 0x1000, + NoTriggerTeleport = 0x2000, + CannotChangeEquippedItems = 0x4000, + + CannotUseGameObjects = 0x10000 } public enum SummonPropFlags diff --git a/Source/Framework/Constants/UnitConst.cs b/Source/Framework/Constants/UnitConst.cs index 7170c48dc..258a69054 100644 --- a/Source/Framework/Constants/UnitConst.cs +++ b/Source/Framework/Constants/UnitConst.cs @@ -337,7 +337,16 @@ namespace Framework.Constants Stealth = 30, MoonkinForm = 31, SpiritOfRedemption = 32, - GladiatorStance = 33 + GladiatorStance = 33, + Metamorphosis2 = 34, + MoonkinRestoration = 35, + TreantForm = 36, + SpiritOwlForm = 37, + SpiritOwl2 = 38, + WispForm = 39, + Wisp2 = 40, + Soulshape = 41, + ForgeborneReveries = 42 } public enum ReactiveType diff --git a/Source/Game/Entities/Player/Player.Items.cs b/Source/Game/Entities/Player/Player.Items.cs index 21e7065d9..9c1b9480c 100644 --- a/Source/Game/Entities/Player/Player.Items.cs +++ b/Source/Game/Entities/Player/Player.Items.cs @@ -2726,7 +2726,6 @@ namespace Game.Entities }); return itemList; - } public bool HasItemCount(uint item, uint count = 1, bool inBankAlso = false) { diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index 5569784cb..1833e202d 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -282,7 +282,7 @@ namespace Game.Entities if (shapeshift == null) return true; - if (!shapeshift.Flags.HasAnyFlag(SpellShapeshiftFormFlags.IsNotAShapeshift)) + if (!shapeshift.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance)) return true; } if (displayId == GetNativeDisplayId()) diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 6b7819e12..81b7c328b 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -814,12 +814,12 @@ namespace Game.Spells Log.outError(LogFilter.Spells, "GetErrorAtShapeshiftedCast: unknown shapeshift {0}", form); return SpellCastResult.SpellCastOk; } - actAsShifted = !shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.IsNotAShapeshift); + actAsShifted = !shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance); } if (actAsShifted) { - if (HasAttribute(SpellAttr0.NotShapeshift) || (shapeInfo != null && shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.PreventUsingOwnSkills))) // not while shapeshifted + if (HasAttribute(SpellAttr0.NotShapeshift) || (shapeInfo != null && shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.CanOnlyCastShapeshiftSpells))) // not while shapeshifted return SpellCastResult.NotShapeshift; else if (Stances != 0) // needs other shapeshift return SpellCastResult.OnlyShapeshift; @@ -1214,7 +1214,7 @@ namespace Game.Spells if (effect != null && effect.ApplyAuraName == AuraType.ModShapeshift) { var shapeShiftFromEntry = CliDB.SpellShapeshiftFormStorage.LookupByKey((uint)effect.MiscValue); - if (shapeShiftFromEntry != null && !shapeShiftFromEntry.Flags.HasAnyFlag(SpellShapeshiftFormFlags.IsNotAShapeshift)) + if (shapeShiftFromEntry != null && !shapeShiftFromEntry.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance)) checkMask |= VehicleSeatFlags.Uncontrolled; break; }