Jump to content

Changing Priest/Mage Spells to Innates on the Fly


Recommended Posts

Posted (edited)

Particularly in kit making, there is a need to quickly and easily change spells from wizard or priest to innate abilities. One way to accomplish this is to open your spell editor of choice, copy the spell, change the spell type to innate, change the spell icon to the innate version, and also change each one of the spell effect headers to display icons as innate abilities. Then you would need to include and copy this file with your installation package.

 

In the course of the Cleric Remix mod, this issue is coming up repeatedly, and frankly, I got tired of making the same changes over and over. Another potential issue is that if another mod wants to alter the spell you're modifying, you could end up with an innate and mage version of a spell that do different damage, save penalties, etc. since the innate version is based on the modder's install, while the player's version is based off another mod.

 

The ideal solution is to use a COPY_EXISTING command and patch as you go along. The following example is one I used to change the mage spell Chain Lightning SPWI615.spl into an innate ability named C!TLCHNL.spl for the Cleric Remix mod.

 

COPY_EXISTING ~SPWI615.spl~ ~override/C!TLCHNL.spl~

  WRITE_SHORT 0x1C 4 // sets spell type to innate (4)

  WRITE_LONG 0x34 1

  READ_LONG 0x64 "offset_abil"

  READ_SHORT  0x68 "num_abil"

  READ_ASCII ("%offset_abil%" + 0x04) "bam" // reads the bam filename from ability

  WRITE_EVALUATED_ASCII 0x3A "%bam%" // writes the bam filename from abilities to spell icon

  SAY NAME1 ~blah~

  SAY NAME2 ~blah~

  SAY UNIDENTIFIED_DESC ~blah~

  SAY DESC ~blah~

  WHILE (0

    BEGIN

      WRITE_SHORT (("%offset_abil%" + 0x02) + (("%num_abil%" - 1) * 0x28)) 4 // changes ability icon location to innate (4)

      SET "num_abil" = ("%num_abil%" - 1)

    END

 

This could also be used in reverse, or to change wizard to priest spells, etc. by altering the number 4 (in bold) in the two WRITE_SHORT commands. If you wanted to alter the name and description of the spell, all of the normal SAY commands can be used with the COPY_EXISTING command. The SAY commands in this example are in gray and are entirely optional as you would only need them if you wanted to change the name and/or description of the spell.

 

The section in green is the meat of the routine. First, you read in the number of abilities and where they begin in the file. Then, you create a loop using WHILE that goes through and patches every ability with the icon location of innate (4). You need the number of abilities and their offset to determine how many times WHILE will loop and the exact offset to patch.

 

The section in purple is used to change the BAM of the spell icon and is also an optional component. By convention, every spell has three icons, named xxxxA.bam, xxxxB.bam, and xxxxC.bam. The A version is used on scrolls, the B version is what shows up in your spellbook, and the C version is displayed on the bottom bar of the game screen when selecting your spell from the "Cast Spell" or "Special Abilities" button. In this example, we're using the fact that the 'Abilities' headers of spells always use the B version of the icon, and copying the name over to the general spell. Please not that this section is specific to changing spells into innates; do not use this block if you're changing a spell into a wizard or priest spell.

 

edit: Thanks for the cleaner code, Idobek!

Edited by CamDawg
Posted

My ideal world is one in which all mods play together nicely.

 

OK, so I really did it because it save me a lot of time in spell editing. :D

Posted

I've just been doing it the old-fashioned way, as I couldn't be bothered to look up all the offsets for spells with lots of headers. :D I did it this way for Elai's spellbook though.

Posted

There are some new commands in WeiDU:

READ_ASCII ("%offset_abil%" + 0x04) "bam" // reads the bam filename from ability
WRITE_EVALUATED_ASCII 0x3A "%bam%" // writes first the bam filename from abilities to spell icon

Saves a couple of lines of code. You can't use a READ_ASCII variable in a WHILE or IF_EVAL situation though.

Posted

Right on! Thanks Idobek. I'll update the tutorial--and my code!

 

Your tutorials were what got me started with my love affair using WeiDU as a hex editor. :D

Posted
Your tutorials were what got me started with my love affair using WeiDU as a hex editor.
Well you are returning the favour. Looking at some of your code helped me solve a problem today.
Posted

As well as changing the spell type to innate you should also set the spell level to 1 (WRITE_LONG 0x34 1). Otherwise if you try to cast it via script you will crash the game. This is the reason for the Scriptable Spells mod, several vanilla innates also have this issue.

 

Why are you changing the spell icon bam? It makes no difference in-game, the icon from the ability is used. The spell icon is only used in the spell book/scroll. Another anal retentiveness example? :D

 

I really should clean up this thread.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...