Core/Spells: Updated spell shapeshift form flags enum

Port From (https://github.com/TrinityCore/TrinityCore/commit/6db27c58b97a028026e0159109fbf20f6132e6b5)
This commit is contained in:
hondacrx
2021-03-28 14:44:49 -04:00
parent fea5674e88
commit d93c4fc3cb
5 changed files with 31 additions and 15 deletions
+17 -9
View File
@@ -1701,15 +1701,23 @@ namespace Framework.Constants
public enum SpellShapeshiftFormFlags public enum SpellShapeshiftFormFlags
{ {
IsNotAShapeshift = 0x0001, Stance = 0x01,
CannotCancel = 0x0002, // Player Cannot Cancel The Aura Giving This Shapeshift NotToggleable = 0x02, // 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 PersistOnDeath = 0x04,
CanEquipItems = 0x0040, // If The Form Does Not Have IsNotAShapeshift Then This Flag Allows Equipping Items Without ItemFlagUsableWhenShapeshifted CanInteractNPC = 0x08, // if the form does not have SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT then this flag must be present to allow NPC interaction
CanUseItems = 0x0080, // If The Form Does Not Have IsNotAShapeshift Then This Flag Allows Using Items Without ItemFlagUsableWhenShapeshifted DontUseWeapon = 0x10,
CanAutoUnshift = 0x0100, // Clientside
PreventLfgTeleport = 0x0200, 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
PreventUsingOwnSkills = 0x0400, // Prevents Using Spells That Don'T Have Any Shapeshift Requirement 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
PreventEmoteSounds = 0x1000a 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 public enum SummonPropFlags
+10 -1
View File
@@ -337,7 +337,16 @@ namespace Framework.Constants
Stealth = 30, Stealth = 30,
MoonkinForm = 31, MoonkinForm = 31,
SpiritOfRedemption = 32, 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 public enum ReactiveType
@@ -2726,7 +2726,6 @@ namespace Game.Entities
}); });
return itemList; return itemList;
} }
public bool HasItemCount(uint item, uint count = 1, bool inBankAlso = false) public bool HasItemCount(uint item, uint count = 1, bool inBankAlso = false)
{ {
+1 -1
View File
@@ -282,7 +282,7 @@ namespace Game.Entities
if (shapeshift == null) if (shapeshift == null)
return true; return true;
if (!shapeshift.Flags.HasAnyFlag(SpellShapeshiftFormFlags.IsNotAShapeshift)) if (!shapeshift.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance))
return true; return true;
} }
if (displayId == GetNativeDisplayId()) if (displayId == GetNativeDisplayId())
+3 -3
View File
@@ -814,12 +814,12 @@ namespace Game.Spells
Log.outError(LogFilter.Spells, "GetErrorAtShapeshiftedCast: unknown shapeshift {0}", form); Log.outError(LogFilter.Spells, "GetErrorAtShapeshiftedCast: unknown shapeshift {0}", form);
return SpellCastResult.SpellCastOk; return SpellCastResult.SpellCastOk;
} }
actAsShifted = !shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.IsNotAShapeshift); actAsShifted = !shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance);
} }
if (actAsShifted) 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; return SpellCastResult.NotShapeshift;
else if (Stances != 0) // needs other shapeshift else if (Stances != 0) // needs other shapeshift
return SpellCastResult.OnlyShapeshift; return SpellCastResult.OnlyShapeshift;
@@ -1214,7 +1214,7 @@ namespace Game.Spells
if (effect != null && effect.ApplyAuraName == AuraType.ModShapeshift) if (effect != null && effect.ApplyAuraName == AuraType.ModShapeshift)
{ {
var shapeShiftFromEntry = CliDB.SpellShapeshiftFormStorage.LookupByKey((uint)effect.MiscValue); 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; checkMask |= VehicleSeatFlags.Uncontrolled;
break; break;
} }