mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
feature(Core/Spells): Allow to learn all spells for characters on cre… (#6464)
* feature(Core/Spells): Allow to learn all spells for characters on creation * Cherry-picked from TrinityCore * now it works =) * Update Player.cpp
This commit is contained in:
@@ -23957,10 +23957,20 @@ void Player::LearnCustomSpells()
|
||||
|
||||
// learn default race/class spells
|
||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
|
||||
ASSERT(info);
|
||||
for (PlayerCreateInfoSpells::const_iterator itr = info->customSpells.begin(); itr != info->customSpells.end(); ++itr)
|
||||
{
|
||||
uint32 tspell = *itr;
|
||||
LOG_DEBUG("entities.player.loading", "PLAYER (Class: %u Race: %u): Adding initial spell, id = %u", uint32(getClass()), uint32(getRace()), tspell);
|
||||
LOG_DEBUG("entities.player.loading", "Player::LearnCustomSpells: Player '%s' (%s, Class: %u Race: %u): Adding initial spell (SpellID: %u)",
|
||||
GetName().c_str(), GetGUID().ToString().c_str(), uint32(getClass()), uint32(getRace()), tspell);
|
||||
if (!IsInWorld()) // will send in INITIAL_SPELLS in list anyway at map add
|
||||
{
|
||||
addSpell(tspell, true, true);
|
||||
}
|
||||
else // but send in normal spell in game learn case
|
||||
{
|
||||
learnSpell(tspell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user