In the Infinity Engine games, there is the pivotally important concept of an "effect". Effects can do many different things, but examples include modification of stats, damage, playing of a sound, display of an animation, or a number of other things. These effects are identified by "type" and by several additional parameters. The valid types in BG ranged at least from 0x00 through 0xae. Whether all the intervening values were used or not is unclear, but it appears that most of them are. This section will be devoted to a detailed explanation of the general format of effects and the specific format of different types of effects.
This file is under construction. There is much information which needs to go in this file.
The basic format of an effect is as follows. Note that some of these fields are put to differing uses by different object types. The sizes of all of the fields is known to be accurate. For ease of
reference, each parameter which is referenced by the specific effects will be given a tag.
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 2 (word) | Effect type (varies by game) |
| 0x0002 | 1 (byte) | Target type |
| 0x0003 | 1 (byte) | Unknown |
| 0x0004 | 4 (dword) | Numeric parameter 1 (NP1). Purpose of field varies from effect to effect. |
| 0x0008 | 4 (dword) | Numeric parameter 2 (NP2). Purpose of field varies from effect to effect. |
| 0x000c | 2 (word) | Flags:
|
| 0x000e | 4 (dword) | Time parameter (Time). This determines either when the effect occurs, or when the effect wears off, if either of the two is applicable. Note that they are only applicable if the relevant flags in the Flags field are set. |
| 0x0012 | 1 (byte) | Probability (Prob) (Note: This field is actually a word in pre-Icewind Dale games -- i.e. 2 bytes, but since it is always <=100, they split it into two probabilities.) |
| 0x0013 | 1 (byte) | Unknown. Another probability? |
| 0x0014 | 8 (resref) | Resref parameter (Resource) |
| 0x001c | 4 (dword) | Dice count (NumDice) |
| 0x0020 | 4 (dword) | Dice sides (NumSides) |
| 0x0024 | 4 (dword) | Saving throw type (SaveType) |
| 0x0028 | 4 (dword) | Saving throw bonus (SaveBonus) |
| 0x002c | 4 (dword) | Unknown |
This section describes the behaviors which are invariant from effect to effect. Each effect, when the associated ability of an ITM or SPL is invoked, will be applied to
some target with a certain probability, given by the Prob field. Basically, a random roll between 0 and 99 is made, and if it is less than Prob for the given effect, the effect will
be invoked. When the effect is invoked, the target is given a chance to save against it according to the SaveType and SaveBonus, as well as the resistances for their particular
CRE resource. If the effect is invoked and the target fails the saving throw, then the effect actually occurs. The Flags determine when the effect begins and when
it ends. Typically an effect will either occur immediately and expire later or will be an instantaneous effect which occurs later. Frequently, delayed events are sound effects and such.
Conventions
The following conventions will be observed below for simplicity:
Flags word is equal to either 0x0001 or 0x0101 will be called a "Permanent" effect. Equivalently, this is an effect for which
(Flags & ~0x100) == 0x0001. It is clear that this is the form that the test takes in the actual Infinity Engine code.Modifies the creature's armor class. Note that all "permanent" ACs must be in the range [-20...20]; if a bonus takes a permanent AC outside this range, it will be thresholded to the limit. This doesn't appear to apply to temporary effects which wear off after a time.
| Field | Purpose/description |
|---|---|
| NP1 | Bonus value: how much is added to the particular AC to be modified |
| NP2 | Bonus type: determines which "AC" is to be modified. This must be one of { 0, 1, 2, 4, 8, 16 }.
|
| Flags | If the effect is a Permanent effect, it is applied to the permanent AC, otherwise, it is applied to the "effective" AC. |
Modifies the number of attacks per round. Upon entry here, "attacks per round" will be either in the range [0,5] or in the range (5,10]. Two types of thresholding occur in this effect, as noted below. The first, "plain thresholding" will threshold the value into [0,10], mapping negative values to 0 and values > 10 to 10. The second, "bracketed" thresholding will threshold the value into the range [0,5] if it was originally in this interval, or (5,10] if it was originally in this interval. For instance, a character with 3 attacks/round who gets a 200% bonus would have 6 attacks/round. This value would then be thresholded down to 5. Similarly, a character with 6 attacks/round who gets a penalty reducing this by 50% would have 3 attacks/round. This value would be thresholded up to 6. It will be noted below where the types of thresholding are used.
| Field | Purpose/description |
|---|---|
| NP1 | Bonus value: Numeric parameter used by the bonus modifier type |
| NP2 | Bonus type: determines how "attacks/round" is to be modified. This must be one of { 0, 1, 2 }.
|
| Flags | If the effect is a Permanent effect, it is applied to the permanent "attacks/round", otherwise, it is applied to the effective "attacks/round". |
Forces a creature's state to not include the "SLEEPING" bit. (See STATE.IDS for details on the character state bits.) This ignores the permanent flag and just removes the sleeping flag from both the permanent and the effective creature status flags.
Standby... Effects are not yet known for these games.
[ back to index ]