Skip to content

fix(items): require the skill requirements to learn a skill with an item - #1243

Merged
sven-n merged 1 commit into
masterfrom
claude/pr995-learnable-skill-requirements
Oct 18, 2026
Merged

sven-n merged 1 commit into
masterfrom
claude/pr995-learnable-skill-requirements

Conversation

@sven-n

@sven-n sven-n commented Oct 17, 2026

Copy link
Copy Markdown
Member

Split out of #995 (the server-side part of Diego Amatte's "send skill requirements to the client" commit), without the client data packets.

Problem

LearnablesConsumeHandlerPlugIn only checked the item's own requirements. A player could therefore learn a skill they can't use, and the item was used up. The clearest case is the Orb of Summoning: the item has no energy requirement, but the skills of its levels do:

Orb Skill Skill energy requirement
+0 Summon Goblin 90
+1 Summon Stone Golem 170
… … …
+6 Summon Soldier 280

Change

  • LearnablesConsumeHandlerPlugIn.CheckPreconditions now also requires the player to meet the Skill.Requirements of the skill the item teaches. It gets that skill through the existing virtual GetLearnableSkill, so the Summoning Orb's override (item level → skill) applies.
  • The requirement check inside Player.TryConsumeForSkillAsync is extracted to Player.CompliesRequirements(Skill) and reused here, so the rule isn't duplicated.

Compared to the original commit, this leaves out the static LearnableSkillRequirements helper, which replaced the Summoning Orb's GetLearnableSkill override with an IsSummoningOrb check (rule 8), and ItemExtensions.GetRequiredAttribute. Both were only needed for the C2 F5 04/05 packets. Those packets have no consumer in the open source client yet and aren't part of this PR.

Testing

LearnablesConsumeHandlerPlugInTest:

  • a scroll teaches its skill only if the player meets the skill's energy requirement, and is only used up in that case
  • an Orb of Summoning +0/+1 requires the energy of skill 30/31

The two "not learned" cases fail without the change. dotnet test tests/MUnique.OpenMU.Tests: 1856/1856 passed.


Generated by Claude Code

A player could learn a skill with a scroll, orb or crystal without complying
with the requirements of the skill itself, and then couldn't use it. E.g.
the Orb of Summoning has no energy requirement, but Summon Goblin needs 90
energy and Summon Soldier (orb +6) 280.

Learning a skill with an item now also requires the requirements of the
skill. The requirement check of Player.TryConsumeForSkillAsync is extracted
to Player.CompliesRequirements(Skill) and reused for it.

Split out of #995, without the client data packets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uz47mrsSwm3hxZc7gCMxd9
@sven-n
sven-n merged commit 7a78405 into master Oct 18, 2026
2 checks passed
@sven-n
sven-n deleted the claude/pr995-learnable-skill-requirements branch October 18, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants