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.
Overall structure
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 4 (char array) | Signature ('SPL ') |
| 0x0004 | 4 (char array) | Version ('V1 ') |
| 0x0008 | 4 (strref) | Spell name (generic) |
| 0x000c | 4 (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?) |
| 0x0010 | 8 (resref) | Casting sound effect |
| 0x0018 | 4 (dword) | Unknown |
| 0x001c | 2 (word) | Spell type (1=wizard, 2=priest, 4=innate) |
| 0x001e | 4 (dword) | Unknown |
| 0x0022 | 2 (word) | Unknown |
| 0x0024 | 2 (word) | Minimum level requirement |
| 0x0026 | 2 (word) | Minimum strength requirement |
| 0x0028 | 2 (word) | Minimum strength bonus requirement |
| 0x002a | 2 (word) | Minimum intelligence requirement |
| 0x002c | 2 (word) | Minimum dexterity requirement |
| 0x002e | 2 (word) | Minimum wisdom requirement |
| 0x0030 | 2 (word) | Minimum constitution requirement |
| 0x0032 | 2 (word) | Minimum charisma requirement |
| 0x0034 | 4 (dword) | Spell level |
| 0x0038 | 2 (word) | Unknown |
| 0x003a | 8 (resref) | Spell Icon (BAM resource) |
| 0x0042 | 2 (word) | Unknown |
| 0x0044 | 8 (resref) | Unknown |
| 0x004c | 4 (dword) | Unknown |
| 0x0050 | 4 (dword) | Spell description (generic) |
| 0x0054 | 4 (dword) | Spell description (identified) |
| 0x0058 | 8 (resref) | Unknown |
| 0x0060 | 4 (dword) | Unknown |
| 0x0064 | 4 (dword) | Ability structs offset |
| 0x0068 | 2 (word) | Ability structs count |
| 0x006a | 4 (dword) | Effect structs offset |
| 0x006e | 2 (word) | Unknown. Could be index of first "global" (i.e. not attached to a specific ability) effect structs |
| 0x0070 | 2 (word) | Count of "global" (i.e. not attached to a specific ability) effect structs |
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...
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 1 (byte) | Ability "type"? |
| 0x0001 | 1 (byte) | Unknown. ("item must be identified before ability can be used" is in this location for items...) |
| 0x0002 | 2 (word) | Unknown |
| 0x0004 | 8 (resref) | BAM icon to represent this ability wherever it needs to be displayed in the GUI |
| 0x000c | 2 (word) | Selectable target type for this ability:
|
| 0x000e | 2 (word) | Range for this ability |
| 0x0010 | 2 (word) | Minimum caster level for which this ability is used. |
| 0x0012 | 2 (word) | Casting speed for this ability? |
| 0x0014 | 2 (word) | To-hit bonus for this ability? |
| 0x0016 | 2 (word) | Number of sides on damage dice to be rolled for this ability |
| 0x0018 | 2 (word) | Number of damage dice to be rolled for this ability |
| 0x001a | 2 (word) | "Enchanted" (i.e. constant bonus added to hit dice)? |
| 0x001c | 2 (word) | Damage type:
|
| 0x001e | 2 (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. |
| 0x0020 | 2 (word) | Index of first attached Effect structs for this ability. |
| 0x0022 | 2 (word) | Unknown. |
| 0x0024 | 2 (word) | Unknown. |
| 0x0026 | 2 (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 ]