EFF file format
Applies to:
BG1: TotS, BG2, BG2: ToB, IWD, IWD:HoW, IWD:TotL
General Description
This file format describes an effect (opcode) and its parameters. The format is an extended version of that found embedded in creatures, items and spells, and is a replacement for the version 1 embedded effects used in BG1. The engine appears to roll a probability for each valid target type, rather than one probability per attack.
| Offset | Size (data type) | Description |
|---|---|---|
| 0x0000 | 4 (char array) | Signature ('EFF ') |
| 0x0004 | 4 (char array) | Version ('V2.0') |
When an effect is called via an eff, several of the fields (including duration and timing mode) are overriden by the calling SPL/ITM. Other fields are copied directly from the calling SPL/ITEM and overwrite the values defined in the EFF.
| Offset | Size (data type) | Description |
|---|---|---|
| 0x0008 | 4 (char array) | External EFFs - the field is the same as the signature field from the header Embedded EFFs - this field is zeroed out |
| 0x000c | 4 (char array) | External EFFs - the field is the same as the version field from the header Embedded EFFs - this field is zeroed out |
| 0x0010 | 4 (dword) | Opcode number |
| 0x0014 | 4 (dword) | Target type
|
| 0x0018 | 4 (dword) | Power |
| 0x001c | 4 (dword) | Parameter 1 |
| 0x0020 | 4 (dword) | Parameter 2 |
| 0x0024 | 2 (word) | Timing mode
|
| 0x0026 | 2 (word) | Timing ? |
| 0x0028 | 4 (dword) | Duration |
| 0x002c | 2 (word) | Probability 1 |
| 0x002e | 2 (word) | Probability 2 Note: The BG1 engine treats probability as a single word, effects are applied in the range 0-probability. Note: Other engines treat probability as two values, effects are applied in the range probability <= x <= probability. Probability range is 0-99 |
| 0x0030 | 8 (resref) | Resource |
| 0x0038 | 4 (dword) | Dice Thrown |
| 0x003c | 4 (dword) | Dice Sides |
| 0x0040 | 4 (dword) | Saving throw type
|
| 0x0044 | 4 (dword) | Save bonus |
| 0x0048 | 4 (dword) | Set local variable only if non-existant |
| 0x004c | 4 (dword) | Primary type (school) |
| 0x0050 | 4 (dword) | Unknown |
| 0x0054 | 4 (dword) | Parent resource lowest affected level |
| 0x0058 | 4 (dword) | Parent resource highest affected level |
| 0x005c | 4 (dword) | Resistance The default behaviour is that effects cannot be dispelled and ignore resistance.
This can also be presented in the more traditional way:
|
| 0x0060 | 4 (dword) | Parameter 3 |
| 0x0064 | 4 (dword) | Parameter 4 |
| 0x0068 | 8 (resref) | Resource 2 |
| 0x0070 | 8 (resref) | Parameter 5 (VVC) (aka Resource 3) |
| 0x0078 | 4 (dword) | Unknown |
| 0x007c | 4 (dword) | Unknown |
| 0x0080 | 4 (dword) | Caster X coordinate |
| 0x0084 | 4 (dword) | Caster Y coordinate |
| 0x0088 | 4 (dword) | Target X coordinate |
| 0x008c | 4 (dword) | Target Y coordinate |
| 0x0090 | 4 (dword) | Parent resource type (0=None, 1=Spell, 2=Item) |
| 0x0094 | 8 (resref) | Parent resource |
| 0x009c | 4 (dword) | Parent resource flags (from SPL 0x18 or ITM ext header 0x26) |
| 0x00a0 | 4 (dword) | Projectile |
| 0x00a4 | 4 (dword) | Parent resource slot |
| 0x00a8 | 32 (bytes) | Variable |
| 0x00c8 | 4 (dword) | Caster level |
| 0x00cc | 4 (dword) | FirstApply (internal flag) |
| 0x00d0 | 4 (dword) | Secondary Type |
| 0x00d4 | 4*15 (dword) | Unknown |