Core/Util: Fixed flag128 and removed flag96 - previously if flag128 and flag96 were used in together the result was always a bool instead of expected flag result due to implicit boolean conversion
This commit is contained in:
@@ -3787,7 +3787,7 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
|
||||
UpdateInterruptMask();
|
||||
}
|
||||
|
||||
void Unit::RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID)
|
||||
void Unit::RemoveAurasWithFamily(SpellFamilyNames family, flag128 const& familyFlag, ObjectGuid casterGUID)
|
||||
{
|
||||
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
|
||||
{
|
||||
@@ -3795,7 +3795,7 @@ void Unit::RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, ui
|
||||
if (!casterGUID || aura->GetCasterGUID() == casterGUID)
|
||||
{
|
||||
SpellInfo const* spell = aura->GetSpellInfo();
|
||||
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3))
|
||||
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & familyFlag)
|
||||
{
|
||||
RemoveAura(iter);
|
||||
continue;
|
||||
@@ -4051,13 +4051,13 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 ico
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID) const
|
||||
AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, flag128 const& familyFlag, ObjectGuid casterGUID) const
|
||||
{
|
||||
AuraEffectList const& auras = GetAuraEffectsByType(type);
|
||||
for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
|
||||
{
|
||||
SpellInfo const* spell = (*i)->GetSpellInfo();
|
||||
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3))
|
||||
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & familyFlag)
|
||||
{
|
||||
if (!casterGUID.IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
|
||||
continue;
|
||||
@@ -5520,7 +5520,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
return false;
|
||||
|
||||
// try to find spell Rip on the target
|
||||
if (AuraEffect const* AurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00800000, 0x0, 0x0, GetGUID()))
|
||||
if (AuraEffect const* AurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, flag128(0x00800000, 0x0, 0x0), GetGUID()))
|
||||
{
|
||||
// Rip's max duration, note: spells which modifies Rip's duration also counted
|
||||
uint32 CountMin = AurEff->GetBase()->GetMaxDuration();
|
||||
@@ -6045,7 +6045,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (!target)
|
||||
return false;
|
||||
// try to find spell Flame Shock on the target
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 0x10000000, 0x0, 0x0, GetGUID()))
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, flag128(0x10000000, 0x0, 0x0), GetGUID()))
|
||||
{
|
||||
Aura* flameShock = aurEff->GetBase();
|
||||
int32 maxDuration = flameShock->GetMaxDuration();
|
||||
@@ -6081,7 +6081,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (dummySpell->SpellIconID == 3059)
|
||||
{
|
||||
// Lightning Shield
|
||||
if (GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0))
|
||||
if (GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, flag128(0x400, 0, 0)))
|
||||
{
|
||||
uint32 spell = 26364;
|
||||
|
||||
@@ -8379,7 +8379,7 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
|
||||
}
|
||||
case 5481: // Starfire Bonus
|
||||
{
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x200002, 0, 0))
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, flag128(0x200002, 0, 0)))
|
||||
AddPct(DoneTotalMod, (*i)->GetAmount());
|
||||
break;
|
||||
}
|
||||
@@ -8418,7 +8418,7 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
|
||||
{
|
||||
// Glyph of Smite
|
||||
if (AuraEffect* aurEff = GetAuraEffect(55692, 0))
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x100000, 0, 0, GetGUID()))
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, flag128(0x100000, 0, 0), GetGUID()))
|
||||
AddPct(DoneTotalMod, aurEff->GetAmount());
|
||||
}
|
||||
break;
|
||||
@@ -8708,7 +8708,7 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
|
||||
{
|
||||
// Improved Insect Swarm
|
||||
if (AuraEffect const* aurEff = GetDummyAuraEffect(SPELLFAMILY_DRUID, 1771, 0))
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002, 0, 0))
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, flag128(0x00000002, 0, 0)))
|
||||
crit_chance += aurEff->GetAmount();
|
||||
break;
|
||||
}
|
||||
@@ -8739,7 +8739,7 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
|
||||
// Lava Burst
|
||||
if (spellProto->SpellFamilyFlags[1] & 0x00001000)
|
||||
{
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 0x10000000, 0, 0, GetGUID()))
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, flag128(0x10000000, 0, 0), GetGUID()))
|
||||
if (victim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE) > -100)
|
||||
return 100.0f;
|
||||
break;
|
||||
@@ -8993,7 +8993,7 @@ float Unit::SpellHealingPctDone(Unit* victim, SpellInfo const* spellProto) const
|
||||
break;
|
||||
case 7798: // Glyph of Regrowth
|
||||
{
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x40, 0, 0))
|
||||
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, flag128(0x40, 0, 0)))
|
||||
AddPct(DoneTotalMod, (*i)->GetAmount());
|
||||
break;
|
||||
}
|
||||
@@ -9018,7 +9018,7 @@ float Unit::SpellHealingPctDone(Unit* victim, SpellInfo const* spellProto) const
|
||||
}
|
||||
case 7871: // Glyph of Lesser Healing Wave
|
||||
{
|
||||
if (victim->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0, 0x00000400, 0, GetGUID()))
|
||||
if (victim->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, flag128(0, 0x00000400, 0), GetGUID()))
|
||||
AddPct(DoneTotalMod, (*i)->GetAmount());
|
||||
break;
|
||||
}
|
||||
@@ -9057,7 +9057,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u
|
||||
if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[1] & 0x2000000)
|
||||
{
|
||||
// Rejuvenation, Regrowth, Lifebloom, or Wild Growth
|
||||
if (GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x50, 0x4000010, 0))
|
||||
if (GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, flag128(0x50, 0x4000010, 0)))
|
||||
// increase healing by 20%
|
||||
TakenTotalMod *= 1.2f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user