mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
fix(Core/Spells): Fixed players being able to mount with all transfor… (#11767)
…m auras. Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -20669,3 +20669,58 @@ bool Unit::CanRestoreMana(SpellInfo const* spellInfo) const
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Unit::IsInDisallowedMountForm() const
|
||||
{
|
||||
if (SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(getTransForm()))
|
||||
{
|
||||
if (transformSpellInfo->HasAttribute(SPELL_ATTR0_ALLOW_WHILE_MOUNTED))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ShapeshiftForm form = GetShapeshiftForm())
|
||||
{
|
||||
SpellShapeshiftEntry const* shapeshift = sSpellShapeshiftStore.LookupEntry(form);
|
||||
if (!shapeshift)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(shapeshift->flags1 & 0x1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetDisplayId() == GetNativeDisplayId())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CreatureDisplayInfoEntry const* display = sCreatureDisplayInfoStore.LookupEntry(GetDisplayId());
|
||||
if (!display)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtendedDisplayInfoID);
|
||||
if (!displayExtra)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelId);
|
||||
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->DisplayRaceID);
|
||||
|
||||
if (model && !(model->HasFlag(CREATURE_MODEL_DATA_FLAGS_CAN_MOUNT)))
|
||||
{
|
||||
if (race && !(race->HasFlag(CHRRACES_FLAGS_CAN_MOUNT)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2034,18 +2034,13 @@ public:
|
||||
SetByteValue(UNIT_FIELD_BYTES_2, 3, form);
|
||||
}
|
||||
|
||||
[[nodiscard]] inline bool IsInFeralForm() const
|
||||
[[nodiscard]] bool IsInFeralForm() const
|
||||
{
|
||||
ShapeshiftForm form = GetShapeshiftForm();
|
||||
return form == FORM_CAT || form == FORM_BEAR || form == FORM_DIREBEAR || form == FORM_GHOSTWOLF; // Xinef: added shamans Ghost Wolf, should behave exactly like druid forms
|
||||
}
|
||||
|
||||
[[nodiscard]] inline bool IsInDisallowedMountForm() const
|
||||
{
|
||||
ShapeshiftForm form = GetShapeshiftForm();
|
||||
return form != FORM_NONE && form != FORM_BATTLESTANCE && form != FORM_BERSERKERSTANCE && form != FORM_DEFENSIVESTANCE &&
|
||||
form != FORM_SHADOW && form != FORM_STEALTH && form != FORM_UNDEAD;
|
||||
}
|
||||
[[nodiscard]] bool IsInDisallowedMountForm() const;
|
||||
|
||||
float m_modMeleeHitChance;
|
||||
float m_modRangedHitChance;
|
||||
@@ -2127,7 +2122,7 @@ public:
|
||||
void AddInterruptMask(uint32 mask) { m_interruptMask |= mask; }
|
||||
void UpdateInterruptMask();
|
||||
|
||||
uint32 GetDisplayId() { return GetUInt32Value(UNIT_FIELD_DISPLAYID); }
|
||||
[[nodiscard]] uint32 GetDisplayId() const { return GetUInt32Value(UNIT_FIELD_DISPLAYID); }
|
||||
virtual void SetDisplayId(uint32 modelId);
|
||||
[[nodiscard]] uint32 GetNativeDisplayId() const { return GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID); }
|
||||
void RestoreDisplayId();
|
||||
|
||||
Reference in New Issue
Block a user