automatically action for random bots

This commit is contained in:
Yunfan Li
2023-08-05 18:41:15 +08:00
parent 9598719801
commit d31fbc0353
12 changed files with 153 additions and 79 deletions

View File

@@ -5,6 +5,7 @@
#include "ChangeTalentsAction.h"
#include "ChatHelper.h"
#include "Event.h"
#include "PlayerbotFactory.h"
#include "Playerbots.h"
bool ChangeTalentsAction::Execute(Event event)
@@ -82,7 +83,7 @@ bool ChangeTalentsAction::Execute(Event event)
out.str("");
out.clear();
if (paths.size() > 1 && sPlayerbotAIConfig->autoPickTalents != "full")
if (paths.size() > 1 && false/*!sPlayerbotAIConfig->autoPickTalents*/)
{
out << "Found multiple specs: ";
listPremadePaths(paths, &out);
@@ -278,7 +279,7 @@ bool ChangeTalentsAction::AutoSelectTalents(std::ostringstream* out)
specId = -1;
// specLink = "";
}
else if (paths.size() > 1 && sPlayerbotAIConfig->autoPickTalents != "full" && !sRandomPlayerbotMgr->IsRandomBot(bot))
else if (paths.size() > 1 && false/*!sPlayerbotAIConfig->autoPickTalents*/ && !sRandomPlayerbotMgr->IsRandomBot(bot))
{
*out << "Found multiple specs: ";
listPremadePaths(paths, out);
@@ -328,13 +329,14 @@ bool AutoSetTalentsAction::Execute(Event event)
{
std::ostringstream out;
if (sPlayerbotAIConfig->autoPickTalents == "no" && !sRandomPlayerbotMgr->IsRandomBot(bot))
if (!sPlayerbotAIConfig->autoPickTalents || !sRandomPlayerbotMgr->IsRandomBot(bot))
return false;
if (bot->GetFreeTalentPoints() <= 0)
return false;
AutoSelectTalents(&out);
PlayerbotFactory factory(bot, bot->GetLevel());
factory.InitTalentsTree(true);
botAI->TellMaster(out);