diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index f0c3ed7fa..dcba26390 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4849,6 +4849,16 @@ bool Unit::HasAura(uint32 spellId, SpellEffectIndex effIndex) const return false; } +bool Unit::HasAuraOfDifficulty(uint32 spellId) const +{ + SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); + if (spellEntry && spellEntry->SpellDifficultyId && IsInWorld() && GetMap()->IsDungeon()) + if (SpellEntry const* spellDiffEntry = GetSpellEntryByDifficulty(spellEntry->SpellDifficultyId, GetMap()->GetDifficulty(), GetMap()->IsRaid())) + spellId = spellDiffEntry->Id; + + return m_spellAuraHolders.find(spellId) != m_spellAuraHolders.end(); +} + void Unit::AddDynObject(DynamicObject* dynObj) { m_dynObjGUIDs.push_back(dynObj->GetObjectGuid()); diff --git a/src/game/Unit.h b/src/game/Unit.h index 570dba58c..855dd55c6 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1421,6 +1421,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject { return m_spellAuraHolders.find(spellId) != m_spellAuraHolders.end(); } + bool HasAuraOfDifficulty(uint32 spellId) const; bool virtual HasSpell(uint32 /*spellID*/) const { return false; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a6ac0908a..11797474f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11798" + #define REVISION_NR "11799" #endif // __REVISION_NR_H__