Jump to content

Spell patching


Recommended Posts

This is probably fairly easy, but I haven't done it yet. How would I go about patching something in an existing spell's extended effects, like changing its projectile animation? I also want to add a lighting effect maybe. I could just copy over a modded spell but that's kind of sloppy.


Also, any idea what the "Unknown" (according to IESDP) values in the headers represent, like at 0x48 and 0x5C?

Link to comment

Well, that's the least of my concerns, but uh, thanks for the info. Why do all the spells have different values at these bytes (e.g. 262180, 262214)? I'm asking because I want to change one unused spell to be more like a different one, and they have different values there, so I'm wondering if I should change those too.

Link to comment

Do what you like to these fields, the engine doesn't ever read them though, so spend little time on them ;)


There's an awful lot of spell patching code in the fixpack to use a template; but basically you're going to be nesting two loops (I use FOR, but WHILE is fine, I do the arithmetic inside the loop definition, Cam does the arithmetic during the operations).

COPY_EXISTING ~aspell.spl~ ~override~
READ_LONG  0x64 "extended_header_offset"
READ_SHORT 0x68 "extended_header_count"
READ_LONG  0x6a "effects_offset"
FOR ("index1" = 0x0; "index1" < ("extended_header_count" * 0x28); "index1" += 0x28) BEGIN
  READ_SHORT ("extended_header_offset" + "index1" + 0x1e) "number_of_effects_this_header"
  READ_SHORT ("extended_header_offset" + "index1" + 0x20) "index_to_effects_this_header"
  READ_SHORT ("extended_header_offset" + "index1" + 0x26) "this_is_the_projectile_field"
  FOR ("index2" = ("index_to_effects_this_header" * 0x30); "index2" < (("index_to_effects_this_header" + "number_of_effects_this_header") * 0x30); "index2" += 0x30) BEGIN
	READ_SHORT ("effects_offset" + "index2" + 0x00) "opcode_for_this_effect"

Link to comment


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

  • Create New...