Filter bot logins by level range

This commit is contained in:
Your Name
2025-08-03 17:36:02 -06:00
parent ee99b66d04
commit 3900237ffd
6 changed files with 260 additions and 50 deletions

View File

@@ -189,6 +189,14 @@ public:
void AssignAccountTypes();
bool IsAccountType(uint32 accountId, uint8 accountType);
// Allowed login range management
void ForceRecount() { SetEventValue(0, "bot_count", 0, 0); }
void MarkBotForLogout(uint32 bot)
{
SetEventValue(bot, "add", 0, 0); // Clear the "add" event to trigger logout
SetEventValue(bot, "logout", 1, 1); // Also set logout for clarity
}
protected:
void OnBotLoginInternal(Player* const bot) override;
@@ -233,6 +241,16 @@ private:
std::vector<uint32> rndBotTypeAccounts; // Accounts marked as RNDbot (type 1)
std::vector<uint32> addClassTypeAccounts; // Accounts marked as AddClass (type 2)
// Login level filtering
bool levelFilterAdjusted = false;
void PopulateEligibleBots();
bool IsLevelFilterActive() const
{
return sPlayerbotAIConfig &&
(sPlayerbotAIConfig->randomBotMinLoginLevel > 1 ||
sPlayerbotAIConfig->randomBotMaxLoginLevel < 80);
}
//void ScaleBotActivity(); // Deprecated function
};