aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 6f248b75161..2ec904dd865 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -616,6 +616,17 @@ bool Unit::HasAuraType(AuraType auraType) const
return (!m_modAuras[auraType].empty());
}
+bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName ,uint64 familyFlags) const
+{
+ if(!HasAuraType(auraType)) return false;
+ AuraList const &auras = GetAurasByType(auraType);
+ for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ if(SpellEntry const *iterSpellProto = (*itr)->GetSpellProto())
+ if(iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags & familyFlags)
+ return true;
+ return false;
+}
+
/* Called by DealDamage for auras that have a chance to be dispelled on damage taken. */
void Unit::RemoveSpellbyDamageTaken(uint32 damage, uint32 spell)
{