refactor(Core/Immunities): Simplify UI64 literal conversion for cleaner code (#25360)
This commit is contained in:
@@ -2224,7 +2224,7 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell)
|
|||||||
|
|
||||||
// Xinef: this should exclude self casts...
|
// Xinef: this should exclude self casts...
|
||||||
// Spells that don't have effectMechanics.
|
// Spells that don't have effectMechanics.
|
||||||
if (spellInfo->Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(UI64LIT(1) << spellInfo->Mechanic))
|
if (spellInfo->Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(1ULL << spellInfo->Mechanic))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// The above helper uses the creature_immunities table rather than a
|
// The above helper uses the creature_immunities table rather than a
|
||||||
@@ -2247,7 +2247,7 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell)
|
|||||||
bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit const* caster /*= nullptr*/) const
|
bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit const* caster /*= nullptr*/) const
|
||||||
{
|
{
|
||||||
// Xinef: this should exclude self casts...
|
// Xinef: this should exclude self casts...
|
||||||
if (spellInfo->Effects[index].Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(UI64LIT(1) << spellInfo->Effects[index].Mechanic))
|
if (spellInfo->Effects[index].Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(1ULL << spellInfo->Effects[index].Mechanic))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL)
|
if (GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL)
|
||||||
|
|||||||
@@ -2194,7 +2194,7 @@ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* s
|
|||||||
{
|
{
|
||||||
if (spellInfo->Effects[effIndex].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE ||
|
if (spellInfo->Effects[effIndex].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE ||
|
||||||
spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_SCHOOL_DAMAGE)
|
spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_SCHOOL_DAMAGE)
|
||||||
if (spellInfo->GetEffectMechanicMask(effIndex) & (1 << MECHANIC_BLEED))
|
if (spellInfo->GetEffectMechanicMask(effIndex) & (1ULL << MECHANIC_BLEED))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5490,7 +5490,7 @@ void Unit::RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, ui
|
|||||||
void Unit::RemoveMovementImpairingAuras(bool withRoot)
|
void Unit::RemoveMovementImpairingAuras(bool withRoot)
|
||||||
{
|
{
|
||||||
if (withRoot)
|
if (withRoot)
|
||||||
RemoveAurasWithMechanic(1 << MECHANIC_ROOT);
|
RemoveAurasWithMechanic(1ULL << MECHANIC_ROOT);
|
||||||
|
|
||||||
// Snares
|
// Snares
|
||||||
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
|
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
|
||||||
@@ -5525,7 +5525,7 @@ void Unit::RemoveAurasWithMechanic(uint64 mechanic_mask, AuraRemoveMode removemo
|
|||||||
|
|
||||||
void Unit::RemoveAurasByShapeShift()
|
void Unit::RemoveAurasByShapeShift()
|
||||||
{
|
{
|
||||||
uint64 mechanic_mask = (UI64LIT(1) << MECHANIC_SNARE) | (UI64LIT(1) << MECHANIC_ROOT);
|
uint64 mechanic_mask = (1ULL << MECHANIC_SNARE) | (1ULL << MECHANIC_ROOT);
|
||||||
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
|
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
|
||||||
{
|
{
|
||||||
Aura const* aura = iter->second->GetBase();
|
Aura const* aura = iter->second->GetBase();
|
||||||
@@ -6082,12 +6082,12 @@ bool Unit::HasAuraWithMechanic(uint64 mechanicMask) const
|
|||||||
for (AuraApplicationMap::const_iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end(); ++iter)
|
for (AuraApplicationMap::const_iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end(); ++iter)
|
||||||
{
|
{
|
||||||
SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
|
SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
|
||||||
if (spellInfo->Mechanic && (mechanicMask & (UI64LIT(1) << spellInfo->Mechanic)))
|
if (spellInfo->Mechanic && (mechanicMask & (1ULL << spellInfo->Mechanic)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
if (iter->second->HasEffect(i) && spellInfo->Effects[i].Effect && spellInfo->Effects[i].Mechanic)
|
if (iter->second->HasEffect(i) && spellInfo->Effects[i].Effect && spellInfo->Effects[i].Mechanic)
|
||||||
if (mechanicMask & (UI64LIT(1) << spellInfo->Effects[i].Mechanic))
|
if (mechanicMask & (1ULL << spellInfo->Effects[i].Mechanic))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8591,7 +8591,7 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da
|
|||||||
|
|
||||||
// Torment the weak
|
// Torment the weak
|
||||||
if (spellProto->SpellFamilyFlags[0] & 0x20600021 || spellProto->SpellFamilyFlags[1] & 0x9000)
|
if (spellProto->SpellFamilyFlags[0] & 0x20600021 || spellProto->SpellFamilyFlags[1] & 0x9000)
|
||||||
if (victim->HasAuraWithMechanic((1 << MECHANIC_SNARE) | (1 << MECHANIC_SLOW_ATTACK)))
|
if (victim->HasAuraWithMechanic((1ULL << MECHANIC_SNARE) | (1ULL << MECHANIC_SLOW_ATTACK)))
|
||||||
if (AuraEffect* aurEff = GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, 3263, EFFECT_0))
|
if (AuraEffect* aurEff = GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, 3263, EFFECT_0))
|
||||||
AddPct(DoneTotalMod, aurEff->GetAmount());
|
AddPct(DoneTotalMod, aurEff->GetAmount());
|
||||||
break;
|
break;
|
||||||
@@ -8910,7 +8910,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
|
|||||||
if (!caster || caster->GetGUID() != (*i)->GetCasterGUID())
|
if (!caster || caster->GetGUID() != (*i)->GetCasterGUID())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mechanicMask & uint64(UI64LIT(1) << (*i)->GetMiscValue()))
|
if (mechanicMask & (1ULL << (*i)->GetMiscValue()))
|
||||||
{
|
{
|
||||||
if ((*i)->GetAmount() > 0)
|
if ((*i)->GetAmount() > 0)
|
||||||
{
|
{
|
||||||
@@ -9218,7 +9218,7 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
|
|||||||
case SPELLFAMILY_MAGE:
|
case SPELLFAMILY_MAGE:
|
||||||
// Glyph of Fire Blast
|
// Glyph of Fire Blast
|
||||||
if (spellProto->SpellFamilyFlags[0] == 0x2 && spellProto->SpellIconID == 12)
|
if (spellProto->SpellFamilyFlags[0] == 0x2 && spellProto->SpellIconID == 12)
|
||||||
if (HasAuraWithMechanic((1 << MECHANIC_STUN) | (1 << MECHANIC_KNOCKOUT)))
|
if (HasAuraWithMechanic((1ULL << MECHANIC_STUN) | (1ULL << MECHANIC_KNOCKOUT)))
|
||||||
if (AuraEffect const* aurEff = caster->GetAuraEffect(56369, EFFECT_0))
|
if (AuraEffect const* aurEff = caster->GetAuraEffect(56369, EFFECT_0))
|
||||||
crit_chance += aurEff->GetAmount();
|
crit_chance += aurEff->GetAmount();
|
||||||
break;
|
break;
|
||||||
@@ -10364,13 +10364,13 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
|
|||||||
|
|
||||||
// Shred, Maul - "Effects which increase Bleed damage also increase Shred damage"
|
// Shred, Maul - "Effects which increase Bleed damage also increase Shred damage"
|
||||||
if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[0] & 0x00008800)
|
if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[0] & 0x00008800)
|
||||||
mechanicMask |= (UI64LIT(1) << MECHANIC_BLEED);
|
mechanicMask |= (1ULL << MECHANIC_BLEED);
|
||||||
|
|
||||||
if (mechanicMask)
|
if (mechanicMask)
|
||||||
{
|
{
|
||||||
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT, [mechanicMask](AuraEffect const* aurEff) -> bool
|
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT, [mechanicMask](AuraEffect const* aurEff) -> bool
|
||||||
{
|
{
|
||||||
if (mechanicMask & uint64(UI64LIT(1) << (aurEff->GetMiscValue())))
|
if (mechanicMask & (1ULL << (aurEff->GetMiscValue())))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -11215,8 +11215,8 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
|||||||
if (Creature* creature = ToCreature())
|
if (Creature* creature = ToCreature())
|
||||||
{
|
{
|
||||||
// use creature helper which now consults creature_immunities table
|
// use creature helper which now consults creature_immunities table
|
||||||
if (creature->HasMechanicTemplateImmunity(UI64LIT(1) << MECHANIC_SNARE) ||
|
if (creature->HasMechanicTemplateImmunity(1ULL << MECHANIC_SNARE) ||
|
||||||
creature->HasMechanicTemplateImmunity(UI64LIT(1) << MECHANIC_DAZE))
|
creature->HasMechanicTemplateImmunity(1ULL << MECHANIC_DAZE))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11237,7 +11237,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
|||||||
if (creature
|
if (creature
|
||||||
&& !IsPet()
|
&& !IsPet()
|
||||||
&& !(IsControlledByPlayer() && IsVehicle())
|
&& !(IsControlledByPlayer() && IsVehicle())
|
||||||
&& !(creature->HasMechanicTemplateImmunity(UI64LIT(1) << MECHANIC_SNARE))
|
&& !(creature->HasMechanicTemplateImmunity(1ULL << MECHANIC_SNARE))
|
||||||
&& !(creature->IsDungeonBoss()))
|
&& !(creature->IsDungeonBoss()))
|
||||||
{
|
{
|
||||||
// 1.6% for each % under 30.
|
// 1.6% for each % under 30.
|
||||||
@@ -11595,7 +11595,7 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in
|
|||||||
// xinef: also calculate self casts, spell can be reflected for example
|
// xinef: also calculate self casts, spell can be reflected for example
|
||||||
if (!positive)
|
if (!positive)
|
||||||
{
|
{
|
||||||
int32 mechanic = spellProto->GetSpellMechanicMaskByEffectMask(effectMask);
|
uint64 mechanic = spellProto->GetSpellMechanicMaskByEffectMask(effectMask);
|
||||||
|
|
||||||
int32 durationMod;
|
int32 durationMod;
|
||||||
int32 durationMod_always = 0;
|
int32 durationMod_always = 0;
|
||||||
@@ -11603,11 +11603,11 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in
|
|||||||
|
|
||||||
for (uint8 i = 1; i <= MECHANIC_ENRAGED; ++i)
|
for (uint8 i = 1; i <= MECHANIC_ENRAGED; ++i)
|
||||||
{
|
{
|
||||||
if (!(mechanic & 1 << i))
|
if (!(mechanic & (1ULL << i)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Xinef: spells affecting movement imparing effects should not reduce duration if disoriented mechanic is present
|
// Xinef: spells affecting movement imparing effects should not reduce duration if disoriented mechanic is present
|
||||||
if (i == MECHANIC_SNARE && (mechanic & (1 << MECHANIC_DISORIENTED)))
|
if (i == MECHANIC_SNARE && (mechanic & (1ULL << MECHANIC_DISORIENTED)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Find total mod value (negative bonus)
|
// Find total mod value (negative bonus)
|
||||||
|
|||||||
@@ -1223,7 +1223,7 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn
|
|||||||
case SPELL_AURA_MECHANIC_IMMUNITY:
|
case SPELL_AURA_MECHANIC_IMMUNITY:
|
||||||
case SPELL_AURA_MOD_MECHANIC_RESISTANCE:
|
case SPELL_AURA_MOD_MECHANIC_RESISTANCE:
|
||||||
// compare mechanic
|
// compare mechanic
|
||||||
if (!spellInfo || !(spellInfo->GetAllEffectsMechanicMask() & (UI64LIT(1) << GetMiscValue())))
|
if (!spellInfo || !(spellInfo->GetAllEffectsMechanicMask() & (1ULL << GetMiscValue())))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK:
|
case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK:
|
||||||
|
|||||||
@@ -6828,7 +6828,7 @@ SpellCastResult Spell::CheckCasterAuras(bool preventionOnly) const
|
|||||||
return SPELL_CAST_OK;
|
return SPELL_CAST_OK;
|
||||||
|
|
||||||
uint8 school_immune = 0;
|
uint8 school_immune = 0;
|
||||||
uint32 mechanic_immune = 0;
|
uint64 mechanic_immune = 0;
|
||||||
uint32 dispel_immune = 0;
|
uint32 dispel_immune = 0;
|
||||||
|
|
||||||
// Check if the spell grants school or mechanic immunity.
|
// Check if the spell grants school or mechanic immunity.
|
||||||
@@ -6840,7 +6840,7 @@ SpellCastResult Spell::CheckCasterAuras(bool preventionOnly) const
|
|||||||
if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_SCHOOL_IMMUNITY)
|
if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_SCHOOL_IMMUNITY)
|
||||||
school_immune |= uint32(m_spellInfo->Effects[i].MiscValue);
|
school_immune |= uint32(m_spellInfo->Effects[i].MiscValue);
|
||||||
else if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MECHANIC_IMMUNITY)
|
else if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MECHANIC_IMMUNITY)
|
||||||
mechanic_immune |= 1 << uint32(m_spellInfo->Effects[i].MiscValue);
|
mechanic_immune |= 1ULL << uint32(m_spellInfo->Effects[i].MiscValue);
|
||||||
else if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_DISPEL_IMMUNITY)
|
else if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_DISPEL_IMMUNITY)
|
||||||
dispel_immune |= SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
|
dispel_immune |= SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
|
||||||
}
|
}
|
||||||
@@ -6871,13 +6871,13 @@ SpellCastResult Spell::CheckCasterAuras(bool preventionOnly) const
|
|||||||
if (usableInStun)
|
if (usableInStun)
|
||||||
{
|
{
|
||||||
bool foundNotStun = false;
|
bool foundNotStun = false;
|
||||||
uint32 mask = (1 << MECHANIC_STUN) | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_HORROR);
|
uint64 mask = (1ULL << MECHANIC_STUN) | (1ULL << MECHANIC_FREEZE) | (1ULL << MECHANIC_HORROR);
|
||||||
// Barkskin should skip sleep effects, sap and fears
|
// Barkskin should skip sleep effects, sap and fears
|
||||||
if (m_spellInfo->Id == 22812)
|
if (m_spellInfo->Id == 22812)
|
||||||
mask |= 1 << MECHANIC_SAPPED | 1 << MECHANIC_HORROR | 1 << MECHANIC_SLEEP;
|
mask |= 1ULL << MECHANIC_SAPPED | 1ULL << MECHANIC_HORROR | 1ULL << MECHANIC_SLEEP;
|
||||||
// Hand of Freedom, can be used while sapped and while under fear-mechanic stuns (e.g. Intimidating Shout primary target)
|
// Hand of Freedom, can be used while sapped and while under fear-mechanic stuns (e.g. Intimidating Shout primary target)
|
||||||
if (m_spellInfo->Id == 1044)
|
if (m_spellInfo->Id == 1044)
|
||||||
mask |= (1 << MECHANIC_SAPPED) | (1 << MECHANIC_FEAR);
|
mask |= (1ULL << MECHANIC_SAPPED) | (1ULL << MECHANIC_FEAR);
|
||||||
Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN);
|
Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN);
|
||||||
for (Unit::AuraEffectList::const_iterator i = stunAuras.begin(); i != stunAuras.end(); ++i)
|
for (Unit::AuraEffectList::const_iterator i = stunAuras.begin(); i != stunAuras.end(); ++i)
|
||||||
{
|
{
|
||||||
@@ -6936,13 +6936,13 @@ SpellCastResult Spell::CheckCasterAuras(bool preventionOnly) const
|
|||||||
{
|
{
|
||||||
case SPELL_AURA_MOD_STUN:
|
case SPELL_AURA_MOD_STUN:
|
||||||
{
|
{
|
||||||
uint32 mask = 1 << MECHANIC_STUN;
|
uint64 mask = 1ULL << MECHANIC_STUN;
|
||||||
// Barkskin should skip sleep effects, sap and fears
|
// Barkskin should skip sleep effects, sap and fears
|
||||||
if (m_spellInfo->Id == 22812)
|
if (m_spellInfo->Id == 22812)
|
||||||
mask |= 1 << MECHANIC_SAPPED | 1 << MECHANIC_HORROR | 1 << MECHANIC_SLEEP;
|
mask |= 1ULL << MECHANIC_SAPPED | 1ULL << MECHANIC_HORROR | 1ULL << MECHANIC_SLEEP;
|
||||||
// Hand of Freedom, can be used while sapped and while under fear-mechanic stuns (e.g. Intimidating Shout primary target)
|
// Hand of Freedom, can be used while sapped and while under fear-mechanic stuns (e.g. Intimidating Shout primary target)
|
||||||
if (m_spellInfo->Id == 1044)
|
if (m_spellInfo->Id == 1044)
|
||||||
mask |= (1 << MECHANIC_SAPPED) | (1 << MECHANIC_FEAR);
|
mask |= (1ULL << MECHANIC_SAPPED) | (1ULL << MECHANIC_FEAR);
|
||||||
|
|
||||||
if (!usableInStun || !(auraInfo->GetAllEffectsMechanicMask() & mask))
|
if (!usableInStun || !(auraInfo->GetAllEffectsMechanicMask() & mask))
|
||||||
return SPELL_FAILED_STUNNED;
|
return SPELL_FAILED_STUNNED;
|
||||||
|
|||||||
@@ -856,7 +856,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
|
|||||||
SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
|
SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
|
||||||
|
|
||||||
// Pounce Bleed shouldn't be removed by Cloak of Shadows.
|
// Pounce Bleed shouldn't be removed by Cloak of Shadows.
|
||||||
if (spell->GetAllEffectsMechanicMask() & (UI64LIT(1) << MECHANIC_BLEED))
|
if (spell->GetAllEffectsMechanicMask() & (1ULL << MECHANIC_BLEED))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool dmgClassNone = false;
|
bool dmgClassNone = false;
|
||||||
@@ -5157,7 +5157,7 @@ void Spell::EffectDispelMechanic(SpellEffIndex effIndex)
|
|||||||
continue;
|
continue;
|
||||||
if (roll_chance_i(aura->CalcDispelChance(unitTarget, !unitTarget->IsFriendlyTo(m_caster))))
|
if (roll_chance_i(aura->CalcDispelChance(unitTarget, !unitTarget->IsFriendlyTo(m_caster))))
|
||||||
{
|
{
|
||||||
if ((aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (UI64LIT(1) << mechanic)))
|
if (aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1ULL << mechanic))
|
||||||
{
|
{
|
||||||
dispel_list.push(std::make_pair(aura->GetId(), aura->GetCasterGUID()));
|
dispel_list.push(std::make_pair(aura->GetId(), aura->GetCasterGUID()));
|
||||||
|
|
||||||
|
|||||||
@@ -1900,10 +1900,10 @@ uint64 SpellInfo::GetAllEffectsMechanicMask() const
|
|||||||
{
|
{
|
||||||
uint64 mask = 0;
|
uint64 mask = 0;
|
||||||
if (Mechanic)
|
if (Mechanic)
|
||||||
mask |= UI64LIT(1) << Mechanic;
|
mask |= 1ULL << Mechanic;
|
||||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
if (Effects[i].IsEffect() && Effects[i].Mechanic)
|
if (Effects[i].IsEffect() && Effects[i].Mechanic)
|
||||||
mask |= UI64LIT(1) << Effects[i].Mechanic;
|
mask |= 1ULL << Effects[i].Mechanic;
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1911,9 +1911,9 @@ uint64 SpellInfo::GetEffectMechanicMask(uint8 effIndex) const
|
|||||||
{
|
{
|
||||||
uint64 mask = 0;
|
uint64 mask = 0;
|
||||||
if (Mechanic)
|
if (Mechanic)
|
||||||
mask |= UI64LIT(1) << Mechanic;
|
mask |= 1ULL << Mechanic;
|
||||||
if (Effects[effIndex].IsEffect() && Effects[effIndex].Mechanic)
|
if (Effects[effIndex].IsEffect() && Effects[effIndex].Mechanic)
|
||||||
mask |= UI64LIT(1) << Effects[effIndex].Mechanic;
|
mask |= 1ULL << Effects[effIndex].Mechanic;
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1921,10 +1921,10 @@ uint64 SpellInfo::GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
|
|||||||
{
|
{
|
||||||
uint64 mask = 0;
|
uint64 mask = 0;
|
||||||
if (Mechanic)
|
if (Mechanic)
|
||||||
mask |= UI64LIT(1) << Mechanic;
|
mask |= 1ULL << Mechanic;
|
||||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
if ((effectMask & (1 << i)) && Effects[i].Mechanic)
|
if ((effectMask & (1 << i)) && Effects[i].Mechanic)
|
||||||
mask |= UI64LIT(1) << Effects[i].Mechanic;
|
mask |= 1ULL << Effects[i].Mechanic;
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2008,7 +2008,7 @@ AuraStateType SpellInfo::LoadAuraState() const
|
|||||||
return AURA_STATE_ENRAGE;
|
return AURA_STATE_ENRAGE;
|
||||||
|
|
||||||
// Bleeding aura state
|
// Bleeding aura state
|
||||||
if (GetAllEffectsMechanicMask() & (UI64LIT(1) << MECHANIC_BLEED))
|
if (GetAllEffectsMechanicMask() & (1ULL << MECHANIC_BLEED))
|
||||||
return AURA_STATE_BLEEDING;
|
return AURA_STATE_BLEEDING;
|
||||||
|
|
||||||
// Banished aura state
|
// Banished aura state
|
||||||
|
|||||||
@@ -705,7 +705,7 @@ public:
|
|||||||
|
|
||||||
handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, Acore::StringFormat("0x{:X}", mechanicImmuneMask).c_str());
|
handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, Acore::StringFormat("0x{:X}", mechanicImmuneMask).c_str());
|
||||||
for (uint8 i = 1; i < MAX_MECHANIC; ++i)
|
for (uint8 i = 1; i < MAX_MECHANIC; ++i)
|
||||||
if (mechanicImmuneMask & (UI64LIT(1) << i))
|
if (mechanicImmuneMask & (1ULL << i))
|
||||||
handler->PSendSysMessage(mechanicImmunes[i].text, mechanicImmunes[i].flag);
|
handler->PSendSysMessage(mechanicImmunes[i].text, mechanicImmunes[i].flag);
|
||||||
|
|
||||||
handler->PSendSysMessage(LANG_NPCINFO_SPELL_SCHOOL_IMMUNE, spellSchoolImmuneMask);
|
handler->PSendSysMessage(LANG_NPCINFO_SPELL_SCHOOL_IMMUNE, spellSchoolImmuneMask);
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ class spell_uk_second_wind : public AuraScript
|
|||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN))) != 0;
|
return (spellInfo->GetAllEffectsMechanicMask() & ((1ULL << MECHANIC_ROOT) | (1ULL << MECHANIC_STUN))) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||||
|
|||||||
@@ -3001,7 +3001,7 @@ class spell_dk_pvp_4p_bonus : public AuraScript
|
|||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_SNARE))) != 0;
|
return (spellInfo->GetAllEffectsMechanicMask() & ((1ULL << MECHANIC_ROOT) | (1ULL << MECHANIC_SNARE))) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||||
|
|||||||
@@ -770,7 +770,7 @@ class spell_dru_moonkin_form_passive : public AuraScript
|
|||||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||||
{
|
{
|
||||||
// reduces all damage taken while Stunned in Moonkin Form
|
// reduces all damage taken while Stunned in Moonkin Form
|
||||||
if (GetTarget()->GetUnitFlags() & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1 << MECHANIC_STUN))
|
if (GetTarget()->GetUnitFlags() & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1ULL << MECHANIC_STUN))
|
||||||
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
|
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -837,7 +837,7 @@ class spell_dru_primal_tenacity : public AuraScript
|
|||||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||||
{
|
{
|
||||||
// reduces all damage taken while Stunned in Cat Form
|
// reduces all damage taken while Stunned in Cat Form
|
||||||
if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->HasUnitFlag(UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1 << MECHANIC_STUN))
|
if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->HasUnitFlag(UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1ULL << MECHANIC_STUN))
|
||||||
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
|
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4372,7 +4372,7 @@ class spell_item_luffa : public SpellScript
|
|||||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||||
{
|
{
|
||||||
Aura const* aura = itr->second->GetBase();
|
Aura const* aura = itr->second->GetBase();
|
||||||
if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
|
if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1ULL << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return SPELL_CAST_OK;
|
return SPELL_CAST_OK;
|
||||||
@@ -4392,7 +4392,7 @@ class spell_item_luffa : public SpellScript
|
|||||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||||
{
|
{
|
||||||
Aura const* aura = itr->second->GetBase();
|
Aura const* aura = itr->second->GetBase();
|
||||||
if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
|
if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1ULL << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
player->RemoveAurasDueToSpell(aura->GetId(), aura->GetCasterGUID());
|
player->RemoveAurasDueToSpell(aura->GetId(), aura->GetCasterGUID());
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class spell_mage_burning_determination : public AuraScript
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Need Interrupt or Silenced mechanic
|
// Need Interrupt or Silenced mechanic
|
||||||
if (!(eventInfo.GetSpellInfo()->GetAllEffectsMechanicMask() & ((1 << MECHANIC_INTERRUPT) | (1 << MECHANIC_SILENCE))))
|
if (!(eventInfo.GetSpellInfo()->GetAllEffectsMechanicMask() & ((1ULL << MECHANIC_INTERRUPT) | (1ULL << MECHANIC_SILENCE))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Xinef: immuned effect should just eat charge
|
// Xinef: immuned effect should just eat charge
|
||||||
|
|||||||
@@ -1486,7 +1486,7 @@ class spell_pal_divine_purpose : public AuraScript
|
|||||||
{
|
{
|
||||||
PreventDefaultAction();
|
PreventDefaultAction();
|
||||||
if (Unit* target = eventInfo.GetActionTarget())
|
if (Unit* target = eventInfo.GetActionTarget())
|
||||||
target->RemoveAurasWithMechanic(1 << MECHANIC_STUN, AURA_REMOVE_BY_ENEMY_SPELL);
|
target->RemoveAurasWithMechanic(1ULL << MECHANIC_STUN, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ class spell_pri_mana_burn : public SpellScript
|
|||||||
void HandleAfterHit()
|
void HandleAfterHit()
|
||||||
{
|
{
|
||||||
if (Unit* unitTarget = GetHitUnit())
|
if (Unit* unitTarget = GetHitUnit())
|
||||||
unitTarget->RemoveAurasWithMechanic((1 << MECHANIC_FEAR) | (1 << MECHANIC_POLYMORPH));
|
unitTarget->RemoveAurasWithMechanic((1ULL << MECHANIC_FEAR) | (1ULL << MECHANIC_POLYMORPH));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
|
|||||||
@@ -735,13 +735,13 @@ class spell_rog_vanish_purge : public SpellScript
|
|||||||
void HandleRootRemove(SpellEffIndex /*effIndex*/)
|
void HandleRootRemove(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
if (GetCaster() && !GetCaster()->HasAura(SPELL_PARALYZE)) // Root from Tainted Core SSC, should not be removed by vanish.
|
if (GetCaster() && !GetCaster()->HasAura(SPELL_PARALYZE)) // Root from Tainted Core SSC, should not be removed by vanish.
|
||||||
GetCaster()->RemoveAurasWithMechanic(1 << MECHANIC_ROOT);
|
GetCaster()->RemoveAurasWithMechanic(1ULL << MECHANIC_ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleSnareRemove(SpellEffIndex /*effIndex*/)
|
void HandleSnareRemove(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
if (GetCaster())
|
if (GetCaster())
|
||||||
GetCaster()->RemoveAurasWithMechanic(1 << MECHANIC_SNARE);
|
GetCaster()->RemoveAurasWithMechanic(1ULL << MECHANIC_SNARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
|
|||||||
@@ -1494,7 +1494,7 @@ class spell_sha_astral_shift_aura : public AuraScript
|
|||||||
bool CheckProc(ProcEventInfo& eventInfo)
|
bool CheckProc(ProcEventInfo& eventInfo)
|
||||||
{
|
{
|
||||||
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
|
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
|
||||||
if (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_SILENCE) | (1 << MECHANIC_STUN) | (1 << MECHANIC_FEAR)))
|
if (spellInfo->GetAllEffectsMechanicMask() & ((1ULL << MECHANIC_SILENCE) | (1ULL << MECHANIC_STUN) | (1ULL << MECHANIC_FEAR)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -927,7 +927,7 @@ class spell_warl_demonic_circle_teleport : public AuraScript
|
|||||||
if (GameObject* circle = player->GetGameObject(SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON))
|
if (GameObject* circle = player->GetGameObject(SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON))
|
||||||
{
|
{
|
||||||
player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation(), false, false, false, true);
|
player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation(), false, false, false, true);
|
||||||
player->RemoveAurasWithMechanic(1 << MECHANIC_SNARE);
|
player->RemoveAurasWithMechanic(1ULL << MECHANIC_SNARE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -612,7 +612,7 @@ class spell_warr_shattering_throw : public SpellScript
|
|||||||
|
|
||||||
// remove shields, will still display immune to damage part
|
// remove shields, will still display immune to damage part
|
||||||
if (Unit* target = GetHitUnit())
|
if (Unit* target = GetHitUnit())
|
||||||
target->RemoveAurasWithMechanic(1 << MECHANIC_IMMUNE_SHIELD, AURA_REMOVE_BY_ENEMY_SPELL);
|
target->RemoveAurasWithMechanic(1ULL << MECHANIC_IMMUNE_SHIELD, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
@@ -1013,7 +1013,7 @@ class spell_warr_second_wind : public AuraScript
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Must be from stun or root mechanic
|
// Must be from stun or root mechanic
|
||||||
if (!(procSpell->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN))))
|
if (!(procSpell->GetAllEffectsMechanicMask() & ((1ULL << MECHANIC_ROOT) | (1ULL << MECHANIC_STUN))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Not from self
|
// Not from self
|
||||||
|
|||||||
@@ -1352,22 +1352,22 @@ enum Mechanics : uint32
|
|||||||
|
|
||||||
// Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967ca6)
|
// Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967ca6)
|
||||||
inline constexpr uint64 IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK =
|
inline constexpr uint64 IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK =
|
||||||
(UI64LIT(1) << MECHANIC_CHARM) |
|
(1ULL << MECHANIC_CHARM) |
|
||||||
(UI64LIT(1) << MECHANIC_DISORIENTED) |
|
(1ULL << MECHANIC_DISORIENTED) |
|
||||||
(UI64LIT(1) << MECHANIC_FEAR) |
|
(1ULL << MECHANIC_FEAR) |
|
||||||
(UI64LIT(1) << MECHANIC_ROOT) |
|
(1ULL << MECHANIC_ROOT) |
|
||||||
(UI64LIT(1) << MECHANIC_SLEEP) |
|
(1ULL << MECHANIC_SLEEP) |
|
||||||
(UI64LIT(1) << MECHANIC_SNARE) |
|
(1ULL << MECHANIC_SNARE) |
|
||||||
(UI64LIT(1) << MECHANIC_STUN) |
|
(1ULL << MECHANIC_STUN) |
|
||||||
(UI64LIT(1) << MECHANIC_FREEZE) |
|
(1ULL << MECHANIC_FREEZE) |
|
||||||
(UI64LIT(1) << MECHANIC_KNOCKOUT) |
|
(1ULL << MECHANIC_KNOCKOUT) |
|
||||||
(UI64LIT(1) << MECHANIC_POLYMORPH) |
|
(1ULL << MECHANIC_POLYMORPH) |
|
||||||
(UI64LIT(1) << MECHANIC_BANISH) |
|
(1ULL << MECHANIC_BANISH) |
|
||||||
(UI64LIT(1) << MECHANIC_SHACKLE) |
|
(1ULL << MECHANIC_SHACKLE) |
|
||||||
(UI64LIT(1) << MECHANIC_TURN) |
|
(1ULL << MECHANIC_TURN) |
|
||||||
(UI64LIT(1) << MECHANIC_HORROR) |
|
(1ULL << MECHANIC_HORROR) |
|
||||||
(UI64LIT(1) << MECHANIC_DAZE) |
|
(1ULL << MECHANIC_DAZE) |
|
||||||
(UI64LIT(1) << MECHANIC_SAPPED);
|
(1ULL << MECHANIC_SAPPED);
|
||||||
|
|
||||||
// Spell dispel type
|
// Spell dispel type
|
||||||
enum DispelType
|
enum DispelType
|
||||||
|
|||||||
Reference in New Issue
Block a user