espelho de https://github.com/Yuof/mod-rndbot-sync (ver branch ragnarok para o que é nosso)
Find a file
Yuof 1f56034300
Some checks failed
core-build / Linux / AzerothCore Playerbot (push) Has been cancelled
Rename IsRealPlayer to IsHumanPlayer to avoid a linkage clash
mod-playerbots #2592 moved IsRealPlayer from a PlayerbotAI member to a
free function in the global namespace, declared in PlayerbotAI.h. Our
file-static of the same name and signature then follows a non-static
declaration, which MSVC accepts but GCC and Clang reject outright.

Keep our implementation rather than calling theirs: theirs is
!GET_PLAYERBOT_AI(player), which is what 0a714ee fixed away from, since
a bot's PlayerbotAI is not attached yet during OnPlayerLogin and the bot
would be picked as the level target.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0176Lw8RSLprCj2zhR85gi84
2026-08-14 18:49:07 +02:00
.github/workflows Add core-build CI workflow; fill repo URLs in README 2026-06-16 12:38:57 +02:00
conf Stand down when mod-playerbots re-levels bots itself 2026-08-11 22:32:05 +02:00
src Rename IsRealPlayer to IsHumanPlayer to avoid a linkage clash 2026-08-14 18:49:07 +02:00
.gitignore Ignore local-only design docs (docs/) 2026-06-16 11:58:34 +02:00
LICENSE feat: initial implementation of mod-rndbot-level-target 2026-06-15 11:56:07 +02:00
README.md Add core-build CI workflow; fill repo URLs in README 2026-06-16 12:38:57 +02:00

logo AzerothCore

mod-rndbot-sync

core-build

Description

mod-rndbot-sync keeps mod-playerbots random bots in sync with the highest-level real player online — in level, gear, and progression — so the world feels populated at your level instead of clustering wherever the default bot pool happens to sit.

Out of the box, mod-playerbots spreads its random bots across the whole 1–80 range. On a populated endgame realm that looks great, but on a small or solo server the handful of bots near your level is tiny: you level a fresh character through a near-empty world while the bots idle at max level. This module fixes that with one idea — the highest real player online sets the level the bots gravitate to — and keeps the rest of the bot world consistent with where that player actually is.

When no real player is online, the module does nothing: it never churns bots in an empty world.

Features

  • Level sync — keeps a configurable share of random bots within ±TargetBand levels of the highest online real player; promotes the lowest-level bots first so the population drifts upward as you level.
  • Level ceiling / downleveling — the player's level plus the band is a ceiling on the whole bot population; bots above it are pulled down, so a lone low-level player brings the bots down to their level (optional, on by default).
  • Item-level cap — caps bot gear at the player's item level so bots never out-gear you, measured from the player's best owned gear (robust to transient situational equips like a fishing pole).
  • Death Knight progression gating — optionally keeps Death Knight bots out of the world until a real-player account has progressed far enough (requires mod-individual-progression).
  • Smart exclusions — never touches bots that are yours: in a guild with a real player (online or offline), on a friends list, in an arena team, in any party/raid group, or name-listed.
  • Safety-aware — never relevels a bot that is busy: dead, in combat, in a battleground/arena/random dungeon (or queue), or in flight.
  • Event-driven — reacts to real-player login and level-up instantly, with a configurable safety timer as a fallback.
  • Ships no database schema — reads existing tables only.

Requirements

Installation

1. Clone the module

cd <ACoreDir>/modules
git clone https://github.com/Yuof/mod-rndbot-sync.git

2. Re-compile AzerothCore

cd <ACoreDir>/build
cmake ../ -DCMAKE_INSTALL_PREFIX=/path/to/server
make -j $(nproc)
make install

3. Configure

Copy mod_rndbot_sync.conf.dist to mod_rndbot_sync.conf in your server's configs/modules directory and adjust the options (see below). The defaults are sensible for a small or solo server.

4. Restart the server

./worldserver

Commands

All commands are administrator-only and work from the console and in-game.

Command Description
.rndbotsync reload Reload the configuration at runtime.
.rndbotsync status Print a read-only snapshot: target player, band/ceiling, eligible-bot counts, gear cap, and Death Knight gate state.
.rndbotsync resync Force an immediate full pass, ignoring the ProcessLimit throttle (still respects the ceiling, gear cap, exclusions, and safety checks).

Configuration Options

Option Type Default Description
RndBotSync.Enabled Boolean 1 Enable/disable the module.
RndBotSync.CheckFrequency Integer 300 Seconds between safety-timer passes (0 = react to events only).
RndBotSync.TargetPercent Integer 30 Percent of eligible bots to keep within the band.
RndBotSync.TargetBand Integer 3 Band half-width (± levels) and ceiling offset.
RndBotSync.ProcessLimit Integer 5 Max bots adjusted per pass (0 = unlimited).
RndBotSync.AllowDownleveling Boolean 1 Pull bots above the ceiling down. 0 = upward-only.
RndBotSync.IgnoreGuildBotsWithRealPlayers Boolean 1 Skip bots in a guild with any real-player member.
RndBotSync.IgnoreFriendListed Boolean 1 Skip bots on a real player's friends list.
RndBotSync.IgnoreArenaTeamBots Boolean 1 Skip bots in an arena team.
RndBotSync.IgnoreGroupedBots Boolean 1 Skip bots in any party/raid group.
RndBotSync.ExcludeNames String "" Comma-separated, case-insensitive bot names to skip.
RndBotSync.GuildCacheRefreshFrequency Integer 600 Seconds between real-player-guild / friend cache refreshes.
RndBotSync.IlvlSync.Enabled Boolean 1 Cap bot gear at the player's item level.
RndBotSync.DeathKnightProgression.Enabled Boolean 0 Gate Death Knight bots on mod-individual-progression.
RndBotSync.DeathKnightProgression.RequiredState Integer 13 Required ProgressionState (1–18) to unlock DK bots (13 = WotLK content).
RndBotSync.FullDebugMode Boolean 0 Verbose logging.
RndBotSync.LiteDebugMode Boolean 0 Summary logging.

How it works

There is a single target: the highest-level real (non-bot) player online. Around it sits a band of ±TargetBand levels; the top of that band is the ceiling on the entire bot population. Each pass:

  1. Pulls stragglers up — raises the lowest-level bots into the band so that about TargetPercent% of bots sit near the player.
  2. Pulls the over-leveled down — reshuffles any bot above the ceiling back down (when AllowDownleveling is on).
  3. Caps gear — drives mod-playerbots' own gear-score limit so all bot gear, including freshly initialized bots, stays at or below the player's item level.

Passes run on real-player login and level-up, plus the safety timer. The ProcessLimit spreads large corrections over several passes so nothing happens in a single laggy burst.

Credits

License

Released under the GNU AGPL v3 license.