Structs List


 
Structs List
Item File Description
Spell File Description
Hex Glossary
Appendices


 
 
FileExtension : SPL
Content : Spell Definitions

Header: Size=114 Bytes
Ext. Header: Size= 40 Bytes
Feature Block: Size=48 Bytes

Header:

Every spell file contains a header. It contains the basic properties of the spell represented by the file.
 

Offset Size Description
0000h 0004h FileType
0004h 0004h FileRevision
0008h 0004h SpellNameReference
000Ch 0004h Not Used
0010h 0008h ????
0018h 0002h ????
001Ah 0002h ????
001Ch 0002h ????
001Eh 0004h ????
0022h 0001h School
0024h 0002h ????
0026h 0002h ????
0028h 0002h ????
002Ah 0002h ????
002Ch 0002h ????
002Eh 0002h ????
0030h 0002h ????
0032h 0002h ????
0034h 0004h SpellLevel
0038h 0002h ????
003Ah 0008h SpellBookIcon
0042h 0002h ????
0044h 0008h ????
004Ch 0004h ????
0050h 0004h DescriptionReference
0054h 0004h Not Used
0058h 0008h ????
0060h 0004h ????
0064h 0004h ExtendedHeaderOffset
0068h 0002h ExtendedHeaderCount
006Ah 0004h FeatureTableOffset

 

Extended Header:

One Extended Header equals one ability of an Spell.
 

0000h 0004h SpellType
0004h 0008h SpellBarIcon
000Ch 0002h ????
000Eh 0002h ????
0010h 0002h CasterLevel
0012h 0004h CastingTime
0016h 0002h ????
0018h 0002h ????
001Ah 0002h ????
001Ch 0002h ????
001Eh 0002h EffectCount
0026h 0001h SpecialGraphic
0027h 0001h ????

 

Feature Block:

A spells magical capabilities come from one or more feature blocks
Every Feature Block provides a specific effect.
 

Offset Size Description
0000h 0001h Feature/Effect
0001 0001h ????
0002h 0001h TargetIdentifier
0003h 0001h ????
0004h 0004h Parameter 1
0008h 0004h Parameter 2
000Ch 0001h EffectTimeMode
000Dh 0001h ????
000Eh 0004h EffectTime
0012h 0002h Probability
0014h 0008h FileName
001Ch 0004h Throws
0020h 0004h DiceSides
0024h 0004h SavingThrowType
0028h 0004h SavingThrowBonus
002Ch 0004h ????


Header:

FileType:
 

Offset Size Data Type Default Data 
0000h 0004h FileType Array[0..3] Of Char 'SPL '

This field contains the type of data file. It should be the same as the file extension.
 

FileRevision:
 

Offset Size Data Type Default Data 
0004h 0004h FileRevision Array[0..3] Of Char 'V1 ' or 'V1.0'

Revision of the data file. In BG I've only found 'V1.x' files, but this may change with future expansions.
 

SpellNameReference:
 

Offset Size Data Type Default Data 
0008h 0004h SpellNameReference Longint FFFFh for none

This is the reference to the name of the spell.
The reference is the index of the name string contained in Dialog.tlk file.
 

School:
 

Offset Size Data Type Default Data 
0022h 0001h PaperdollItem Byte  00h

This field specifies the school the spell belongs to:
 

Value(ASCII) Value(Hex) Description
" " 00h <none>Unspecified/Schoolless
" " 09h Necromancy
" " 0Ah Alteration
" " 0Bh Enchantment/Charm
" " 0Ch Abjuration
" " 0Dh Illusion/Phantasm
" " 0Eh Cunjuratio/Summoning
" " 0Fh Invocation
" " 10h Divination
" " 18h Evocation

SpellLevel:
 

Offset Size Data Type Default Data 
0034h 0004h SpellLevel Longint  

Contains the casting level of spell.
 

SpellBookIcon:
 

Offset Size Data Type Default Data 
003Ah 0008h InventoryIcon Array[0..7] Of Char  

File name of the BAM file that contains the Spell Book Icon.
 

DescriptionReference:
 

Offset Size Data Type Default Data 
0050h 0004h DescriptionReference Longint FFFFh for none

This is the reference to the spell description.
The reference is the index of the name string contained in Dialog.tlk file.
 

