Core/Spells: Updated spell shapeshift form flags enum
This commit is contained in:
1 parent
2caca9e55c
commit
45df49c826
4 files changed
+29
-4
No files matched your search
@@ -518,6 +518,29 @@ enum EnchantmentSlotMask
|
||||
#define MAX_PET_TALENT_RANK 3 // use in calculations, expected <= MAX_TALENT_RANK
|
||||
#define MAX_TALENT_TABS 3
|
||||
|
||||
enum class SpellShapeshiftFormFlags : int32
|
||||
{
|
||||
Stance = 0x00000001,
|
||||
NotToggleable = 0x00000002, // player cannot cancel the aura giving this shapeshift
|
||||
PersistOnDeath = 0x00000004,
|
||||
CanInteractNPC = 0x00000008, // if the form does not have SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT then this flag must be present to allow NPC interaction
|
||||
DontUseWeapon = 0x00000010,
|
||||
|
||||
CanUseEquippedItems = 0x00000040, // 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 = 0x00000080, // 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 = 0x00000100, // clientside
|
||||
ConsideredDead = 0x00000200,
|
||||
CanOnlyCastShapeshiftSpells = 0x00000400, // prevents using spells that don't have any shapeshift requirement
|
||||
StanceCancelsAtFlightmaster = 0x00000800,
|
||||
NoEmoteSounds = 0x00001000,
|
||||
NoTriggerTeleport = 0x00002000,
|
||||
CannotChangeEquippedItems = 0x00004000,
|
||||
|
||||
CannotUseGameObjects = 0x00010000
|
||||
};
|
||||
|
||||
DEFINE_ENUM_FLAG(SpellShapeshiftFormFlags);
|
||||
|
||||
#define TaxiMaskSize 114
|
||||
typedef std::array<uint8, TaxiMaskSize> TaxiMask;
|
||||
|
||||
|
||||
@@ -2261,6 +2261,8 @@ struct SpellShapeshiftFormEntry
|
||||
uint32 PresetSpellID[MAX_SHAPESHIFT_SPELLS]; // 11 - 18 spells which appear in the bar after shapeshifting
|
||||
uint32 MountTypeID; // 19
|
||||
//uint32 ExitSoundEntriesID; // 20
|
||||
|
||||
EnumFlag<SpellShapeshiftFormFlags> GetFlags() const { return static_cast<SpellShapeshiftFormFlags>(Flags); }
|
||||
};
|
||||
|
||||
// SpellShapeshift.dbc
|
||||
|
||||
@@ -9394,7 +9394,7 @@ bool Unit::IsInDisallowedMountForm() const
|
||||
if (!shapeshift)
|
||||
return true;
|
||||
|
||||
if (!(shapeshift->Flags & 0x1))
|
||||
if (!shapeshift->GetFlags().HasFlag(SpellShapeshiftFormFlags::Stance))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1664,14 +1664,14 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
|
||||
TC_LOG_ERROR("spells", "GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
actAsShifted = !(shapeInfo->Flags & 1); // shapeshift acts as normal form for spells
|
||||
actAsShifted = !shapeInfo->GetFlags().HasFlag(SpellShapeshiftFormFlags::Stance);
|
||||
}
|
||||
|
||||
if (actAsShifted)
|
||||
{
|
||||
if (HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT)) // not while shapeshifted
|
||||
if (HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT) || (shapeInfo && shapeInfo->GetFlags().HasFlag(SpellShapeshiftFormFlags::CanOnlyCastShapeshiftSpells))) // not while shapeshifted
|
||||
return SPELL_FAILED_NOT_SHAPESHIFT;
|
||||
else if (Stances != UI64LIT(0)) // needs other shapeshift
|
||||
else if (Stances != 0) // needs other shapeshift
|
||||
return SPELL_FAILED_ONLY_SHAPESHIFT;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user