[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;
}
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());