From 6a4e7f0e1b30d04af5b6fa6ef6f51ae5f9d76eeb Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 22 Oct 2026 07:10:29 -0400 Subject: [PATCH] Refuse creation stats below 1 or above the racial maximum Follows CharCreate_AdjustAttribute (0xBAC140): a stat must stay at 1 or more and can't be raised past the racial maximum. Checked after the rune bonuses and max adjustments but before the rune penalties, since Giant's Blood lowers the INT/DEX max by 10 but the stat by only 5. Co-Authored-By: Claude Opus 5.5 --- src/engine/objects/PlayerCharacter.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index b4eb145e..6a0ba931 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -1091,6 +1091,17 @@ public class PlayerCharacter extends AbstractCharacter { } } + // Checked before the penalties, as the client's +/- does (0xBAC140): Giant's Blood cuts a max below its stat + if (strCur < 1 || dexCur < 1 || conCur < 1 || intCur < 1 || spiCur < 1) { + Logger.info("Attribute below 1"); + return null; + } + + if (strCur > strMax || dexCur > dexMax || conCur > conMax || intCur > intMax || spiCur > spiMax) { + Logger.info("Attribute above racial maximum"); + return null; + } + // Add in all of the penalties. strCur += penalties.get("StrCur"); strMax += penalties.get("StrMax");