Compare commits

..

166 Commits

Author SHA1 Message Date
bash
5baba708e0 feat(Core/Debug): Combat-aware state label + retry counter visibility + give-up event emit 2026-06-05 09:56:48 +02:00
bash
e854e9beca feat(Core/RPG): Per-spawn destination pattern for incomplete quests (drops POI roam) 2026-06-05 09:56:48 +02:00
bash
fd34598e6a refactor(Core/RPG): Retry counter + give-up state replaces MoveRandomNear nudge on MoveFarTo failure 2026-06-05 09:56:48 +02:00
bash
c61b311a1b fix(Core/Movement): AC has no MAX_GAMEOBJECT_TYPE sentinel + no sAreaTriggerStore DBC store 2026-06-05 09:56:48 +02:00
bash
fa3ffd13fa fix(Core/Movement): MoveNear engine-aware near-point + FollowOnTransport port + drop dead botZoneId 2026-06-05 09:56:48 +02:00
bash
c4a0d01d34 fix(Core/Movement): Align HandleSpecialMovement + ClipPath details with reference 2026-06-05 09:56:48 +02:00
bash
0b41ab391f refactor(Core/Movement): Close walking-path divergences from reference (A-E) 2026-06-05 09:56:48 +02:00
bash
3f8aa0b6b3 fix(Core/Movement): Take TravelPath/WorldPosition by value in DispatchMovement 2026-06-05 09:56:48 +02:00
bash
2913db8964 docs(Core/Travel): Note why setAreaCost(12,13) is not ported (mmap dataset diverges) 2026-06-05 09:56:48 +02:00
bash
59f82465e1 refactor(Core/Movement): DispatchPathPoints → DispatchMovement (TravelPath sig + transport sandwich) 2026-06-05 09:56:48 +02:00
bash
2bb0bc04b8 refactor(Core/Movement): WaitForReach formula parity + PointsArray overload 2026-06-05 09:56:47 +02:00
bash
d7b29b5e73 fix(Core/Movement): Take WorldPosition by value in MoveTo2 (IsValid is non-const) 2026-06-05 09:56:47 +02:00
bash
3e1aa0c34f fix(Core/Movement): WorldPosition::IsValid is PascalCase on AC 2026-06-05 09:56:47 +02:00
bash
eada942a4e refactor(Core/Movement): Funnel all MoveTo through MoveTo2 path-aware pipeline 2026-06-05 09:56:47 +02:00
bash
59d9bc6f78 fix(Core/Debug): Inline zone filter in showpath cmd — GetNodesInZone was removed 2026-06-05 09:56:47 +02:00
bash
9da99163a8 fix(Core/Travel): Remove stray '}' left over from dead-code sweep 2026-06-05 09:56:47 +02:00
bash
76dbf56227 fix(Core/Movement): Drop FORCED_MOVEMENT_FLIGHT — AC enum has no FLIGHT variant 2026-06-05 09:56:47 +02:00
bash
1638bb1828 fix(Core/Movement): Restore SpellAuraEffects.h (provides AuraEffect definition) 2026-06-05 09:56:47 +02:00
bash
ba60fae9b6 fix(Core/Movement): Restore PositionValue.h include (provides PositionInfo type) 2026-06-05 09:56:47 +02:00
bash
f762053b79 refactor: Dead-code sweep — TravelMgr.cpp 5x /* */ blocks (-823 lines) + NewRpgBaseAction 5 unused includes 2026-06-05 09:56:47 +02:00
bash
c9dfee19d6 refactor(Core/Travel): Drop dead zone-index machinery + isEqual + cropUselessLink(single) (-124 lines) 2026-06-05 09:56:47 +02:00
bash
36a4b2a431 refactor: Dead-code sweep — Follow /* */ block + TravelNode 2x /* */ blocks + LastMovement.lastFollow + 6 unused includes 2026-06-05 09:56:47 +02:00
bash
e820889965 refactor(Core/Movement): Remove partial vehicle handling in MoveTo+ChaseTo (deferred to dedicated PR) 2026-06-05 09:56:47 +02:00
bash
9ac6dcbac6 refactor(Core/Movement): Dead-code sweep — drop old MoveTo commented block + ANGLE_45_DEG + cropUselessNode + addZoneLinkNode + addRandomExtNode 2026-06-05 09:56:47 +02:00
bash
e07f56d2a7 refactor(Core/Travel): Drop unused MAX_PATHFINDING_DISTANCE constant (orphaned by ExecuteTravelPlan removal) 2026-06-05 09:56:47 +02:00
bash
45a3189d4b refactor(Core/Travel): Remove teleportSpell + NODE_TELEPORT + PortalNode + hearthstone/mage A* injection (staticPortal kept) 2026-06-05 09:56:47 +02:00
bash
6079863fce refactor(Core/Travel): Simplify transport config to TransportSkipRide bool; drop mode-0 deck-walk approximations 2026-06-05 09:56:47 +02:00
bash
f90f365e94 feat(Core/Movement): Mode-0 transport board/disembark — snap-and-deck-walk on board, NearTeleport+walk on disembark 2026-06-05 09:56:47 +02:00
bash
343ab7ac30 feat(Core/Movement): BoardTransport mode 1 — teleport directly to boarding edge when transportTeleportType >= 1 2026-06-05 09:56:47 +02:00
bash
666136ab34 feat(Core/Travel): Add transportTeleportType config + teleport-across-water branch in UpcommingSpecialMovement 2026-06-05 09:56:47 +02:00
bash
b269fa3825 fix(Core/Movement): MoveFarTo re-caches lastPath after UpcommingSpecialMovement (matches reference) 2026-06-05 09:56:47 +02:00
bash
276d773ea9 fix(Core/Movement): WaitForTransport now actively disembarks (matches reference UseTransport flow) 2026-06-05 09:56:47 +02:00
bash
180f45899c fix(Core/Movement): MoveFarTo clears lastMove on collapse + drops AC single-point branch; DispatchPathPoints mirrors reference dispatch order (Clear -> MovePoint(last) -> MoveSplinePath) 2026-06-05 09:56:47 +02:00
bash
c194daa8a1 fix(Core/Travel): GetFullPath now reuses failed probe waypoints as startPath via cropPathTo (matches reference) 2026-06-05 09:56:47 +02:00
bash
ac741cac80 fix(Core/Travel): Revert AC-side 'improvements' over reference — hearthstone deathCount underflow, A* iteration cap, endPath tolerance 2026-06-05 09:56:47 +02:00
bash
f78e16c5d0 fix(Core/Travel): Strip AC-side meaningfulProgress branch in probe-first; match reference acceptance exactly 2026-06-05 09:56:47 +02:00
bash
24b302496c fix(Core/Travel): Loosen probe-progress threshold + relax endPath validation to INTERACTION_DISTANCE 2026-06-05 09:56:47 +02:00
bash
0f612ab7a5 fix(Core/Travel): Use GetGroupLeader()==bot instead of nonexistent IsGroupLeader 2026-06-05 09:56:46 +02:00
bash
c586f141a8 fix(Core/Travel): Restore probe-first short-circuit in GetFullPath — AC-side workaround for cave-interior destinations the graph misses 2026-06-05 09:56:46 +02:00
bash
f4c6177520 debug(Core/Movement): Telemetry whisper showing path tail coords vs bot vs dest 2026-06-05 09:56:46 +02:00
bash
ee3f92c04a fix(Core/Travel): GetNodeRoute parity — group-min gold accounting + hearthstone cost formula 2026-06-05 09:56:46 +02:00
bash
9bb86f35bc fix(Core/Travel): Include Transport.h in TravelNode.cpp for GetEntry() call 2026-06-05 09:56:46 +02:00
bash
848bffac86 refactor(Core/Movement): Drop no-progress guard now that probe + zone + validation fixes prevent the oscillation it was masking 2026-06-05 09:56:46 +02:00
bash
80a0e79cd2 fix(Core/Movement): HandleSpecialMovement parity — portal spell-effect check, mount-flying refuse, area-trigger orientation, transport board throttle, teleport failure clears lastPath 2026-06-05 09:56:46 +02:00
bash
6b6f61a89d fix(Core/Travel): Restructure GetFullPath to mirror reference: drop probe short-circuit, add per-candidate validation + bad-node tracking + transport early-return + hearthstone fallback 2026-06-05 09:56:46 +02:00
bash
b0324cd343 fix(Core/Travel): Map-wide node scan in GetFullPath candidate pick (was zone-restricted) 2026-06-05 09:56:46 +02:00
bash
b371eff871 fix(Core/Travel): Tighten GetFullPath probe gate so graph routing wins when probe misses 2026-06-05 09:56:46 +02:00
bash
2d68716b24 fix(Core/Movement): No-progress guard in MoveFarTo to break stuck oscillation near unreachable targets 2026-06-05 09:56:46 +02:00
bash
ccfcb1dfb0 fix(Core/Travel): Hoist AiObjectContext* context in GetNodeRoute so PortalNode injection blocks see it 2026-06-05 09:56:46 +02:00
bash
43186dac42 fix(Core/Travel): Declare AiObjectContext* context in ClipPath for AI_VALUE macro 2026-06-05 09:56:46 +02:00
bash
b446c5c3ac fix(Core/Travel): Re-add PathNodeType::NODE_TELEPORT now that BuildPath emits + handler consumes 2026-06-05 09:56:46 +02:00
bash
b187031ed2 fix(Core/Movement): ResolveMovePath takes WorldPosition by value (distance() not const-safe) 2026-06-05 09:56:46 +02:00
bash
c2df89f923 fix(Core/Travel): Re-add TravelNodePathType::teleportSpell now that PortalNode emits it 2026-06-05 09:56:46 +02:00
bash
50e271c601 fix(Core/Movement): Align Follow IsSafe/bounding-radius + ChaseTo emote clear + IsSitState->IsStandState normalization + MoveNear bounding radius 2026-06-05 09:56:46 +02:00
bash
33aa553b71 feat(Core/Travel): Inject hearthstone + mage teleport spells into A* via PortalNode 2026-06-05 09:56:46 +02:00
bash
5fcba45e80 feat(Core/Travel): Emit NODE_TELEPORT for teleport-spell edges; add HandleSpecialMovement consumer 2026-06-05 09:56:46 +02:00
bash
f32ebb8f6b feat(Core/Travel): Port TravelPath::ClipPath; call from MoveFarTo, drop inline clip 2026-06-05 09:56:46 +02:00
bash
37b518aafe fix(Core/Movement): Force graph routing for vertical moves on map 609 (Ebon Hold) 2026-06-05 09:56:46 +02:00
bash
496f9cc3d5 refactor(Core/Movement): Drop unused lastMoveTo* fields + std::future scratch 2026-06-05 09:56:46 +02:00
bash
e7e2cdae6e refactor(Core/Movement): Drop redundant prefix-trim + setPath in DispatchPathPoints 2026-06-05 09:56:46 +02:00
bash
df97900674 fix(Core/Movement): Skip walk dispatch when bot is on transport without special segment 2026-06-05 09:56:46 +02:00
bash
0fedb5f8d9 fix(Core/Movement): Align WaitForTransport + HandleSpecialMovement disembark 2026-06-05 09:56:46 +02:00
bash
2929b94d9a refactor(Core/Movement): Rename stale TravelPlan:* labels + drop unused lastdelayTime 2026-06-05 09:56:46 +02:00
bash
f7df64e4c2 refactor(Core/Travel): Drop TravelPlan struct; GetFullPath returns TravelPath 2026-06-05 09:56:46 +02:00
bash
7d507a6922 refactor(Core/Movement): Drop dead ExecuteTravelPlan + LaunchWalkSpline + MoveToSpline + GetTravelPlan + RefineWalkPoints 2026-06-05 09:56:46 +02:00
bash
b1dc9c787a refactor(Core/Movement): Drop dead StartTravelPlan + UpdateTravelPlan + debug node lookup 2026-06-05 09:56:45 +02:00
bash
5552398e2d refactor(Core/Movement): Rewrite MoveFarTo to use ResolveMovePath + HandleSpecialMovement 2026-06-05 09:56:45 +02:00
bash
e4d4bb74f6 feat(Core/Movement): Add HandleSpecialMovement + WaitForTransport 2026-06-05 09:56:45 +02:00
bash
665f2a3e56 feat(Core/Movement): Add MovementAction::ResolveMovePath unified resolver 2026-06-05 09:56:45 +02:00
bash
bf5d4cf047 feat(Core/Movement): Add LastMovement::lastTransportEntry for transport-resume gate 2026-06-05 09:56:45 +02:00
bash
dcecb6844f feat(Core/Travel): Port UpcommingSpecialMovement + getNextPoint helpers 2026-06-05 09:56:45 +02:00
bash
78ae50d3ba feat(Core/Travel): Add WorldPosition::projectOnSegment for path-progress checks 2026-06-05 09:56:45 +02:00
bash
052b8de95c feat(Core/Travel): Port TravelPath::cutTo for upcoming special-movement handling 2026-06-05 09:56:45 +02:00
bash
13b10e5d20 refactor(Core/Movement): Align MoveFarTo preamble + drop spline-plan throttle 2026-06-05 09:56:45 +02:00
bash
2f00af0352 refactor(Core/Movement): Drop IsWaitingForLastMove throttle 2026-06-05 09:56:45 +02:00
bash
d85d0aabbc fix(Core/Movement): Bypass stale lastMove gate when bot stopped + loosen probe short-circuit 2026-06-05 09:56:45 +02:00
bash
7fcdc5d75b refactor(Conf): Hardcode master-walk-pace distance to 5y, drop config 2026-06-05 09:56:45 +02:00
bash
5436bb11c5 fix(Conf): Add missing AiPlayerbot.WalkDistance to playerbots.conf.dist 2026-06-05 09:56:45 +02:00
bash
6ce047ab6a fix(Core/Travel): Batch NODE_PREPATH into the walk-spline dispatch so per-tick re-resolve actually moves the bot 2026-06-05 09:56:45 +02:00
bash
270689bc22 fix(Core/RPG): Drop per-tick travelplan whisper to silence spam 2026-06-05 09:56:45 +02:00
bash
df77ea730d fix(Core/Travel): Pass GAMEOBJECT_TYPE_SPELLCASTER to GetGameObjectIfCanInteractWith 2026-06-05 09:56:45 +02:00
bash
e57dcf50c5 refactor(Core/Travel): Remove dead spline-progress tracking and unused NODE_TELEPORT path 2026-06-05 09:56:45 +02:00
bash
f328f455ca feat(Core/Travel): Re-enable area-trigger, static-portal, and teleport-spell nodes 2026-06-05 09:56:45 +02:00
bash
e7870afbd9 feat(Core/Travel): K-nearest node search, cropPathTo reuse, cross-map pathToEnd 2026-06-05 09:56:45 +02:00
bash
f85e6568d0 fix(Core/Travel): mmap-path startPath and endPath in GetFullPath 2026-06-05 09:56:45 +02:00
bash
c0e41e6ce1 feat(Core/Travel): Exclude area-trigger, static-portal, teleport-spell path types from PR 2026-06-05 09:56:45 +02:00
bash
905f550ca1 fix(Core/RPG): Per-tick re-resolve travel plan instead of advancing cached plan 2026-06-05 09:56:45 +02:00
bash
7ac501adb0 feat(Core/Travel): Handle NODE_TELEPORT (hearthstone) and NODE_AREA_TRIGGER 2026-06-05 09:56:45 +02:00
bash
ec6e412f35 fix(Core/Movement): ChaseTo tries mmap path before MoveChase 2026-06-05 09:56:45 +02:00
bash
f656c3d9ef fix(Core/RPG): Use GetNearPoint and followAngle in MoveWorldObjectTo, bump travel-node threshold to sightDistance 2026-06-05 09:56:44 +02:00
bash
65bf6a0dff fix(Core/Travel): Soft-bias STEEP at regen PathGenerator sites 2026-06-05 09:56:44 +02:00
bash
a460886c1c Revert "fix(Core/RPG): Drop chained probe and waypoint dispatch in MoveFarTo"
This reverts commit 3384fa4fcfdc8e394653f4604f7de97cf7da9571.
2026-06-05 09:56:44 +02:00
bash
bf67e9fb6b fix(Core/RPG): Drop chained probe and waypoint dispatch in MoveFarTo 2026-06-05 09:56:44 +02:00
bash
e0d10bb8e9 fix(Core/RPG): Align MoveFarTo, MoveWorldObjectTo, MoveRandomNear with cmangos 2026-06-05 09:56:44 +02:00
bash
6cd95d8f53 fix(Core/RPG): Scope do-quest yield-to-grind to current objective only 2026-06-05 09:56:44 +02:00
bash
721f81a119 fix(Core/RPG): Drop over-strict MoveFarTo and MoveWorldObjectTo guards 2026-06-05 09:56:44 +02:00
bash
f868b6f96b fix(Core/RPG): Require LOS from candidate to GO in MoveWorldObjectTo 2026-06-05 09:56:44 +02:00
bash
4295f484a8 fix(Core/Loot): Drop hostiles-in-sight gate on loot-available trigger 2026-06-05 09:56:44 +02:00
bash
f5cd75e336 refactor(Core/Movement): Drop redundant bot filter setters at PathGenerator sites 2026-06-05 09:56:44 +02:00
bash
a6d691e6a7 refactor(Core/Movement): Rename SetAreaCost calls to SetNavTerrainCost 2026-06-05 09:56:44 +02:00
bash
2a8bd23272 fix(Core/Movement): Apply bot filter setters at all PathGenerator construction sites 2026-06-05 09:56:44 +02:00
bash
9d3ecbab88 fix(Core/Travel): Apply NAV_WATER cost bias on regen PathGenerator 2026-06-05 09:56:44 +02:00
bash
326f962bd7 fix(Core/Travel): Exclude NAV_GROUND_STEEP on regen PathGenerator 2026-06-05 09:56:44 +02:00
bash
6d6ad2412d fix(Core/Travel): Hoist portal/transport cheat above 2-point reject 2026-06-05 09:56:44 +02:00
bash
3d7e43c1a2 fix(Core/Travel): Match cmangos buildPath stitching, drop 75y guard 2026-06-05 09:56:44 +02:00
bash
e3b24aadd9 fix(Core/Travel): Preserve walk paths from taxi-path overwrite 2026-06-05 09:56:44 +02:00
bash
7bbcc62797 chore(Core/Travel): Warn admins to shutdown after generatenode 2026-06-05 09:56:44 +02:00
bash
39927925e4 fix(Core/Travel): Skip 5y dedup when loading nodes from DB 2026-06-05 09:56:44 +02:00
bash
f9cf3c67ac chore(DB/Travel): Temporarily disable Aldrassil ramp anchors 2026-06-05 09:56:44 +02:00
bash
9bd76103f2 fix(Core/Travel): Drop 2-point check, keep last-segment teleport guard 2026-06-05 09:56:44 +02:00
bash
7a9d5cd73d fix(Core/Travel): Reject paths with >75y final-segment teleport jumps 2026-06-05 09:56:44 +02:00
bash
2d83396c59 fix(Core/Travel): Reject 2-point BuildShortcut paths between non-adjacent nodes 2026-06-05 09:56:44 +02:00
bash
537d7b0284 chore(Core/Travel): Bump 2-point shortcut threshold to 75y 2026-06-05 09:56:44 +02:00
bash
8a5b6d455c fix(Core/Travel): Reject 2-point BuildShortcut teleports in chained probe 2026-06-05 09:56:44 +02:00
bash
b1dde93827 Revert non-progress chained-probe detection (broke valid paths) 2026-06-05 09:56:44 +02:00
bash
5cf7a2e0db fix(Core/Travel): Loosen chained-probe non-progress threshold 2026-06-05 09:56:44 +02:00
bash
cb2fae7628 fix(Core/Travel): Bail chained probe on non-progress oscillation 2026-06-05 09:56:44 +02:00
bash
0d7b7bb1da fix(Core/Travel): Chunk all saveNodeStore phases (deletes, nodes, links) 2026-06-05 09:56:44 +02:00
bash
5b39d1552c fix(Core/Travel): Chunk saveNodeStore path inserts to avoid mega-tx 2026-06-05 09:56:44 +02:00
bash
11db5ae821 feat(DB/Travel): Add Aldrassil ramp travelnode anchors 2026-06-05 09:56:44 +02:00
bash
4b4fdd26c1 chore(Core/Debug): Compact debug-move whisper format 2026-06-05 09:56:43 +02:00
bash
da64c2cdcf feat(Core/Travel): Sparse-segment clip in LaunchWalkSpline 2026-06-05 09:56:43 +02:00
bash
7fa12be1b9 feat(Core/RPG): Prefix-trim and sparse-segment clip on path dispatch 2026-06-05 09:56:43 +02:00
bash
c8e98923c5 feat(Core/RPG): Port cmangos 8-angle LOS+navmesh-snap to MoveWorldObjectTo 2026-06-05 09:56:43 +02:00
bash
4882c7c25b chore(Core/RPG): Loosen Z-mismatch threshold from 5y to 10y 2026-06-05 09:56:43 +02:00
bash
d3e73cc0c0 fix(Core/RPG): Reject mmap paths whose endpoint Z misses dest 2026-06-05 09:56:43 +02:00
bash
e76c54d575 fix(Core/RPG): Reject mmap paths that LOS-fail any segment 2026-06-05 09:56:43 +02:00
bash
498224d5be feat(Core/RPG): Switch POI when current cluster is empty 2026-06-05 09:56:43 +02:00
bash
e2d4d24e93 fix(Core/RPG): Stop next to quest objects instead of on top of them 2026-06-05 09:56:43 +02:00
bash
9395ed79ef chore: Drop bot movement console logs 2026-06-05 09:56:43 +02:00
bash
a81c7a2761 chore: Tighten comments in travel and movement code 2026-06-05 09:56:43 +02:00
bash
4b3e7f24f3 chore(Core/Travel): Drop cmangos reference in RefineWalkPoints comment 2026-06-05 09:56:43 +02:00
bash
662e86c687 fix(Core/RPG): LOS check on MoveRandomNear samples to avoid tree tunneling 2026-06-05 09:56:43 +02:00
bash
487d12711e Revert "fix(Core/Travel): LOS check before trusting raw cmangos waypoints" 2026-06-05 09:56:43 +02:00
bash
33dafd6ec0 fix(Core/Travel): LOS gate on empty-probe single-waypoint fallback 2026-06-05 09:56:43 +02:00
bash
1a057319c3 fix(Core/Travel): LOS check before trusting raw cmangos waypoints 2026-06-05 09:56:43 +02:00
bash
fd4c09d000 chore(Core/Travel): Revert travelnode threshold to 50y 2026-06-05 09:56:43 +02:00
bash
a1129cb301 chore(Core/Travel): Bump travelnode threshold to 75y 2026-06-05 09:56:43 +02:00
bash
21c981bd35 fix(Core/Travel): Trust travelnode waypoints when AC mmap rejects segments 2026-06-05 09:56:43 +02:00
bash
ae5f9e6ff1 feat(Core/Travel): Hardcode 50y travelnode threshold 2026-06-05 09:56:43 +02:00
bash
762e793244 core filter isnt working yet 2026-06-05 09:56:43 +02:00
bash
70efd4f1b9 refactor(Core/Travel): Drop redundant NAV_GROUND_STEEP excludes (core handles via IsBot) 2026-06-05 09:56:43 +02:00
bash
523624c611 fix(Core/Travel): Exclude NAV_GROUND_STEEP at all bot PathGenerator sites 2026-06-05 09:56:43 +02:00
bash
86f0be5b08 feat(Core/Travel): Align MoveFarTo and probe pipeline with cmangos 2026-06-05 09:56:43 +02:00
bash
724b15e39f feat(Core/Travel): Cap bots at 50° via NAV_GROUND_STEEP exclude 2026-06-05 09:56:43 +02:00
bash
2104f1279e feat(Core/Debug): Trace movement entry points and visualize travel nodes 2026-06-05 09:56:43 +02:00
bash
8033691888 feat(Core/RPG): MoveFarTo flow, quest-pursuit at POI, MoveRandomNear retries 2026-06-05 09:56:43 +02:00
bash
c7fa1fcc4f feat(Core/Travel): Travel-node graph routing for long-distance pathing 2026-06-05 09:56:42 +02:00
bash
8c110ba515 feat(Core/Loot): Quest GO loot, bag-make-room, item-pursuit 2026-06-05 09:56:42 +02:00
bash
97fa6b671f chore(Tools): Add mmap/vmap client-data extraction script 2026-06-05 09:56:42 +02:00
bash
6ea3fdcbcd feat(DB/Travel): Import cmangos travel-node graph 2026-06-05 09:56:42 +02:00
Keleborn
714bb6bca3
Shorten paths (#2396)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
This is designed to significantly shorten the overall path while
maintaining the more detailed structure. I tried to follow the principle
of removing any folder that had 1 or 2 files in it, shortenining
dungeon/raid names to acronyms, and removing instances when the base
name was in the file name (Like Raid) etc.


## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.



## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->



## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [x] No
    - - [ ] Yes (**explain why**)



- Does this change add new decision branches or increase maintenance
complexity?
    - - [x] No
    - - [ ] Yes (**explain below**)



## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->

Plan and execute

<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [ ] Stability is not compromised.
- - [ ] Performance impact is understood, tested, and acceptable.
- - [ ] Added logic complexity is justified and explained.
- - [ ] Any new bot dialogue lines are translated.
- - [ ] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
2026-05-31 18:38:01 +02:00
dillyns
585027fab7
Remove fire totem override from enhancement AOE strategy (#2270)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
Currently in AOE enchancement shamans are dropping magma totems. They
should not be overriding the set fire totem strategy.

## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.



## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->
Bring an enhancement shaman into medium aoe scenario (3 enemies)
They should no longer replace their fire totem with magma totem. They
should only drop the fire totem that is set in their strategies.

## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [x] No
    - - [ ] Yes (**explain why**)



- Does this change add new decision branches or increase maintenance
complexity?
    - - [x] No
    - - [ ] Yes (**explain below**)



## Messages to Translate
<!--
Bot messages have to be translatable, but you don't need to do the
translations here. You only need to make sure
the message is in a translatable format, and list in the table the
message_key and the default English message.
Search for GetBotTextOrDefault in the codebase for examples.
-->
- Does this change add bot messages to translate?
    - - [x] No
    - - [ ] Yes (**list messages in the table**)

| Message key  | Default message |
| --------------- | ------------------ |
|			 |			      |
|			 |			      |

## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
- Was AI assistance used while working on this change?
    - - [x] No
    - - [ ] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->



## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
2026-05-31 06:41:13 -07:00
Crow
571735cd57
Fix crash from missing spellInfo check in TogglePetSpellAutoCastAction (#2431)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
I had repeated crashes upon login traced to line 89 of
TogglePetSpellAutoCastAction, where a spellInfo check is missing. I
confirmed that adding the check fixed my crashing.

I don't know why there was invalid spellInfo to create the crash, as
this missing check is not a new development and I never had a crash
before, but clearly this code should be fixed in any case.

## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.



## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->



## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [x] No
    - - [ ] Yes (**explain why**)



- Does this change add new decision branches or increase maintenance
complexity?
    - - [x] No
    - - [ ] Yes (**explain below**)



## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [x] No
- - [ ] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->



<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
2026-05-30 20:10:33 -07:00
kadeshar
b430118124
Sunder Armor fixes (#2427)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->

Arms and Fury using Sunder Armor when there is not Protection Warrior in
group

## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->

Invite warrior/warriors to group and check how they apply Sunder Armor
on dummy target


## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [ ] No
    - - [x] Yes (**explain why**)

Yes, expained in Pull Request Description

- Does this change add new decision branches or increase maintenance
complexity?
    - - [x] No
    - - [ ] Yes (**explain below**)



## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->

Analyze orginal behavior

<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
2026-05-30 14:14:54 -07:00
Keleborn
180be33d9d Remove stray folder. 2026-05-30 14:09:09 -07:00
Keleborn
9e251dc397 Fix conf merge error 2026-05-30 13:50:54 -07:00
Crow
92fa97c3aa
Rewrite Equipment-Randomization-Related Configs (#2409)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
The main focus on this PR is to clarify and eliminate overlap between
three very confusingly described yet important config options:
AutoUpgradeEquip, EquipmentPersistence, and IncrementalGearInit.

For context, after initialization, randombots generally get randomized
each time after logging in and periodically between
MinRandomBotRandomizeTime (configurable, default 2 hours) to
MaxRandomBotRandomizeTime (configurable, default 14 days). This
randomization happens only when the bot is idle.

Now let’s look at what those three config options currently say.
- AutoUpgradeEquip: Randombots automatically upgrade their equipment on
levelup.
- EquipmentPersistence: Enable/Disable bot equipment persistence (stop
random initialization) after certain level (EquipmentPersistenceLevel).
- IncrementalGearInit: If disabled, random bots can only upgrade
equipment through looting and quest

None of those descriptions are accurate.
- AutoUpgradeEquip determines if randombots, upon leveling up, refresh
ammo, reagents, food, consumables, potions, and, ONLY IF
IncrementalGearInit is also enabled and EquipmentPersistence is
disabled, upgrade equipment (yes, three config options required for this
one thing).
-	EquipmentPersistence affects both equipment and talents. 
- Disabling IncrementalGearInit does not prevent randombots from
changing their equipment through the login/periodic randomization
process unless EquipmentPersistence is enabled.

These config options shouldn’t overlap with or be dependent on each
other, and their names and descriptions should reflect what they
actually do. Thus, this PR does the following:
- AutoUpgradeEquip solely controls whether or not randombots
automatically upgrade their gear upon level up. No other config option
is involved for this purpose, and AutoUpgradeEquip no longer impacts
inventory items. This does mean that it is no longer possible to stop
randombots from being given ammo, potions, etc. when they level up. I
tend to think that randombots as they currently are cannot fully
function otherwise so I have no issue with the loss of this ability, but
if there is disagreement, then we need to introduce a new config option.
AutoUpgradeEquip is also now set to true in PlayerbotAIConfig to reflect
that the default is true in the .dist.
- I originally wanted to combine EquipmentPersistence and
EquipmentPersistenceLevel into a single config option that also included
talents in the name, but EquipmentPersistence is used in the level
brackets mod so I don’t want to make a breaking change there. I settled
for making EquipmentPersistence enabled by default and also reducing
EquipmentPersistenceLevel to 1 by default, in effect entirely disabling
periodic/login randomization of randombot talents and gear by default. I
only see people complain about these features so I think unless there is
some compelling performance or structural reason to the contrary, the
default should be that randombots do not continuously randomize their
talents and equipment.
- IncrementalGearInit is eliminated. There are two real functional
impacts: (1) as noted above, randombots cannot be blocked from receiving
standard inventory items upon level-up (though the way it is currently
being gated does not make sense anyway), and (2) you can no longer have
equipment persistence for equipment only but not talents (I cannot
imagine anybody would ever want to do that, and I don't think it was
even intended given the strange interaction between config options that
was needed to even accomplish that before).
- For all these settings, the config descriptions are updated to try to
be clear about what the player is actually configuring.

Beyond that, I made some clean-up changes to the config to fix some
typos and try to shorten it in places, and I also deleted a few config
options that do not appear in operative code anymore (and any
corresponding references in PlayerbotAIConfig). I also deleted some
comments and made some minor style changes in
AutoMaintenanceOnLevelupAction.cpp.


## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.

The main substance of the PR consists of changes to checks in
PlayerbotFactory and AutoMaintenanceOnLevelupAction.

## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->

- To test AutoUpgradeEquip, use the gm command .level 1 while targeting
an rndbot.
- To test EquipmentPersistence, the only way I could find to force an
incremental randomization was to use .playerbots rndbot level BotName.
This will do an incremental randomization and a level up. However, this
level does not go through the AutoMaintenanceOnLevelupAction path so
just disregard the +1 level aspect and consider it a pure test of
EquipmentPersistence.

## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [x] No
    - - [ ] Yes (**explain why**)



- Does this change add new decision branches or increase maintenance
complexity?
    - - [x] No
    - - [ ] Yes (**explain below**)



## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->
I had GPT-5.4 review my changes and come up with the testing method.


<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->

---------

Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com>
2026-05-30 11:13:18 -07:00
Mat
ff001afd46
Reset instance ID via existing cmd refresh=raid for alt bots (#2422)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
Alt bots can now use refresh=raid cmd if cfg is set to 1.
`AiPlayerbot.ResetInstanceIdForAltBots = 1`


## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.



## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->
Add alt bot, use .playerbots bot refresh=raid and it should say ok after
reseting instance.


## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [ ] No
    - - [x] Yes (**explain why**)
Alt bots will now reset instance ID if cfg is set to 1.


- Does this change add new decision branches or increase maintenance
complexity?
    - - [ ] No
    - - [x] Yes (**explain below**)
It will check if cfg is set to 1 to enable alt bots to reset instance
id.


## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [x] No
- - [ ] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->



<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->

---------

Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com>
2026-05-30 11:12:54 -07:00
Crow
32d10080a4
Improve bot trinket usage and fix related bugs (#2425)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->

This PR makes three changes to UseTrinketAction:
1. It adds health and mana gating (based on existing config thresholds)
for bots to activate mana recovery, mana efficiency, and defensive
trinkets. The thresholds are mediumMana (default 40%) for mana recovery
trinkets, highMana (default 65%) for mana efficiency trinkets, and
lowHealth (default 45%) for defensive trinkets.
2. It removes the old overinclusive procflag/specproc gate introduced by
PR 1385, which prevents bots from using dozens of valid trinkets,
including some extremely powerful ones (such as Skull of Gul’dan, the
iconic TBC expansion BiS trinket for all casters), and replaces it with
a narrower exclusion that still addresses the original issue.

- Regarding PR 1385, focusing on liyunfan’s post specifically, I
interpet the issue to be relating to trinkets where the item data is
screwed up such that a passive effect was implemented as an on-use
spell. I had AI do a scan, and it seems that issue impacts only 2
trinkets in the game, Oracle Talisman of Ablution and Frenzyheart
Insignia of Fury, and specifically only the versions of those items that
are not legitimately obtainable (unclear why they exist at all). I’ve
excluded those trinkets from bots via the config now, and this PR
maintains the guards against those trinkets regardless but does so in a
narrower fashion. PR 1385's approach of using ProcFlags != 0 (i.e.,
excluding all on-use trinkets with non-zero ProcFlags) works only if
proc metadata can be used to distinguish between active/passive
trinkets, and that’s not even close to being the case. AI came up with
44 false positives, including many significant trinkets beyond Skull of
Gul’dan such as the ZG Hakkar quest trinkets, Badge of the Swarmguard,
Petrified Scarab, Scarab Brooch, Eye of the Dead, Essence of the Martyr,
Abacus of Violent Odds, Ribbon of Sacrifice, and Pendant of the Violet
Eye (and I’m not mentioning WotLK trinkets only because I don’t know
anything about what is relevant for that expansion).

3. It fixes an issue where bots were not respecting trinket cooldowns in
some cases. This resulted because trinkets with shared cooldown
categories (i.e., those that are not stackable) would substitute the
individual trinket cooldowns with shared category cooldowns, which let
bots spam usages of trinkets, by tracking per-item and per-category
trinket cooldowns locally. The root of this is based in AC; I don't know
if it should be considered a bug or not, but regardless it doesn't
impact players, presumably because cooldowns are enforced on the client
side.

- Here’s an illustration to explain the issue in practice. Skull of
Gul’dan has a 240s cooldown and Shifting Naaru Sliver has a 180s
cooldown, and they share a cooldown category so their usages cannot be
stacked. The shared cooldown matches the length of the on-use effect (so
20s for Skull and 15s for Sliver). The below is what can happen without
this PR (and is what I observed in testing).

- t = 0s: Shifting Naaru Sliver used, writes its 90s personal cooldown
and 15s shared category cooldown.
- t = 15s: Skull of Gul’dan used, writes its 120s personal cooldown and
20s shared category cooldown. Skull’s shared category cooldown
overwrites Sliver’s spell-cooldown entry, giving Sliver 20s left on its
personal cooldown instead of 75s.
- t = 35s: Sliver incorrectly appears ready and can be used again (55s
sooner than should be possible). Then Sliver’s shared category cooldown
in turn overwrites Skull’s longer personal cooldown.
- t = 50s: Skull incorrectly appears ready and can be used again (85s
sooner than should be possible).
  - Repeat.


## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.

The logic runs through the existing trinket use code. Specifically:

- Helpers are used to classify on-use trinket effects into mana
restoration, mana efficiency, and defensive/tank categories using
spell-effect checks
- Existing configured mana and health thresholds are applied to those
trinkets
- The old procflag gate is replaced with a one-time cached set of mixed
ON_USE/ON_EQUIP trinket spell ids
- Two small cooldown maps per bot are tracked in UseTrinketAction: one
for item cooldowns and one for shared category cooldowns


## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->

I did all of these things, but verification is always good. Overall, I
think it is worth running with this PR merged into test-staging if/when
that happens and keeping an eye on overall performance.
1. Equip a bot with a trinket referenced above, such as Skull of
Gul'dan, and confirm it is now used in combat.
2. Test mana-based classes with mana recovery and mana-efficiency
trinkets and confirm they are used only when below the applicable
configured mana threshold. An easy one to check is Glimmering Naaru
Sliver because it is a channel.
3. Test defensive on-use trinkets and confirm they are used only when
health is below the configured low-health threshold. Something like
Shadowmoon Insignia, which increases maximum health, is pretty obvious.
4. Confirm that the error versions of Oracle/Frenzyheart don’t stack
auras on bots (i.e., the bug addressed in PR 1385 has not returned). You
can do this by having a bot kill mobs and check .listauras, though I
checked through logging in the code because auras are noisy as hell.
5. Equip a bot with two trinkets that have shared cooldowns. I used
Skull of Gul’dan and Shifting Naaru Sliver. Go fight a mostly
tank-and-spank boss, such as Gruul. Use an add-on like Skada that tracks
buffs. You should see that before this PR, bots will use the trinkets
multiple times in one cooldown period, and after, they observe the
actual cooldowns.

## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [ ] No, not at all
    - - [x] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)

Any additional impact is confined to UseTrinketAction. The exclusion of
the busted trinkets uses a cache that is built once per server process
followed by constant-time lookups. The per-bot trinket cooldown maps
also use constant-time lookups and store only a few timestamp entries
per bot.

- Does this change modify default bot behavior?
    - - [x] No
    - - [ ] Yes (**explain why**)



- Does this change add new decision branches or increase maintenance
complexity?
    - - [ ] No
    - - [x] Yes (**explain below**)

Sort of--trinkets previously didn't have any consideration for effects
with respect to usage so that is new. I think it is necessary though to
have half-decent bot trinket usage, and there could be further
refinement for how bots decide to use trinkets based on this structure.

## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->

GPT-5.4 was used for investigation and root-cause analysis and
assistance with drafting. All resulting code and the PR rationale was
validated through in-game testing.

<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
Bots also suck at using DPS trinkets properly, but I don't think there's
a simple way to address that unlike with mana recovery or defensive
trinkets. So that's to consider another day.

---------

Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com>
2026-05-30 11:12:34 -07:00
dillyns
1bbed177c8
Add Nefarian Fear Ward action and trigger, along with Wild Magic trigger (#2412)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
For Nefarian in BWL, this does the following:
Mages - Ice block if the mage class call "Wild Magic" happens
Priests - Buff the current target of Nefarian with Fear Ward

## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.



## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->
Go to Nefarian (id 11583) or his phase 1 form (id 10162) in BWL with a
mage and a priest bot.
During phase 2, the priest bot should cast fear ward on whoever nefarian
is targeting.
Wait for a mage class call. Once it happens the mage bot should cast ice
block (if its available) to remove the Wild Magic debuff.


## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [x] No
    - - [ ] Yes (**explain why**)



- Does this change add new decision branches or increase maintenance
complexity?
    - - [x] No
    - - [ ] Yes (**explain below**)



## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->
AI assistance was used to explore how dungeon/raid strats are
implemented and to explore examples.
All code has been reviewed


<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
2026-05-30 07:14:38 -07:00
Lichborne
a3ca438bef
Make .playerbots bot commands case-insensitive (#2419)
## Pull Request Description

\`.playerbots bot add jared\` fails with "Character 'jared' not found"
even when \`Jared\` exists, because the lookup is case-sensitive. Same
issue hits \`remove\`, \`init=<...>\`, \`refresh\`, \`addaccount\`, and
any other subcommand that takes a character name.

Fix at the parser layer in \`HandlePlayerbotCommand\`: every subcommand
that takes a charname flows through one shared name-lookup step.
Normalize the typed name to canonical form (first letter upper, rest
lower) at that step so \`jared\`, \`JARED\`, \`JaReD\` all resolve to
\`Jared\`. The \`addaccount\` path still tries the raw token as an
account name first (account names are case-insensitive on the auth
side), then falls back to a normalized character-name lookup.

No subcommand's behavior changes — only the name lookup that precedes
them. Subcommands with no charname (\`initself\`, \`list\`, \`reload\`,
\`tweak\`, \`self\`, \`lookup\`, \`addclass\`) are unaffected.


## Feature Evaluation

- Describe the **minimum logic** required to achieve the intended
behavior.

One \`normalizePlayerName(s)\` call on each comma-separated token before
the existing \`GetCharacterGuidByName(s)\` lookup. Uses the helper this
module already calls in four other places.

- Describe the **processing cost** when this logic executes across many
bots.

Runs only when a player types a \`.playerbots bot ...\` command, on the
typed tokens. Not in any bot-tick or per-bot path. Cost does not scale
with bot count.


## How to Test the Changes

\`\`\`
.playerbots bot add Jared           → adds Jared
.playerbots bot add jared           → adds Jared
.playerbots bot add JARED           → adds Jared
.playerbots bot add JaReD           → adds Jared
.playerbots bot remove Jared        → removes Jared
.playerbots bot remove jared        → removes Jared
.playerbots bot init=auto jared     → re-rolls Jared's gear
.playerbots bot levelup jared → re-rolls Jared at his current level
.playerbots bot refresh jared       → refreshes Jared (HP/mana restored)
.playerbots bot refresh=raid jared  → unbinds Jared from saved raid IDs
.playerbots bot add jAred,saLLy,BOB → adds all three
.playerbots bot add nonexistent     → still reports not found
.playerbots bot initself            → still works (untouched path)
\`\`\`

All cases verified in-game.


## Impact Assessment

- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - [x] No, not at all
    - [ ] Minimal impact (**explain below**)
    - [ ] Moderate impact (**explain below**)

- Does this change modify default bot behavior?
    - [x] No
    - [ ] Yes (**explain why**)

- Does this change add new decision branches or increase maintenance
complexity?
    - [x] No
    - [ ] Yes (**explain below**)


## AI Assistance

Was AI assistance used while working on this change?
- [ ] No
- [x] Yes (**explain below**)

Used Claude to help trace the call graph (confirming which subcommands
are affected and which are untouched) and to draft the patch. Reviewed
and tested in-game before pushing.


## Final Checklist

- [x] Stability is not compromised.
- [x] Performance impact is understood, tested, and acceptable.
- [x] Added logic complexity is justified and explained.
- [x] Any new bot dialogue lines are translated.
- [x] Documentation updated if needed (Conf comments, WiKi commands).


## Notes for Reviewers

Diff is small (~25 lines in one file). One minor cosmetic side effect:
"Character 'X' not found" errors now echo the normalized form (\`Bogus\`
instead of \`bogus\`).

---------

Co-authored-by: Lichborne-AC <lzeppelin112@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 07:03:22 -07:00
Keleborn
28ec9b34b8
add conf option for disabling send mail (#2411)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
Fixes exploit in multiplayer servers where players can ask bots to mail
them items.


## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
Conf.
- Describe the **processing cost** when this logic executes across many
bots.
Cheap bool checkl


## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->

Use send mail command to try to get a bot to send you mail. Should
follow bool setting.

## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [x] No
    - - [ ] Yes (**explain why**)



- Does this change add new decision branches or increase maintenance
complexity?
    - - [x] No
    - - [ ] Yes (**explain below**)



## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->
CLaude Make do. 
simple enough one even AI can do it. 


<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
2026-05-30 06:52:54 -07:00
Mat
a1f9ff4542
fix bot leader handling (#2426)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
This pr fixes bots "freaking out" after leader change and bots will
promote player to party leader after give leader command
closes #2420 #2424 

## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.



## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->
1. Join rdf or make group
2. Promote bot to leader (rnd or alt), if bot was not leader
3. Type /p give leader
4. Bot will promote you to leader and it will follow you instead of
freaking out

## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [ ] No
    - - [x] Yes (**explain why**)

1. Bots now reset their AI on every SMSG_GROUP_SET_LEADER packet, so old
leader strategies get cleared after a leader change.
2. Random bots auto-bind their master to a real-player group member
during reset botAI, so commands like give leader and follow logic that
depend on HasActivePlayerMaster() start working for them.
3. On OnBotLogin, bots no longer steal leadership from a real player,
they only force the leader change if the current leader is a bot or
offline.

- Does this change add new decision branches or increase maintenance
complexity?
    - - [ ] No
    - - [x] Yes (**explain below**)

Adds two small guards: an "is current leader a real player" check on
login, and a "find first real-player member" loop inside ResetAiAction.
Both reuse existing patterns (IsRealPlayer(), the OnPlayerLogin
master-assign loop).


## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [x] No
- - [ ] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->



<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
2026-05-30 06:48:29 -07:00
NoxMax
0afaf753c6
Clarifies BG bracket auto-join comments and configs (#2417)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
<!-- Describe what this change does and why it is needed -->
playerbots.conf.dist:
1. Updated and clarified comments. At best they were misleading, at
worst they were wrong.
2. Reordered brackets configs top to bottom, from Warsong to IOC.
3. No config values have actually been changed.

PlayerbotAIConfig.cpp:
1. Made sure the config values actually match the .dist file.
2. Reordered brackets configs top to bottom, from Warsong to IOC.

## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.



## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->



## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [x] No
    - - [ ] Yes (**explain why**)



- Does this change add new decision branches or increase maintenance
complexity?
    - - [x] No
    - - [ ] Yes (**explain below**)



## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [x] No
- - [ ] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->



<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
Bracket ranges are from `pvpdifficulty_dbc`
2026-05-30 06:48:16 -07:00
Mat
240bb2dfca
Autogear suffixes (#2415)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
Suffix scoring was already wired up in playerbots, bots could evaluate
suffix items they owned, but factory init scored candidates with
randomPropertyId = 0 and equipped via EquipNewItem which doesn't roll
suffixes, so suffix items always looked like junk and never got picked.

Added a cached item_enchantment_template pool in RandomItemMgr, a
PickBestRandomPropertyId helper that picks the best suffix per bot
class/spec, and added it on the equipped item via
SetItemRandomProperties.

Tested levels 20-80, suffixes match spec. Closes #2370.



## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.

For items with RandomProperty != 0 or RandomSuffix != 0, run the
item_enchantment_template pool once, score each candidate suffix against
the bot's existing class/spec stat weights, keep the highest, and stamp
that id on the item right after EquipNewItem. Items without a suffix
pool skip the helper entirely. Without this, every suffix template
scores as base stats only (often near zero) and never gets picked during
factory init.

- Describe the **processing cost** when this logic executes across many
bots.

Startup: one SELECT entry, ench FROM item_enchantment_template (few
hundred rows), parsed into an unordered_map<uint32, vector<uint32>>
once. No SQL afterwards.
Per bot during init: PickBestRandomPropertyId only runs on candidates
that actually have a suffix pool. Each call is a hash lookup plus a loop
over 5-15 enchantment ids, each doing DBC lookups already used by the
scoring code. Cost is mostly by the existing CalculateRandomProperty
work, not new logic.
Scales linearly with bot count, same as the rest of factory init. No new
per-tick work.


## How to Test the Changes

1. Generate a fresh random bot at level 20-79 and use autogear (cloth,
leather, mail, plate, lots of suffix gear at that range).
2. Inspect the bot's gear. Items with names like "of the Eagle", "of the
Monkey", "of Healing", etc... should be equipped, with the suffix stats
visible on the tooltip.
3. Generate a level 80 bot at high gear-score limit. Confirm it still
equips raid epics normally (epics have no suffix pool, so this path is
untouched).



## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [ ] No
    - - [x] Yes (**explain why**)
Bots now consider random-suffix items during factory init and equip them
with the best suffix for their class/spec. Before, suffix items were
effectively invisible to init autogear because they scored as base stats
only. This is the intended fix for #2370.


- Does this change add new decision branches or increase maintenance
complexity?
    - - [ ] No
    - - [x] Yes (**explain below**)
Added one new public method on StatsWeightCalculator
(PickBestRandomPropertyId) and one new cache in RandomItemMgr
(LoadEnchantmentPool + GetEnchantmentPool). The candidate list in
InitEquipment changed from vector<uint32> to vector<pair<uint32, int32>>
to carry the chosen suffix id alongside the item id. Logic mirrors
existing patterns in the same files (DBC lookups, SQL-backed caches,
signed randomPropertyId encoding), no new abstractions, no new wrappers.


## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
Used AI to help me find the bug. It mapped the existing scoring pipeline
and pointed out that PlayerbotFactory::InitEquipment was scoring
candidates with randomPropertyId = 0 and equipping via EquipNewItem
(which doesn't roll suffixes), so the scoring side was already built,
just never fed real suffix ids during init. I reviewed and tested all
the code in-game across levels 20-80 and multiple classes/specs.




<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->

---------

Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com>
Co-authored-by: bash <hermensb@gmail.com>
Co-authored-by: Revision <tkn963@gmail.com>
Co-authored-by: kadeshar <kadeshar@gmail.com>
2026-05-30 06:48:07 -07:00
433 changed files with 1153 additions and 854 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
DELETE FROM ai_playerbot_texts WHERE name IN (
'send_mail_disabled'
);
DELETE FROM ai_playerbot_texts_chance WHERE name IN (
'send_mail_disabled'
);
INSERT INTO ai_playerbot_texts (id, name, text, say_type, reply_type, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8) VALUES
(1899, 'send_mail_disabled', 'I cannot send mail', 0, 0, '우편을 보낼 수 없습니다', 'Je ne peux pas envoyer de courrier', 'Ich kann keine Post senden', '我不能寄送邮件', '我不能寄送郵件', 'No puedo enviar correo', 'No puedo enviar correo', 'Я не могу отправить почту');
INSERT INTO ai_playerbot_texts_chance (name, probability) VALUES
('send_mail_disabled', 100);

View File

@ -12,8 +12,8 @@ bool AutoMaintenanceOnLevelupAction::Execute(Event /*event*/)
{
AutoPickTalents();
AutoLearnSpell();
AutoUpgradeEquip();
AutoTeleportForLevel();
AutoUpgradeEquip();
return true;
}
@ -21,13 +21,11 @@ bool AutoMaintenanceOnLevelupAction::Execute(Event /*event*/)
void AutoMaintenanceOnLevelupAction::AutoTeleportForLevel()
{
if (!sPlayerbotAIConfig.autoTeleportForLevel || !sRandomPlayerbotMgr.IsRandomBot(bot))
{
return;
}
if (botAI->HasRealPlayerMaster())
{
return;
}
sRandomPlayerbotMgr.RandomTeleportForLevel(bot);
return;
}
@ -89,21 +87,17 @@ void AutoMaintenanceOnLevelupAction::LearnQuestSpells(std::ostringstream* out)
{
Quest const* quest = i->second;
// only process class-specific quests to learn class-related spells, cuz
// we don't want all these bunch of entries to be handled!
if (!quest->GetRequiredClasses())
if (!quest->GetRequiredClasses() || quest->IsRepeatable() || quest->GetMinLevel() < 10 ||
quest->GetMinLevel() > bot->GetLevel())
{
continue;
}
// skip quests that are repeatable, too low level, or above bots' level
if (quest->IsRepeatable() || quest->GetMinLevel() < 10 || quest->GetMinLevel() > bot->GetLevel())
continue;
// skip if bot doesnt satisfy class, race, or skill requirements
if (!bot->SatisfyQuestClass(quest, false) || !bot->SatisfyQuestRace(quest, false) ||
!bot->SatisfyQuestSkill(quest, false))
{
continue;
// use the same logic and impl from Player::learnQuestRewardedSpells
}
int32 spellId = quest->GetRewSpellCast();
if (!spellId)
@ -113,31 +107,26 @@ void AutoMaintenanceOnLevelupAction::LearnQuestSpells(std::ostringstream* out)
if (!spellInfo)
continue;
// xinef: find effect with learn spell and check if we have this spell
bool found = false;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (spellInfo->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL && spellInfo->Effects[i].TriggerSpell &&
!bot->HasSpell(spellInfo->Effects[i].TriggerSpell))
{
// pusywizard: don't re-add profession specialties!
if (SpellInfo const* triggeredInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[i].TriggerSpell))
if (triggeredInfo->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL)
break; // pussywizard: break and not cast the spell (found is false)
break;
found = true;
break;
}
}
// xinef: we know the spell, continue
if (!found)
continue;
bot->CastSpell(bot, spellId, true);
// Check if RewardDisplaySpell is set to output the proper spell learned
// after processing quests. Output the original RewardSpell otherwise.
uint32 rewSpellId = quest->GetRewSpell();
if (rewSpellId)
{
@ -167,12 +156,11 @@ std::string const AutoMaintenanceOnLevelupAction::FormatSpell(SpellInfo const* s
void AutoMaintenanceOnLevelupAction::AutoUpgradeEquip()
{
if (!sPlayerbotAIConfig.autoUpgradeEquip || !sRandomPlayerbotMgr.IsRandomBot(bot))
if (!sRandomPlayerbotMgr.IsRandomBot(bot))
return;
PlayerbotFactory factory(bot, bot->GetLevel());
// Clean up old consumables before adding new ones
factory.CleanupConsumables();
factory.InitAmmo();
@ -181,9 +169,6 @@ void AutoMaintenanceOnLevelupAction::AutoUpgradeEquip()
factory.InitConsumables();
factory.InitPotions();
if (!sPlayerbotAIConfig.equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig.equipmentPersistenceLevel)
{
if (sPlayerbotAIConfig.incrementalGearInit)
if (sPlayerbotAIConfig.autoUpgradeEquip)
factory.InitEquipment(true);
}
}

View File

@ -154,9 +154,11 @@ void EquipAction::EquipItem(Item* item)
calculator.SetOverflowPenalty(false);
// Calculate item scores once and store them
float newItemScore = calculator.CalculateItem(itemId);
float mainHandScore = mainHandItem ? calculator.CalculateItem(mainHandItem->GetTemplate()->ItemId) : 0.0f;
float offHandScore = offHandItem ? calculator.CalculateItem(offHandItem->GetTemplate()->ItemId) : 0.0f;
float newItemScore = calculator.CalculateItem(itemId, item->GetItemRandomPropertyId());
float mainHandScore = mainHandItem
? calculator.CalculateItem(mainHandItem->GetTemplate()->ItemId, mainHandItem->GetItemRandomPropertyId()) : 0.0f;
float offHandScore = offHandItem
? calculator.CalculateItem(offHandItem->GetTemplate()->ItemId, offHandItem->GetItemRandomPropertyId()) : 0.0f;
// Determine where this weapon can go
bool canGoMain = (invType == INVTYPE_WEAPON ||

View File

@ -86,7 +86,7 @@ bool TogglePetSpellAutoCastAction::Execute(Event /*event*/)
uint32 spellId = itr->first;
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo->IsAutocastable())
if (!spellInfo || !spellInfo->IsAutocastable())
continue;
bool shouldApply = true;

View File

@ -6,6 +6,7 @@
#include "GenericSpellActions.h"
#include <ctime>
#include <unordered_set>
#include "Event.h"
#include "ItemTemplate.h"
@ -23,6 +24,116 @@
using ai::buff::MakeAuraQualifierForBuff;
using ai::spell::HasSpellOrCategoryCooldown;
namespace
{
std::unordered_set<uint32> const& GetMixedTriggerTrinketSpellIds()
{
static std::unordered_set<uint32> const mixedTriggerSpellIds = []()
{
std::unordered_set<uint32> onUseSpellIds;
std::unordered_set<uint32> onEquipSpellIds;
std::unordered_set<uint32> mixedSpellIds;
auto const* itemTemplates = sObjectMgr->GetItemTemplateStore();
if (!itemTemplates)
return mixedSpellIds;
auto const markSpellId = [&](int32 spellId, uint8 spellTrigger)
{
if (spellId <= 0)
return;
if (spellTrigger == ITEM_SPELLTRIGGER_ON_USE)
{
if (onEquipSpellIds.find(spellId) != onEquipSpellIds.end())
mixedSpellIds.insert(spellId);
onUseSpellIds.insert(spellId);
}
else if (spellTrigger == ITEM_SPELLTRIGGER_ON_EQUIP)
{
if (onUseSpellIds.find(spellId) != onUseSpellIds.end())
mixedSpellIds.insert(spellId);
onEquipSpellIds.insert(spellId);
}
};
for (auto const& itr : *itemTemplates)
{
ItemTemplate const& proto = itr.second;
if (proto.InventoryType != INVTYPE_TRINKET)
continue;
for (uint8 spellIndex = 0; spellIndex < MAX_ITEM_PROTO_SPELLS; ++spellIndex)
{
auto const& spellData = proto.Spells[spellIndex];
markSpellId(spellData.SpellId, spellData.SpellTrigger);
}
}
return mixedSpellIds;
}();
return mixedTriggerSpellIds;
}
bool IsManaRestoreEffect(SpellEffectInfo const& effectInfo)
{
return (effectInfo.Effect == SPELL_EFFECT_ENERGIZE &&
effectInfo.MiscValue == POWER_MANA) ||
(effectInfo.Effect == SPELL_EFFECT_APPLY_AURA &&
effectInfo.ApplyAuraName == SPELL_AURA_PERIODIC_ENERGIZE &&
effectInfo.MiscValue == POWER_MANA);
}
bool IsManaEfficiencyEffect(SpellEffectInfo const& effectInfo)
{
return effectInfo.Effect == SPELL_EFFECT_APPLY_AURA &&
(((effectInfo.ApplyAuraName == SPELL_AURA_MOD_POWER_REGEN ||
effectInfo.ApplyAuraName == SPELL_AURA_MOD_POWER_REGEN_PERCENT) &&
effectInfo.MiscValue == POWER_MANA) ||
effectInfo.ApplyAuraName == SPELL_AURA_MOD_POWER_COST_SCHOOL ||
effectInfo.ApplyAuraName == SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT ||
effectInfo.ApplyAuraName == SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
}
bool IsDefensiveTankEffect(SpellEffectInfo const& effectInfo)
{
if (effectInfo.Effect != SPELL_EFFECT_APPLY_AURA)
return false;
uint32 const tankRatingsMask =
(1u << CR_DEFENSE_SKILL) |
(1u << CR_DODGE) |
(1u << CR_PARRY) |
(1u << CR_BLOCK) |
(1u << CR_HIT_TAKEN_MELEE) |
(1u << CR_HIT_TAKEN_RANGED) |
(1u << CR_HIT_TAKEN_SPELL) |
(1u << CR_CRIT_TAKEN_MELEE) |
(1u << CR_CRIT_TAKEN_RANGED) |
(1u << CR_CRIT_TAKEN_SPELL);
switch (effectInfo.ApplyAuraName)
{
case SPELL_AURA_MOD_RESISTANCE:
return (effectInfo.MiscValue & SPELL_SCHOOL_MASK_NORMAL) != 0;
case SPELL_AURA_MOD_RATING:
return (effectInfo.MiscValue & tankRatingsMask) != 0;
case SPELL_AURA_MOD_INCREASE_HEALTH:
case SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT:
case SPELL_AURA_MOD_PARRY_PERCENT:
case SPELL_AURA_MOD_DODGE_PERCENT:
case SPELL_AURA_MOD_BLOCK_PERCENT:
case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN:
return true;
default:
return false;
}
}
}
CastSpellAction::CastSpellAction(PlayerbotAI* botAI, std::string const spell)
: Action(botAI, spell), range(botAI->GetRange("spell")), spell(spell) {}
@ -429,52 +540,109 @@ bool UseTrinketAction::UseTrinket(Item* item)
uint8 bagIndex = item->GetBagSlot();
uint8 slot = item->GetSlot();
// uint8 spell_index = 0; //not used, line marked for removal.
uint8 cast_count = 1;
ObjectGuid item_guid = item->GetGUID();
uint32 glyphIndex = 0;
uint8 castFlags = 0;
uint32 targetFlag = TARGET_FLAG_NONE;
uint32 spellId = 0;
int32 itemSpellCooldown = 0;
uint32 itemSpellCategory = 0;
int32 itemSpellCategoryCooldown = 0;
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
if (item->GetTemplate()->Spells[i].SpellId > 0 &&
item->GetTemplate()->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE)
{
spellId = item->GetTemplate()->Spells[i].SpellId;
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
itemSpellCooldown = item->GetTemplate()->Spells[i].SpellCooldown;
itemSpellCategory = item->GetTemplate()->Spells[i].SpellCategory;
itemSpellCategoryCooldown = item->GetTemplate()->Spells[i].SpellCategoryCooldown;
uint64 const itemCooldownKey = (static_cast<uint64>(item->GetEntry()) << 32) | spellId;
uint32 const now = getMSTime();
if (itemSpellCooldown > 0)
{
auto const itemCooldownItr = trinketItemCooldownExpiries.find(itemCooldownKey);
if (itemCooldownItr != trinketItemCooldownExpiries.end())
{
if (itemCooldownItr->second > now)
return false;
trinketItemCooldownExpiries.erase(itemCooldownItr);
}
}
if (itemSpellCategory && itemSpellCategoryCooldown > 0)
{
auto const categoryCooldownItr = trinketCategoryCooldownExpiries.find(itemSpellCategory);
if (categoryCooldownItr != trinketCategoryCooldownExpiries.end())
{
if (categoryCooldownItr->second > now)
return false;
trinketCategoryCooldownExpiries.erase(categoryCooldownItr);
}
}
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo || !spellInfo->IsPositive())
return false;
bool applyAura = false;
bool restoresMana = false;
bool improvesManaEfficiency = false;
bool defensiveTankEffect = false;
for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
{
const SpellEffectInfo& effectInfo = spellInfo->Effects[i];
if (effectInfo.Effect == SPELL_EFFECT_APPLY_AURA)
{
applyAura = true;
restoresMana = restoresMana || IsManaRestoreEffect(effectInfo);
improvesManaEfficiency = improvesManaEfficiency || IsManaEfficiencyEffect(effectInfo);
defensiveTankEffect = defensiveTankEffect || IsDefensiveTankEffect(effectInfo);
}
if (!applyAura && !restoresMana)
return false;
if (restoresMana || improvesManaEfficiency)
{
if (!AI_VALUE2(bool, "has mana", "self target"))
return false;
uint8 const manaPct = AI_VALUE2(uint8, "mana", "self target");
if ((restoresMana && manaPct >= sPlayerbotAIConfig.mediumMana) ||
manaPct >= sPlayerbotAIConfig.highMana)
{
return false;
}
}
if (defensiveTankEffect)
{
uint8 const healthPct = AI_VALUE2(uint8, "health", "self target");
if (healthPct > sPlayerbotAIConfig.lowHealth)
return false;
}
auto const& mixedTriggerTrinketSpellIds = GetMixedTriggerTrinketSpellIds();
// Exclude trinkets that expose the same spell as both ON_EQUIP and ON_USE across
// item templates. Those are equip/proc effects leaking into the active-use path,
// as seen with the error versions of Oracle Talisman of Ablution (44870) and
// Frenzyheart Insignia of Fury (44869).
if (mixedTriggerTrinketSpellIds.find(spellId) != mixedTriggerTrinketSpellIds.end())
return false;
if (!botAI->CanCastSpell(spellId, bot, false, nullptr, item))
return false;
break;
}
}
if (!applyAura)
return false;
uint32 spellProcFlag = spellInfo->ProcFlags;
// Handle items with procflag "if you kill a target that grants honor or experience"
// Bots will "learn" the trinket proc, so CanCastSpell() will be true
// e.g. on Item https://www.wowhead.com/wotlk/item=44074/oracle-talisman-of-ablution leading to
// constant casting of the proc spell onto themselfes https://www.wowhead.com/wotlk/spell=59787/oracle-ablutions
// This will lead to multiple hundreds of entries in m_appliedAuras -> Once killing an enemy -> Big diff time spikes
if (spellProcFlag != 0) return false;
if (!botAI->CanCastSpell(spellId, bot, false))
return false;
break;
}
}
if (!spellId)
return false;
@ -483,7 +651,25 @@ bool UseTrinketAction::UseTrinket(Item* item)
targetFlag = TARGET_FLAG_NONE;
packet << targetFlag << bot->GetPackGUID();
bot->GetSession()->HandleUseItemOpcode(packet);
uint32 const now = getMSTime();
uint32 const cooldownDelay = bot->GetSpellCooldownDelay(spellId);
if (cooldownDelay > 0)
{
if (itemSpellCooldown > 0)
{
uint64 const itemCooldownKey = (static_cast<uint64>(item->GetEntry()) << 32) | spellId;
trinketItemCooldownExpiries[itemCooldownKey] = now + static_cast<uint32>(itemSpellCooldown);
}
if (itemSpellCategory && itemSpellCategoryCooldown > 0)
{
trinketCategoryCooldownExpiries[itemSpellCategory] = now + static_cast<uint32>(itemSpellCategoryCooldown);
}
}
return true;
}

View File

@ -334,6 +334,10 @@ public:
protected:
bool UseTrinket(Item* trinket);
private:
std::unordered_map<uint64, uint32> trinketItemCooldownExpiries;
std::unordered_map<uint32, uint32> trinketCategoryCooldownExpiries;
};
class CastSpellOnEnemyHealerAction : public CastSpellAction

View File

@ -44,6 +44,21 @@ bool ResetAiAction::Execute(Event event)
}
}
}
if (Player* master = botAI->GetMaster())
{
Group* botGroup = bot->GetGroup();
Group* masterGroup = master->GetGroup();
if (botGroup && (!masterGroup || masterGroup != botGroup))
botAI->SetMaster(nullptr);
}
if (sRandomPlayerbotMgr.IsRandomBot(bot) && !bot->InBattleground())
{
if (bot->GetGroup() && (!botAI->GetMaster() || GET_PLAYERBOT_AI(botAI->GetMaster())))
{
if (Player* newMaster = botAI->FindNewMaster())
botAI->SetMaster(newMaster);
}
}
PlayerbotRepository::instance().Reset(botAI);
botAI->ResetStrategies(false);
botAI->TellMaster("AI was reset to defaults");

View File

@ -34,24 +34,23 @@ bool SendMailAction::Execute(Event event)
Player* receiver = GetMaster();
Player* tellTo = receiver;
std::vector<std::string> ss = split(text, ' ');
if (ss.size() > 1)
{
if (Player* p = ObjectAccessor::FindPlayer(ObjectGuid(uint64(ss[ss.size() - 1].c_str()))))
receiver = p;
}
if (!receiver)
receiver = event.getOwner();
if (!receiver || receiver == bot)
{
return false;
}
if (!tellTo)
tellTo = receiver;
if (!sPlayerbotAIConfig.botSendMailEnabled)
{
bot->Whisper(PlayerbotTextMgr::instance().GetBotTextOrDefault(
"send_mail_disabled", "I cannot send mail", {}),
LANG_UNIVERSAL, tellTo);
return false;
}
if (!mailboxFound && !randomBot)
{
bot->Whisper(PlayerbotTextMgr::instance().GetBotTextOrDefault(

View File

@ -16,7 +16,7 @@ void WorldPacketHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
triggers.push_back(
new TriggerNode("uninvite guid", { NextAction("uninvite", relevance) }));
triggers.push_back(
new TriggerNode("group set leader", { /*NextAction("leader", relevance),*/ }));
new TriggerNode("group set leader", { NextAction("reset botAI", relevance) }));
triggers.push_back(new TriggerNode(
"not enough money", { NextAction("tell not enough money", relevance) }));
triggers.push_back(

View File

@ -161,9 +161,7 @@ void ShamanAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
}
else if (tab == SHAMAN_TAB_ENHANCEMENT)
{
triggers.push_back(new TriggerNode("medium aoe",{ NextAction("magma totem", 24.0f),
NextAction("fire nova", 23.0f), }));
triggers.push_back(new TriggerNode("medium aoe",{ NextAction("fire nova", 23.0f), }));
triggers.push_back(new TriggerNode("maelstrom weapon 5 and medium aoe", { NextAction("chain lightning", 22.0f), }));
triggers.push_back(new TriggerNode("maelstrom weapon 4 and medium aoe", { NextAction("chain lightning", 21.0f), }));
triggers.push_back(new TriggerNode("enemy within melee", { NextAction("fire nova", 5.1f), }));

View File

@ -112,6 +112,7 @@ std::vector<NextAction> ArmsWarriorStrategy::getDefaultActions()
return {
NextAction("bladestorm", ACTION_DEFAULT + 0.2f),
NextAction("mortal strike", ACTION_DEFAULT + 0.1f),
NextAction("sunder armor", ACTION_DEFAULT + 0.05f),
NextAction("melee", ACTION_DEFAULT)
};
}

View File

@ -5,6 +5,7 @@
#include "WarriorActions.h"
#include "AiFactory.h"
#include "Playerbots.h"
bool CastBerserkerRageAction::isPossible()
@ -36,6 +37,27 @@ bool CastBerserkerRageAction::isUseful()
bool CastSunderArmorAction::isUseful()
{
Group* group = bot->GetGroup();
if (!group)
return false;
if (!botAI->IsTank(bot, false))
{
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
{
Player* member = ref->GetSource();
if (!member || member == bot || !member->IsAlive() || !member->IsInWorld() ||
member->GetMapId() != bot->GetMapId())
{
continue;
}
if (member->getClass() == CLASS_WARRIOR &&
botAI->IsTank(member, false))
return false;
}
}
Aura* aura = botAI->GetAura("sunder armor", GetTarget(), false, true);
return !aura || aura->GetStackAmount() < 5 || aura->GetDuration() <= 6000;
}

View File

@ -3,7 +3,7 @@
#include "AiObjectContext.h"
#include "Action.h"
#include "AuchenaiCryptsActions.h"
#include "ACActions.h"
class TbcDungeonAuchenaiCryptsActionContext : public NamedObjectContext<Action>
{

View File

@ -1,7 +1,7 @@
#include "Playerbots.h"
#include "AiFactory.h"
#include "AuchenaiCryptsTriggers.h"
#include "AuchenaiCryptsActions.h"
#include "ACTriggers.h"
#include "ACActions.h"
// Shirrak the Dead Watcher

View File

@ -3,7 +3,7 @@
#include "AttackAction.h"
#include "MovementActions.h"
#include "AuchenaiCryptsTriggers.h"
#include "ACTriggers.h"
// Shirrak the Dead Watcher

View File

@ -1,6 +1,6 @@
#include "AuchenaiCryptsMultipliers.h"
#include "AuchenaiCryptsActions.h"
#include "AuchenaiCryptsTriggers.h"
#include "ACMultipliers.h"
#include "ACActions.h"
#include "ACTriggers.h"
#include "MovementActions.h"
#include "ReachTargetActions.h"
#include "FollowActions.h"

View File

@ -1,6 +1,6 @@
#include "AuchenaiCryptsTriggers.h"
#include "AuchenaiCryptsStrategy.h"
#include "AuchenaiCryptsMultipliers.h"
#include "ACTriggers.h"
#include "ACStrategy.h"
#include "ACMultipliers.h"
void TbcDungeonAuchenaiCryptsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{

View File

@ -3,7 +3,7 @@
#include "AiObjectContext.h"
#include "TriggerContext.h"
#include "AuchenaiCryptsTriggers.h"
#include "ACTriggers.h"
class TbcDungeonAuchenaiCryptsTriggerContext : public NamedObjectContext<Trigger>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "AuchenaiCryptsTriggers.h"
#include "ACTriggers.h"
#include "AiObject.h"
#include "AiObjectContext.h"

View File

@ -3,7 +3,7 @@
#include "Action.h"
#include "NamedObjectContext.h"
#include "OldKingdomActions.h"
#include "AKActions.h"
class WotlkDungeonOKActionContext : public NamedObjectContext<Action>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "OldKingdomActions.h"
#include "AKActions.h"
bool AttackNadoxGuardianAction::Execute(Event /*event*/)
{

View File

@ -5,7 +5,7 @@
#include "AttackAction.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
#include "OldKingdomTriggers.h"
#include "AKTriggers.h"
class AttackNadoxGuardianAction : public AttackAction
{

View File

@ -1,9 +1,9 @@
#include "OldKingdomMultipliers.h"
#include "OldKingdomActions.h"
#include "AKMultipliers.h"
#include "AKActions.h"
#include "GenericSpellActions.h"
#include "ChooseTargetActions.h"
#include "MovementActions.h"
#include "OldKingdomTriggers.h"
#include "AKTriggers.h"
#include "Action.h"
float ElderNadoxMultiplier::GetValue(Action* action)

View File

@ -1,5 +1,5 @@
#include "OldKingdomStrategy.h"
#include "OldKingdomMultipliers.h"
#include "AKStrategy.h"
#include "AKMultipliers.h"
void WotlkDungeonOKStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
{

View File

@ -3,7 +3,7 @@
#include "NamedObjectContext.h"
#include "AiObjectContext.h"
#include "OldKingdomTriggers.h"
#include "AKTriggers.h"
class WotlkDungeonOKTriggerContext : public NamedObjectContext<Trigger>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "OldKingdomTriggers.h"
#include "AKTriggers.h"
#include "AiObject.h"
#include "AiObjectContext.h"

View File

@ -3,7 +3,7 @@
#include "Action.h"
#include "NamedObjectContext.h"
#include "AzjolNerubActions.h"
#include "ANActions.h"
class WotlkDungeonANActionContext : public NamedObjectContext<Action>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "AzjolNerubActions.h"
#include "ANActions.h"
bool AttackWebWrapAction::isUseful() { return !botAI->IsHeal(bot); }
bool AttackWebWrapAction::Execute(Event /*event*/)

View File

@ -5,7 +5,7 @@
#include "AttackAction.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
#include "AzjolNerubTriggers.h"
#include "ANTriggers.h"
class AttackWebWrapAction : public AttackAction
{

View File

@ -1,9 +1,9 @@
#include "AzjolNerubMultipliers.h"
#include "AzjolNerubActions.h"
#include "ANMultipliers.h"
#include "ANActions.h"
#include "GenericSpellActions.h"
#include "ChooseTargetActions.h"
#include "MovementActions.h"
#include "AzjolNerubTriggers.h"
#include "ANTriggers.h"
#include "Action.h"
float KrikthirMultiplier::GetValue(Action* action)

View File

@ -1,5 +1,5 @@
#include "AzjolNerubStrategy.h"
#include "AzjolNerubMultipliers.h"
#include "ANStrategy.h"
#include "ANMultipliers.h"
void WotlkDungeonANStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
{

View File

@ -3,7 +3,7 @@
#include "NamedObjectContext.h"
#include "AiObjectContext.h"
#include "AzjolNerubTriggers.h"
#include "ANTriggers.h"
class WotlkDungeonANTriggerContext : public NamedObjectContext<Trigger>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "AzjolNerubTriggers.h"
#include "ANTriggers.h"
#include "AiObject.h"
#include "AiObjectContext.h"

View File

@ -3,7 +3,7 @@
#include "Action.h"
#include "NamedObjectContext.h"
#include "CullingOfStratholmeActions.h"
#include "CoSActions.h"
class WotlkDungeonCoSActionContext : public NamedObjectContext<Action>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "CullingOfStratholmeActions.h"
#include "CoSActions.h"
bool ExplodeGhoulSpreadAction::Execute(Event /*event*/)
{

View File

@ -6,7 +6,7 @@
#include "GenericSpellActions.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
#include "CullingOfStratholmeTriggers.h"
#include "CoSTriggers.h"
class ExplodeGhoulSpreadAction : public MovementAction
{

View File

@ -1,9 +1,9 @@
#include "CullingOfStratholmeMultipliers.h"
#include "CullingOfStratholmeActions.h"
#include "CoSMultipliers.h"
#include "CoSActions.h"
#include "GenericSpellActions.h"
#include "ChooseTargetActions.h"
#include "MovementActions.h"
#include "CullingOfStratholmeTriggers.h"
#include "CoSTriggers.h"
#include "Action.h"
float EpochMultiplier::GetValue(Action* action)

View File

@ -1,5 +1,5 @@
#include "CullingOfStratholmeStrategy.h"
#include "CullingOfStratholmeMultipliers.h"
#include "CoSStrategy.h"
#include "CoSMultipliers.h"
void WotlkDungeonCoSStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
{

View File

@ -3,7 +3,7 @@
#include "NamedObjectContext.h"
#include "AiObjectContext.h"
#include "CullingOfStratholmeTriggers.h"
#include "CoSTriggers.h"
class WotlkDungeonCoSTriggerContext : public NamedObjectContext<Trigger>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "CullingOfStratholmeTriggers.h"
#include "CoSTriggers.h"
#include "AiObject.h"
#include "AiObjectContext.h"

View File

@ -3,7 +3,7 @@
#include "Action.h"
#include "NamedObjectContext.h"
#include "DrakTharonKeepActions.h"
#include "DTKActions.h"
class WotlkDungeonDTKActionContext : public NamedObjectContext<Action>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "DrakTharonKeepActions.h"
#include "DTKActions.h"
bool CorpseExplodeSpreadAction::Execute(Event /*event*/)
{

View File

@ -6,7 +6,7 @@
#include "GenericSpellActions.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
#include "DrakTharonKeepTriggers.h"
#include "DTKTriggers.h"
const Position NOVOS_PARTY_POSITION = Position(-378.852f, -760.349f, 28.587f);

View File

@ -1,9 +1,9 @@
#include "DrakTharonKeepMultipliers.h"
#include "DrakTharonKeepActions.h"
#include "DTKMultipliers.h"
#include "DTKActions.h"
#include "GenericSpellActions.h"
#include "ChooseTargetActions.h"
#include "MovementActions.h"
#include "DrakTharonKeepTriggers.h"
#include "DTKTriggers.h"
#include "Action.h"
float NovosMultiplier::GetValue(Action* action)

View File

@ -1,5 +1,5 @@
#include "DrakTharonKeepStrategy.h"
#include "DrakTharonKeepMultipliers.h"
#include "DTKStrategy.h"
#include "DTKMultipliers.h"
void WotlkDungeonDTKStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
{

View File

@ -3,7 +3,7 @@
#include "NamedObjectContext.h"
#include "AiObjectContext.h"
#include "DrakTharonKeepTriggers.h"
#include "DTKTriggers.h"
class WotlkDungeonDTKTriggerContext : public NamedObjectContext<Trigger>
{

View File

@ -1,5 +1,5 @@
#include "Playerbots.h"
#include "DrakTharonKeepTriggers.h"
#include "DTKTriggers.h"
#include "AiObject.h"
#include "AiObjectContext.h"

Some files were not shown because too many files have changed in this diff Show More