Repository navigation
Count exp-table reward skill points in the account pool - #83
Conversation
MMOCore runs exp-table command triggers through Bukkit.dispatchCommand, which fires no command event, so SkillPointCommandListener never saw the level 7 "mmocore admin skill-points give %player% 2" reward. The account pool stayed at 0 and the next class apply clawed the points back, downgrading any skill they were spent on. RPCharacters now counts the skill points the current class's claimed rewards gave, and adds any it has not counted yet to the account pool. It stores what it has counted as account-reward-skill-points, so each reward counts once per account. This runs on every class apply (including join), which repairs existing accounts, and a tick after each level-up, when MMOCore has claimed the reward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to The change credits skill points from claimed experience-table rewards. No concrete merge-blocking risk was found in the supplied context.
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Problem
Since Act 1 raised the cap to 11 on Main (2026-10-10), every subclass player who reaches level 7 gets the +2 skill points and then loses them on the next login. Any skill they upgraded with those points drops back to level 1. DrDref (DrdeerX) and Matcha (vMatcha) reported it: they upgraded Bloodlust twice, and after relogging both the upgrades and the points were gone.
The exp tables give the points with
command{format="mmocore admin skill-points give %player% 2"}. MMOCore runs that throughBukkit.dispatchCommand, which fires no command event, soSkillPointCommandListenernever sees it and the account pool (account-skill-points-total) stays at 0. On the next class apply (join, character load, class change),clampExcessSkillPoolsees spent + unspent > 0 and claws the points back. On Main, all 39 players who have claimed the level-7 reward haveaccount-skill-points-total: 0.Fix
ExpTableSkillPointscounts the skill points the current class's claimed exp-table rewards gave. It reads MMOCore's claim counts and the reward'sskill-points givecommands.ClassServiceadds the points the account has not counted yet to the pool, and stores what it has counted asaccount-reward-skill-pointsin the player file. Each reward counts once per account, so claiming the level-7 reward again under another class adds nothing. Tome and admin points are kept when a later reward arrives.PlayerManageralso runs it one tick after each level-up, because MMOCore claims the reward after it fires the level change.Testing
ExpTableSkillPointsTest(uses real MMOCoreExperienceItemandCommandTriggerobjects), plus new cases inClassServiceTest,PlayerManagerEventsTestandCharacterFieldsRuntimeTest. Locally, everything passes except the 4 POSIX-permission tests that always error on Windows.~/skillpts-test/test.js, with Dev's Berserker cap raised to 11 for the test and then restored):🤖 Generated with Claude Code