mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Fix addclass
This commit is contained in:
parent
0281fe73ad
commit
3f9165a714
@ -13,6 +13,7 @@
|
|||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "RandomItemMgr.h"
|
#include "RandomItemMgr.h"
|
||||||
#include "RandomPlayerbotFactory.h"
|
#include "RandomPlayerbotFactory.h"
|
||||||
|
#include "RandomPlayerbotMgr.h"
|
||||||
#include "Talentspec.h"
|
#include "Talentspec.h"
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@ -482,6 +483,9 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
selfBotLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.SelfBotLevel", 1);
|
selfBotLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.SelfBotLevel", 1);
|
||||||
|
|
||||||
RandomPlayerbotFactory::CreateRandomBots();
|
RandomPlayerbotFactory::CreateRandomBots();
|
||||||
|
if (sPlayerbotAIConfig->addClassCommand)
|
||||||
|
sRandomPlayerbotMgr->PrepareAddclassCache();
|
||||||
|
|
||||||
if (World::IsStopped())
|
if (World::IsStopped())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -162,8 +162,6 @@ RandomPlayerbotMgr::RandomPlayerbotMgr() : PlayerbotHolder(), processTicks(0)
|
|||||||
{
|
{
|
||||||
sPlayerbotCommandServer->Start();
|
sPlayerbotCommandServer->Start();
|
||||||
PrepareTeleportCache();
|
PrepareTeleportCache();
|
||||||
if (sPlayerbotAIConfig->addClassCommand)
|
|
||||||
PrepareAddclassCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BattlegroundData.clear();
|
BattlegroundData.clear();
|
||||||
|
|||||||
@ -169,6 +169,7 @@ public:
|
|||||||
void setActivityPercentage(float percentage) { activityMod = percentage / 100.0f; }
|
void setActivityPercentage(float percentage) { activityMod = percentage / 100.0f; }
|
||||||
static uint8 GetTeamClassIdx(bool isAlliance, uint8 claz) { return isAlliance * 20 + claz; }
|
static uint8 GetTeamClassIdx(bool isAlliance, uint8 claz) { return isAlliance * 20 + claz; }
|
||||||
|
|
||||||
|
void PrepareAddclassCache();
|
||||||
std::map<uint8, std::vector<ObjectGuid>> addclassCache;
|
std::map<uint8, std::vector<ObjectGuid>> addclassCache;
|
||||||
protected:
|
protected:
|
||||||
void OnBotLoginInternal(Player* const bot) override;
|
void OnBotLoginInternal(Player* const bot) override;
|
||||||
@ -193,7 +194,6 @@ private:
|
|||||||
void RandomTeleport(Player* bot, std::vector<WorldLocation>& locs, bool hearth = false);
|
void RandomTeleport(Player* bot, std::vector<WorldLocation>& locs, bool hearth = false);
|
||||||
uint32 GetZoneLevel(uint16 mapId, float teleX, float teleY, float teleZ);
|
uint32 GetZoneLevel(uint16 mapId, float teleX, float teleY, float teleZ);
|
||||||
void PrepareTeleportCache();
|
void PrepareTeleportCache();
|
||||||
void PrepareAddclassCache();
|
|
||||||
typedef void (RandomPlayerbotMgr::*ConsoleCommandHandler)(Player*);
|
typedef void (RandomPlayerbotMgr::*ConsoleCommandHandler)(Player*);
|
||||||
|
|
||||||
std::vector<Player*> players;
|
std::vector<Player*> players;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user