Sly Posted May 5, 2020 Share Posted May 5, 2020 Is there a mod or tweak that allows disabling guaranteed misses on Nat 1s and guaranteed hits on Nat 20s? If not, would it be possible to make that tweak or is it hard-coded? Quote Link to comment
Sly Posted May 7, 2020 Author Share Posted May 7, 2020 Managed to piece it together using opcodes 301 and 362. Thanks to CamDawg for providing the TP2 code template for patching effects. To remove guaranteed hits on Nat 20s (or 18, 19, depending on crit range) [Will also remove crits altogether]: COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~ READ_BYTE 0x33 fx_flag READ_LONG 0x2c4 fx_off READ_LONG 0x2c8 fx_num WRITE_LONG 0x2c8 (fx_num + 1) // fix offsets after inserted effects PATCH_FOR_EACH offset IN 0x2a0 0x2a8 0x2b0 0x2b8 0x2bc BEGIN READ_LONG offset offset_val PATCH_IF (fx_off <= offset_val) BEGIN WRITE_LONG offset (offset_val + 0x30 + (fx_flag * 0xd8)) END END INSERT_BYTES fx_off (0x30 + (fx_flag * 0xd8)) WRITE_SHORT (fx_off + (fx_flag * 0x08)) 301 WRITE_BYTE (fx_off + 0x02 + (fx_flag * 0x0a)) 1 WRITE_LONG (fx_off + 0x04 + (fx_flag * 0x10)) 0xfffffffd WRITE_BYTE (fx_off + 0x0c + (fx_flag * 0x10)) 9 WRITE_BYTE (fx_off + 0x12 + (fx_flag * 0x12)) 100 BUT_ONLY and to remove guaranteed misses on Nat 1s: COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~ READ_BYTE 0x33 fx_flag READ_LONG 0x2c4 fx_off READ_LONG 0x2c8 fx_num WRITE_LONG 0x2c8 (fx_num + 1) // fix offsets after inserted effects PATCH_FOR_EACH offset IN 0x2a0 0x2a8 0x2b0 0x2b8 0x2bc BEGIN READ_LONG offset offset_val PATCH_IF (fx_off <= offset_val) BEGIN WRITE_LONG offset (offset_val + 0x30 + (fx_flag * 0xd8)) END END INSERT_BYTES fx_off (0x30 + (fx_flag * 0xd8)) WRITE_SHORT (fx_off + (fx_flag * 0x08)) 362 WRITE_BYTE (fx_off + 0x02 + (fx_flag * 0x0a)) 1 WRITE_LONG (fx_off + 0x04 + (fx_flag * 0x10)) 0xffffffff WRITE_BYTE (fx_off + 0x0c + (fx_flag * 0x10)) 9 WRITE_BYTE (fx_off + 0x12 + (fx_flag * 0x12)) 100 BUT_ONLY Cheerios! Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.