Jump to content

Spell Tables: IWD1 vs. IWD2

Recommended Posts

Sorry for flogging this so hard. I couldn't find any docs on the web that explained this explicitly. Anyway, here goes:



I was just trying to figure out how spell tables are determined by the engine for priests (and for sorc/wiz in IWD2).


IWD1 (and bg2 etc) I think do this. Please correct me if I'm wrong as I'm just trying to figure this stuff out:


The engine looks at the SPELLS.2DA table and find the column for the current level. The single number in that column determins the highest spell resource number to include in the spell book. It then finds all SPL resources starting from "01" and incrementing up to that maximum number (apparently SPL resources can be missing within this range). If the character doesn't match the "Priest Type" field of an SPL or if they do match one of the exclusions flags, then the SPL is skipped.


The SPL resource names are constucted like this:




So for example a lawful-good cleric has for 4th level spells a maximum res## of 24 (in SPELLS.2DA). So we would scan through all these resources:







SPPR402 would be skipped because it's a Druid/Ranger spell (we would skip 7 more like this), SPPR416 (cause serious wounds) is excluded for "Good" (and 2 others) and SPPR415 (blood rage) is excluded for "Lawful". SPPR424 doesn't exist.


I think that Wizard spells are mainly determined by whatever scroll you happen to pick up. There could be any SPL resource in a scroll for you to memorize (and Sorc's don't exist in iwd1). However, it looks as though the same convention is still followed. The SPELLS.2DA file does give a maximum spell number and the file names can be constructed using SPWI<level#><res##>.


IWD2 is a bit simpler


It looks like the file LISTSPLL.2DA gives a mapping from each spell resource to each class and level. There is an additional LISTMAGE.2DA which gives the spell exclusions for specialist mages. There's also a LISTDOMN.2DA which I think is for determining cleric domain spells, but it might also be for determining domain restrictions (or both? The class that isn't restricted gets an extra one for their domain spell?). Either that or they use the same bit field as iwd1 (even though the SPL resource is a different version, there's a bit field at the same offset which apears to be used for something. That is, I did see that it was set differently for "Holy Word" and "Blasphemy" but was zeroed out in most other cases).

Link to comment


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

  • Create New...