InitTalentsTree

This commit is contained in:
Yunfan Li
2023-08-09 12:39:00 +08:00
parent cc0a874a4c
commit 4654218d39
3 changed files with 6 additions and 3 deletions

View File

@@ -705,7 +705,7 @@ void PlayerbotFactory::InitSpells()
InitAvailableSpells();
}
void PlayerbotFactory::InitTalentsTree(bool increment/*false*/, bool use_template/*true*/)
void PlayerbotFactory::InitTalentsTree(bool increment/*false*/, bool use_template/*true*/, bool reset/*false*/)
{
uint32 specNo;
uint8 cls = bot->getClass();
@@ -717,6 +717,9 @@ void PlayerbotFactory::InitTalentsTree(bool increment/*false*/, bool use_templat
uint32 p2 = p1 + sPlayerbotAIConfig->specProbability[cls][1];
specNo = (point < p1 ? 0 : (point < p2 ? 1 : 2));
}
if (reset) {
bot->resetTalents(true);
}
// use template if can
if (use_template && sPlayerbotAIConfig->defaultTalentsOrder[cls][specNo].size() > 0) {
InitTalentsByTemplate(specNo);

View File

@@ -115,7 +115,7 @@ class PlayerbotFactory : public InventoryAction
static uint32 tradeSkills[];
static float CalculateItemScore(uint32 item_id, Player* bot);
void InitTalentsTree(bool incremental = false, bool use_template = true);
void InitTalentsTree(bool incremental = false, bool use_template = true, bool reset = false);
void InitAvailableSpells();
void InitClassSpells();
void InitEquipment(bool incremental);

View File

@@ -336,7 +336,7 @@ bool AutoSetTalentsAction::Execute(Event event)
return false;
PlayerbotFactory factory(bot, bot->GetLevel());
factory.InitTalentsTree(true);
factory.InitTalentsTree(true, true, true);
botAI->TellMaster(out);