Seems like there are lots of peculiarity with stats in Ultima 2, but this time this one was introduced by me. There is currently an exploit where it’s possible to max out your stats without spending any gold. This one was reported to me by a user of the upgrade.
The way to reproduce is this: head to the hotel clerk and offer him 0 gold. If he says “Alakazam!” he will max one stat up to 99. The game follows the stat boost logic anyway, even if you offer 0 gold. I suppose I didn’t quite realize this when I added the stat rollover fix.
The code for the stat check looks like this:
; al = current stat value 49f0 mov ah,al ; save orig stat in ah 49f2 popf 49f3 adc al, ; add in offer amount 49f7 daa ; adjust for bcd 49f8 pushf ; save state of carry flag 49f9 cmp al,ah 49fb ja 49ff ; if new stat > orig stat, jump to end 49fd mov al,99 ; else, cap stat at 99
The problem here is at line 49fb. I did this to check that the stat was actually raised and there was no overflow. Unfortunately, I didn’t check what happens if the stat doesn’t change. Instead of a “>” operator it should be “>=”. So line 49fb becomes:
49fb jae 49ff ; if new stat >= orig stat, jump to end
I’ve checked this fix into my v2.1 branch. Shout out to Stephen Lambert for reporting this!