clear default race/class skills when randomizing

This commit is contained in:
Yunfan Li
2023-07-24 19:52:13 +08:00
parent 8c914e5723
commit 36bb6d4786

View File

@@ -669,9 +669,17 @@ void PlayerbotFactory::ClearSkills()
{
bot->SetSkill(tradeSkills[i], 0, 0, 0);
}
bot->SetUInt32Value(PLAYER_SKILL_INDEX(0), 0);
bot->SetUInt32Value(PLAYER_SKILL_INDEX(1), 0);
// unlearn default race/class skills
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(bot->getRace(), bot->getClass());
for (PlayerCreateInfoSkills::const_iterator itr = info->skills.begin(); itr != info->skills.end(); ++itr)
{
uint32 skillId = itr->SkillId;
if (!bot->HasSkill(skillId))
continue;
bot->SetSkill(skillId, 0, 0, 0);
}
}
void PlayerbotFactory::ClearEverything()