1b7ec4b follow-up
This commit is contained in:
1 parent
de81a77ef8
commit
b4d5f46ea4
3 files changed
+78
-86
No files matched your search
@@ -4616,36 +4616,35 @@ bool Unit::HasAuraType(AuraType auraType) const
|
||||
return (!m_modAuras[auraType].empty());
|
||||
}
|
||||
|
||||
bool Unit::HasAuraTypeWithCaster(AuraType auratype, ObjectGuid caster) const
|
||||
bool Unit::HasAuraTypeWithCaster(AuraType auraType, ObjectGuid caster) const
|
||||
{
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
if (caster == (*i)->GetCasterGUID())
|
||||
for (AuraEffect const* eff : GetAuraEffectsByType(auraType))
|
||||
if (caster == eff->GetCasterGUID())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Unit::HasAuraTypeWithMiscvalue(AuraType auratype, int32 miscvalue) const
|
||||
bool Unit::HasAuraTypeWithMiscvalue(AuraType auraType, int32 miscvalue) const
|
||||
{
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auraType);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
if (miscvalue == (*i)->GetMiscValue())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Unit::HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const
|
||||
bool Unit::HasAuraTypeWithAffectMask(AuraType auraType, SpellInfo const* affectedSpell) const
|
||||
{
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auraType);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
if ((*i)->IsAffectingSpell(affectedSpell))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Unit::HasAuraTypeWithValue(AuraType auratype, int32 value) const
|
||||
bool Unit::HasAuraTypeWithValue(AuraType auraType, int32 value) const
|
||||
{
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auraType);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
if (value == (*i)->GetAmount())
|
||||
return true;
|
||||
@@ -4769,9 +4768,9 @@ uint32 Unit::GetDoTsByCaster(ObjectGuid casterGUID) const
|
||||
return dots;
|
||||
}
|
||||
|
||||
int32 Unit::GetTotalAuraModifier(AuraType auratype, std::function<bool(AuraEffect const*)> const& predicate) const
|
||||
int32 Unit::GetTotalAuraModifier(AuraType auraType, std::function<bool(AuraEffect const*)> const& predicate) const
|
||||
{
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auraType);
|
||||
if (mTotalAuraList.empty())
|
||||
return 0;
|
||||
|
||||
@@ -4784,7 +4783,7 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype, std::function<bool(AuraEffec
|
||||
{
|
||||
// Check if the Aura Effect has a the Same Effect Stack Rule and if so, use the highest amount of that SpellGroup
|
||||
// If the Aura Effect does not have this Stack Rule, it returns false so we can add to the multiplier as usual
|
||||
if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), static_cast<uint32>(auratype), aurEff->GetAmount(), sameEffectSpellGroup))
|
||||
if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), static_cast<uint32>(auraType), aurEff->GetAmount(), sameEffectSpellGroup))
|
||||
modifier += aurEff->GetAmount();
|
||||
}
|
||||
}
|
||||
@@ -4796,9 +4795,9 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype, std::function<bool(AuraEffec
|
||||
return modifier;
|
||||
}
|
||||
|
||||
float Unit::GetTotalAuraMultiplier(AuraType auratype, std::function<bool(AuraEffect const*)> const& predicate) const
|
||||
float Unit::GetTotalAuraMultiplier(AuraType auraType, std::function<bool(AuraEffect const*)> const& predicate) const
|
||||
{
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auraType);
|
||||
if (mTotalAuraList.empty())
|
||||
return 1.0f;
|
||||
|
||||
@@ -4811,7 +4810,7 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype, std::function<bool(AuraEff
|
||||
{
|
||||
// Check if the Aura Effect has a the Same Effect Stack Rule and if so, use the highest amount of that SpellGroup
|
||||
// If the Aura Effect does not have this Stack Rule, it returns false so we can add to the multiplier as usual
|
||||
if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), static_cast<uint32>(auratype), aurEff->GetAmount(), sameEffectSpellGroup))
|
||||
if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), static_cast<uint32>(auraType), aurEff->GetAmount(), sameEffectSpellGroup))
|
||||
AddPct(multiplier, aurEff->GetAmount());
|
||||
}
|
||||
}
|
||||
@@ -4823,9 +4822,9 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype, std::function<bool(AuraEff
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype, std::function<bool(AuraEffect const*)> const& predicate) const
|
||||
int32 Unit::GetMaxPositiveAuraModifier(AuraType auraType, std::function<bool(AuraEffect const*)> const& predicate) const
|
||||
{
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auraType);
|
||||
if (mTotalAuraList.empty())
|
||||
return 0;
|
||||
|
||||
@@ -4839,9 +4838,9 @@ int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype, std::function<bool(Aur
|
||||
return modifier;
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype, std::function<bool(AuraEffect const*)> const& predicate) const
|
||||
int32 Unit::GetMaxNegativeAuraModifier(AuraType auraType, std::function<bool(AuraEffect const*)> const& predicate) const
|
||||
{
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auraType);
|
||||
if (mTotalAuraList.empty())
|
||||
return 0;
|
||||
|
||||
@@ -4855,29 +4854,29 @@ int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype, std::function<bool(Aur
|
||||
return modifier;
|
||||
}
|
||||
|
||||
int32 Unit::GetTotalAuraModifier(AuraType auratype) const
|
||||
int32 Unit::GetTotalAuraModifier(AuraType auraType) const
|
||||
{
|
||||
return GetTotalAuraModifier(auratype, [](AuraEffect const* /*aurEff*/) { return true; });
|
||||
return GetTotalAuraModifier(auraType, [](AuraEffect const* /*aurEff*/) { return true; });
|
||||
}
|
||||
|
||||
float Unit::GetTotalAuraMultiplier(AuraType auratype) const
|
||||
float Unit::GetTotalAuraMultiplier(AuraType auraType) const
|
||||
{
|
||||
return GetTotalAuraMultiplier(auratype, [](AuraEffect const* /*aurEff*/) { return true; });
|
||||
return GetTotalAuraMultiplier(auraType, [](AuraEffect const* /*aurEff*/) { return true; });
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const
|
||||
int32 Unit::GetMaxPositiveAuraModifier(AuraType auraType) const
|
||||
{
|
||||
return GetMaxPositiveAuraModifier(auratype, [](AuraEffect const* /*aurEff*/) { return true; });
|
||||
return GetMaxPositiveAuraModifier(auraType, [](AuraEffect const* /*aurEff*/) { return true; });
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype) const
|
||||
int32 Unit::GetMaxNegativeAuraModifier(AuraType auraType) const
|
||||
{
|
||||
return GetMaxNegativeAuraModifier(auratype, [](AuraEffect const* /*aurEff*/) { return true; });
|
||||
return GetMaxNegativeAuraModifier(auraType, [](AuraEffect const* /*aurEff*/) { return true; });
|
||||
}
|
||||
|
||||
int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 miscMask) const
|
||||
int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auraType, uint32 miscMask) const
|
||||
{
|
||||
return GetTotalAuraModifier(auratype, [miscMask](AuraEffect const* aurEff) -> bool
|
||||
return GetTotalAuraModifier(auraType, [miscMask](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if ((aurEff->GetMiscValue() & miscMask) != 0)
|
||||
return true;
|
||||
@@ -4885,9 +4884,9 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 miscMask) c
|
||||
});
|
||||
}
|
||||
|
||||
float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 miscMask) const
|
||||
float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auraType, uint32 miscMask) const
|
||||
{
|
||||
return GetTotalAuraMultiplier(auratype, [miscMask](AuraEffect const* aurEff) -> bool
|
||||
return GetTotalAuraMultiplier(auraType, [miscMask](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if ((aurEff->GetMiscValue() & miscMask) != 0)
|
||||
return true;
|
||||
@@ -4895,9 +4894,9 @@ float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 miscMask)
|
||||
});
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 miscMask, AuraEffect const* except /*= nullptr*/) const
|
||||
int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auraType, uint32 miscMask, AuraEffect const* except /*= nullptr*/) const
|
||||
{
|
||||
return GetMaxPositiveAuraModifier(auratype, [miscMask, except](AuraEffect const* aurEff) -> bool
|
||||
return GetMaxPositiveAuraModifier(auraType, [miscMask, except](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (except != aurEff && (aurEff->GetMiscValue() & miscMask) != 0)
|
||||
return true;
|
||||
@@ -4905,9 +4904,9 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 miscM
|
||||
});
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 miscMask) const
|
||||
int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auraType, uint32 miscMask) const
|
||||
{
|
||||
return GetMaxNegativeAuraModifier(auratype, [miscMask](AuraEffect const* aurEff) -> bool
|
||||
return GetMaxNegativeAuraModifier(auraType, [miscMask](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if ((aurEff->GetMiscValue() & miscMask) != 0)
|
||||
return true;
|
||||
@@ -4915,9 +4914,9 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 miscM
|
||||
});
|
||||
}
|
||||
|
||||
int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 miscValue) const
|
||||
int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auraType, int32 miscValue) const
|
||||
{
|
||||
return GetTotalAuraModifier(auratype, [miscValue](AuraEffect const* aurEff) -> bool
|
||||
return GetTotalAuraModifier(auraType, [miscValue](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (aurEff->GetMiscValue() == miscValue)
|
||||
return true;
|
||||
@@ -4925,9 +4924,9 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 miscValue)
|
||||
});
|
||||
}
|
||||
|
||||
float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 miscValue) const
|
||||
float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auraType, int32 miscValue) const
|
||||
{
|
||||
return GetTotalAuraMultiplier(auratype, [miscValue](AuraEffect const* aurEff) -> bool
|
||||
return GetTotalAuraMultiplier(auraType, [miscValue](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (aurEff->GetMiscValue() == miscValue)
|
||||
return true;
|
||||
@@ -4935,9 +4934,9 @@ float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 miscValue
|
||||
});
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 miscValue) const
|
||||
int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auraType, int32 miscValue) const
|
||||
{
|
||||
return GetMaxPositiveAuraModifier(auratype, [miscValue](AuraEffect const* aurEff) -> bool
|
||||
return GetMaxPositiveAuraModifier(auraType, [miscValue](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (aurEff->GetMiscValue() == miscValue)
|
||||
return true;
|
||||
@@ -4945,9 +4944,9 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 miscV
|
||||
});
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 miscValue) const
|
||||
int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auraType, int32 miscValue) const
|
||||
{
|
||||
return GetMaxNegativeAuraModifier(auratype, [miscValue](AuraEffect const* aurEff) -> bool
|
||||
return GetMaxNegativeAuraModifier(auraType, [miscValue](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (aurEff->GetMiscValue() == miscValue)
|
||||
return true;
|
||||
@@ -4955,9 +4954,9 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 miscV
|
||||
});
|
||||
}
|
||||
|
||||
int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const
|
||||
int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auraType, SpellInfo const* affectedSpell) const
|
||||
{
|
||||
return GetTotalAuraModifier(auratype, [affectedSpell](AuraEffect const* aurEff) -> bool
|
||||
return GetTotalAuraModifier(auraType, [affectedSpell](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (aurEff->IsAffectingSpell(affectedSpell))
|
||||
return true;
|
||||
@@ -4965,9 +4964,9 @@ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const*
|
||||
});
|
||||
}
|
||||
|
||||
float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const
|
||||
float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auraType, SpellInfo const* affectedSpell) const
|
||||
{
|
||||
return GetTotalAuraMultiplier(auratype, [affectedSpell](AuraEffect const* aurEff) -> bool
|
||||
return GetTotalAuraMultiplier(auraType, [affectedSpell](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (aurEff->IsAffectingSpell(affectedSpell))
|
||||
return true;
|
||||
@@ -4975,9 +4974,9 @@ float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo cons
|
||||
});
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const
|
||||
int32 Unit::GetMaxPositiveAuraModifierByAffectMask(AuraType auraType, SpellInfo const* affectedSpell) const
|
||||
{
|
||||
return GetMaxPositiveAuraModifier(auratype, [affectedSpell](AuraEffect const* aurEff) -> bool
|
||||
return GetMaxPositiveAuraModifier(auraType, [affectedSpell](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (aurEff->IsAffectingSpell(affectedSpell))
|
||||
return true;
|
||||
@@ -4985,9 +4984,9 @@ int32 Unit::GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo
|
||||
});
|
||||
}
|
||||
|
||||
int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const
|
||||
int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auraType, SpellInfo const* affectedSpell) const
|
||||
{
|
||||
return GetMaxNegativeAuraModifier(auratype, [affectedSpell](AuraEffect const* aurEff) -> bool
|
||||
return GetMaxNegativeAuraModifier(auraType, [affectedSpell](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
if (aurEff->IsAffectingSpell(affectedSpell))
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user