Commit Graph
558 Commits
Author SHA1 Message Date
Shauren f1d6cdf3d9 Core/Units: Fix crashes caused by spirit being brought back into existence in 12.0.0
Signed-off-by: luis <[email protected]>
2026-02-11 20:19:44 -03:00
Shauren 2e8a8df234 Core/Movement: Improve Turning spline handling
Signed-off-by: luis <[email protected]>
2026-02-11 20:19:09 -03:00
Shauren 12484c7f5d Core/Misc: Fix build with gcc 12
Signed-off-by: luis <[email protected]>
2026-02-11 20:18:08 -03:00
Shauren a1f8425939 Core/Misc: Fix MovementFlags3 log in MovementInfo::OutDebug
Signed-off-by: luis <[email protected]>
2026-02-11 20:17:43 -03:00
Naddley b6122b0ee8 DB/Stormwind: Update Wizards Sanctum
Signed-off-by: luis <[email protected]>
2026-02-11 20:16:37 -03:00
Aqua Deus 60897cca6a Core/Auras: Implement SPELL_AURA_CONVERT_CRIT_RATING_PCT_TO_PARRY_RATING (#31531)
Signed-off-by: luis <[email protected]>
2026-02-11 20:15:17 -03:00
Naddley 47fd89caec DB/Stormwind: Added creature spawns for Quest: "Avoiding Blame"
Signed-off-by: luis <[email protected]>
2026-02-11 20:14:44 -03:00
Shauren de506923d0 Core/Transports: Fix transport model rotation
Signed-off-by: luis <[email protected]>
2026-02-11 20:14:07 -03:00
Shauren 7290703c86 Core/Vmaps: Fix mismatched new and delete operators in BIH::build
Signed-off-by: luis <[email protected]>
2026-02-11 20:11:52 -03:00
luis 5528a23dd7 Core/Items: Implement CMSG_SELL_ALL_JUNK_ITEMS handler 2026-02-11 20:10:05 -03:00
luis 190dd2a3c3 Core/Items: Implement CMSG_SET_INSERT_ITEMS_LEFT_TO_RIGHT handler 2026-02-11 20:07:06 -03:00
luis 83ee5e3af0 rework 2026-02-11 19:55:00 -03:00
agathoandClaude Opus 4.6 03602eb6d1 fix(bg): Fix BotActionProcessor GUID lookup + add BG overpopulation trim
BotActionProcessor::GetBot() used ObjectAccessor::GetPlayer(nullptr, guid)
which compares player->GetMap() == nullptr — always false for bots on BG
maps. This caused 100% action failure rate (39/39 failed). All deferred
actions (orb pickup, flag capture, node interaction) were silently dropped.

Fix: Use ObjectAccessor::FindPlayer(guid) which does a global lookup
without map comparison.

Also adds TrimExcessBotsLocked() to detect and remove excess bots when
teams are overpopulated, called from both PopulateBattlegroundLocked()
and ProcessPendingPopulations().

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:49:37 -03:00
agathoandClaude Opus 4.6 055b2dd985 fix(travel): Eliminate terrain loading from PortalDatabase init entirely
Replace TerrainMgr::GetZoneId() calls with direct reads from the
gameobject table's zoneId/areaId columns. This avoids loading 62+ map
terrain trees (with recursive child maps, grid file I/O, and VMap/MMap
load/unload cycles) during startup.

destinationZoneId is unused by any consumer — the travel route planner
already uses exact destinationPosition coordinates for distance-based
routing, which is strictly more precise than zone-level comparison.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:49:03 -03:00
agathoandClaude Opus 4.6 b8f545a467 feat(currency): Implement CMSG_SET_CURRENCY_FLAGS handler
Implements the previously unhandled CMSG_SET_CURRENCY_FLAGS opcode, which
allows players to toggle per-currency display preferences (e.g. "Show on
Backpack"). Wire format decoded from IDA disassembly of WoW 12.x client:
{ uint32 CurrencyID; uint8 Flags; }

Changes:
- Add SetCurrencyFlags ClientPacket class (MiscPackets.h/cpp)
- Add Player::SetCurrencyFlags() with ClientFlags mask validation
- Add WorldSession::HandleSetCurrencyFlags() with DB2 currency validation
- Wire opcode as STATUS_LOGGEDIN, PROCESS_THREADUNSAFE

The flags (CurrencyDbFlags::InBackpack, UnusedInUI) are persisted via the
existing _SaveCurrency() path — no schema changes needed.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:47:07 -03:00
agathoandClaude Opus 4.6 8d4a383430 fix(travel): Cache terrain refs during PortalDatabase init to prevent thrashing
GetZoneIdForPosition() calls sTerrainMgr.GetZoneId() per portal, which
uses weak_ptr caching. During startup no Map objects hold terrain refs,
so each call loads the entire terrain tree from disk (including all child
instance maps) then immediately unloads it. For continent maps with dozens
of children, this repeats hundreds of times causing extreme startup delay.

Hold shared_ptr<TerrainInfo> in a temporary cache during initialization so
each map's terrain is loaded exactly once.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:45:30 -03:00
agathoandClaude Opus 4.6 112eff8ac5 fix(bg): Wire BotActionMgr ProcessActions + fix BG death corpse run
Two critical bugs fixed:

1. BotActionManager::ProcessActions() was never called in production.
   The BotActionManagerSubsystem had updateOrder=0 (never updated) and
   no Update() method. All deferred actions (INTERACT_OBJECT, ENTER_VEHICLE,
   etc.) queued by worker threads accumulated forever without execution.
   This broke ToK orb pickup, CTF flag return, node captures, vehicle
   boarding, and all other deferred GO interactions added in Phase 1A.
   Fix: Added Update() override with updateOrder=250.

2. Dead bots in BGs ran to their corpse instead of resurrecting.
   HandleResurrecting with AUTO_RESURRECT passively waited 30s for
   IsAlive(), but BG spirit guides require gossip interaction that bots
   never perform. After timeout, retry via GHOST_DECIDING could choose
   CORPSE_RUN if BG ended during the wait (InBattleground() false).
   Fix: Force-resurrect bots in BGs after 30s wave timer instead of
   falling through to corpse run retry path.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:44:13 -03:00
agathoandClaude Opus 4.6 cc9eb95f68 feat(bg-scripts): Comprehensive BG script enhancement - 14-phase plan
Complete overhaul of all 13 battleground scripts with behavioral,
strategic, and thread-safety improvements across 6 major phases:

Phase 1 - Base class fixes:
- Fix TryInteractWithGameObject phase mismatch + thread-safety
- Add pending interaction framework to BGScriptBase
- Fix CTFScriptBase ReturnDroppedFlag and EscortFriendlyFC
- Add fight-on-flag leash to DominationScriptBase::DefendNode

Phase 2 - Universal behavioral enhancements:
- Node defense commitment timer for all Domination BGs
- Reinforcement routing (INC response) for contested nodes
- Distance-weighted node priority for smarter objective selection
- Score-driven strategy amplification with momentum tracking
- Phase transition hysteresis to prevent oscillation

Phase 3 - CTF-specific enhancements:
- Activate FC route evasion (WSG + Twin Peaks)
- Dropped flag priority with mid-field return
- Defense allocation rebalance for opening phase
- EOTS FC protection escort at 4-cap

Phase 4 - Per-BG domination fixes:
- Arathi Basin: proximity-based opening rush
- Seething Shore: dynamic node spawn response
- Deepwind Gorge: cart/mine mechanics verification

Phase 5 - Siege & Epic BG enhancements:
- AV: Boss NPC targeting with tank/healer awareness
- SOTA: Vehicle boarding system (demolishers + turrets)
- IOC: Vehicle mounting + parachute assault from Hangar
- SSM: Cart capture, track following, intersection handling
- Ashran: Dynamic road progression, event cycling, boss targeting

Phase 6 - Thread-safety & quality:
- Add std::atomic for cross-thread state variables
- Add std::shared_mutex for container protection
- Fix atomic-to-atomic assignments and fmt::format compatibility
- Make cached phase enums atomic in 4 scripts

47 files changed, +2837/-470 lines across all BG script types.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:43:35 -03:00
agathoandClaude Opus 4.6 fc6d363b2a fix(bg-tok): Fix 6 ToK runtime bugs - deferred Use(), orb split, combat, cleanup
- Fix silent orb pickup failure: deferred Use() via BotActionMgr caused bots
  to move away before main thread processed the spell cast. Added
  m_pendingOrbPickup hold-position state so bots stay at orb for up to 2s
  until the main thread processes the deferred GO interaction.

- Fix uneven orb split (1 vs 8+ bots): replaced race-prone m_orbTargeters
  map with GUID-based deterministic slot assignment (GUID % ORB_COUNT with
  round-robin fallback) for even distribution without shared mutable state.

- Fix missing combat engagement: bots now check for nearby enemies via
  coordinator during orb approach movement and initiate Attack().

- Fix claim-aware hasFreeOrb: ExecuteStrategy Priority 2 now skips orbs
  with active m_orbClaimedUntil and m_orbSearchFailed cooldowns, so bots
  correctly fall through to escort/hunt instead of re-entering PickupOrb.

- Fix carrier waypoint oscillation: replaced forward-only waypoint scan
  with center-distance comparison so carriers don't oscillate between
  midway waypoint and center.

- Fix missing OnBattlegroundEnd hook: PlayerbotBGScript now detects
  STATUS_WAIT_LEAVE transition and calls BGBotManager::OnBattlegroundEnd()
  to prevent resource leaks and dangling pointers.

- Fix Map::SendObjectUpdates crash: RemovePlayerBot now clears Account
  and Item BaseEntity objects from _updateObjects, not just Player.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:41:59 -03:00
agathoandClaude Opus 4.6 1c943acd36 fix(bg-runtime): Fix 4 runtime bugs - faction cache, population, orb race, carrier circling
Bug 1: BG under-population (7v4) - Skip bots on wrong map in in-transit
counting. Bots that failed teleport sit on their home map but were
counted as "in-transit", making teams appear full prematurely.

Bug 2 (CRITICAL): Spatial cache faction bug - BGSpatialQueryCache used a
single _faction from the first bot for ALL enemy/ally queries. Half the
bots saw their own team as enemies and enemies as allies. Added
callerFaction parameter to all 8 spatial query methods and excludeGuid
to GetNearestEnemy to prevent self-targeting. Updated all 15 call sites
across BGScriptBase, CTFScriptBase, and TempleOfKotmoguScript.

Bug 3: Dual orb pickup race - Two bots at orb location could both call
Use() in the same tick before RefreshOrbState() detected the aura. Added
m_orbClaimedUntil timestamp map with 3-second claim window.

Bug 4: Carrier circling - Fully caused by Bug 2. Carrier's
GetNearestEnemy() returned itself, causing self-attack which disrupted
movement. Resolved by callerFaction + excludeGuid parameters.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:41:19 -03:00
agathoandClaude Opus 4.6 2e3bdfef66 fix(bg-queue): Fix 5 cascading bugs preventing BG population
When a human queued for a BG, warm pool bots failed to populate the
queue due to 5 cascading failures:

1. Human player was only registered in _humanPlayers after botsQueued>0,
   but warm pool bots are async so botsQueued=0 — human never tracked,
   breaking GetQueuedHumanForBG() for all warm pool bots
2. Dead bots from previous sessions silently failed IsBotAvailable()
   with no logging — 10/19 warm pool bots rejected
3. IsBotAvailable() had no diagnostic logging for any rejection path
4. QueueStatePoller immediately unregistered after warm pool claimed
   success, with no verification that bots actually queued

Fixes:
- Move human registration before bot loop (always register)
- Resurrect dead bots in BotPostLoginConfigurator before BG queue
- Add TC_LOG_DEBUG to every IsBotAvailable rejection path
- Replace immediate unregister with 30s verification re-poll that
  re-registers the queue if actual counts are insufficient

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:40:46 -03:00
agathoandClaude Opus 4.6 5a989f6117 refactor(packet): Replace polling ACK scanner with reactive event-driven system
BotPacketSimulator previously polled every 100ms scanning all 9 speed types
plus teleport/knockback/magnitude flags for every bot. Now BotSession::SendPacket()
intercepts outgoing SMSGs and sets atomic flags via OnPacketSent(), and Update()
processes only the flagged ACKs with O(1) cost when idle.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:40:22 -03:00
agathoandClaude Opus 4.6 9377b2b540 feat(systems): Add 6 new systems - raid coordination, combat logging, reagents, transmog, archaeology
- TankSwapCoordinator: Automated tank swap detection with taunt rotation and debuff tracking
- CooldownSyncCoordinator: Raid-wide defensive/offensive CD synchronization with priority queuing
- StructuredCombatLog: Ring-buffer combat event logging with DPS/HPS metrics and encounter tracking
- ReagentManager: Reagent/consumable inventory management with auto-purchase and crafting support
- TransmogManager: Per-bot transmog outfit management with appearance collection and themed outfits
- ArchaeologyManager: Full archaeology profession state machine (survey/triangulate/collect/solve)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:39:57 -03:00
agathoandClaude Opus 4.6 af30e56008 feat(coordination): Add GroupBuffCoordinator for raid-wide buff deduplication
Prevents duplicate raid-wide buff casting when multiple bots of the same
class are in a group. Uses claim-based system: bot claims buff responsibility,
others skip. Tracks 7 WoW 12.0 categories (Intellect, Stamina, Versatility,
Attack Power, Physical/Magic damage, Movement Speed).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:39:16 -03:00
agathoandClaude Opus 4.6 a967ea495c feat(performance): Add bandwidth telemetry for per-bot network monitoring
Tracks packet counts, bytes sent/received, and filter savings per bot
session. Provides per-opcode breakdown, top-N bots by bandwidth, and
formatted reports. Uses sharded atomic counters for lock-free recording.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:38:36 -03:00
agathoandClaude Opus 4.6 a52471c22a feat(movement): Add swimming and breath management for underwater bots
Tracks water state (DRY/WADING/SWIMMING/UNDERWATER/SURFACING/DROWNING),
monitors breath timer, and triggers proactive surfacing at 30% breath.
Detects water breathing auras and aquatic form availability for druids.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:37:23 -03:00
agathoandClaude Opus 4.6 b06dc3eda7 feat(diagnostics): Add per-bot log filtering for targeted debugging
Enables operators to set verbose log levels (DEBUG/TRACE) for individual
bots without flooding logs from hundreds of other bots. Supports category
filters, timed auto-expiry, and convenience macros (BOT_LOG_DEBUG, etc.).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:36:50 -03:00
agathoandClaude Opus 4.6 2fe7dfe9e8 feat(combat): Add proc expiry urgency monitor for all classes
Tracks active proc auras and escalates rotation priority when procs are
about to expire unused. Covers all major class procs (Hot Streak, Brain
Freeze, Rime, Art of War, Maelstrom Weapon, etc.) with configurable
urgency thresholds and stack-aware consumption logic.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:36:16 -03:00
agathoandClaude Opus 4.6 93d7da138a feat(social): Add summon/meeting stone response manager for bot summon handling
Bots now auto-respond to warlock summons and meeting stone requests with
human-like delays (1.5-4s randomized). Evaluates combat state, CC, BG/arena,
and group membership before accepting. Tracks summon history and statistics.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:35:17 -03:00
agathoandClaude Opus 4.6 94b8377714 feat(combat): Add racial ability manager for all playable races
Implements RacialAbilityManager with complete database of racial abilities
for all 25+ playable races including TWW Earthen. Evaluates racials by
priority: CC-break > defensive > offensive (burst-aligned) > resource >
AoE CC. Includes spell availability validation, cooldown tracking, burst
window detection, and CC-state awareness.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:34:16 -03:00
agathoandClaude Opus 4.6 194348d4a7 feat(dungeon): Add delve behavior manager for TWW delve content support
Implements DelveBehaviorManager with state machine (IDLE -> ENTERING ->
EXPLORING -> OBJECTIVE -> COMBAT -> BOSS -> LOOTING -> COMPLETED),
tier-aware difficulty scaling (1-11), NPC companion tracking (Brann),
objective tracking, loot chest discovery, and combat behavior adaptation.
Integrates with existing ConsumableManager content type awareness.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:33:19 -03:00
agathoandClaude Opus 4.6 2ddf731715 feat(commands): Add .bot config reload command for hot-reloading configuration
Adds a .bot config reload chat command that reloads playerbots.conf,
synchronizes runtime ConfigManager, refreshes BotSpawner config, and
reloads trade configuration. Reports per-subsystem success/failure with
step counts. Also available from server console.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:32:49 -03:00
agathoandClaude Opus 4.6 baf1155cd5 feat(combat): Add DPS/HPS combat metrics tracker with spell breakdowns
Implements CombatMetricsTracker providing WoW-style damage/healing meters:
rolling-window DPS/HPS/DTPS, per-spell breakdowns with crit rates and
efficiency, encounter tracking with auto-detect, formatted reports for
chat commands, and session history. Uses fixed-size circular buffer for
zero-allocation combat event recording.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:31:57 -03:00
agathoandClaude Opus 4.6 028e29e49c feat(performance): Add thread-safe string interning pool for memory deduplication
Implements StringInterningPool with shared_mutex for read-heavy concurrent access,
FNV-1a hashing, transparent heterogeneous lookup via string_view, and per-category
profiling. Pre-interns common class/spec/resource names at startup. Eliminates
duplicate string allocations across all bot instances (~6.4MB savings at 500 bots).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:30:55 -03:00
agathoandClaude Opus 4.6 552e674c0a feat(combat): Add proactive LOS fixing with smart repositioning
Implements ProactiveLoSFixer component that intercepts spell cast
attempts, checks LOS, and repositions the bot to a valid position
before casting. Completes all missing LineOfSightManager method
implementations and upgrades MovementIntegration to use smart
position-finding instead of naive movement toward target.

Key additions:
- ProactiveLoSFixer: pre-cast LOS check with queued cast + reposition
- Healer group LOS maintenance: proactive repositioning to see group
- 30+ missing LineOfSightManager method implementations completed
- LoSUtils::DoLinesIntersect segment intersection implementation
- MovementIntegration::CheckLineOfSight upgraded to use FindBestLoSPosition

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:30:10 -03:00
agathoandClaude Opus 4.6 88f3e121fa feat(combat): Add TrinketUsageManager for automated on-use trinket activation
Per-bot component that scans EQUIPMENT_SLOT_TRINKET1/TRINKET2 for
items with ITEM_SPELLTRIGGER_ON_USE effects and activates them at
optimal times during combat:

- Offensive trinkets: aligned with burst/opener windows, then on-CD
- Defensive trinkets: reactive when health drops below 35%
- PvP trinkets: reactive CC-break on stun/fear/charm/confuse
- Utility trinkets: used on cooldown for maximum uptime

Features:
- SpellInfo-based effect classification (aura types determine category)
- Equipment change detection via lightweight checksum comparison
- Cooldown tracking via SpellHistory::HasCooldown()
- CastSpellExtraArgs(item) for proper item-sourced spell casting
- 500ms update throttle to minimize per-bot overhead
- Debug summary for diagnostics

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:29:04 -03:00
agathoandClaude Opus 4.6 8d935c9895 fix(mail): Add MailInteractionManager to build with API fixes
Existing MailInteractionManager (829 lines) was complete but not
compiled. Fixed multiple API issues for TrinityCore 11.x compatibility:

- Add missing DetermineMailRecommendations() declaration in header
- Fix mail ID type: uint32 -> uint64 (matches Mail::messageID)
- Rename inner MailItemInfo to BotMailItemInfo (avoids TC name collision)
- Fix item_guid type: uint32 -> uint64 (ObjectGuid::LowType)
- Fix sender check: mail->sender.IsEmpty() -> mail->sender == 0
- Fix ReturnMail: use MAIL_RETURNED_TO_SENDER + MAIL_CHECK_MASK_RETURNED
- Convert all printf logging (%s/%u/%llu) to fmt-style ({})
- Fix ModifyMoney cast: uint64 -> int64 for money take
- Use module.playerbot log channel consistently
- Add to CMakeLists.txt Interaction section

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:26:22 -03:00
agathoandClaude Opus 4.6 0e16dd2f10 feat(combat): Add CombatPhaseDetector for unified opener/execute phase logic across all 39 specs
Provides per-bot combat phase detection (Opener/Sustained/Execute/Finishing)
with spec-specific thresholds and rotation guidance for all 39 specializations.
Each spec has configured execute threshold (20-35%), opener duration (3-8s),
stealth opener flags, execute spell IDs, opener burst CD sequences, and
resource pooling guidance. Integrates with rotation systems via
ShouldPrioritizeSpell() and IsExecuteAbility() queries.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:25:46 -03:00
agathoandClaude Opus 4.6 365a4843ce feat(perf): Add GUID-sharded metrics collector and replace recursive_mutex with shared_mutex
Introduces ShardedMetricsCollector with 256 independent shards for per-bot
performance metrics (AI decision, combat rotation, target selection, etc.).
Each shard has its own std::shared_mutex enabling parallel reader access
(3-5x faster than recursive_mutex for 500+ bots). Also upgrades the existing
Session/BotPerformanceMonitor to use std::shared_mutex for its system-level
tick metrics, replacing OrderedRecursiveMutex. All read-only operations
(reports, queries, degradation checks) now use shared_lock for zero-contention
concurrent access.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:25:17 -03:00
agathoandClaude Opus 4.6 044aa95ea1 feat(combat): Add PreBurstResourcePooling for resource-aware burst CD preparation
Detects when major burst cooldowns are 3-5 seconds from ready and signals
rotation systems to pool resources (energy/rage/mana/etc.) so bots enter
burst windows at 80-95% resource. Supports all 25+ DPS specs with per-spec
burst CD definitions and progressive pooling intensity (light/moderate/aggressive).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:23:30 -03:00
agathoandClaude Opus 4.6 fa9268d5be feat(combat): Add context-aware AddPrioritySystem for intelligent add targeting
Automatically classifies nearby hostile creatures by combat role (healer,
explosive, fixate, enraged, shielding, summoner, berserker) using creature
template data and active spell/aura analysis. Generates role-adjusted
priority scores so tanks pick up loose adds, ranged DPS handle explosives,
and all DPS focus healer adds first. Supports M+ affix awareness
(bolstering, bursting, raging, spiteful) and encounter context scaling.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:21:46 -03:00
agathoandClaude Opus 4.6 e76f7068bc feat(combat): Add IncomingDamagePredictor for proactive defensive CD usage
Bridges InterruptAwareness spell cast detection to damage estimation,
enabling bots to trigger defensive cooldowns BEFORE damage lands rather
than reactively after health drops. Three-phase prediction: active spell
casts via SpellInfo analysis, melee attackers via threat list, and
historical DPS extrapolation. Produces time-bucketed forecasts (1/2/3/5s)
with severity classification and role-aware defensive recommendations.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:19:59 -03:00
agathoandClaude Opus 4.6 7450e2cebb feat(validation): Add SpellIdValidator for startup spell ID validation against SpellDB
Two-phase validation system that catches stale/invalid spell IDs at server
startup instead of silently failing during combat:

Phase 1 - ClassSpellDatabase: Validates all spell IDs stored in rotation,
defensive, cooldown, healing tier, fallback chain, and interrupt maps for
all 39 specs across 13 classes.

Phase 2 - Constexpr SpellValidation: Validates ~1925 constexpr spell ID
definitions from SpellValidation_WoW120.h and SpellValidation_WoW120_Part2.h
via per-class registration functions for all 13 classes.

Uses sSpellMgr->GetSpellInfo(spellId, DIFFICULTY_NONE) for validation.
Logs per-spec breakdowns for specs with errors plus aggregate summary.
Called automatically at end of ClassSpellDatabase::Initialize().

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:19:18 -03:00
agathoandClaude Opus 4.6 2c62d3f912 refactor(bg): Migrate all BG bot behavior from BattlegroundAI into individual script ExecuteStrategy()
Replace the broken role-based system (SetRoleRequirement never called, all bots
default to ROAMER) with dynamic behavior trees in each BG script. This extends
the Temple of Kotmogu "lighthouse pattern" to all 13 battlegrounds.

Phase 1 - Shared utilities added to base classes:
- BGScriptBase: EngageTarget, FindNearestEnemyPlayer, PatrolAroundPosition
- CTFScriptBase: RefreshFlagState, RunFlagHome, PickupEnemyFlag, HuntEnemyFC,
  EscortFriendlyFC, DefendOwnFlagRoom, ReturnDroppedFlag
- DominationScriptBase: RefreshNodeState, CaptureNode, DefendNode,
  FindNearestCapturableNode, GetBestAssaultTarget

Phase 2-7 - ExecuteStrategy behavior trees for all 13 BGs:
- CTF: WarsongGulch, TwinPeaks (phase-aware flag priority trees)
- Domination: ArathiBasin (3-cap), BattleForGilneas (2-cap), DeepwindGorge,
  SeethingShore (dynamic nodes), EyeOfTheStorm (hybrid CTF/domination)
- Siege: AlteracValley (phase-based), StrandOfTheAncients, IsleOfConquest
- ResourceRace: SilvershardMines (cart escort + lane control)
- Epic: Ashran (road push with event objectives)

Phase 8 - BattlegroundAI.cpp cleanup:
- Reduced from 2,418 to 429 lines (-82%), header from 463 to 164 lines (-65%)
- Removed all legacy behavior methods, strategy structs, role management
- Kept thin dispatch layer, coordinator registration, profiles, metrics

Key patterns applied from ToK lighthouse:
- GUID-hash duty split for deterministic task distribution
- RefreshState throttled to 1s at top of each ExecuteStrategy
- EngageTarget (SetSelection + Attack) at every engagement point
- Phase-ignoring GO search for dynamically spawned BG objects
- Thin delegation: if (script->ExecuteStrategy(player)) return

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-11 19:18:27 -03:00
agathoandClaude Opus 4.6 d5a2aaf267 feat(consumables): Add ConsumableManager for pre-combat buffing and combat potions
Implements comprehensive consumable management system:
- Pre-combat buffing: flasks/phials, food (Well Fed), augment runes
  with context-aware usage (only in dungeons/raids/delves)
- Combat emergency: health potions at <=30% HP, healthstones at <=35% HP,
  mana potions at <=20% mana for healers/casters
- Combat DPS potions: role-appropriate potions during burst windows
- Content-type detection: Open World, Dungeon, Raid, PvP, Delve
- Role detection: Tank, Healer, Melee DPS, Ranged DPS, Caster DPS

Consumable databases cover TWW, Dragonflight, Shadowlands, BfA, Legion,
WoD, and Classic-era items with priority-based selection (best first).
Buff state detection scans active auras for flask/food/rune patterns.

Per-bot instance owned by GameSystemsManager, updated at REDUCED+ tier
with internal throttling (5s out of combat, 500ms in combat).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:48:41 -03:00
Shauren 3a2719552f Core/GameObjects: Fix anim kits
Signed-off-by: luis <[email protected]>
2026-02-10 21:47:47 -03:00
agathoandClaude Opus 4.6 901b0d3a63 feat(ai): Complete proc reaction logic for 7 specs missing consumption
Add proc tracking and rotation-integrated consumption for:
- Devastation Evoker: Essence Burst (free Disintegrate/Pyre in ST/AoE/burst)
- Preservation Evoker: Essence Burst (free Emerald Blossom/Verdant Embrace)
- Restoration Shaman: Tidal Waves (2-stack system from Riptide/Chain Heal,
  consumed by Healing Surge for +40% crit or Healing Wave for +20% speed)
- Shadow Priest: Surge of Insanity (from Devouring Plague, consumed as
  Mind Flay: Insanity or Mind Spike: Insanity based on talent detection)
- Subtlety Rogue: Shadow Techniques (passive auto-attack proc granting
  1 combo point + 8 energy with edge detection)
- Guardian Druid: Gore (Mangle reset + 4 extra rage, priority over normal Mangle)
- Restoration Druid: Clearcasting/Omen of Clarity (free instant Regrowth
  on most injured group member)

Also adds GORE, CLEARCASTING_RESTO, SURGE_OF_INSANITY, MIND_FLAY_INSANITY,
MIND_SPIKE_INSANITY, and DEATHSPEAKER spell IDs to validation registries.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:46:41 -03:00
agathoandClaude Opus 4.6 9bfd9312ee feat(ai): Add hero talent rotation integration for all 39 specializations
Implements runtime hero talent detection and rotation branches for every
WoW 12.0 specialization. Each spec's UpdateRotation() now lazily detects
the bot's hero talent tree via HeroTalentCache and prioritizes the
corresponding hero-talent-specific ability before the standard rotation.

Hero talent mappings per class:
- Warrior: Slayer/Mountain Thane (Arms), Slayer/Mountain Thane (Fury), Colossus/Mountain Thane (Prot)
- Paladin: Herald of the Sun/Lightsmith (Holy), Lightsmith/Templar (Prot), Templar/Herald of the Sun (Ret)
- DK: Deathbringer/Rider of the Apocalypse (Blood), Deathbringer/Rider (Frost), San'layn/Rider (Unholy)
- DH: Aldrachi Reaver/Fel-Scarred (Havoc), Aldrachi Reaver/Fel-Scarred (Vengeance)
- Druid: Keeper of the Grove/Elune's Chosen (Balance), Druid of the Claw/Wildstalker (Feral),
         Druid of the Claw/Elune's Chosen (Guardian), Keeper of the Grove/Wildstalker (Resto)
- Evoker: Flameshaper/Scalecommander (Dev), Chronowarden/Flameshaper (Pres), Chronowarden/Scalecommander (Aug)
- Hunter: Pack Leader/Dark Ranger (BM), Sentinel/Dark Ranger (MM), Pack Leader/Sentinel (SV)
- Mage: Spellslinger/Sunfury (Arcane), Frostfire/Sunfury (Fire), Frostfire/Spellslinger (Frost)
- Monk: Conduit of the Celestials/Shado-Pan (BrM), Conduit/Master of Harmony (MW),
        Conduit/Shado-Pan (WW)
- Priest: Oracle/Voidweaver (Disc), Oracle/Archon (Holy), Voidweaver/Archon (Shadow)
- Rogue: Deathstalker/Fatebound (Assassination), Trickster/Fatebound (Outlaw),
         Deathstalker/Trickster (Subtlety)
- Shaman: Farseer/Stormbringer (Elemental), Totemic/Stormbringer (Enhancement),
          Farseer/Totemic (Restoration)
- Warlock: Hellcaller/Soul Harvester (Affliction), Diabolist/Soul Harvester (Demonology),
           Hellcaller/Diabolist (Destruction)

Also fixes:
- BGScriptBase.cpp/CTFScriptBase.cpp: Add missing BGSpatialQueryCache.h include
- BotMovementManager.h: Fix PathCache.h include path ambiguity

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:46:12 -03:00
agathoandClaude Opus 4.6 a91933499c feat(perf): Add save tiering, differential saves, idle memory reduction, and anti-cluster dispersal
Implement 4 enhancement gaps identified from mod-playerbots comparison:
- P6: Budget-tier-based save frequency (FULL=5min, REDUCED=15min, MINIMAL=30min)
- P3: Coarse differential saves skip unchanged bot state (FNV-1a checksums)
- P5: ObjectCache::ClearNonEssential() prunes caches on MINIMAL transition
- R1: BotClusterDetector disperses 8+ bot clusters via MoveRandom

Also fixes pre-existing PathCache.h/.cpp shared_lock/unique_lock type
mismatch with OrderedSharedMutex (CTAD fix).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:45:21 -03:00
agathoandClaude Opus 4.6 1f15680a4b fix(bg): Replace broken role-based ToK strategy with dynamic behavior tree
The coordinator role system never populated role requirements, causing all
bots to default to ROAMER. This meant no carriers were defended, no enemy
carriers were hunted, and bots wandered aimlessly after picking up orbs.

Replace the role switch with per-tick game state evaluation:
- Priority 1: Orb carriers always move to center (never stop for combat)
- Priority 2: Free orbs get picked up (with bot-splitting via m_orbTargeters)
- Priority 3: GUID-hash duty split - 2/3 escort friendly carriers, 1/3 hunt
  enemy carriers, with center-carrier priority weighting
- Priority 4: No carriers - patrol center and fight enemies

Also fix carrier en-route combat that blocked center movement with a
return-true when enemies were within 10yd. Carriers now initiate attack
(so class AI casts abilities) but always continue waypoint movement.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: luis <[email protected]>
2026-02-10 21:44:46 -03:00