Commit Graph
10 Commits
Author SHA1 Message Date
Karrz1 bc6b943603 Bots: one .reload config reloads the bot settings, conf.d wins
`.playerbot reload` re-added playerbot.conf on top of the merged config.
Any key in playerbot.conf then beat the same key in worldserver.conf.d
(test runs set Playerbot.World.SoakAnchors, PlayerbotV2.SnapshotBuildSplitMap
and the like there), so a test setting could vanish on reload. And
`.reload config` alone did not refresh the module's cached settings, so a
run needed both commands.

- playerbot.conf is loaded as a base file: worldserver.conf.d overrides it,
  at startup and after every reload.
- `.playerbot reload` reads every config file again in that order and takes
  the values; `.reload config` now also refreshes the module's settings
  (OnConfigLoad), so it is enough on its own.
- after every load and reload the log, and the `.playerbot reload` reply,
  show the effective ParallelSnapshotBuild, SnapshotBuildSplitMap,
  World.Enable and World.SoakAnchors.

Changes for a realm that has the same key in playerbot.conf and in
worldserver.conf.d with different values: the conf.d value now wins.
2026-11-15 21:26:39 +00:00
Karrz1 68e116f392 Bots: console self-tests for fixes that needed a player
New `.playerbot selftest` commands (Commands/cs_selftest.cpp) drive an online
character, a world bot is fine, through the same server code a client reaches
and print PASS/FAIL lines a script can grep:

- quest <name> <quest> [add|accept <npc>|drop]: can it be taken, and which
  rule refuses it; gives it (start items too, or from an NPC so its accept
  script runs) and prints every objective with the bag count.
- explore <name> <quest>: moves the character into the quest's area trigger,
  then sends the client's area trigger message and reports the credit.
- explorelist: every exploration quest and whether its trigger exists.
- itemobjective <name> <quest> <item> [n]: collected quest items follow the
  bags when they are destroyed.
- npc <name> <entry> go|show|learn <spell>: the gossip menu a player gets
  (trainer, vendor, talk), goods and trainer spells; learn as the Train
  button does.
- path <name> <entry> x y z: a creature's path with floor and water under
  each point (land creatures walk on the sea bed).
- namegen <race> <sex> [n]: what the name dice gets.
- cast <name> <spell>, auras <name> [spell]: put down a bag or trap, read
  resting and auras.

New file: needs a cmake reconfigure.
2026-11-12 14:36:48 +00:00
Karrz1 312fdf59e4 PlayerbotV2: no hired bots and no bot arenas
The hired bots (hire brokers, Playerbot.Hire.*, .bot hire, the add-on's hire panel) and the bot arena play
(.bot arena, arena bot teams, the add-on's arena buttons and the Ring of Law arena script) are taken out.
Neither is Blizzard content. The stock TrinityCore arena code and the bot module's arena tactics stay.
2026-11-09 17:35:58 +00:00
Karrz1 b5f1d43560 Merge forever (sync with WoW Forever 0.1.34) into forever-bots
forever-bots is forever plus the optional player bots module (src/modules/PlayerbotV2), now at our 0.1.34 bot code:
dungeon and raid tactics (BWL Nefarian, Zul'Gurub), pull back, ships and zeppelins, gear trading, orders in party chat,
autosave every 15 minutes, the ForeverBots add-on 0.6.20 and the Playerbot.Enable master switch.
World PvP bots and the optional bot chat program are in the module but off by default.
2026-11-09 17:27:57 +00:00
Karrz1 9df935eed5 PlayerbotV2: bot module update
conf/zz-forever-bots.conf ships the WoW Forever repack settings: world bots on with the
16-29 GB crowd preset (RssBudgetMb 6000), start zone caps, spawn pacing, and the auction
house bot listing every quality on the neutral house with a fair-price buyer. A
playerbot.conf next to worldserver.conf is read too; one in worldserver.conf.d is not
loaded twice.
2026-10-27 23:06:42 +00:00
Karrz1 911c523267 Bots: a companion its owner removes from the group is let go like a dismissal (#97)
Reason: after its owner used Uninvite on a companion bot, the bot kept following the owner for as long as the owner binding stood.

Why: nothing reacted to the group removal; only .bot dismiss released a companion.

Fix: a group hook releases an owned companion that the owner kicks or that leaves the group: it says goodbye and logs out, and the owner and saved mark stay, so .bot call brings it back. Battleground groups, a bot that is logging out, internal removals and kicks by anyone but the owner do nothing.
2026-10-23 18:55:16 +08:00
Karrz1 d01d392103 Bots: module update (raid, dungeon, battleground and world-bot fixes) (#61)
Module-only update of src/modules/PlayerbotV2. Nothing outside the module directory changes.
2026-10-18 09:20:47 +08:00
Advocaite 93e292ad6f Bots: move the bot code out of the core into the module
src/server/game/Playerbot (PlayerbotAPI, bot movement, item scorer, Classic
spec/supplies/talent tables, ...) is now src/modules/PlayerbotV2/Api, and the
.playerbot/.bot commands are src/modules/PlayerbotV2/Commands. The module
registers its commands itself; PlayerbotHooks is gone.

Core:
- PathGenerator: the bot-only liquid avoidance is an optional
  LiquidRouteCheck callback the module sets.
- Debug probe logging removed from chat, group, inspect, party packets and
  the session packet loop.
- .learn all mylevel moved into the module (same name and permission).
- .summon is the stock GM command again. Removed the auth update that gave
  every player .summon (only a module check kept them from summoning real
  players). Players call their own bots with .bot summon all|saved|<name>;
  the ForeverBots "Call saved" button uses it.
2026-10-13 11:40:17 +08:00
Advocaite 0bc03e79ab Bots: core events reach the module through ScriptMgr hooks
The core no longer calls Playerbot::Hooks. Events the module reacts to come
through ScriptMgr; PlayerbotV2Scripts.cpp forwards them to the module.

Existing hooks reused at the same place: player login, logout, level change,
repop, text emote, guild member added, unit damage.

New generic hooks, called where the bot calls were:
- PlayerScript: OnChatSent (say/yell, whisper, group, guild; after the
  message was sent), OnAddonMessageSent (whisper, group), OnLootItem,
  OnBattlegroundQueueJoin, OnBattlegroundInvite, OnBattlegroundPortFailed,
  OnLfgJoin, OnLfgProposal
- UnitScript: OnUnitDeath
- GroupScript: OnSubgroupChange
- WorldScript: CanCreateBattleground

The human-only checks on queue joins moved into the module. Dropped the hit
outcome, energize and heal calls (only fed debug statistics). Bot code still in
src/server/game/Playerbot keeps PlayerbotHooks until it moves into the module.
2026-10-13 10:55:04 +08:00
Advocaite af808e1492 Modules: load optional modules through ScriptMgr, bots start/tick/stop as a WorldScript
src/modules: every folder with a CMakeLists.txt is added; a module registers its
library, script loader and configs with trinity_add_module(). worldserver links
the generated `modules` library, whose AddModuleScripts() runs after AddScripts()
and is empty when no module is built. Module configs go to worldserver.conf.d.

New WorldScript hooks: OnBeforeMapsUpdate (each tick, before the maps update)
and OnWorldInitialized (world loaded, before the network starts). The bot module
uses them instead of direct calls from World.cpp and Main.cpp. The world script
update is back at its place after the maps, as in forever.

Removed the unused ModuleManager, modules/Common and TestModule, and the bot
freeze dump and settings log from Main.cpp (the settings line moved into the
module).
2026-10-13 10:20:15 +08:00