--- title: "SPL file format" regenerate: true --- {% include relurl.html %}
SPL file format

Applies to:
BG1, BG1: TotS, BG2, BG2: ToB, PST, IWD, IWD:HoW, IWD:TotL, BGEE

General Description
This file format describes a "spell". Spells include mage spells, priest spells, innate abilities, special abilities and effects used for game advancement (e.g. animation effects, custom spells). SPL files have a similar structure to ITM files.

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

Detailed Description
SPL files consist of a main header, zero or more extended headers (each containing zero or more feature blocks) and zero or more casting feature blocks. All the feature blocks are stored as a continuous data segment, with each extended header containing an offset into this data, and the main header containing an offset into this data for the casting feature blocks.

Overall structure:
  • Header
  • Extended Headers
  • Feature Blocks

  • {% assign offset_header_name = "splv1_Header" %} {% assign offset_header_display_name = "Header" %} {% assign offsets = site.data.file_formats.spl_v1.header %} {% include offset_table.html %} {% assign offset_header_name = "splv1_Extended_Header" %} {% assign offset_header_display_name = "Extended Header" %} {% assign offset_header_desc = "Extended headers represent the effects of a spell on the target. Multiple extended headers can be set in a spell, to allow the spell to use effects based on the level of the caster. Extended headers should be in the file in order of increasing level" %} {% assign offsets = site.data.file_formats.spl_v1.extended_header %} {% include offset_table.html %} {% assign offset_header_name = "splv1_Feature_Block" %} {% assign offset_header_display_name = "Feature Block" %} {% assign offset_header_desc = "Any action carried out by a spell is done by feature blocks, each of which holds an effect number as well as targetting and timing information. The engine appears to roll a probability for each valid target type, rather than one probability per attack." %} {% assign offsets = site.data.file_formats.spl_v1.feature_block %} {% include offset_table.html %}

    Header Flags

    Bit Byte 1 Byte 2 Byte 3 Byte 4
    0 Unknown Unknown Not in combat Can target invisible (BGEE, TobEx)
    1 Unknown Breaks Sanctuary / Invisibility (EE games) Unknown Castable when silenced (BGEE, TobEx)
    2 Unknown Hostile Unknown Unknown
    3 Unknown No LOS required Unknown Unknown
    4 Unknown Allow spotting Unknown Unknown
    5 Unknown Outdoors only Unknown Unknown
    6 Unknown Ignore dead-magic and wild surge effect Unknown Unknown
    7 Unknown Ignore wild surge effect (i.e. trigger/contingency) Unknown Unknown
    *This means that creatures protected by Minor Globe of Invulnerability can safely cast, say, Fireball at their feet without taking damage.

    Exclusion Flags

    bit 0: Exclude Chaotic priests. (BG2 & HoW)
    bit 1: Exclude Evil priests. (BG2 & HoW)
    bit 2: Exclude Good priests. (BG2 & HoW)
    bit 3: Exclude GENeutral priests. (BG2 & HoW)
    bit 4: Exclude Lawful priests. (BG2 & HoW)
    bit 5: Exclude LCNeutral priests. (BG2 & HoW)
    bit 6: Exclude Abjurers
    bit 7: Exclude Conjurers
    bit 8: Exclude Diviners
    bit 9: Exclude Enchanters
    bit 10: Exclude Illusionists
    bit 11: Exclude Invokers
    bit 12: Exclude Necromancers
    bit 13: Exclude Transmuters
    bit 14: Wild Magic (exclude Generalists) (BG2)
    bit 15 - 29: Unused
    bit 30: Exclude Cleric/Paladin
    bit 31: Exclude Druid/Ranger

    NB.Alignment and School exclusion bits cannot be combined.

    Casting Graphics

    BG1,BG2,IWD
    00
        ...No animation
    08
    09 Necromancy
    10 Alteration
    11 Enchantment
    12 Abjuration
    13 Illusion
    14 Conjuration
    15 Invocation
    16 Divination
    17 White sparks
    18 Black sparks
    19 White sparks
    20 White sparks
    21 White sparks
    22 White -> red sparks
    23 White -> purple/red sparks
    24 White -> red sparks
    26 White sparks
    32 White sparks
    34 White sparks
    56461 No animation
    65535 No animation

    NB. The 'spark' entries are related to sprklclr.2da (and probably opcode #41)

    PST
    35: Abjuration
    36: Alteration
    37: Conjuration
    38: Enchantment
    39: Divination
    40: Illusion
    41: Invocation
    42: Necromancy
    44: Special (Innate) Skill