Fix bots using skills they should not have access to - #944
Conversation
Bots no longer receive orb/scroll skills magically on level-up; like regular players, they now learn them only by looting the orb/scroll and consuming it through the regular consume action (new BotSkillHandler, hooked into pickup and the navigator's equipment cadence). Generation backfills a plausible kit instead, gated by granting-item obtainability (drop level + item requirements). Mount-bound skills (Impale, Fire Breath, Plasma Storm) are off-limits to bots entirely: never learned, looted, or selected, with no mount detection needed. Fresh-start bots now spawn weapon-only with no armor, like a regular player's new character; veteran starter gear was extracted into BotStarterGearEquipper. Fixes MUnique#943.
ReviewReviewed The direction is right: moving orb/scroll skills onto the loot-and-consume path via the real A few things I'd want addressed before merge. 1. A looted orb can be sold before it is ever consumed
Concretely: a bot loots an Orb of Twisting Slash and, in the window before The gear path protects itself with exactly this guard ("selling a piece it picked up as an upgrade one tick before it puts it on is pure loss" — same comment applies verbatim here). One line in if (BotSkillHandler.WantsSkillItem(player, item))
{
continue; // a skill orb/scroll waiting for the next learn pass.
}2.
|
- Keep looted skill orbs out of the junk list, so they survive both selling and slot-pressure discarding until the next learn pass. - Drop the static granting-items cache; generation builds the lookup once per run instead of pinning the configuration graph. - Backfill consumable (orb/scroll) grants only; worn-equipment and pet grants are never written into learned skills. The raw requirement comparison is documented as consumable-only. - Replace IsBotLearnableSkill with IsBotLootableSkill plus per-call-site grant filtering; gate orb pickup behind the upgrade-items toggle. - Document the asymmetric handling of previously over-granted scroll skills in bots.md. - Cover BotSkillHandler and BotStarterGearEquipper with tests; port the grant-rule tests to MayBackfillSkill.
Re-review (
|
- Fix the skill-list race the sell guard introduced: GetSellableJunk no longer reads the skill list, so the navigator-timer shopping decision stays race-free. Pending skill orbs are pulled back out of the junk list in SellJunkAsync instead, which runs serialized on the MU Helper tick with the learn pass that mutates it. - Rename IsBotLootableSkill to MayBotOwnSkill to match its role as the gate for looting, generation backfill and level-up alike. - Tests: realistic TotalEnergyRequirementValue on the orb fixture, non-mount equipment-grant case, and a staff-vs-sword proof that build preference wins over drop level.
|
Merged as 3b88313.
Merged on green CI at One cosmetic leftover, not worth holding the merge for. Worth confirming separately that Earthshake is genuinely safe in production, since it is mount-bound but absent from Generated by Claude Code |
Summary
Fixes #943 — server-side bots were fighting with skills no legitimate character
in their situation could use (Impale on foot, Evil Spirit before its scroll
could drop, plus Fire Breath / Plasma Storm of the same kind).
What changed
BotSkillHandler): bots pick up orbs/scrollsteaching unknown, consumable skills (
ItemPickupHandler) and consume them throughthe regular
ItemConsumeActionon the navigator's equipment cadence — same gatesa human faces. Level-ups grant no item skills anymore (
BotSkillProgressionPlugIn).BotGenerator): backfilled skills additionally requiregranting-item obtainability (drop level + item requirements), so the fresh-start flag
controls the starting kit — fresh level-1 bots start with almost nothing.
BotProgression,CombatHandler): Impale (47),Fire Breath (49) and Plasma Storm (76) are never learned, looted, or selected by bots;
the combat skip is bot-only, so humans keep their mounted skills. No mount detection.
BotStartupProfile.EquipStarterArmor): weapon only,like a regular new character; veterans keep the basic set. Gear equipping extracted
from
BotGeneratorintoBotStarterGearEquipper(SRP; shared state as fields).bots.md) and newBotProgressionTests/BotStartupProfileTestscases.Verification
refactor — please re-run once more before merging.
mount-bound ones go silent immediately. Use Reset bots once for a fully clean
population.