Bot eating/drinking state machine and mage conjure improvements#269
Merged
billy1arm merged 1 commit intomangoszero:masterfrom Mar 9, 2026
Merged
Bot eating/drinking state machine and mage conjure improvements#269billy1arm merged 1 commit intomangoszero:masterfrom
billy1arm merged 1 commit intomangoszero:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Playerbot AI to improve out-of-combat sustenance behavior (eating/drinking) for all bots, and enhances Mage bot group utility via conjured food/water and mana gems.
Changes:
- Adds configurable “hungry”/“thirsty” thresholds (default 65%) and introduces corresponding triggers used by the food/drink strategy.
- Reworks eat/drink handling to be stateful (via
PlayerbotAItimers) and interruptible within the normal action priority mix. - Expands Mage behavior: conjure food/water/mana gems, share conjured food/water with nearby group members, and prefer mana gems over mana potions/evocation when low on mana.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/Bots/playerbot/strategy/triggers/TriggerContext.h | Registers new global triggers: hungry, thirsty. |
| src/modules/Bots/playerbot/strategy/triggers/HealthTriggers.h | Adds HungryTrigger driven by config threshold and eating state. |
| src/modules/Bots/playerbot/strategy/triggers/GenericTriggers.h | Declares ThirstyTrigger. |
| src/modules/Bots/playerbot/strategy/triggers/GenericTriggers.cpp | Implements ThirstyTrigger using config threshold and drinking state. |
| src/modules/Bots/playerbot/strategy/mage/MageTriggers.h | Adds mage triggers for mana gem presence and party sustenance needs. |
| src/modules/Bots/playerbot/strategy/mage/MageTriggers.cpp | Implements party sustenance scanning/caching logic. |
| src/modules/Bots/playerbot/strategy/mage/MageAiObjectContext.cpp | Registers new mage triggers and actions for conjuring/giving sustenance. |
| src/modules/Bots/playerbot/strategy/mage/MageActions.h | Adds conjure food/water/mana gem actions and give-conjured actions. |
| src/modules/Bots/playerbot/strategy/mage/MageActions.cpp | Implements giving conjured items to party and best-rank mana gem conjure selection. |
| src/modules/Bots/playerbot/strategy/mage/GenericMageStrategy.cpp | Updates low-mana behavior to try mana gem before evocation. |
| src/modules/Bots/playerbot/strategy/mage/GenericMageNonCombatStrategy.cpp | Adds non-combat triggers for conjuring mana gems and giving conjured food/water. |
| src/modules/Bots/playerbot/strategy/generic/UseFoodStrategy.cpp | Switches food/drink triggers from fixed low-health/low-mana to hungry/thirsty. |
| src/modules/Bots/playerbot/strategy/actions/UseItemAction.h | Makes UseItemAuto protected to allow derived overrides (mana gem preference). |
| src/modules/Bots/playerbot/strategy/actions/UseItemAction.cpp | Removes prior food-use special-case that interrupted casting and delayed AI checks. |
| src/modules/Bots/playerbot/strategy/actions/TradeStatusAction.cpp | Adds include for UseItemAction.h. |
| src/modules/Bots/playerbot/strategy/actions/NonCombatActions.h | Reworks Eat/Drink actions to maintain state while active and use new thresholds. |
| src/modules/Bots/playerbot/strategy/actions/NonCombatActions.cpp | Restores proper includes (uncommented). |
| src/modules/Bots/playerbot/strategy/actions/InventoryAction.h | Adds InventoryAction::FindPlayerItem helper for scanning other players’ inventories. |
| src/modules/Bots/playerbot/strategy/actions/InventoryAction.cpp | Adds mana gem inventory parsing and conjured food/drink parsing; implements FindPlayerItem. |
| src/modules/Bots/playerbot/strategy/ItemVisitors.h | Adds visitors for (conjured) food/drink detection by spell category. |
| src/modules/Bots/playerbot/aiplayerbot.conf.dist.in | Documents new config options: HungryHealth, ThirstyMana. |
| src/modules/Bots/playerbot/PlayerbotAIConfig.h | Adds config fields hungryHealth and thirstyMana. |
| src/modules/Bots/playerbot/PlayerbotAIConfig.cpp | Loads new hungry/thirsty thresholds from config with defaults. |
| src/modules/Bots/playerbot/PlayerbotAI.h | Adds eat/drink state tracking (timers + helpers). |
| src/modules/Bots/playerbot/PlayerbotAI.cpp | Initializes/clears eat/drink timers; minor guard added to SpellInterrupted. |
| src/game/Object/SpellMgr.h | Defines spell category constants for food/drink used by the bot logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/modules/Bots/playerbot/strategy/mage/GenericMageStrategy.cpp
Outdated
Show resolved
Hide resolved
Adds IsEating/IsDrinking state tracking so bots hold their sit-and-eat behavior for the full duration. New hungry/thirsty triggers fire at configurable thresholds before health/mana are critical. Mage bots now conjure food, water, and mana gems, and distribute conjured items to party members who need them.
74ecd80 to
4279163
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is mostly about making better Mage Playerbot Group Members by:
However, when working on these things, I discovered general issues with Bots eating and drinking, so this change ALSO tackles several things there that apply to ALL Playerbots:
** 2. Instead of blocking the entire AI action processing during eating and drinking, this puts Eat/Drink firmly into the priority mix, allowing it to be interrupted by higher priority actions (such as responding to aggro)..
This change is