SPL file

Description

This file describes any spells or character abilities which operate in a similar manner to spells. Innate abilities and such are handled via these files, as are priest and mage spells. In composition, this file is very, very similar to the ITM file format. It seems likely that some cut-n-paste coding occurred during the creation of the SPL module. (Or the ITM module.) The physical appearance of the two editors is quite similar, the spell editor looking a lot like the item editor minus a bunch of options which are only relevant to items. Glance over the list of offsets and types in the ITM file and compare to the offsets and types here. The purpose of some of these fields may never actually be established, since some of them are not actually used in any items in the games we have available to us. Most notable among these are the 2 blank resrefs, which are recognizable as resrefs only because thanks to the wonders of uninitialized data buffers, the editors used in creating these games typically leave one of a handful of easily recognizable signatures when writing an "empty" resref.

SPL file versions

SPL V1

Overall structure

SPL V1 Header

OffsetSize (datatype)Description
0x00004 (char array)Signature ('SPL ')
0x00044 (char array)Version ('V1 ')
0x00084 (strref)Spell name (generic)
0x000c4 (strref)Spell name (identified) (See! This doesn't make much sense, since spells don't need to be identified. But it's present in spells and in items. Weird, huh?)
0x00108 (resref)Casting sound effect
0x00184 (dword)Unknown
0x001c2 (word)Spell type (1=wizard, 2=priest, 4=innate)
0x001e4 (dword)Unknown
0x00222 (word)Unknown
0x00242 (word)Minimum level requirement
0x00262 (word)Minimum strength requirement
0x00282 (word)Minimum strength bonus requirement
0x002a2 (word)Minimum intelligence requirement
0x002c2 (word)Minimum dexterity requirement
0x002e2 (word)Minimum wisdom requirement
0x00302 (word)Minimum constitution requirement
0x00322 (word)Minimum charisma requirement
0x00344 (dword)Spell level
0x00382 (word)Unknown
0x003a8 (resref)Spell Icon (BAM resource)
0x00422 (word)Unknown
0x00448 (resref)Unknown
0x004c4 (dword)Unknown
0x00504 (dword)Spell description (generic)
0x00544 (dword)Spell description (identified)
0x00588 (resref)Unknown
0x00604 (dword)Unknown
0x00644 (dword)Ability structs offset
0x00682 (word)Ability structs count
0x006a4 (dword)Effect structs offset
0x006e2 (word)Unknown. Could be index of first "global" (i.e. not attached to a specific ability) effect structs
0x00702 (word)Count of "global" (i.e. not attached to a specific ability) effect structs

SPL V1 Abilities

The "abilities" of a spell most likely have a different function from the "abilities" of an item. It appears that the abilities of a spell are primarily used to allow a spell to have a different effect based on the level of the caster. This does not necessarily mean that they are different. Perhaps it is possible to write a spell which can be cast in more than one way. Anyway...

OffsetSize (datatype)Description
0x00001 (byte)Ability "type"?
0x00011 (byte)Unknown. ("item must be identified before ability can be used" is in this location for items...)
0x00022 (word)Unknown
0x00048 (resref)BAM icon to represent this ability wherever it needs to be displayed in the GUI
0x000c2 (word)Selectable target type for this ability:
  • 1: living actor
  • 2: inventory
  • 3: dead actor
  • 4: any point within range
  • 5: caster
  • other values?
0x000e2 (word)Range for this ability
0x00102 (word)Minimum caster level for which this ability is used.
0x00122 (word)Casting speed for this ability?
0x00142 (word)To-hit bonus for this ability?
0x00162 (word)Number of sides on damage dice to be rolled for this ability
0x00182 (word)Number of damage dice to be rolled for this ability
0x001a2 (word)"Enchanted" (i.e. constant bonus added to hit dice)?
0x001c2 (word)Damage type:
  • 0: none?
  • 1: piercing (also appears to be set for some magical attacks, though it is likely ignored in these cases -- i.e. damage specified as 0d6+0)
  • 2: crushing
  • 3: slashing
  • 4: missile
0x001e2 (word)Number of attached Effect structs for this ability. Note that not all abilities are designed in terms of effects. For instance, standard weapon damage doesn't require any effects, since it is just a to-hit bonus, a die specification, a damage bonus, and a damage type.
0x00202 (word)Index of first attached Effect structs for this ability.
0x00222 (word)Unknown.
0x00242 (word)Unknown.
0x00262 (word)Projectile type. (Pre-BG2, these were all hardcoded; according to Dmitry Jemerov, there were 296 hard-coded types as of IWD. In BG2, some types are still hardcoded, but they are first looked up in the VEFPROJ.IDS and PROJECTL.IDS files. The PROJECTL.IDS file maps the id to .PRO file, which describes projectiles. The VEFPROJ.IDS file presumably maps the id to a .VEF file, which describes a 'visual effect', presumably using the new 3D OpenGL stuff. The precise function of this file is unknown though, since it is empty in BG2.)

[ back to index ]