mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-02 18:33:48 +00:00
Update random bots level stats
This commit is contained in:
@@ -2513,13 +2513,15 @@ void RandomPlayerbotMgr::PrintStats()
|
|||||||
uint32 stateCount[MAX_TRAVEL_STATE + 1] = {0};
|
uint32 stateCount[MAX_TRAVEL_STATE + 1] = {0};
|
||||||
std::vector<std::pair<Quest const*, int32>> questCount;
|
std::vector<std::pair<Quest const*, int32>> questCount;
|
||||||
std::unordered_map<NewRpgStatus, int> rpgStatusCount;
|
std::unordered_map<NewRpgStatus, int> rpgStatusCount;
|
||||||
|
uint8 maxBotLevel = 0;
|
||||||
for (PlayerBotMap::iterator i = playerBots.begin(); i != playerBots.end(); ++i)
|
for (PlayerBotMap::iterator i = playerBots.begin(); i != playerBots.end(); ++i)
|
||||||
{
|
{
|
||||||
Player* bot = i->second;
|
Player* bot = i->second;
|
||||||
if (IsAlliance(bot->getRace()))
|
if (IsAlliance(bot->getRace()))
|
||||||
++alliance[bot->GetLevel() / 10];
|
++alliance[bot->GetLevel()];
|
||||||
else
|
else
|
||||||
++horde[bot->GetLevel() / 10];
|
++horde[bot->GetLevel()];
|
||||||
|
maxBotLevel = std::max(maxBotLevel, bot->GetLevel());
|
||||||
|
|
||||||
++perRace[bot->getRace()];
|
++perRace[bot->getRace()];
|
||||||
++perClass[bot->getClass()];
|
++perClass[bot->getClass()];
|
||||||
@@ -2613,18 +2615,22 @@ void RandomPlayerbotMgr::PrintStats()
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("playerbots", "Bots level:");
|
LOG_INFO("playerbots", "Bots level:");
|
||||||
uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
// uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||||
for (uint8 i = 0; i < 10; ++i)
|
uint32 currentAlliance = 0, currentHorde = 0;
|
||||||
|
uint32 step = std::max(1, (maxBotLevel + 4) / 8);
|
||||||
|
uint32 from = 1;
|
||||||
|
for (uint8 i = 1; i <= maxBotLevel; ++i)
|
||||||
{
|
{
|
||||||
if (!alliance[i] && !horde[i])
|
currentAlliance += alliance[i];
|
||||||
continue;
|
currentHorde += horde[i];
|
||||||
|
|
||||||
uint32 from = i * 10;
|
if (((i + 1) % step == 0) || i == maxBotLevel)
|
||||||
uint32 to = std::min(from + 9, maxLevel);
|
{
|
||||||
if (!from)
|
LOG_INFO("playerbots", " {}..{}: {} alliance, {} horde", from, i, currentAlliance, currentHorde);
|
||||||
from = 1;
|
currentAlliance = 0;
|
||||||
|
currentHorde = 0;
|
||||||
LOG_INFO("playerbots", " {}..{}: {} alliance, {} horde", from, to, alliance[i], horde[i]);
|
from = i + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("playerbots", "Bots race:");
|
LOG_INFO("playerbots", "Bots race:");
|
||||||
@@ -2671,7 +2677,7 @@ void RandomPlayerbotMgr::PrintStats()
|
|||||||
LOG_INFO("playerbots", " NEAR_RANDOM: {}", rpgStatusCount[NewRpgStatus::NEAR_RANDOM]);
|
LOG_INFO("playerbots", " NEAR_RANDOM: {}", rpgStatusCount[NewRpgStatus::NEAR_RANDOM]);
|
||||||
LOG_INFO("playerbots", " NEAR_NPC: {}", rpgStatusCount[NewRpgStatus::NEAR_NPC]);
|
LOG_INFO("playerbots", " NEAR_NPC: {}", rpgStatusCount[NewRpgStatus::NEAR_NPC]);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("playerbots", "Bots engine:", dead);
|
LOG_INFO("playerbots", "Bots engine:", dead);
|
||||||
LOG_INFO("playerbots", " Non-combat: {}", engine_noncombat);
|
LOG_INFO("playerbots", " Non-combat: {}", engine_noncombat);
|
||||||
LOG_INFO("playerbots", " Combat: {}", engine_combat);
|
LOG_INFO("playerbots", " Combat: {}", engine_combat);
|
||||||
|
|||||||
Reference in New Issue
Block a user