ExtendedHeaderOffset:
 

Offset Size Data Type Default Data 
0064h 0004h ExtendedHeaderOffset Longint  

Offset of the start of the first extended header found in the Spell file.

ExtendedHeaderCount:
 

Offset Size Data Type Default Data 
0068h 0002h ExtdendedHeaderCount Word  

Some spell files may actually contain more than one Extended Header..
 

FeatureTableOffset:
 

Offset Size Data Type Default Data 
006Ah 0004h FeatureTableOffset Longint  

Offset of the first Feature Block.

Extended Header:

SpellType:
 
Offset Size Data Type Default Data 
0000h 0004h SpellType Byte  

This field determines the type of Spell:
 

Value Data
0100 0400h Innate Ability
0200 0200h Wizard Spell
0100 0200h Priest Spell

SpellBarIcon:
 

Offset Size Data Type Default Data 
0004h 0008h Target Array[0..7] Of Char  

File name of the BAM file that contains the Spell Bar Icon.
 

CasterLevel:
 

Offset Size Data Type Default Data 
0010h 0002h CasterLevel Word  

Level at which caster must be for this Extended Header to apply.
 

CastingTime:
 

Offset Size Data Type Default Data 
0012h 0004h CastingTime Longint  

This field specifies the time it takes the user to cast the spell.
 

EffectCount:
 

Offset Size Data Type Default Data 
001Eh 0002h EffectCount Word  

Number of structs used for this extended header.

SpecialGraphic:
 

Offset Size Data Type Default Data 
001Eh 0002h SpecialGraphic Byte  

Special Graphic if "missle weapon".
 

Feature Block:

Feature:
 

Offset Size Data Type Default Data 
0000h 0002h Feature/Effect Word  


TargetIdentifier:
 

Offset Size Data Type Default Data 
0002h 0002h TargetIdentifier Word  

TaregetIdentifier deetermines the target of this effect
 

Parameter 1:
 

Offset Size Data Type Default Data 
0004h 0004h Parameter 1 Longint  

Parameter 1 is a Parameter passed to the Feature/Effect function.
Most of the time it contains the modification value of a Feature/Effect.
 

Parameter 2:
 

Offset Size Data Type Default Data 
0008h 0004h Parameter 2 Longint/Bitfield  

Parameter 2 Is The Second Parameter passed to the Feature/Effect function.
Most of the time it contains the mode of Parameter 1(%, Absolute, Relative.....).
 

EffectTimeMode:
 

Offset Size Data Type Default Data
000Ch 0001h EffectTimeMode Byte  

This field sets the timemode of the item and the EffectTimeField
 

Value Start of Effect Duration
0 Instantly For [EffecTime] Seconds
1 Instantly Permanent
2 Instantly While equiped
4 After [EffecTime] Seconds Permanent

EffectTime:
 

Offset Size Data Type Default Data 
000Eh 0004h EffectTime Longint  

EffectTime contains a time value for the Effect.
Game time in Rounds = EffectTime / 60
 

Probability:
 

Offset Size Data Type Default Data 
0012h 0002h Probability Word  

This field contains the probability of this Effect to happen. It's value can go from 0 to 100.
0 The Effect never happens, 100 The Effect always happens. Values greater than 100 are taken as 100.
 

FileName:
 

Offset Size Data Type Default Data 
0014h 0008h FileName Array[0..7] Of Char  

FileName is another Paremeter passed to the Effect/Feature function.
Some functions like make sound use it to specify the sound file played.
 

Throws:
 

Offset Size Data Type Default Data 
0001Ch 0004h Throws Longint  

This field only matters for dice based Effects.
 

DiceSides:
 

Offset Size Data Type Default Data 
00020h 0004h DiceSides Longint  

This field only matters for dice based Effects.
 

SavingThrowType:
 

Offset Size Data Type Default Data 
00024h 0004h SavingThrowType Longint  

This field determines the type of saving throw that must be made to avoid Effect.
 

SavingThrowBonus:
 

Offset Size Data Type Default Data 
00028h 0004h SavingThrowBonus Longint  

This field determines the bonus to the saving throw that must be made to avoid Effect.
 

This File Is Not Complete Nor Error Free.