Commit Graph
558 Commits
Author SHA1 Message Date
agathoandClaude Opus 4.6 9f45ea3fb0 feat(commands): Add .bot cheat commands for bot cheat management
Add in-game commands to toggle and manage bot cheats via BotCheatMask:
- .bot cheat <name> — toggle a cheat on selected/group bots
- .bot cheat list — show available cheats and active cheats
- .bot cheat off — clear all cheats on selected/group bots
- .bot cheat mult <type> <value> — set speed/damage/XP multipliers

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:44:01 -03:00
agathoandClaude Opus 4.6 e75d905abf feat(ai): Add RPG-state-based AI budget tier system for CPU optimization
Gate AI subsystems by RPG state to skip unnecessary work in passive states,
reducing CPU per-bot by 30-60% for bots in low-activity states. Three tiers:
FULL (combat/quest/dungeon), REDUCED (travel/city - movement+safety only),
MINIMAL (idle/resting - safety-critical only). Complements existing ST-1
frequency throttling with scope-per-update reduction. Instant combat
escalation ensures bots under attack switch to FULL within one server tick.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:43:06 -03:00
agathoandClaude Opus 4.6 dee387d685 refactor(enchants): Replace SQL enchant/gem data with DB2 client data loading
EnchantGemDatabase now loads entirely from DB2 stores (SpellItemEnchantment,
GemProperties, ChrSpecialization) at startup, scoring each enchant/gem against
spec role and primary stat priorities. Removes all hardcoded SQL data and drops
the now-unnecessary playerbot_enchant_recommendations and
playerbot_gem_recommendations tables. Also replaces hardcoded skill IDs in
GuildTaskManager with SharedDefines enums.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:41:58 -03:00
agathoandClaude Opus 4.6 8acd3117a7 fix(db): Route all new feature queries to playerbot database, not characters
GuildTaskManager, AccountLinkingManager, ChatTemplateManager, and
EnchantGemDatabase were incorrectly using CharacterDatabase for their
queries. All playerbot tables live in the dedicated playerbot database
accessed via sPlayerbotDatabase.

Changes per file:
- Replace #include "DatabaseEnv.h" with "Database/PlayerbotDatabase.h"
- Replace CharacterDatabase.Query() with sPlayerbotDatabase->Query()
- Replace CharacterDatabase.DirectExecute() with sPlayerbotDatabase->Execute()

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:39:57 -03:00
agathoandClaude Opus 4.6 0f0875fe6e feat(playerbot): Add 14 new systems - combat intelligence, RPG simulation, utilities
Implement complete feature batch from mod-playerbots analysis plan:

CRITICAL (4):
- TTK Estimator: Skip long casts on dying targets (rolling 5s DPS window)
- Healing Mana Tiers: 5-tier efficiency gating for 7 healer specs
- Spell Fallback Chains: Try alternatives when primary spell unavailable
- RPG World Simulation: Personality-driven daily routines for idle bots

HIGH (4):
- ClassSpellDatabase: Static shared spell data for all 13 classes
- Population PID Controller: Smooth bot spawning with Kp/Ki/Kd tuning
- Enchant/Gem Templates: Auto-enchant and gem equipment by spec
- Chat/Emote Templates: DB-driven contextual bot chat with locale support

MEDIUM (4):
- ServerLoadMonitor: Scale reaction delays under server load
- DirtyValue<T>: Lazy evaluation template for expensive computations
- Guild Task System: Auto-generated guild tasks with bot assignment
- Packet Handler Cleanup: Remove deprecated opcode-based stubs

LOW (2):
- Account Linking: Permission-based bot account sharing
- BotCheatMask: Debug cheat system with 15 flags and multipliers

Includes SQL schemas, subsystem registrations, and user documentation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:39:23 -03:00
agathoandClaude Opus 4.6 764103da11 fix(bg): Close ToK behavioral gaps - proactive combat, orb rush, kiting
Five behavioral gaps fixed in Temple of Kotmogu bot AI:

1. Carrier fights while traveling to center: Carriers now engage enemies
   within 15yd en route instead of being passive targets. Chase within
   10yd, attack-and-continue for 10-15yd enemies.

2. Proactive escort combat: Escorts now engage the closest enemy within
   20yd of the carrier regardless of carrier combat state, instead of
   waiting until the carrier is already being attacked.

3. Dropped orb rush: Any bot within 40yd of a free orb rushes to pick
   it up, overriding assigned role. Prevents orbs sitting on ground
   while bots escort/hunt/defend elsewhere.

4. Contested orb fighting: When PickupOrb finds no GO (orb was taken),
   bots engage nearby enemies at the location instead of standing idle.

5. Carrier kiting in center: When HP 30-60% and 2+ enemies within 10yd,
   carrier moves away from enemy cluster while staying in center zone,
   maintaining attack on closest enemy.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:38:24 -03:00
