[9789] Implement spell selection, for creatures in instances, based on map difficulty

This commit is contained in:
Laise 2010-04-24 20:07:28 +03:00
parent 6ad2d18f1a
commit 51546e1ff9
10 changed files with 45 additions and 10 deletions

View file

@ -3591,3 +3591,17 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return true;
}
SpellEntry const* GetSpellEntryByDifficulty(uint32 id, Difficulty difficulty)
{
SpellDifficultyEntry const* spellDiff = sSpellDifficultyStore.LookupEntry(id);
if (!spellDiff)
return NULL;
if (!spellDiff->spellId[difficulty])
return NULL;
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellDiff->spellId[difficulty]);
return spellEntry;
}