Core/Spells: Defined known shapeshift flags

This commit is contained in:
Shauren
2016-08-23 16:00:44 +02:00
parent f7cdc78f80
commit 4a13ec2fcb
3 changed files with 16 additions and 12 deletions

View File

@@ -729,6 +729,19 @@ enum SpellProcsPerMinuteModType
SPELL_PPM_MOD_BATTLEGROUND = 7
};
enum SpellShapeshiftFormFlags
{
SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT = 0x0001,
SHAPESHIFT_FORM_CANNOT_CANCEL = 0x0002, // player cannot cancel the aura giving this shapeshift
SHAPESHIFT_FORM_CAN_INTERACT = 0x0008, // if the form does not have SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT then this flag must be present to allow NPC interaction
SHAPESHIFT_FORM_CAN_EQUIP_ITEMS = 0x0040, // if the form does not have SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT then this flag allows equipping items without ITEM_FLAG_USABLE_WHEN_SHAPESHIFTED
SHAPESHIFT_FORM_CAN_USE_ITEMS = 0x0080, // if the form does not have SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT then this flag allows using items without ITEM_FLAG_USABLE_WHEN_SHAPESHIFTED
SHAPESHIFT_FORM_CAN_AUTO_UNSHIFT = 0x0100, // clientside
SHAPESHIFT_FORM_PREVENT_LFG_TELEPORT = 0x0200,
SHAPESHIFT_FORM_PREVENT_USING_OWN_SKILLS = 0x0400, // prevents using spells that don't have any shapeshift requirement
SHAPESHIFT_FORM_PREVENT_EMOTE_SOUNDS = 0x1000
};
#define TaxiMaskSize 236
typedef std::array<uint8, TaxiMaskSize> TaxiMask;

View File

@@ -10713,7 +10713,7 @@ bool Unit::IsInDisallowedMountForm() const
if (!shapeshift)
return true;
if (!(shapeshift->Flags & 0x1))
if (!(shapeshift->Flags & SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT))
return true;
}

View File

@@ -1652,12 +1652,12 @@ 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->Flags & SHAPESHIFT_FORM_IS_NOT_A_SHAPESHIFT);
}
if (actAsShifted)
{
if (Attributes & SPELL_ATTR0_NOT_SHAPESHIFT) // not while shapeshifted
if (Attributes & SPELL_ATTR0_NOT_SHAPESHIFT || (shapeInfo && shapeInfo->Flags & SHAPESHIFT_FORM_PREVENT_USING_OWN_SKILLS)) // not while shapeshifted
return SPELL_FAILED_NOT_SHAPESHIFT;
else if (Stances != 0) // needs other shapeshift
return SPELL_FAILED_ONLY_SHAPESHIFT;
@@ -1669,15 +1669,6 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
return SPELL_FAILED_ONLY_SHAPESHIFT;
}
// Check if stance disables cast of not-stance spells
// Example: cannot cast any other spells in zombie or ghoul form
/// @todo Find a way to disable use of these spells clientside
if (shapeInfo && shapeInfo->Flags & 0x400)
{
if (!(stanceMask & Stances))
return SPELL_FAILED_ONLY_SHAPESHIFT;
}
return SPELL_CAST_OK;
}