luis 5a0839fe33 Quest and misc db fixes 2026-02-07 13:58:22 -03:00
Shauren 1f87241f1a Core/Objects: Refactor entity fragment functions to separate global array and move ClearChangesMask there
* Additionally unify argument order for UF::Structure::WriteSomething and Object::BuildValuesSomething

Signed-off-by: luis <[email protected]>
2026-02-07 13:14:33 -03:00
agathoandClaude Opus 4.6 c4902451ef fix(bg): Add combat initiation, fix ToK center coords, always push center
- Add player->Attack(enemy, true) at all 15 enemy engagement points
  across BattlegroundAI.cpp (7 sites) and TempleOfKotmoguScript.cpp
  (8 sites). Without Attack(), bots only did SetSelection+ChaseTarget
  which is movement-only — combat never started, no PvP occurred.
- Fix ToK CENTER_X/Y from (1732,1287) to (1783.5,1333.4) — the actual
  geometric center of the 4 orb positions. Old coords were ~69yd off,
  causing carriers to navigate to the wrong location.
- Simplify carrier movement to always push center for 3-6x scoring
  bonus instead of requiring 2+ orbs and time conditions.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-07 13:13:11 -03:00
agathoandClaude Opus 4.6 e75b5c7cb4 fix(bg): Fix ToK orb pickup phase mismatch and BG population race condition
- Replace phase-sensitive GetGameObjectListWithEntryInGrid with
  GetGameObjectListWithOptionsInGrid (IgnorePhases=true) for ToK orb
  pickup. Dynamically spawned BG orbs may not share bot PhaseShift,
  causing silent filter in grid search VisitImpl().
- Add ProcessPendingPopulations() retry system in BGBotManager that
  retries PopulateBattleground every 5s for up to 2 minutes after BG
  start, fixing 8v5 starts caused by warm pool bots still in async login.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-07 13:12:24 -03:00
agathoandClaude Opus 4.6 8cee246f2b fix(bg): Fix ToK starting with 5v5 instead of 10v10
Add explicit BATTLEGROUND_TK and BATTLEGROUND_SM cases to GetBGTeamSize()
(return 10) and GetBGMinPlayers() (return 5). Fix QueueStatePoller DBC
fallback which incorrectly divided BattlemasterListEntry::MaxPlayers by 2
(the field is already per-team, as GetMaxPlayersPerTeam() returns it
directly). Use BGBotManager::GetBGTeamSize() as primary fallback instead
of the DBC lookup.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-07 13:10:10 -03:00
agathoandClaude Opus 4.6 3c92d7aae6 fix(bg): Fix ToK bots converging on same orb, stuck at empty spawns, and idle carriers
Replace broken event-based orb tracking (ORB_PICKED_UP never fired) with
aura-based RefreshOrbState() that scans all BG players for orb auras every
second. Add m_orbTargeters map to distribute bots 1-per-orb instead of all
targeting the same one. Clear targeting when no GO found at orb location so
bots fall through to escort/hunt instead of looping. Add EscortOrbCarrier
fallback for ORB_CARRIER role when no orbs are available.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-07 13:09:12 -03:00
agathoandClaude Opus 4.6 900ee56f03 fix(bg): Fix BG bot lifecycle - cleanup on end, end when human leaves, stop over-spawning
Three fixes for BG bot lifecycle issues:

1. End BG when last human leaves: MonitorActiveBattlegrounds() now checks
   for human presence in active BGs. After a 30s grace period with no
   humans, the BG ends as a draw via EndBattleground(TEAM_OTHER).

2. Release and logout BG bots on BG end: OnBattlegroundEnd() now releases
   pool bots via InstanceBotPool::ReleaseBot(), logs out all BG bots via
   BotWorldSessionMgr::RemovePlayerBot(), and notifies the orchestrator
   via OnInstanceEnded(). Previously only tracking maps were cleared.

3. Fix zone spawner over-spawning with no humans: CalculateTargetBotCount()
   now uses _lastRealPlayerCount (humans only) instead of the broken
   condition that always applied minimums in static mode or counted bot
   sessions as active players.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-07 07:40:55 -03:00
agathoandClaude Opus 4.6 cc8f3ea465 docs(audit): Update audit reports to reflect zero-TODO milestone
Update COMPREHENSIVE_AUDIT_REPORT.md and INCOMPLETE_IMPLEMENTATIONS_REPORT.md
to document the February 2026 TODO cleanup results: 50 TODOs resolved across
29 files, 15 MIGRATION markers standardized across 6 files, zero remaining
production TODOs verified by codebase scan.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-07 07:19:20 -03:00
agathoandClaude Opus 4.6 fb41d15af3 cleanup(code): Resolve all TODO comments and standardize MIGRATION markers
Resolve 50 TODO comments across 29 production files and standardize 15 MIGRATION
comments across 6 files, achieving zero remaining TODOs in production code.

