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 <noreply@anthropic.com>
This commit is contained in:
1 parent
d6bda1fff0
commit
6a4e7f0e1b
1 file changed
+11
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user