void LearnSpellsForNewLevel(Player* player, uint8 level)
{
if (level == player->getLevel() + 1)
return;
uint32 family;
switch(player->getClass())
{
case CLASS_ROGUE:
family = SPELLFAMILY_ROGUE;
break;
case CLASS_DEATH_KNIGHT:
family = SPELLFAMILY_DEATHKNIGHT;
break;
case CLASS_WARRIOR:
family = SPELLFAMILY_WARRIOR;
break;
case CLASS_PRIEST:
family = SPELLFAMILY_PRIEST;
break;
case CLASS_MAGE:
family = SPELLFAMILY_MAGE;
break;
case CLASS_PALADIN:
family = SPELLFAMILY_PALADIN;
break;
case CLASS_HUNTER:
family = SPELLFAMILY_HUNTER;
break;
case CLASS_DRUID:
family = SPELLFAMILY_DRUID;
break;
case CLASS_SHAMAN:
family = SPELLFAMILY_SHAMAN;
break;
case CLASS_WARLOCK:
family = SPELLFAMILY_WARLOCK;
break;
}
for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
if (!spellInfo)
continue;
if (spellInfo->SpellFamilyName != family)
continue;
if (IsIgnoredSpell(spellInfo->Id))
continue;
if (spellInfo->PowerType == POWER_FOCUS)
continue;
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, spellInfo->Id, player))
continue;
if ((spellInfo->AttributesEx7 & SPELL_ATTR7_ALLIANCE_ONLY && player->GetTeam() != ALLIANCE) || (spellInfo->AttributesEx7 & SPELL_ATTR7_HORDE_ONLY && player->GetTeam() != HORDE))
continue;
if (spellInfo->BaseLevel != level && sSpellMgr->IsSpellValid(spellInfo, player))
continue;