Core/Spells: Extended mechanic mask to uint64

This commit is contained in:
Shauren
2022-12-04 15:07:36 +01:00
parent 943e37f208
commit de7c03c838
14 changed files with 82 additions and 61 deletions
@@ -0,0 +1,5 @@
--
-- Table structure for table `creature_template`
--
ALTER TABLE `creature_template` MODIFY `mechanic_immune_mask` bigint unsigned NOT NULL DEFAULT 0;
+2 -2
View File
@@ -3787,7 +3787,7 @@ int32 GetUnitConditionVariable(Unit const* unit, Unit const* otherUnit, UnitCond
case UnitConditionVariable::HasHelpfulAuraMechanic:
return unit->GetAuraApplication([value](AuraApplication const* aurApp)
{
return (aurApp->GetFlags() & AFLAG_NEGATIVE) == 0 && (aurApp->GetBase()->GetSpellInfo()->GetSpellMechanicMaskByEffectMask(aurApp->GetEffectMask()) & (1 << value)) != 0;
return (aurApp->GetFlags() & AFLAG_NEGATIVE) == 0 && (aurApp->GetBase()->GetSpellInfo()->GetSpellMechanicMaskByEffectMask(aurApp->GetEffectMask()) & (UI64LIT(1) << value)) != 0;
}) != nullptr ? value : 0;
case UnitConditionVariable::HasHarmfulAuraSpell:
return unit->GetAuraApplication(value, [](AuraApplication const* aurApp)
@@ -3802,7 +3802,7 @@ int32 GetUnitConditionVariable(Unit const* unit, Unit const* otherUnit, UnitCond
case UnitConditionVariable::HasHarmfulAuraMechanic:
return unit->GetAuraApplication([value](AuraApplication const* aurApp)
{
return (aurApp->GetFlags() & AFLAG_NEGATIVE) != 0 && (aurApp->GetBase()->GetSpellInfo()->GetSpellMechanicMaskByEffectMask(aurApp->GetEffectMask()) & (1 << value)) != 0;
return (aurApp->GetFlags() & AFLAG_NEGATIVE) != 0 && (aurApp->GetBase()->GetSpellInfo()->GetSpellMechanicMaskByEffectMask(aurApp->GetEffectMask()) & (UI64LIT(1) << value)) != 0;
}) != nullptr ? value : 0;
case UnitConditionVariable::HasHarmfulAuraSchool:
return unit->GetAuraApplication([value](AuraApplication const* aurApp)
@@ -2326,11 +2326,11 @@ void Creature::LoadTemplateImmunities()
if (GetOwnerGUID().IsPlayer() && IsHunterPet())
return;
if (uint32 mask = GetCreatureTemplate()->MechanicImmuneMask)
if (uint64 mask = GetCreatureTemplate()->MechanicImmuneMask)
{
for (uint32 i = MECHANIC_NONE + 1; i < MAX_MECHANIC; ++i)
{
if (mask & (1 << (i - 1)))
if (mask & (UI64LIT(1) << (i - 1)))
ApplySpellImmune(placeholderSpellId, IMMUNITY_MECHANIC, i, true);
}
}
@@ -474,7 +474,7 @@ struct TC_GAME_API CreatureTemplate
int32 WidgetSetID;
int32 WidgetSetUnitConditionID;
bool RegenHealth;
uint32 MechanicImmuneMask;
uint64 MechanicImmuneMask;
uint32 SpellSchoolImmuneMask;
uint32 flags_extra;
uint32 ScriptID;
+15 -15
View File
@@ -4011,7 +4011,7 @@ void Unit::RemoveMovementImpairingAuras(bool withRoot)
RemoveAurasWithMechanic(1 << MECHANIC_SNARE, AURA_REMOVE_BY_DEFAULT, 0, false);
}
void Unit::RemoveAurasWithMechanic(uint32 mechanicMaskToRemove, AuraRemoveMode removeMode, uint32 exceptSpellId, bool withEffectMechanics)
void Unit::RemoveAurasWithMechanic(uint64 mechanicMaskToRemove, AuraRemoveMode removeMode, uint32 exceptSpellId, bool withEffectMechanics)
{
RemoveAppliedAuras([=](AuraApplication const* aurApp)
{
@@ -4019,12 +4019,12 @@ void Unit::RemoveAurasWithMechanic(uint32 mechanicMaskToRemove, AuraRemoveMode r
if (exceptSpellId && aura->GetId() == exceptSpellId)
return false;
uint32 appliedMechanicMask = aura->GetSpellInfo()->GetSpellMechanicMaskByEffectMask(aurApp->GetEffectMask());
uint64 appliedMechanicMask = aura->GetSpellInfo()->GetSpellMechanicMaskByEffectMask(aurApp->GetEffectMask());
if (!(appliedMechanicMask & mechanicMaskToRemove))
return false;
// spell mechanic matches required mask for removal
if ((1 << aura->GetSpellInfo()->Mechanic) & mechanicMaskToRemove || withEffectMechanics)
if ((UI64LIT(1) << aura->GetSpellInfo()->Mechanic) & mechanicMaskToRemove || withEffectMechanics)
return true;
// effect mechanic matches required mask for removal - don't remove, only update targets
@@ -4035,7 +4035,7 @@ void Unit::RemoveAurasWithMechanic(uint32 mechanicMaskToRemove, AuraRemoveMode r
void Unit::RemoveAurasByShapeShift()
{
uint32 mechanic_mask = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT);
uint64 mechanic_mask = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT);
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
{
Aura const* aura = iter->second->GetBase();
@@ -4578,17 +4578,17 @@ bool Unit::HasNegativeAuraWithInterruptFlag(InterruptFlags flag, ObjectGuid guid
template TC_GAME_API bool Unit::HasNegativeAuraWithInterruptFlag(SpellAuraInterruptFlags flag, ObjectGuid guid) const;
template TC_GAME_API bool Unit::HasNegativeAuraWithInterruptFlag(SpellAuraInterruptFlags2 flag, ObjectGuid guid) const;
bool Unit::HasAuraWithMechanic(uint32 mechanicMask) const
bool Unit::HasAuraWithMechanic(uint64 mechanicMask) const
{
for (AuraApplicationMap::const_iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end(); ++iter)
{
SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
if (spellInfo->Mechanic && (mechanicMask & (1 << spellInfo->Mechanic)))
if (spellInfo->Mechanic && (mechanicMask & (UI64LIT(1) << spellInfo->Mechanic)))
return true;
for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
if (iter->second->HasEffect(spellEffectInfo.EffectIndex) && spellEffectInfo.IsEffect() && spellEffectInfo.Mechanic)
if (mechanicMask & (1 << spellEffectInfo.Mechanic))
if (mechanicMask & (UI64LIT(1) << spellEffectInfo.Mechanic))
return true;
}
@@ -6604,11 +6604,11 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
float TakenTotalMod = 1.0f;
// Mod damage from spell mechanic
if (uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask())
if (uint64 mechanicMask = spellProto->GetAllEffectsMechanicMask())
{
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT, [mechanicMask](AuraEffect const* aurEff) -> bool
{
if (mechanicMask & uint32(1 << (aurEff->GetMiscValue())))
if (mechanicMask & uint64(UI64LIT(1) << aurEff->GetMiscValue()))
return true;
return false;
});
@@ -7310,12 +7310,12 @@ uint32 Unit::GetDamageImmunityMask() const
return mask;
}
uint32 Unit::GetMechanicImmunityMask() const
uint64 Unit::GetMechanicImmunityMask() const
{
uint32 mask = 0;
uint64 mask = 0;
SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
for (auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
mask |= (1 << itr->first);
mask |= (UI64LIT(1) << itr->first);
return mask;
}
@@ -7520,7 +7520,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
});
// Mod damage from spell mechanic
uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask();
uint64 mechanicMask = spellProto->GetAllEffectsMechanicMask();
// Shred, Maul - "Effects which increase Bleed damage also increase Shred damage"
if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[0] & 0x00008800)
@@ -7530,7 +7530,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
{
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT, [mechanicMask](AuraEffect const* aurEff) -> bool
{
if (mechanicMask & uint32(1 << (aurEff->GetMiscValue())))
if (mechanicMask & uint64(UI64LIT(1) << (aurEff->GetMiscValue())))
return true;
return false;
});
@@ -8198,7 +8198,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype)
{
if (Creature* creature = ToCreature())
{
uint32 immuneMask = creature->GetCreatureTemplate()->MechanicImmuneMask;
uint64 immuneMask = creature->GetCreatureTemplate()->MechanicImmuneMask;
if (immuneMask & (1 << (MECHANIC_SNARE - 1)) || immuneMask & (1 << (MECHANIC_DAZE - 1)))
break;
}
+3 -3
View File
@@ -1387,7 +1387,7 @@ class TC_GAME_API Unit : public WorldObject
void RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const* source = nullptr);
void RemoveAurasWithAttribute(uint32 flags);
void RemoveAurasWithFamily(SpellFamilyNames family, flag128 const& familyFlag, ObjectGuid casterGUID);
void RemoveAurasWithMechanic(uint32 mechanicMaskToRemove, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT, uint32 exceptSpellId = 0, bool withEffectMechanics = false);
void RemoveAurasWithMechanic(uint64 mechanicMaskToRemove, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT, uint32 exceptSpellId = 0, bool withEffectMechanics = false);
void RemoveMovementImpairingAuras(bool withRoot);
void RemoveAurasByShapeShift();
@@ -1441,7 +1441,7 @@ class TC_GAME_API Unit : public WorldObject
bool HasAuraTypeWithTriggerSpell(AuraType auratype, uint32 triggerSpell) const;
template <typename InterruptFlags>
bool HasNegativeAuraWithInterruptFlag(InterruptFlags flag, ObjectGuid guid = ObjectGuid::Empty) const;
bool HasAuraWithMechanic(uint32 mechanicMask) const;
bool HasAuraWithMechanic(uint64 mechanicMask) const;
bool HasStrongerAuraWithDR(SpellInfo const* auraSpellInfo, Unit* caster) const;
AuraEffect* IsScriptOverriden(SpellInfo const* spell, int32 script) const;
@@ -1712,7 +1712,7 @@ class TC_GAME_API Unit : public WorldObject
bool IsImmunedToSpell(SpellInfo const* spellInfo, WorldObject const* caster, bool requireImmunityPurgesEffectAttribute = false) const;
uint32 GetSchoolImmunityMask() const;
uint32 GetDamageImmunityMask() const;
uint32 GetMechanicImmunityMask() const;
uint64 GetMechanicImmunityMask() const;
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const;
bool IsImmunedToDamage(SpellInfo const* spellInfo) const;
+2 -2
View File
@@ -497,7 +497,7 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields)
creatureTemplate.WidgetSetID = fields[64].GetInt32();
creatureTemplate.WidgetSetUnitConditionID = fields[65].GetInt32();
creatureTemplate.RegenHealth = fields[66].GetBool();
creatureTemplate.MechanicImmuneMask = fields[67].GetUInt32();
creatureTemplate.MechanicImmuneMask = fields[67].GetUInt64();
creatureTemplate.SpellSchoolImmuneMask = fields[68].GetUInt32();
creatureTemplate.flags_extra = fields[69].GetUInt32();
creatureTemplate.ScriptID = GetScriptId(fields[70].GetString());
@@ -1019,7 +1019,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
differenceMask = cInfo->MechanicImmuneMask & (~difficultyInfo->MechanicImmuneMask);
if (differenceMask)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, mechanic_immune_mask: %u) has weaker immunities in difficulty %u mode (Entry: %u, mechanic_immune_mask: %u).",
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, mechanic_immune_mask: " UI64FMTD ") has weaker immunities in difficulty %u mode (Entry: %u, mechanic_immune_mask: " UI64FMTD ").",
cInfo->Entry, cInfo->MechanicImmuneMask, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->MechanicImmuneMask);
TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|%u WHERE `entry`=%u;",
differenceMask, cInfo->DifficultyEntry[diff]);
@@ -2482,7 +2482,11 @@ enum Mechanics : uint32
MECHANIC_SAPPED = 30,
MECHANIC_ENRAGED = 31,
MECHANIC_WOUNDED = 32,
MAX_MECHANIC = 33 // SKIP
MECHANIC_INFECTED_2 = 33,
MECHANIC_INFECTED_3 = 34,
MECHANIC_INFECTED_4 = 35,
MECHANIC_TAUNTED = 36,
MAX_MECHANIC = 37 // SKIP
};
// Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967ca6)
@@ -3307,12 +3307,16 @@ TC_API_EXPORT EnumText EnumUtils<Mechanics>::ToString(Mechanics value)
case MECHANIC_SAPPED: return { "MECHANIC_SAPPED", "MECHANIC_SAPPED", "" };
case MECHANIC_ENRAGED: return { "MECHANIC_ENRAGED", "MECHANIC_ENRAGED", "" };
case MECHANIC_WOUNDED: return { "MECHANIC_WOUNDED", "MECHANIC_WOUNDED", "" };
case MECHANIC_INFECTED_2: return { "MECHANIC_INFECTED_2", "MECHANIC_INFECTED_2", "" };
case MECHANIC_INFECTED_3: return { "MECHANIC_INFECTED_3", "MECHANIC_INFECTED_3", "" };
case MECHANIC_INFECTED_4: return { "MECHANIC_INFECTED_4", "MECHANIC_INFECTED_4", "" };
case MECHANIC_TAUNTED: return { "MECHANIC_TAUNTED", "MECHANIC_TAUNTED", "" };
default: throw std::out_of_range("value");
}
}
template <>
TC_API_EXPORT size_t EnumUtils<Mechanics>::Count() { return 33; }
TC_API_EXPORT size_t EnumUtils<Mechanics>::Count() { return 37; }
template <>
TC_API_EXPORT Mechanics EnumUtils<Mechanics>::FromIndex(size_t index)
@@ -3352,6 +3356,10 @@ TC_API_EXPORT Mechanics EnumUtils<Mechanics>::FromIndex(size_t index)
case 30: return MECHANIC_SAPPED;
case 31: return MECHANIC_ENRAGED;
case 32: return MECHANIC_WOUNDED;
case 33: return MECHANIC_INFECTED_2;
case 34: return MECHANIC_INFECTED_3;
case 35: return MECHANIC_INFECTED_4;
case 36: return MECHANIC_TAUNTED;
default: throw std::out_of_range("index");
}
}
@@ -3394,6 +3402,10 @@ TC_API_EXPORT size_t EnumUtils<Mechanics>::ToIndex(Mechanics value)
case MECHANIC_SAPPED: return 30;
case MECHANIC_ENRAGED: return 31;
case MECHANIC_WOUNDED: return 32;
case MECHANIC_INFECTED_2: return 33;
case MECHANIC_INFECTED_3: return 34;
case MECHANIC_INFECTED_4: return 35;
case MECHANIC_TAUNTED: return 36;
default: throw std::out_of_range("value");
}
}
@@ -1156,7 +1156,7 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn
case SPELL_AURA_MECHANIC_IMMUNITY:
case SPELL_AURA_MOD_MECHANIC_RESISTANCE:
// compare mechanic
if (!spellInfo || !(spellInfo->GetAllEffectsMechanicMask() & (1 << GetMiscValue())))
if (!spellInfo || !(spellInfo->GetAllEffectsMechanicMask() & (UI64LIT(1) << GetMiscValue())))
return false;
break;
case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK:
+1 -1
View File
@@ -4090,7 +4090,7 @@ void Spell::EffectDispelMechanic()
if (!aura->GetApplicationOfTarget(unitTarget->GetGUID()))
continue;
if (roll_chance_i(aura->CalcDispelChance(unitTarget, !unitTarget->IsFriendlyTo(m_caster))))
if ((aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << mechanic)))
if ((aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (UI64LIT(1) << mechanic)))
dispel_list.emplace_back(aura->GetId(), aura->GetCasterGUID());
}
+24 -24
View File
@@ -2367,40 +2367,40 @@ SpellSchoolMask SpellInfo::GetSchoolMask() const
return SpellSchoolMask(SchoolMask);
}
uint32 SpellInfo::GetAllEffectsMechanicMask() const
uint64 SpellInfo::GetAllEffectsMechanicMask() const
{
uint32 mask = 0;
uint64 mask = 0;
if (Mechanic)
mask |= 1 << Mechanic;
mask |= UI64LIT(1) << Mechanic;
for (SpellEffectInfo const& effect : GetEffects())
if (effect.IsEffect() && effect.Mechanic)
mask |= 1 << effect.Mechanic;
mask |= UI64LIT(1) << effect.Mechanic;
return mask;
}
uint32 SpellInfo::GetEffectMechanicMask(SpellEffIndex effIndex) const
uint64 SpellInfo::GetEffectMechanicMask(SpellEffIndex effIndex) const
{
uint32 mask = 0;
uint64 mask = 0;
if (Mechanic)
mask |= 1 << Mechanic;
mask |= UI64LIT(1) << Mechanic;
if (GetEffect(effIndex).IsEffect() && GetEffect(effIndex).Mechanic)
mask |= 1 << GetEffect(effIndex).Mechanic;
mask |= UI64LIT(1) << GetEffect(effIndex).Mechanic;
return mask;
}
uint32 SpellInfo::GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
uint64 SpellInfo::GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
{
uint32 mask = 0;
uint64 mask = 0;
if (Mechanic)
mask |= 1 << Mechanic;
mask |= UI64LIT(1) << Mechanic;
for (SpellEffectInfo const& effect : GetEffects())
if ((effectMask & (1 << effect.EffectIndex)) && effect.Mechanic)
mask |= 1 << effect.Mechanic;
mask |= UI64LIT(1) << effect.Mechanic;
return mask;
}
@@ -2461,7 +2461,7 @@ void SpellInfo::_LoadAuraState()
return AURA_STATE_ENRAGED;
// Bleeding aura state
if (GetAllEffectsMechanicMask() & 1<<MECHANIC_BLEED)
if (GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED))
return AURA_STATE_BLEED;
if (GetSchoolMask() & SPELL_SCHOOL_MASK_FROST)
@@ -3210,7 +3210,7 @@ void SpellInfo::_LoadImmunityInfo()
{
uint32 schoolImmunityMask = 0;
uint32 applyHarmfulAuraImmunityMask = 0;
uint32 mechanicImmunityMask = 0;
uint64 mechanicImmunityMask = 0;
uint32 dispelImmunity = 0;
uint32 damageImmunityMask = 0;
@@ -3414,7 +3414,7 @@ void SpellInfo::_LoadImmunityInfo()
if (miscVal < 1)
return;
mechanicImmunityMask |= 1 << miscVal;
mechanicImmunityMask |= UI64LIT(1) << miscVal;
break;
}
break;
@@ -3528,10 +3528,10 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, SpellEffectInfo const& s
target->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::InvulnerabilityBuff);
}
if (uint32 mechanicImmunity = immuneInfo.MechanicImmuneMask)
if (uint64 mechanicImmunity = immuneInfo.MechanicImmuneMask)
{
for (uint32 i = 0; i < MAX_MECHANIC; ++i)
if (mechanicImmunity & (1 << i))
if (mechanicImmunity & (UI64LIT(1) << i))
target->ApplySpellImmune(Id, IMMUNITY_MECHANIC, i, apply);
if (HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
@@ -3612,8 +3612,8 @@ bool SpellInfo::CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInf
return true;
}
if (uint32 mechanicImmunity = immuneInfo.MechanicImmuneMask)
if ((mechanicImmunity & (1 << auraSpellInfo->Mechanic)) != 0)
if (uint64 mechanicImmunity = immuneInfo.MechanicImmuneMask)
if ((mechanicImmunity & (UI64LIT(1) << auraSpellInfo->Mechanic)) != 0)
return true;
if (uint32 dispelImmunity = immuneInfo.DispelImmune)
@@ -3635,7 +3635,7 @@ bool SpellInfo::CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInf
if (uint32 mechanic = auraSpellEffectInfo.Mechanic)
{
if (!(immuneInfo.MechanicImmuneMask & (1 << mechanic)))
if (!(immuneInfo.MechanicImmuneMask & (UI64LIT(1) << mechanic)))
{
immuneToAllEffects = false;
break;
@@ -3721,15 +3721,15 @@ bool SpellInfo::SpellCancelsAuraEffect(AuraEffect const* aurEff) const
return false;
}
uint32 SpellInfo::GetAllowedMechanicMask() const
uint64 SpellInfo::GetAllowedMechanicMask() const
{
return _allowedMechanicMask;
}
uint32 SpellInfo::GetMechanicImmunityMask(Unit const* caster) const
uint64 SpellInfo::GetMechanicImmunityMask(Unit const* caster) const
{
uint32 casterMechanicImmunityMask = caster->GetMechanicImmunityMask();
uint32 mechanicImmunityMask = 0;
uint64 casterMechanicImmunityMask = caster->GetMechanicImmunityMask();
uint64 mechanicImmunityMask = 0;
if (CanBeInterrupted(nullptr, caster, true))
{
+7 -7
View File
@@ -222,7 +222,7 @@ struct TC_GAME_API ImmunityInfo
uint32 SchoolImmuneMask = 0;
uint32 ApplyHarmfulAuraImmuneMask = 0;
uint32 MechanicImmuneMask = 0;
uint64 MechanicImmuneMask = 0;
uint32 DispelImmune = 0;
uint32 DamageSchoolMask = 0;
@@ -543,9 +543,9 @@ class TC_GAME_API SpellInfo
bool CheckTargetCreatureType(Unit const* target) const;
SpellSchoolMask GetSchoolMask() const;
uint32 GetAllEffectsMechanicMask() const;
uint32 GetEffectMechanicMask(SpellEffIndex effIndex) const;
uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const;
uint64 GetAllEffectsMechanicMask() const;
uint64 GetEffectMechanicMask(SpellEffIndex effIndex) const;
uint64 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const;
Mechanics GetEffectMechanic(SpellEffIndex effIndex) const;
uint32 GetDispelMask() const;
static uint32 GetDispelMask(DispelType type);
@@ -600,9 +600,9 @@ class TC_GAME_API SpellInfo
bool CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInfo) const;
bool SpellCancelsAuraEffect(AuraEffect const* aurEff) const;
uint32 GetAllowedMechanicMask() const;
uint64 GetAllowedMechanicMask() const;
uint32 GetMechanicImmunityMask(Unit const* caster) const;
uint64 GetMechanicImmunityMask(Unit const* caster) const;
// Player Condition
bool MeetsFutureSpellPlayerCondition(Player const* player) const;
@@ -628,7 +628,7 @@ class TC_GAME_API SpellInfo
AuraStateType _auraState = AURA_STATE_NONE;
SpellDiminishInfo _diminishInfo;
uint32 _allowedMechanicMask = 0;
uint64 _allowedMechanicMask = 0;
};
#endif // _SPELLINFO_H
+1 -1
View File
@@ -2932,7 +2932,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
for (SpellEffectInfo const& spellEffectInfo : spellInfoMutable->GetEffects())
{
// all bleed effects and spells ignore armor
if (spellInfo.GetEffectMechanicMask(spellEffectInfo.EffectIndex) & (1 << MECHANIC_BLEED))
if (spellInfo.GetEffectMechanicMask(spellEffectInfo.EffectIndex) & (UI64LIT(1) << MECHANIC_BLEED))
spellInfoMutable->AttributesCu |= SPELL_ATTR0_CU_IGNORE_ARMOR;
switch (spellEffectInfo.ApplyAuraName)