Implementations:
- DemandCalculator: IsQuestHub() via QuestHubDatabase, GetBotCountInZone() via BotSpawner
- QuestPathfinder: Replace hardcoded RUN_SPEED with player->GetSpeed(MOVE_RUN)
- PlayerbotGroupScript: Add bot detection via PlayerBotHooks::IsPlayerBot()

Comment standardization:
- TODO stubs → DESIGN/LIMITATION/ARCHITECTURE documentation comments
- MIGRATION COMPLETE noise → descriptive architectural comments
- Empty/stale TODOs removed entirely

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-07 07:12:04 -03:00
StorM dfad4f5819 fix MajorCooldownTracker.h 2026-02-07 09:28:32 +01:00
StorM b7f9b926a4 fix BGScriptRegistry.cpp 2026-02-07 09:26:35 +01:00
StorM b59a689b9f fix ActivitySession.h 2026-02-07 09:07:30 +01:00
StorM bada006bcd fix ActivitySession.cpp 2026-02-07 09:06:10 +01:00
StorM 9e6a57667c fix ClaimResolver.h 2026-02-07 09:03:08 +01:00
MoltenCrystal 567306d6b6 Scripts/Spells: Handle Thunder Clap slow and Rend (#31525)
Signed-off-by: luis <[email protected]>
2026-02-06 20:24:42 -03:00
agathoandClaude Opus 4.6 a47d8b6b88 fix(bg): Fix vtable dispatch crash in DominationScriptBase::OnLoad
Add `override` keyword to all virtual function overrides across 16 BG
script headers to catch signature mismatches at compile time.

Extract virtual calls (GetNodeCount/GetNodeData) from
DominationScriptBase::OnLoad into a new InitializeNodeTracking() method
called by derived classes after base OnLoad completes. This avoids
virtual dispatch at the fragile IBGScript/DominationScriptBase vtable
slot boundary, where MSVC RelWithDebInfo builds with stale .obj files
could route GetNodeCount (returns uint32, RCX=this) through
GetObjectivePath (returns std::vector<Position>, RCX=hidden_return,
RDX=this), causing ACCESS_VIOLATION when RDX=0.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-06 20:22:23 -03:00
agathoandClaude Opus 4.6 c72a04bdef fix(bg): Move coordinator creation to main thread to prevent worker thread crashes
Coordinator Initialize() accesses Battleground data (GetPlayers, GetMapId),
loads BG scripts, and runs map grid operations (FindNearestGameObject 500yd)
which are NOT thread-safe. The previous commit moved Initialize() outside
the lock but still ran it on worker threads, causing ACCESS_VIOLATION in
TempleOfKotmoguScript::OnLoad -> DominationScriptBase::OnLoad vtable crash.

Fix: Worker threads now queue creation requests via _pendingCreations map.
The main thread processes them in Update() -> ProcessPendingCreations()
where Battleground access is safe. Coordinator available within one tick.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-06 20:17:38 -03:00
agathoandClaude Opus 4.6 90a7bf8aca fix(bg): Resolve mutex contention causing 10-30s thread pool hangs in BG coordinator
BattlegroundCoordinatorManager held _mutex during expensive coordinator
Initialize() (grid scans, pathfinding, script loading) and Update() calls,
blocking all worker threads from GetCoordinatorForPlayer() lookups. This
caused thread pool timeouts and bots standing idle at spawn.

Fix: copy-and-release pattern - only hold _mutex for map insert/find/erase,
never during coordinator operations. Added _creatingCoordinators guard to
prevent redundant Initialize() calls from multiple worker threads.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-06 20:00:43 -03:00
agathoandClaude Opus 4.6 fac92714c0 fix(bg): Register BG scripts explicitly and stop QueueStatePoller over-spawning
Two root causes for idle bots and over-population in battlegrounds:

1. BGScriptRegistry had 0 registered scripts at runtime. The
   REGISTER_BG_SCRIPT macro uses static global constructors for
   auto-registration, but MSVC's linker dead-strips object files from
   static libraries when no external symbol references them. The previous
   ForceInclude/volatile-pointer pattern did not prevent this.
   Fix: Replace with explicit RegisterScript() calls in
   InitializeBGScripts() for all 14 BG map IDs.

2. QueueStatePoller kept re-polling every 5-10 seconds after assigning
   warm pool bots. Since bots take time to login and enter the queue
   asynchronously, the poller saw "0/10 Alliance, 0/10 Horde" on each
   poll and spawned another full batch (14 rounds = ~280 bots for 10v10).
   Fix: Unregister the BG queue from the poller immediately after the
   warm pool (or JIT) fully satisfies the demand. Also copy the active
   queue set before iterating to avoid iterator invalidation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-06 19:39:09 -03:00
Naddleyandfunjoker f2077de55d Scripts/Westfall: Implement Quest: "Murder Was The Case That They Gave Me" (#31494)
- re-spawn Hobo spawns with createobject2
- pooled spawns

Co-Authored-By: funjoker <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-06 14:46:27 -03:00
Shauren 0f32a1d35d Core/Players: Fixed spellpower for devourer demon hunters (currently the only intellect based spec without mana)
Signed-off-by: luis <[email protected]>
2026-02-06 14:45:55 -03:00
Aqua Deus 47e7f1768a Scripts/Spells: Implement dh talent "Enduring Torment" (#31523)
Signed-off-by: luis <[email protected]>
2026-02-06 14:45:12 -03:00
Cristian Vintila 63cb26eecf Scripts/Spells: Update Atonement trigger spells (#31651)
Signed-off-by: luis <[email protected]>
2026-02-06 14:44:28 -03:00
Cristian Vintila 70b2af2acd Scripts/Spells: Implement druid talent Flower Walk (#31532)
Signed-off-by: luis <[email protected]>
2026-02-06 14:43:45 -03:00
Aqua Deus 269ab5a25a Scripts/Spells: Implement proc of dk talent Suppression (#30243)
Signed-off-by: luis <[email protected]>
2026-02-06 14:42:40 -03:00
Shauren 8496186319 Core/Misc: Add devourer demon hunter spec to enum
Signed-off-by: luis <[email protected]>
2026-02-06 14:42:15 -03:00
Meji 3d1c44ce7f DB/Hotfixes: Updated zhTW hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:41:45 -03:00
Meji d85db03a88 DB/Hotfixes: Updated zhCN hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:41:15 -03:00
Meji 7c9b0c3b1b DB/Hotfixes: Updated ruRU hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:40:51 -03:00
Meji 9e246e1a16 DB/Hotfixes: Updated ptBR hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:40:16 -03:00
Meji 605976fa1c DB/Hotfixes: Updated koKR hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:39:40 -03:00
Meji 1a9c41f80a DB/Hotfixes: Updated itIT hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:39:06 -03:00
Meji a1ecc7d28b DB/Hotfixes: Updated frFR hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:38:38 -03:00
Meji d7f1577900 DB/Hotfixes: Updated esMX hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:36:02 -03:00
Meji f21dbbd0e3 DB/Hotfixes: Updated esES hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:18:16 -03:00
Meji 6935f7efe2 DB/Hotfixes: Updated deDE hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:17:29 -03:00
Meji 9aaa95b3ee DB/Hotfixes: Updated hotfixes to 12.0.0.65727
Signed-off-by: luis <[email protected]>
2026-02-06 14:14:23 -03:00
Aqua Deus d17d583400 Scripts/Spells: Implement dh talent "Soul Sigils" (#31529)
Signed-off-by: luis <[email protected]>
2026-02-06 14:12:59 -03:00
Cristian Vintila 1ac20f3256 Scripts/Spells: Implement druid talent Guardian of Elune (#31541)
Signed-off-by: luis <[email protected]>
2026-02-06 14:12:10 -03:00
Cristian Vintila 4cf4ac7cef Scripts/Spells: Implement druid talent Maim (#31586)
Signed-off-by: luis <[email protected]>
2026-02-06 14:11:14 -03:00
ModoX 9eab46322c Core/Spells: Make sure that spells with overridden duration but default duration 0 are not flagged immune
Signed-off-by: luis <[email protected]>
2026-02-06 14:09:04 -03:00
Shauren f4065e2724 Core/PacketIO: Fix some DifficultyID types in packets
Signed-off-by: luis <[email protected]>
2026-02-06 14:08:04 -03:00
agathoandClaude Opus 4.6 18d20a2193 fix(bg): Prevent double bot population and register late-joining bots with coordinator
Two BG fixes:

1. BGBotManager::PopulateBattlegroundLocked now counts in-transit bots
   (dispatched via SendToBattleground but not yet in bg->GetPlayers())
   when calculating empty slots. Without this, both WAIT_JOIN and
   IN_PROGRESS population calls thought teams were empty and spawned
   full teams, resulting in 20v20 in a 10v10 BG.

2. BattlegroundAI::Update now calls coordinator->AddBot() when a bot
   has a coordinator but UNASSIGNED role. This handles late-joining bots
   that arrive after the coordinator was created, ensuring they get
   proper roles and participate in strategy execution.

Also converts TODO comments to NOTE/DESIGN NOTE across 10 files where
the TODOs described intentional design decisions rather than future work.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-06 14:06:55 -03:00
luis 609119b7b9 fix(bg): Break infinite recursion in BGRoleManager role assignment loop 2026-02-06 14:06:24 -03:00