mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
random bots maintanence
This commit is contained in:
@@ -533,7 +533,7 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
|
|||||||
return "bot not found";
|
return "bot not found";
|
||||||
|
|
||||||
if (!isRandomAccount || isRandomBot) {
|
if (!isRandomAccount || isRandomBot) {
|
||||||
return "ERROR: You can not use this command on summoned random bot.";
|
return "ERROR: You can not use this command on non-summoned random bot.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Player* master = GET_PLAYERBOT_AI(bot)->GetMaster())
|
if (Player* master = GET_PLAYERBOT_AI(bot)->GetMaster())
|
||||||
|
|||||||
@@ -2182,7 +2182,7 @@ void RandomItemMgr::BuildAmmoCache()
|
|||||||
for (uint32 subClass = ITEM_SUBCLASS_ARROW; subClass <= ITEM_SUBCLASS_THROWN; subClass++)
|
for (uint32 subClass = ITEM_SUBCLASS_ARROW; subClass <= ITEM_SUBCLASS_THROWN; subClass++)
|
||||||
{
|
{
|
||||||
QueryResult results = WorldDatabase.Query("SELECT entry FROM item_template WHERE class = {} AND subclass = {} AND RequiredLevel <= {} "
|
QueryResult results = WorldDatabase.Query("SELECT entry FROM item_template WHERE class = {} AND subclass = {} AND RequiredLevel <= {} "
|
||||||
"ORDER BY RequiredLevel DESC", ITEM_CLASS_PROJECTILE, subClass, level);
|
"ORDER BY RequiredLevel DESC, Quality DESC, ItemLevel DESC", ITEM_CLASS_PROJECTILE, subClass, level);
|
||||||
if (!results)
|
if (!results)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -262,12 +262,6 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/)
|
|||||||
activateCheckPlayersThread();
|
activateCheckPlayersThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sPlayerbotAIConfig->syncLevelWithPlayers && !players.empty())
|
|
||||||
{
|
|
||||||
if (time(nullptr) > (PlayersCheckTimer + 60))
|
|
||||||
activateCheckPlayersThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sPlayerbotAIConfig->randomBotJoinBG/* && !players.empty()*/)
|
if (sPlayerbotAIConfig->randomBotJoinBG/* && !players.empty()*/)
|
||||||
{
|
{
|
||||||
if (time(nullptr) > (BgCheckTimer + 30))
|
if (time(nullptr) > (BgCheckTimer + 30))
|
||||||
@@ -1483,8 +1477,9 @@ bool RandomPlayerbotMgr::IsRandomBot(ObjectGuid::LowType bot)
|
|||||||
ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>(bot);
|
ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>(bot);
|
||||||
if (!sPlayerbotAIConfig->IsInRandomAccountList(sCharacterCache->GetCharacterAccountIdByGuid(guid)))
|
if (!sPlayerbotAIConfig->IsInRandomAccountList(sCharacterCache->GetCharacterAccountIdByGuid(guid)))
|
||||||
return false;
|
return false;
|
||||||
|
if (std::find(currentBots.begin(), currentBots.end(), bot) != currentBots.end())
|
||||||
return GetEventValue(bot, "add");
|
return true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<uint32> RandomPlayerbotMgr::GetBots()
|
std::list<uint32> RandomPlayerbotMgr::GetBots()
|
||||||
@@ -1501,7 +1496,8 @@ std::list<uint32> RandomPlayerbotMgr::GetBots()
|
|||||||
{
|
{
|
||||||
Field* fields = result->Fetch();
|
Field* fields = result->Fetch();
|
||||||
uint32 bot = fields[0].Get<uint32>();
|
uint32 bot = fields[0].Get<uint32>();
|
||||||
currentBots.push_back(bot);
|
if (GetEventValue(bot, "add"))
|
||||||
|
currentBots.push_back(bot);
|
||||||
}
|
}
|
||||||
while (result->NextRow());
|
while (result->NextRow());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user