refactor(Core/Immunities): Simplify UI64 literal conversion for cleaner code (#25360)
This commit is contained in:
@@ -705,7 +705,7 @@ public:
|
||||
|
||||
handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, Acore::StringFormat("0x{:X}", mechanicImmuneMask).c_str());
|
||||
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(LANG_NPCINFO_SPELL_SCHOOL_IMMUNE, spellSchoolImmuneMask);
|
||||
|
||||
@@ -224,7 +224,7 @@ class spell_uk_second_wind : public AuraScript
|
||||
if (!spellInfo)
|
||||
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)
|
||||
|
||||
@@ -3001,7 +3001,7 @@ class spell_dk_pvp_4p_bonus : public AuraScript
|
||||
if (!spellInfo)
|
||||
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)
|
||||
|
||||
@@ -770,7 +770,7 @@ class spell_dru_moonkin_form_passive : public AuraScript
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
@@ -837,7 +837,7 @@ class spell_dru_primal_tenacity : public AuraScript
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -4372,7 +4372,7 @@ class spell_item_luffa : public SpellScript
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
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;
|
||||
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
||||
player->RemoveAurasDueToSpell(aura->GetId(), aura->GetCasterGUID());
|
||||
|
||||
@@ -120,7 +120,7 @@ class spell_mage_burning_determination : public AuraScript
|
||||
return false;
|
||||
|
||||
// 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;
|
||||
|
||||
// Xinef: immuned effect should just eat charge
|
||||
|
||||
@@ -1486,7 +1486,7 @@ class spell_pal_divine_purpose : public AuraScript
|
||||
{
|
||||
PreventDefaultAction();
|
||||
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
|
||||
|
||||
@@ -473,7 +473,7 @@ class spell_pri_mana_burn : public SpellScript
|
||||
void HandleAfterHit()
|
||||
{
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
unitTarget->RemoveAurasWithMechanic((1 << MECHANIC_FEAR) | (1 << MECHANIC_POLYMORPH));
|
||||
unitTarget->RemoveAurasWithMechanic((1ULL << MECHANIC_FEAR) | (1ULL << MECHANIC_POLYMORPH));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -735,13 +735,13 @@ class spell_rog_vanish_purge : public SpellScript
|
||||
void HandleRootRemove(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
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*/)
|
||||
{
|
||||
if (GetCaster())
|
||||
GetCaster()->RemoveAurasWithMechanic(1 << MECHANIC_SNARE);
|
||||
GetCaster()->RemoveAurasWithMechanic(1ULL << MECHANIC_SNARE);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1494,7 +1494,7 @@ class spell_sha_astral_shift_aura : public AuraScript
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
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 false;
|
||||
|
||||
@@ -927,7 +927,7 @@ class spell_warl_demonic_circle_teleport : public AuraScript
|
||||
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->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
|
||||
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
|
||||
@@ -1013,7 +1013,7 @@ class spell_warr_second_wind : public AuraScript
|
||||
return false;
|
||||
|
||||
// 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;
|
||||
|
||||
// Not from self
|
||||
|
||||
Reference in New Issue
Block a user