[11799] Add HasAuraOfDifficulty to support difficulty spells for HasAura

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2011-09-18 13:21:19 +02:00
parent 6f156a2583
commit 8b7f3e5245
3 changed files with 12 additions and 1 deletions

View file

@ -4849,6 +4849,16 @@ bool Unit::HasAura(uint32 spellId, SpellEffectIndex effIndex) const
return false; 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) void Unit::AddDynObject(DynamicObject* dynObj)
{ {
m_dynObjGUIDs.push_back(dynObj->GetObjectGuid()); m_dynObjGUIDs.push_back(dynObj->GetObjectGuid());

View file

@ -1421,6 +1421,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
{ {
return m_spellAuraHolders.find(spellId) != m_spellAuraHolders.end(); return m_spellAuraHolders.find(spellId) != m_spellAuraHolders.end();
} }
bool HasAuraOfDifficulty(uint32 spellId) const;
bool virtual HasSpell(uint32 /*spellID*/) const { return false; } bool virtual HasSpell(uint32 /*spellID*/) const { return false; }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11798" #define REVISION_NR "11799"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__