mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
feat(Unit/Misc): HasAnyAuras() HasAllAuras() HasAuras() (#21040)
This commit is contained in:
@@ -5695,6 +5695,29 @@ uint32 Unit::GetAuraCount(uint32 spellId) const
|
||||
return count;
|
||||
}
|
||||
|
||||
bool Unit::HasAuras(SearchMethod sm, std::vector<uint32>& spellIds) const
|
||||
{
|
||||
if (sm == SearchMethod::MatchAll)
|
||||
{
|
||||
for (auto const& spellId : spellIds)
|
||||
if (!HasAura(spellId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
else if (sm == SearchMethod::MatchAny)
|
||||
{
|
||||
for (auto const& spellId : spellIds)
|
||||
if (HasAura(spellId))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::HasAuras using non-supported SearchMethod {}", sm);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Unit::HasAura(uint32 spellId, ObjectGuid casterGUID, ObjectGuid itemCasterGUID, uint8 reqEffMask) const
|
||||
{
|
||||
if (GetAuraApplication(spellId, casterGUID, itemCasterGUID, reqEffMask))
|
||||
|
||||
Reference in New Issue
Block a user