I'm trying to recreate the PnP Kensai from Oriental Adventures 1ed, thus I'm trying to figure out a way to include a restriction on magical weapons.
This has been suggested, but unfortunately includes several non-magical weapons. Is there a way to refine or adjust this code?
COPY_EXISTING_REGEXP "^.+\.itm" override
PATCH_IF SOURCE_SIZE > 0x71 BEGIN
READ_LONG 0x64 ex_off
READ_SHORT 0x68 ex_co
PATCH_IF LONG_AT 0x60 > 0 BEGIN
FOR (i = 0; i < ex_co; i += 1) BEGIN
READ_BYTE (ex_co + i * 0x38) type
PATCH_IF type == 1 || type == 2 || type == 4 BEGIN
WRITE_BYTE 0x2f (THIS & 0b00000100)
END
END
END
END
BUT_ONLY
This has been suggested, but unfortunately includes several non-magical weapons. Is there a way to refine or adjust this code?
COPY_EXISTING_REGEXP "^.+\.itm" override
PATCH_IF SOURCE_SIZE > 0x71 BEGIN
READ_LONG 0x64 ex_off
READ_SHORT 0x68 ex_co
PATCH_IF LONG_AT 0x60 > 0 BEGIN
FOR (i = 0; i < ex_co; i += 1) BEGIN
READ_BYTE (ex_co + i * 0x38) type
PATCH_IF type == 1 || type == 2 || type == 4 BEGIN
WRITE_BYTE 0x2f (THIS & 0b00000100)
END
END
END
END
BUT_ONLY