mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 01:37:00 +00:00
[11842] Add spell difficulty selection for creature*_addon auras
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
35d2d4a316
commit
62c4f5e6bf
4 changed files with 13 additions and 6 deletions
|
|
@ -784,7 +784,7 @@ bool Creature::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo cons
|
|||
cPos.GetMap()->GetCreatureLinkingHolder()->AddMasterToHolder(this);
|
||||
}
|
||||
|
||||
LoadCreatureAddon();
|
||||
LoadCreatureAddon(false, cPos.GetMap());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1911,7 +1911,7 @@ CreatureDataAddon const* Creature::GetCreatureAddon() const
|
|||
}
|
||||
|
||||
//creature_addon table
|
||||
bool Creature::LoadCreatureAddon(bool reload)
|
||||
bool Creature::LoadCreatureAddon(bool reload /*= false*/, Map* map /*= NULL*/)
|
||||
{
|
||||
CreatureDataAddon const *cainfo = GetCreatureAddon();
|
||||
if(!cainfo)
|
||||
|
|
@ -1965,7 +1965,14 @@ bool Creature::LoadCreatureAddon(bool reload)
|
|||
continue;
|
||||
}
|
||||
|
||||
CastSpell(this, *cAura, true);
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(*cAura); // Already checked on load
|
||||
|
||||
// Get Difficulty mode for initial case (npc not yet added to map)
|
||||
if (spellInfo->SpellDifficultyId && !reload && map && map->IsDungeon())
|
||||
if (SpellEntry const* spellEntry = GetSpellEntryByDifficulty(spellInfo->SpellDifficultyId, map->GetDifficulty(), map->IsRaid()))
|
||||
spellInfo = spellEntry;
|
||||
|
||||
CastSpell(this, spellInfo, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue