Skip to content

Keep passive skills at login and never resolve a cast to one - #2878

Merged
erwan-joly merged 1 commit into
masterfrom
claude/project-thread-wi9f5y-passive-skills
Nov 12, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
claude/project-thread-wi9f5y-passive-skills

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #2873

This is the first step of the passive skills ticket. Passives are the training courses, PvP boosts and tomes with TYPE c1 = 0 in Skill.dat, vnums 20-152.

What changed

  • SkillService.ForgetUnlearnableSkillsAsync runs at every login and kept only the class's own skills, so it deleted any passive a character had learned. It now leaves passives alone, because they are not tied to a class.
  • SkillResolver.FindLearned now skips passives. A passive's cast id is its kind (for example, passive 20 has cast id 0), so it overlaps the cast ids of real skills. Once passives stay learned, a u_s 0 could otherwise resolve to the course instead of the basic attack.
  • A SkillDto.IsPassive() helper names the SkillType == 0 check.
  • Test data for active skills now sets SkillType = 1, as the real data does. They had defaulted to 0, which is the passive type.

Verification

  • New tests: a passive row survives ForgetUnlearnableSkillsAsync, and a cast with id 0 resolves to the basic attack when passive 20 is also known. All suites are green except the known EveryDeclaredEffectIsNamed failure in Parser.Tests, which also fails on master.
  • In the client, I gave the character passives 20 and 113 in CharacterSkill, logged in and opened Skill Info > Training:
    • master: ski 220 221 220, and after the login only skill 220 is left in the table. The Education List is empty.
    • branch: ski 220 221 20 220 113, and all three rows are kept. Passive 20 shows in the Education List.

master: Skill Info > Training is empty, the passives were deleted at login

master training

branch: the learned passive is still there

branch training

Still to do on #2873

  • Buying passives. The client data has skill shops (n_inv 2 <npc> 0 0 <vnums> for the training page), but the parser skips them.
  • Storing the passive kind and amount under their own names.
  • Applying the bonuses to stats and damage.

Generated by Claude Code

Part of #2873

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gSmkVtYup7KTZ63CJcxZT
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds passive-skill identification, preserves passive skill rows during unlearnable-skill cleanup, and excludes passive skills from cast-ID matching. Tests cover row retention, cast resolution, and skill type fixture values.

Changes

Passive skill handling

Layer / File(s) Summary
Passive classification and retention
src/NosCore.GameObject/Services/SkillService/SkillExtensions.cs, src/NosCore.GameObject/Services/SkillService/SkillService.cs, test/NosCore.GameObject.Tests/Services/SkillService/ClassSkillLearningTests.cs
Adds IsPassive, which checks whether SkillType is 0. ForgetUnlearnableSkillsAsync preserves passive skill rows. A test verifies that passive skill 20 remains stored.
Cast lookup filtering
src/NosCore.GameObject/Services/BattleService/SkillResolver.cs, test/NosCore.GameObject.Tests/Services/BattleService/SkillResolverTests.cs, test/NosCore.GameObject.Tests/Services/SkillService/ClassSkillLearningTests.cs, test/NosCore.PacketHandlers.Tests/Battle/*
FindLearned excludes passive skills when matching cast IDs. Tests verify that cast ID 0 resolves to active skill 220 instead of passive skill 20. Skill fixtures now specify their SkillType.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • NosCoreIO/NosCore issue 2873: The issue describes passive skill rows being deleted by ForgetUnlearnableSkillsAsync. This change preserves those rows, but the issue also mentions purchase and stat application, which this change does not address.

Possibly related PRs

  • NosCoreIO/NosCore#2652: Both changes rely on SkillResolver.FindLearned selecting the same skill for cast resolution and mana and cooldown checks.
  • NosCoreIO/NosCore#2646: This PR routes learned-skill lookups through SkillResolver.FindLearned, whose passive-skill filtering changes here.

Suggested reviewers: claude, denislauri1999

Merge Risk: Minimal · up to 876a7

The change keeps passive skill rows at login and stops passive skills from taking precedence in cast resolution. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the two main behavioral changes: passive skills are kept when unlearnable skills are forgotten at login, and passive skills are never resolved as a cast. The raw summary confirms both…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title states the two main behavioral changes: passive skills are kept when unlearnable skills are forgotten at login, and passive skills are never resolved as a cast. The raw summary confirms both changes in SkillService.ForgetUnlearnableSkillsAsync and SkillResolver.FindLearned, and the objectives describe the same intent. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0c77917 and 876a7a3.

Files selected for processing: 8

  • src/NosCore.GameObject/Services/BattleService/SkillResolver.cs
  • src/NosCore.GameObject/Services/SkillService/SkillExtensions.cs
  • src/NosCore.GameObject/Services/SkillService/SkillService.cs
  • test/NosCore.GameObject.Tests/Services/BattleService/SkillResolverTests.cs
  • test/NosCore.GameObject.Tests/Services/SkillService/ClassSkillLearningTests.cs
  • test/NosCore.PacketHandlers.Tests/Battle/MultiTargetListPacketHandlerTests.cs
  • test/NosCore.PacketHandlers.Tests/Battle/UseAoeSkillPacketHandlerTests.cs
  • test/NosCore.PacketHandlers.Tests/Battle/UseSkillPacketHandlerTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

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