Jump to content

Editing caster level


Guest Guest

Recommended Posts

Guest Guest

Is it possible to create an effect to edit caster level (so that spells are cast at a higher or lower level than the character's actual level)?

 

I know there is a Wild Magic effect that seems to cause the spell to be cast at double normal level, and also iirc Wild Mages sometimes cast their spells at slightly lower or higher level than their actual level, but perhaps it is hard-coded.

Link to comment
Is it possible to create an effect to edit caster level (so that spells are cast at a higher or lower level than the character's actual level)?

I think that the last time this was tried with opcode #191 Spell: Casting Level Modifier, it didn't seem to work, so for the time being, no.

 

Perhaps Taimon could investigate whether this could be fixed.

Link to comment

Okay, here goes:

BACKUP castlvlmod
AUTHOR me

BEGIN ~Apply casting level modifier stat~
INSTALL_BY_DEFAULT

OUTER_PATCH_SAVE orig_bytes_1 ~~ BEGIN
INSERT_BYTES 0x000 0x48
WRITE_LONG   0x000 0x7e01f883
WRITE_LONG   0x004 0xbc4d8b43
WRITE_LONG   0x008 0x6412b983
WRITE_LONG   0x00c 0x74000000
WRITE_LONG   0x010 0xbc558b0e
WRITE_LONG   0x014 0x0b0ac281
WRITE_LONG   0x018 0x55890000
WRITE_LONG   0x01c 0x8b0bebe4
WRITE_LONG   0x020 0xc205bc45
WRITE_LONG   0x024 0x89000013
WRITE_LONG   0x028 0x4d8be445
WRITE_LONG   0x02c 0x1cc183bc
WRITE_LONG   0x030 0xac435ee8
WRITE_LONG   0x034 0x4d8b50ff
WRITE_LONG   0x038 0x435ee8e4
WRITE_LONG   0x03c 0xff25ffb2
WRITE_LONG   0x040 0x89000000
WRITE_LONG   0x044 0x07ebb845
END

OUTER_PATCH_SAVE patch_bytes_1 ~~ BEGIN
INSERT_BYTES 0x000 0x48
WRITE_LONG   0x000 0x0fe84d8b
WRITE_LONG   0x004 0x00d091be
WRITE_LONG   0x008 0xc2030000
WRITE_LONG   0x00c 0x7e01f883
WRITE_LONG   0x010 0xb8458937
WRITE_LONG   0x014 0x909039eb
WRITE_LONG   0x018 0x90909090
WRITE_LONG   0x01c 0x90909090
WRITE_LONG   0x020 0x90909090
WRITE_LONG   0x024 0x90909090
WRITE_LONG   0x028 0x90909090
WRITE_LONG   0x02c 0x90909090
WRITE_LONG   0x030 0x90909090
WRITE_LONG   0x034 0x90909090
WRITE_LONG   0x038 0x90909090
WRITE_LONG   0x03c 0x90909090
WRITE_LONG   0x040 0x90909090
WRITE_LONG   0x044 0x90909090
END

OUTER_PATCH_SAVE orig_bytes_2 ~~ BEGIN
INSERT_BYTES 0x000 0x48
WRITE_LONG   0x000 0x7e01f883
WRITE_LONG   0x004 0xbc558b43
WRITE_LONG   0x008 0x6412ba83
WRITE_LONG   0x00c 0x74000000
WRITE_LONG   0x010 0xbc458b0d
WRITE_LONG   0x014 0x000b0a05
WRITE_LONG   0x018 0xdc458900
WRITE_LONG   0x01c 0x4d8b0ceb
WRITE_LONG   0x020 0xc2c181bc
WRITE_LONG   0x024 0x89000013
WRITE_LONG   0x028 0x4d8bdc4d
WRITE_LONG   0x02c 0x1cc183bc
WRITE_LONG   0x030 0xac42bbe8
WRITE_LONG   0x034 0x4d8b50ff
WRITE_LONG   0x038 0x4408e8dc
WRITE_LONG   0x03c 0xff25ffb2
WRITE_LONG   0x040 0x89000000
WRITE_LONG   0x044 0x07ebb445
END

OUTER_PATCH_SAVE patch_bytes_2 ~~ BEGIN
INSERT_BYTES 0x000 0x48
WRITE_LONG   0x000 0x0fe04d8b
WRITE_LONG   0x004 0x00ce91be
WRITE_LONG   0x008 0xc2030000
WRITE_LONG   0x00c 0x7e01f883
WRITE_LONG   0x010 0xb4458937
WRITE_LONG   0x014 0x909039eb
WRITE_LONG   0x018 0x90909090
WRITE_LONG   0x01c 0x90909090
WRITE_LONG   0x020 0x90909090
WRITE_LONG   0x024 0x90909090
WRITE_LONG   0x028 0x90909090
WRITE_LONG   0x02c 0x90909090
WRITE_LONG   0x030 0x90909090
WRITE_LONG   0x034 0x90909090
WRITE_LONG   0x038 0x90909090
WRITE_LONG   0x03c 0x90909090
WRITE_LONG   0x040 0x90909090
WRITE_LONG   0x044 0x90909090
END

COPY bgmain.exe bgmain.exe
READ_ASCII 0x00551511 target_bytes_1 ELSE 0 (0x48)
READ_ASCII 0x005515b4 target_bytes_2 ELSE 0 (0x48)
PATCH_IF (~%target_bytes_1%~ STRING_EQUAL ~%orig_bytes_1%~)
	 AND (~%target_bytes_2%~ STRING_EQUAL ~%orig_bytes_2%~)
THEN BEGIN
	WRITE_ASCIIE 0x00551511 ~%patch_bytes_1%~ (0x48)
	WRITE_ASCIIE 0x005515b4 ~%patch_bytes_2%~ (0x48)
END ELSE
PATCH_IF (~%target_bytes_1%~ STRING_EQUAL ~%patch_bytes_1%~)
	 AND (~%target_bytes_2%~ STRING_EQUAL ~%patch_bytes_2%~)
THEN BEGIN
	PATCH_PRINT ~Patch already applied. Skipping ...~
END ELSE INNER_ACTION BEGIN FAIL ~Target bytes don't match. Aborting ...~ END
BUT_ONLY

 

Should work in most cases, but the real testing is up to you guys.

 

Param1 of the effect is only a byte value.

Link to comment

bigg: You know how lazy I am, when it comes to testing - so I'd suggest you wait until someone tested this. :)

(And this is patched ToB only.)

 

guest: The effect already works like that, but the two stats aren't used in the game. That's what I'm trying to change with this patch.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...