BG(2)EE Opcodes


#0 (0x0) Stat: AC vs. Damage Type Modifier Variants: IWD2
Parameter #1: AC Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'AC Modifier' field to the category specified by the 'Type' field.

Known values for 'Type' are:
0 All
1 Crushing
2 Missile
4 Piercing
8 Slashing
16 Base AC setting (sets the targets AC to the value specified by the 'AC Modifier' field. If the targets AC is already 'AC Modifier' or below, this effect will do nothing).

Each modifier type to AC from this opcode is capped to the range [-20, 20]. Each AC type total is capped to the range [-32768,32767].

Note: IWD1 and PST use a slightly different version. The “Base AC” sets to field - 1 instead.
IWD2 uses different parameters altogether.

#1 (0x1) Stat: Attacks Per Round Modifier Variants: BG1
Parameter #1: Key Modifier
Parameter #2: Type
Description:
Alters a characters Attacks per Round, by changing the Key by the modifier value specified by the 'Key Value' field, in the style specified by 'Type' field.
Key Attacks Per Round
0 0
1 1
2 2
3 3
4 4
5 5
6 0.5
7 1.5
8 2.5
9 3.5
10 4.5

Known values for 'Type' are:
0 Cumulative Modifier -> Key = Key + 'Key Modifier' value
1 Flat Value Modifier -> Key = 'Key Modifier' value
2 Percentage Modifier -> Key = (Key * 'Key Modifier' value) / 100
3 Final Value Modifier -> Key = 'Key Modifier' value
Info: When this opcode is stacked, the number of attacks are stacked, not the values of the Key Modifier.
Note: Param#1 can take negative values. These values match their positive counterparts (e.g., “-6” corresponds to “-0.5”).
Note: IWD1 treats all keys above 5 as 5. PST does not support Type 3, while BG(2)EE uses it differently.

#2 (0x2) Cure: Sleep
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes opcode #39 effects and the STATE_SLEEPING flag from the targeted creature(s).
This effect ignores durations attributed to it.
Note: Does not remove the STATE_HELPLESS flag.
Note: At least in EEs, it can remove opcode #177 effects targeting an EFF with opcode #39. Does not always work when delayed.

#3 (0x3) State: Berserking Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Applies the berserk effect to the targeted creature(s) in the style specified by the 'Type' field.
Target will uncontrollably attack enemies if any are in view, and will occasionally attack neutral creatures.
Known values for 'Type' are:
0 Default/In Combat -> Only berserk while in combat.
1 Constant -> always berserk, sets SPELLSTATE 39 - ANIMAL_RAGE (only in EEs).
2 Blood Rage -> this is probably not implemented. It should be linked to SPELLSTATE 35 - SUPPRESS_HP_INFO. (only in EEs)

The affected creature becomes berserk and its AI scripts stop running. Grants a +2 bonus to hit and damage with all weapons. It also sets the STATE_BERSERK flag.

Note: Forces creature(s) to use a melee weapon if possible.
Note: This effect only affects party members.
Note: The second paragraph hasn’t been verified for PST and BG1 yet, but likely holds.
Important: Used with timing modes 1/4/7 results in setting STATE_BERSERK when it triggers (and using its default behavior), rather than attaching a removable effect with selected behavior.

#4 (0x4) Cure: Berserking
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes opcode #3 effects and STATE_BERSERK from the targeted creature(s). Does not remove opcode #245, opcode #246 and opcode #247 effects.
This effect ignores durations attributed to it.
Important: Both parameters should be 0 (zero).
Note: At least in BG2 and EEs, this effect only affects player characters.
Note: At least in BG2 and EEs, this effect can remove opcode #177 effects targeting an EFF with opcode #3.

#5 (0x5) Charm: Charm Specific Creature Variants: IWD1 IWD2 PST
Parameter #1: General Type
Parameter #2: Charm Type
Description:
Charms the targeted creature(s) according to value in the 'Charm Type' field, if the target is matched by the value in the 'General Type' field. Values for 'General Type' are from General.ids.
Known values for 'Charm Type' are:
0 Neutral Charm
  • Does not alter targets allegiance stat.
  • Maintains EA REALLYCHARMED on the target if the caster is EA GOODCUTOFF.
  • Maintains EA CHARMED_PC on the target if the caster is EA NOTGOOD.
  • Maintains Portrait Icon 'Charm' on the target.
  • Effect ends if the creature is attacked by EA GOODCUTOFF.
  • Target displays "charmed" string.

1 Hostile Charm
  • Sets targets allegiance to GOODCUTOFF if the caster is EVILCUTOFF.
  • Sets targets allegiance to EVILCUTOFF if the caster is NOTEVIL.
  • Maintains EA REALLYCHARMED on the target if the caster is GOODCUTOFF.
  • Maintains EA CHARMED_PC on the target if the caster is NOTGOOD.
  • Maintains Portrait Icon 'Charm' on the target.
  • Effect ends if the creature is attacked by EA GOODCUTOFF.
  • Target displays "charmed" string.

2 Neutral Dire Charm
  • Does not alter targets allegiance stat.
  • Maintains EA CONTROLLED on the target if the caster is GOODCUTOFF.
  • Maintains EA ENEMY on the target if the caster is NOTGOOD.
  • Maintains Portrait Icon 'Dire Charm' on the target.
  • Effect ends if the creature is attacked by EA GOODCUTOFF.
  • Target displays "dire charmed" string.

3 Hostile Dire Charm
  • Sets targets allegiance to GOODCUTOFF if the caster is EVILCUTOFF.
  • Sets targets allegiance to EVILCUTOFF if the caster is NOTEVIL.
  • Maintains EA CONTROLLED on the target if the caster is GOODCUTOFF.
  • Maintains EA ENEMY on the target if the caster is NOTGOOD.
  • Maintains Portrait Icon 'Dire Charm' on the target.
  • Effect ends if the creature is attacked by EA GOODCUTOFF.
  • Target displays "dire charmed" string.

4 Controlled by Cleric
  • Sets targets allegiance to GOODCUTOFF if the caster is EVILCUTOFF.
  • Sets targets allegiance to EVILCUTOFF if the caster is NOTEVIL.
  • Maintains EA CONTROLLED on the target if the caster is GOODCUTOFF.
  • Maintains EA ENEMY on the target if the caster is NOTGOOD.
  • Target displays "turned" string.

5 Thrull Charm
  • Does not alter targets allegiance stat.
  • Maintains EA ENEMY on the target (regardless of casters Allegience).
  • Sets THRULLCHARM stat to 1.
  • Maintains Portrait Icon 'Charm' on the target.
  • Target displays "charmed" string.

1000 Neutral Charm (no Feedback) -> Same as 0, but target does not display any string.
1001 Hostile Charm (no Feedback) -> Same as 1, but target does not display any string.
1002 Neutral Domination -> Same as 2, except:
  • Maintains Portrait Icon 'Domination' on the target.
  • Target does not display any string.

1003 Hostile Domination -> Same as 3, except:
  • Maintains Portrait Icon 'Domination' on the target.
  • Target does not display any string.

1004 Controlled by Cleric (no Feedback) -> Same as 4, but target does not display any string.
1005 Thrull Charm (no Feedback) -> Same as 5, but target does not display any string.
Note: If this effect turns a party member hostile, it will disable all of their scripts.
Note: In EEs, the “Dice Thrown” parameter can be used to override the maintained EA Value. It is used in all but the first application of the effect.

#6 (0x6) Stat: Charisma Modifier Variants: IWD1 PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Charisma = Charisma + 'Statistic Modifier' value
1 Flat Value Modifier -> Charisma = 'Statistic Modifier' value
2 Percentage Modifier -> Charisma = (Charisma * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.
With a Timing Modes of Permanent or Delayed, if 'Type' is 0 and 'Statistic Modifier' is positive, the statistic will alter and remain shown in white text, and a message 'Charisma raised permanently' will be shown.
With a Timing Modes of Permanent or Delayed, if 'Type' is 1 or 2, or 'Statistic Modifier' is negative, the statistic will alter and remain shown in white text, though no message is shown.
With all other Timing Modes, the statistic will alter and be shown in red text.

#7 (0x7) Colour: Set Character colours by Palette Variants: IWD1
Parameter #1: Gradient Number
Parameter #2: Location
Description:
Alters the colour of the area specified by the 'Location' field, to the colour gradient specified by the 'Gradient Number' field.
Known values for 'Location' are:
00 Belt Buckle (on armour) or amulets (on robes) - entire body for some animations
01 Minor colour
02 Major colour
03 Skin colour
04 Strap colour (on armour) or minor trimming (on robes - the centre strip down a robe and the hem on some robes)
05 Armor colour (and major trimming on robe - cross trim and cape trim on robe of archmagi)
06 Hair colour
16 Quillons or Crossguard
20 Grip (usually not visible as it's in the characters hand)
21 Blade or major portion of weapon
32 Shield hub
33 Shield interior
34 Shield panelling
34 Helmet misc
37 Shield rim
48 Helm ornamentation - i.e. wings
49 Helm ornamentation - i.e. feathers/horsehair
50 Helm ornamentation - i.e. feathers/horsehair
52 Helm face
53 Helm - the main covering
255 Whole Body (at least in IWD2)

#8 (0x8) Colour: Change by RGB Variants: BG1 IWD1 PST
Parameter #1: RGB colour
Parameter #2: Location
Description:
Alters the colour of the area specified by the 'Location' field, to the colour specified by the 'RGB colour' field.
The 'RGB Colour' field is handled as follows:
Second byte = Red (0-255)
Third byte = Green (0-255)
Fourth byte = Blue (0-255)
Known values for 'Location' are:
00 Belt Buckle (on armour) or amulets (on robes) - entire body for some animations
01 Minor colour
02 Major colour
03 Skin colour
04 Strap colour (on armour) or minor trimming (on robes - the centre strip down a robe and the hem on some robes)
05 Armor colour (and major trimming on robe - cross trim and cape trim on robe of archmagi)
06 Hair colour
16 Quillons or Crossguard
20 Grip (usually not visible as it's in the characters hand)
21 Blade or major portion of weapon
32 Shield hub
33 Shield interior
34 Shield panelling
34 Helmet misc
37 Shield rim
48 Helm ornamentation - i.e. wings
49 Helm ornamentation - i.e. feathers/horsehair
50 Helm ornamentation - i.e. feathers/horsehair
52 Helm face
53 Helm - the main covering
255 Whole Body (at least in IWD2)

#9 (0x9) Colour: Glow Pulse Variants: BG1 IWD1 PST
Parameter #1: RGB Colour
Parameter #2: Location and Speed
Description:
Pulses the area specified by the 'Location and Speed' field, at the rate specified by the 'Location and Speed' field, with the colour specified by the 'RGB Colour' field. If the colour values are all set to 0, the glow effect only occurs if the creature is in darkness; outside at night, inside a building, or standing in shadows.
The 'RGB Colour' field is handled as follows:
Second byte = Red (0-255)
Third byte = Green (0-255)
Fourth byte = Blue (0-255)
The 'Location' field is handled as follows:
First byte = Location
Third byte = Speed (0-255)
A speed of 0 does not pulsate. A speed of 1 is fastest, and a speed of 255 is slowest.
Known values for 'Location' are:
00 Belt Buckle (on armour) or amulets (on robes) - entire body for some animations
01 Minor colour
02 Major colour
03 Skin colour
04 Strap colour (on armour) or minor trimming (on robes - the centre strip down a robe and the hem on some robes)
05 Armor colour (and major trimming on robe - cross trim and cape trim on robe of archmagi)
06 Hair colour
16 Quillons or Crossguard
20 Grip (usually not visible as it's in the characters hand)
21 Blade or major portion of weapon
32 Shield hub
33 Shield interior
34 Shield panelling
34 Helmet misc
37 Shield rim
48 Helm ornamentation - i.e. wings
49 Helm ornamentation - i.e. feathers/horsehair
50 Helm ornamentation - i.e. feathers/horsehair
52 Helm face
53 Helm - the main covering
255 Whole Body (at least in IWD2)

#10 (0xA) Stat: Constitution Modifier Variants: IWD1 PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Constitution = Constitution + 'Statistic Modifier' value
1 Flat Value Modifier -> Constitution = 'Statistic Modifier' value
2 Percentage Modifier -> Constitution = (Constitution * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.
With a Timing Modes of Permanent or Delayed, if 'Type' is 0 and 'Statistic Modifier' is positive, the statistic will alter and remain shown in white text, and a message 'Constitution raised permanently' will be shown.
With a Timing Modes of Permanent or Delayed, if 'Type' is 1 or 2, or 'Statistic Modifier' is negative, the statistic will alter and remain shown in white text, though no message is shown.
With all other Timing Modes, the statistic will alter and be shown in red text.

#11 (0xB) Cure: Poison
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes opcode #25 poison effects and STATE_POISON from the targeted creature(s).
Info: This effect ignores durations attributed to it.
Info: At least in EEs, this effect can remove opcode #177 effects targeting an EFF with opcode #25.

#12 (0xC) HP: Damage Variants: BG2 PST BG1
Parameter #1: Damage Amount
Parameter #2: Type
Special: Flags
Description:
Damages the target by the value specified by the 'Damage Amount' field, with the damage type specified by the 'Type' field.
Known values for 'Type' are:
0 Crushing
1 Crushing Set to Value
2 Crushing Set to Percentage
3 Crushing Reduce by Percentage
65536 Acid
65537 Acid Set to Value
65538 Acid Set to Percentage
65539 Acid Reduce by Percentage
131072 Cold
131073 Cold Set to Value
131074 Cold Set to Percentage
131075 Cold Reduce by Percentage
262144 Electricity
262145 Electricity Set to Value
262146 Electricity Set to Percentage
262147 Electricity Reduce by Percentage
524288 Fire
524289 Fire Set to Value
524290 Fire Set to Percentage
524291 Fire Reduce by Percentage
1048576 Piercing
1048577 Piercing Set to Value
1048578 Piercing Set to Percentage
1048579 Piercing Reduce by Percentage
2097152 Poison
2097153 Poison Set to Value
2097154 Poison Set to Percentage
2097155 Poison Reduce by Percentage
4194304 Magic
4194305 Magic Set to Value
4194306 Magic Set to Percentage
4194307 Magic Reduce by Percentage
8388608 Missile
8388609 Missile Set to Value
8388610 Missile Set to Percentage
8388611 Missile Reduce by Percentage
16777216 Slashing
16777217 Slashing Set to Value
16777218 Slashing Set to Percentage
16777219 Slashing Reduce by Percentage
33554432 Magic Fire
33554433 Magic Fire Set to Value
33554434 Magic Fire Set to Percentage
33554435 Magic Fire Reduce by Percentage
67108864 Magic Cold
67108865 Magic Cold Set to Value
67108866 Magic Cold Set to Percentage
67108867 Magic Cold Reduce by Percentage
134217728 Stunning
134217729 Stunning Set to Value
134217730 Stunning Set to Percentage
134217731 Stunning Reduce by Percentage
268435456 Soul Eater
268435457 Soul Eater Set to Value
268435458 Soul Eater Set to Percentage
268435459 Soul Eater Reduce by Percentage
1073741824 Disease
1073741825 Disease Set to Value
1073741826 Disease Set to Percentage
1073741827 Disease Reduce by Percentage

The Dice values can be used to inflict varying damage amounts - e.g. 2d6 would do 2-12 damage (Damage type is still specified by the 'Type' value).

Useful bit values for 'Save Type' are:
Bit 10 - Ignore primary target - Line AoE projectile doesn't affect end target
Bit 11 - Ignore secondary target - Line AoE projectile doesn't affect bystanders
Bit 24 - Bypass 'mirror image'
Bit 25 - Ignore difficulty - It refers to the damage multiplier to party members based on difficulty.

Known bit values for 'Flags' are:
Bit 0 - Drain HP to caster
Bit 1 - Transfer HP to target
Bit 2 - Fist damage only
Bit 3 - Drain to max. HP of caster
Bit 5 - Suppress combat log feedback string
Bit 8 - Save for half
Bit 9 - Made save
Bit 10 - Does not wake sleepers

'Damage Amount' can be positive or negative (though the damage sound will play in either case).
If 'Damage Amount' and the Dice values are both non-zero, the total damage inflicted is: 'Damage Amount' + Dice value.

Note: ‘Stunning’ damage does not stun the target. Stunning damage cannot kill a creature, creatures are reduced to 1 HP and are knocked unconscious.
Note: Damage type ‘Poison’ automatically uses save flag ‘Bypass Mirror Image’.
Note: If this effect reduces target to -20 (Allegiance: [PC]) or -9 (any other Allegiance value) hit points, it also applies opcode #13 of the specified type:
  • Crushing/Slashing/Piercing: Exploding Death
  • Acid/Unlisted: Acid Death
  • Cold/Magic Cold: Frozen Death
  • Fire/Magic Fire: Burning Death
  • Electricity: Electrified Death
  • Magic/Missile/Poison: Normal Death

#13 (0xD) Death: Instant Death Variants: BG1 IWD1 PST
Parameter #1: Text Notification
Parameter #2: Death Type
Description:
Instantly kills the targeted creature(s), in the style specified by the 'Death Type' value.
Known values for 'Text Notification' are:
0 Show death message
1 Don't show death message
Known values for 'Death Type' are:
0 Acid death
  • Sets state STATE_ACID_DEATH (0x00000400), STATE_DEAD (0x00000800)
  • Kicked from party, drops inventory

1 Burning death
  • Sets state STATE_FLAME_DEATH (0x00000200), STATE_DEAD (0x00000800)
  • Character Tint Solid, character color ~[0x00404040] (Darkens avatar)
  • Kicked from party, drops inventory

2 Crushed death
  • Sets state STATE_EXPLODING_DEATH (0x00000100), STATE_DEAD (0x00000800)
  • Kicked from party, drops inventory

4 Normal death
  • Sets state STATE_DEAD (0x00000800)
  • Drops inventory

8 Chunked death
  • Sets state STATE_EXPLODING_DEATH (0x00000100), STATE_DEAD (0x00000800)
  • Sets ANIMATE[0x230][EXPLODING_TORSO]
  • Plays sound ("GORE.WAV")/("GORE2.WAV")
  • Kicked from party, drops inventory, sets all color indexes to 70

16 Stoned death
  • Sets state STATE_STONE_DEATH (0x00000080)
  • Any hostile action against the creature(s) applies an Exploding Stoned Death to them
  • Kicked from party, retains inventory, overlay's color index 72

32 Freezing death
  • Applies Exploding Freezing Death to the target with a (random) 0-5 second delay
  • Sets state STATE_FROZEN_DEATH (0x00000040)
  • Any hostile action against the creature applies an Exploding Freezing Death to the target
  • Kicked from party, retains inventory, overlay's color index 71

64 Exploding stoned death/Level Drain death
  • Sets state STATE_EXPLODING_DEATH (0x00000100), STATE_DEAD (0x00000800)
  • Sets ANIMATE[0x100][CHUNKS]
  • Kicked from party, retains inventory, sets all color indexes to 72

128 Exploding freezing death
  • Sets state STATE_EXPLODING_DEATH (0x00000100), STATE_DEAD (0x00000800)
  • Sets ANIMATE[0x100][CHUNKS]
  • Kicked from party, retains inventory, sets all color indexes to 71

256 Electrified death
  • Sets state STATE_FLAMING_DEATH (0x00000200), STATE_DEAD (0x00000800)
  • Character Tint Solid, character color ~[0x00404040] (Darkens avatar)
  • Kicked from party, drops inventory

512 Disintegration death
  • Sets state STATE_EXPLODING_DEATH (0x00000100), STATE_DEAD (0x00000800)
  • Sets ANIMATE[0x100][CHUNKS]
  • Kicked from party, retains inventory, sets all color indexes to 72

1024 Destruction (in IWD2)
  • Sets state STATE_EXPLODING_DEATH (0x00000100), STATE_DEAD (0x00000800)
  • Sets ANIMATE[0x230][EXPLODING_TORSO]
  • Plays sound ("GORE.WAV")/("GORE2.WAV")
  • Kicked from party, retains inventory, sets all color indexes to 70

Other
  • Removes all death states, but does not restore HP
  • Drops inventory

Any -> Removes death states that they do not set (e.g, a normal Death will remove STATE_FROZEN_DEATH).

#14 (0xE) Graphics: Defrost Variants: PST BG1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes STATE_FROZEN_DEATH from the targeted creatures and restores them to 1 HP. Does not affect creatures without STATE_FROZEN_DEATH.

#15 (0xF) Stat: Dexterity Modifier Variants: IWD1 IWD2 PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Dexterity = Dexterity + 'Statistic Modifier' value
1 Flat Value Modifier -> Dexterity = 'Statistic Modifier' value
2 Percentage Modifier -> Dexterity = (Dexterity * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.
With a Timing Modes of Permanent or Delayed, if 'Type' is 0 and 'Statistic Modifier' is positive, the statistic will alter and remain shown in white text, and a message 'Dexterity raised permanently' will be shown.
With a Timing Modes of Permanent or Delayed, if 'Type' is 1 or 2, or 'Statistic Modifier' is negative, the statistic will alter and remain shown in white text, though no message is shown.
With all other Timing Modes, the statistic will alter and be shown in red text.

#16 (0x10) State: Haste Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Applies the Haste effect, in the style specified by the 'Type' value.
Known values for 'Type' are:
0 Normal Haste - double the movement rate and grants an additional Attack Per Round (APR), rounded down (capped at 6)
1 Improved Haste - double the movement rate and doubles APR (capped at 10)
2 Weak Haste – Speed haste without attack bonuses, round APR up (capped at 5)

All of them set STATE_HASTED. Improved/Weak function by setting an additional STAT value, which modifies the behavior of STATE_HASTED:
  • STAT 155 – IMPROVEDHASTE.
  • STAT 185 – ANIMATION_ONLY_HASTE.

The normal and improved haste types grant a -2 initiative (weapon speed) bonus. All types:
- grant portrait icons
- increase the creature's animation speed and the animation speed of Opcode 140 effects
- halve the creature's round timer used by attacks, modal abilities and "Auto-Pause: End of Round"
- increase frequency of application of poison, disease, regeneration, Cast on Condition and Use EFF File (at Frequency), but not below 1s

Info: This effect will cancel out the slow opcode.
Warning: BG1 only supports haste type 0.

This opcode will set the STATE_HASTED flag and nothing else when applied with timing mode 1, and cannot be removed within the game by any means, only suppressed by Slow. This only works when applying normal/improved haste (there’s no difference, since the STAT for improved haste doesn’t get set this way), weak haste does not do anything with timing mode 1.

#17 (0x11) HP: Current HP Modifier Variants: IWD2 BG1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> HP = HP + 'Statistic Modifier' value
1 Flat Value Modifier -> HP = 'Statistic Modifier' value
2 Percentage Modifier -> HP = (HP * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.
Note: If ‘Statistic Modifier’ and the Dice values are both non-zero, the total HP change is: ‘Statistic Modifier’ + Dice value.


The upper word of the 'Type' field can further control the style.
Known values for the upper word of 'Type' are:
BIT0 – Raise dead
BIT1 – Remove all effects with a limited timing mode (not equipped(2) or permanent(9)), but also any ITM in the Magical Weapon slot.

#18 (0x12) HP: Maximum HP Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> HP = HP + 'Statistic Modifier' value (affects current and max HP)
1 Flat Value Modifier -> HP = 'Statistic Modifier' value (affects current and max HP)
2 Percentage Modifier -> HP = (HP * 'Statistic Modifier' value) / 100 (affects current and max HP)
3 As 0 (does not affect current HP)
4 As 1 (does not affect current HP)
5 As 2 (does not affect current HP)

'Statistic Modifier' can be positive or negative.
Note: For non-permanent timing modes of ‘Type’ 2 or 5 use the base maximum HP value, and therefor override other ‘Type’ 2 or 5 modifiers.
Note: If ‘Statistic Modifier’ and the Dice values are both non-zero, the total HP change is: ‘Statistic Modifier’ + Dice value.

#19 (0x13) Stat: Intelligence Modifier Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Intelligence = Intelligence + 'Statistic Modifier' value
1 Flat Value Modifier -> Intelligence = 'Statistic Modifier' value
2 Percentage Modifier -> Intelligence = (Intelligence * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.
With a Timing Modes of Permanent or Delayed, if 'Type' is 0 and 'Statistic Modifier' is positive, the statistic will alter and remain shown in white text, and a message 'Intelligence raised permanently' will be shown.
With a Timing Modes of Permanent or Delayed, if 'Type' is 1 or 2, or 'Statistic Modifier' is negative, the statistic will alter and remain shown in white text, though no message is shown.
With all other Timing Modes, the statistic will alter and be shown in red text.

#20 (0x14) State: Invisibility Variants: BG1 IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Applies the invisibility effect, in the style specified by the 'Type' value.
Known values for 'Type' are :
0 Normal Invisibility -> affected creature makes the first attack with +4
1 Improved Invisibility -> affected creature stays invisible after attack
2 Weak Invisibility -> EE: It's the same type of invisibility as 'Improved Invisibility' after you take a hostile action and reveal yourself.
Note: ‘Improved Invisibility’ does not provide saving throw bonuses outside EEs, where it provides a bonus of 4 to all. The same holds for ‘Weak Invisibility’.
Note: ‘Improved Invisibility’ lingers after the duration is spent and act as permanent if used as a ‘While Equipped’ effect
Note: ‘Weak Invisibility’ is not by itself sufficient to trigger backstabs.
Info: Creatures attacking an invisible creature suffer a -4 penalty to hit, unless they are affected by opcode #193 Invisible Detection by Script. Moreover, you cannot target an improved/weak invisible creature with spells unless you’re affected by opcode #193 or the spell can target invisible creatures.

#21 (0x15) Stat: Lore Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Lore = Lore + 'Statistic Modifier' value
1 Flat Value Modifier -> Lore = 'Statistic Modifier' value
2 Percentage Modifier -> Lore = (Lore * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.
Warning: This effect does not work with Timing Mode 1.

#22 (0x16) Stat: Cumulative Luck Bonus Variants: IWD1 PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field. Luck affects the minimum damage caused by a weapon (up to the normal maximum damage of the weapon) and the attack roll modifier (up to a maximum of 20, excluding natural attack roll modifiers, e.g. high STR, invisibility etc) by 'Statistic Modifier' amount. 'Statistic Modifier' also affects the damge rolls of opponents (in feature blocks, not extension headers). The effect does not set STATE_LUCK.
Known values for 'Type' are:
0 Cumulative Modifier -> Luck = Luck + 'Statistic Modifier' value
1 Flat Value Modifier -> Luck = 'Statistic Modifier' value
2 Percentage Modifier -> Luck = (Luck * 'Statistic Modifier' value) / 100

#23 (0x17) Stat: Morale Modifier Variants: BG2
Parameter #1: Statistic Modifier
Parameter #2: Type
Special: Mode
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Morale = Morale + 'Statistic Modifier' value
1 Flat Value Modifier -> Morale = 'Statistic Modifier' value
2 Percentage Modifier -> Morale = (Morale * 'Statistic Modifier' value) / 100
At least in EEs, known values for 'Mode' are:
0 BG2 mode -> It's hardcoded to fill the following values:
  • param #1 = 10
  • param #2 = 1
  • m_done = 1 (internal field that immediately removes the effect from creature, no matter duration)

In addition, it checks if the creature is berserking, and if it is, it returns without doing anything.
1 BG1 mode -> Default (functions as expected)
Note: Any Morale-based effect (i.e. Panic) may be added or removed by this effect.

#24 (0x18) State: Horror Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Applies the horror effect to the targeted creature(s) in the style specified by the 'Type' field, which is suspected to be an EE extension.
Known values for 'Type' are:
0 -> Default
Non-zero -> Bypass opcode #101 (Immunity to effect)

#25 (0x19) State: Poison Variants: BG1 IWD1 IWD2 PST BG2
Parameter #1: Amount_1
Parameter #2: Type
Parameter #3: Amount_2
Parameter #4: Frequency Multiplier
Special: Icon
Description:
Damages the target by a certain amount, in the style specified by the 'Type' field.
Known values for 'Type' are:
  • 0 => Inflict 1 HP per second ('Amount_2' and 'Frequency Multiplier' are ignored – 'Amount_1' needs to be non-zero)
  • 1 => Inflict 1 HP per second (for best results, leave 'Amount_2' and 'Frequency Multiplier' at zero, 'Amount_1' between 1 and 101)
  • 2 => Deal 'Amount_1' damage every 'Frequency Multiplier' second(s)
  • 3 => Deal one damage every 'Amount_1' * 'Frequency Multiplier' second(s)
  • 4 => Deal 'Amount_2' damage every 'Amount_1' * 'Frequency Multiplier' second(s) – This is the only one that must be in external EFF files
  • 5+ => Crash
'Icon' defines the index from STATDESC.2DA for custom portrait icons. Default value is 6 (Poisoned).
Important: The Damage Amount parameters should be set to a positive value.
Info: If ‘Frequency Multiplier’ = 0, its value is treated as 1. This is the default value for SPL/ITM effects.
Note: When the effect is NOT attached through opcode #177, ‘Frequency Multiplier’ will be replaced when using opcode #329 (Slow Poison) – not necessarily “slow” though, as it can increase or decrease the frequency.
Note: When the ‘Type’ field is 1:
  • if the 'Frequency Multiplier' field is non-zero, damage is always dealt.
  • if the 'Amount_1' field is less than 256, damage is dealt while HP > 100 / 'Amount_1'.

#26 (0x1A) Item: Remove Curse Variants: PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes cursed items from the targeted creature(s).

#27 (0x1B) Stat: Acid Resistance Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Resistance = Resistance + 'Statistic Modifier' value
1 Flat Value Modifier -> Resistance = 'Statistic Modifier' value
2 Percentage Modifier -> Resistance = (Resistance * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#28 (0x1C) Stat: Cold Resistance Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Resistance = Resistance + 'Statistic Modifier' value
1 Flat Value Modifier -> Resistance = 'Statistic Modifier' value
2 Percentage Modifier -> Resistance = (Resistance * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#29 (0x1D) Stat: Electricity Resistance Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Resistance = Resistance + 'Statistic Modifier' value
1 Flat Value Modifier -> Resistance = 'Statistic Modifier' value
2 Percentage Modifier -> Resistance = (Resistance * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#30 (0x1E) Stat: Fire Resistance Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Resistance = Resistance + 'Statistic Modifier' value
1 Flat Value Modifier -> Resistance = 'Statistic Modifier' value
2 Percentage Modifier -> Resistance = (Resistance * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#31 (0x1F) Stat: Magic Damage Resistance Modifier Variants: BG1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Resistance = Resistance + 'Statistic Modifier' value
1 Flat Value Modifier -> Resistance = 'Statistic Modifier' value
2 Percentage Modifier -> Resistance = (Resistance * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#32 (0x20) Cure: Death (Raise Dead) Variants: IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Raises the targeted creature(s) from the dead.
This effect ignores durations attributed to it.

#33 (0x21) Stat: Save vs. Death Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Save = Save + 'Statistic Modifier' value
1 Flat Value Modifier -> Save = 'Statistic Modifier' value
2 Percentage Modifier -> Save = (Save * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#34 (0x22) Stat: Save vs. Wands Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Save = Save + 'Statistic Modifier' value
1 Flat Value Modifier -> Save = 'Statistic Modifier' value
2 Percentage Modifier -> Save = (Save * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#35 (0x23) Stat: Save vs. Petrification/Polymorph Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Save = Save + 'Statistic Modifier' value
1 Flat Value Modifier -> Save = 'Statistic Modifier' value
2 Percentage Modifier -> Save = (Save * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#36 (0x24) Stat: Save vs. Breath Weapons Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Save = Save + 'Statistic Modifier' value
1 Flat Value Modifier -> Save = 'Statistic Modifier' value
2 Percentage Modifier -> Save = (Save * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#37 (0x25) Stat: Save vs. Spells Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Save = Save + 'Statistic Modifier' value
1 Flat Value Modifier -> Save = 'Statistic Modifier' value
2 Percentage Modifier -> Save = (Save * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.

#38 (0x26) State: Silence
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the silence effect to the targeted creature(s). A silenced creature cannot cast spells, use special abilities or initiate dialog. The engine is hard-coded to allow these spells to be cast by a silenced creature:
  • SPWI219 (Vocalize)
  • SPIN649 (Teleport to Pocket Plane) in BG2/BGEE

#39 (0x27) State: Unconsciousness Variants: IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Wake on Damage
Special: Icon
Description:
Applies the unconsciousness effect to the targeted creature(s).
Known values for 'Wake on Damage' are (only in EEs):
  • 0 => Yes
  • 1 => No
'Icon' defines the index from STATDESC.2DA for custom portrait icons (EE only).
Note: A permanent timing mode will set the STATE_HELPLESS flag. In such a case, that flag cannot be removed in-game.

#40 (0x28) State: Slow
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the slow effect to the targeted creature(s).
Info: This effect will cancel out the haste opcode.
Note: This effect doubles the casting time of all spells. Not verified for IWD2.
Warning: This opcode will set the STATE_SLOWED flag and nothing else when applied with timing mode 1, and cannot be removed within the game by any means, only suppressed by Haste.

#41 (0x29) Graphics: Sparkle Variants: BG1 IWD1 IWD2 PST
Parameter #1: Colour
Parameter #2: Type
Description:
Displays the sparkle effect specified by the 'Type' field, in the colour specified by the 'Colour' field. The colour field may be connected to SPRKLCLR.2DA.
Known values for 'Colour' are:
0 Crash
1 Black
2 Blue
3 Chromatic
4 Gold
5 Green
6 Purple
7 Red
8 White
9 Ice
10 Stone
11 Magenta
12 Orange
13 Crash+

Known values for 'Type' are:
1 Explosion
2 No effect?
3 Sparkle Shower
Info: Both of these params use only the lower 16 bits (upper bits might have other function).

#42 (0x2A) Spell: Wizard Spell Slots Modifier Variants: IWD1
Parameter #1: Slot Amount Modifier
Parameter #2: Spell Level
Description:
Alters the number of wizard spell slots available to the targeted creature(s), as specified by the 'Slot Amount Modifier' field, at the level specified by the 'Spell Level' field. Wizard spells are used by Bards, Sorcerers and Wizards in IWD2.
Known values for 'Spell Level' are:
0 Double spells
1 Level 1
2 Level 2
4 Level 3
8 Level 4
16 Level 5
32 Level 6
64 Level 7
128 Level 8
256 Level 9
For a 'Spell Level' of 0, the amount of spell slots is doubled for the level specified by the 'Slot Amount Modifier' value and all levels below. The target creature(s) must have at least 1 slot at the selected level to have their slot count changed. If the resultant slot count is negative, the creature is given 12 slots.

'Statistic Modifier' can be positive or negative.

#43 (0x2B) Cure: Stone to Flesh
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Changes the targeted creature(s) from stone to flesh.
Important: Both parameters should be 0 (zero).

#44 (0x2C) Stat: Strength Modifier Variants: IWD1 IWD2 PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Strength = Strength + 'Statistic Modifier' value
1 Flat Value Modifier -> Strength = 'Statistic Modifier' value
2 Percentage Modifier -> Strength = (Strength * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.
With a Timing Modes of Permanent or Delayed, if 'Type' is 0 and 'Statistic Modifier' is positive, the statistic will alter and remain shown in white text, and a message 'Strength raised permanently' will be shown.
With a Timing Modes of Permanent or Delayed, if 'Type' is 1 or 2, or 'Statistic Modifier' is negative, the statistic will alter and remain shown in white text, though no message is shown.
With all other Timing Modes, the statistic will alter and be shown in red text.

#45 (0x2D) State: Stun Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Stuns the targeted creature(s).
Note: At least in EEs, this opcode automatically provides the ‘Stun’ portrait icon.

#46 (0x2E) Cure: Stun (Unstun) Variants: PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Unstuns the targeted creature(s) (opcode #45).
This effect ignores durations attributed to it.

#47 (0x2F) Cure: Invisibility
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the invisibility effect from the targeted creature(s).
This effect ignores durations attributed to it.
Important: Both parameters should be 0 (zero).

#48 (0x30) Cure: Silence (Vocalize)
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the silence effect and the silenced state from the targeted creature(s).
This effect ignores durations attributed to it.

#49 (0x31) Stat: Wisdom Modifier Variants: IWD1 PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Wisdom = Wisdom + 'Statistic Modifier' value
1 Flat Value Modifier -> Wisdom = 'Statistic Modifier' value
2 Percentage Modifier -> Wisdom = (Wisdom * 'Statistic Modifier' value) / 100

'Statistic Modifier' can be positive or negative.
With a Timing Modes of Permanent or Delayed, if 'Type' is 0 and 'Statistic Modifier' is positive, the statistic will alter and remain shown in white text, and a message 'Wisdom raised permanently' will be shown.
With a Timing Modes of Permanent or Delayed, if 'Type' is 1 or 2, or 'Statistic Modifier' is negative, the statistic will alter and remain shown in white text, though no message is shown.
With all other Timing Modes, the statistic will alter and be shown in red text.

#50 (0x32) Colour: Glow by RGB (Brief) Variants: BG1 IWD1 IWD2 PST
Parameter #1: RGB Colour
Parameter #2: Speed
Description:
The targeted creature(s) entire animation glows the colour specified by the 'RGB Colour' field, at the speed specified by the (3rd byte of the) 'Speed' field.
The 'RGB Colour' field is handled as follows:
Second byte = Red (0-255)
Third byte = Green (0-255)
Fourth byte = Blue (0-255)
The 'Speed' field is handled as follows:
Third byte = Speed (0-255)
A speed of 0 does not pulsate. A speed of 1 is fastest, and a speed of 255 is slowest. The duration of the effect is controlled by the 'Speed' field.

#51 (0x33) Colour: Strong/Dark by RGB Variants: BG1 IWD1 IWD2
Parameter #1: RGB Colour
Parameter #2: Location
Description:
Alters the colour of the area specified by the 'Location and Speed' field, to the colour specified by the 'RGB Colour' field.
The 'RGB Colour' field is handled as follows:
Second byte = Red (0-255)
Third byte = Green (0-255)
Fourth byte = Blue (0-255)

Known values for 'Location' are:
00 Belt Buckle (on armour) or amulets (on robes) - entire body for some animations
01 Minor colour
02 Major colour
03 Skin colour
04 Strap colour (on armour) or minor trimming (on robes - the centre strip down a robe and the hem on some robes)
05 Armor colour (and major trimming on robe - cross trim and cape trim on robe of archmagi)
06 Hair colour
16 Quillons or Crossguard
20 Grip (usually not visible as it's in the characters hand)
21 Blade or major portion of weapon
32 Shield hub
33 Shield interior
34 Shield panelling
34 Helmet misc
37 Shield rim
48 Helm ornamentation - i.e. wings
49 Helm ornamentation - i.e. feathers/horsehair
50 Helm ornamentation - i.e. feathers/horsehair
52 Helm face
53 Helm - the main covering

#52 (0x34) Colour: Very Bright by RGB Variants: BG1 IWD1 IWD2 PST
Parameter #1: RGB Colour
Parameter #2: Location
Description:
Alters the colour of the area specified by the 'Location' field, to the colour specified by the 'RGB Colour' field.
The 'RGB Colour' field is handled as follows:
Second byte = Red (0-255)
Third byte = Green (0-255)
Fourth byte = Blue (0-255)

Known values for 'Location' are:
00 Belt Buckle (on armour) or amulets (on robes) - entire body for some animations
01 Minor colour
02 Major colour
03 Skin colour
04 Strap colour (on armour) or minor trimming (on robes - the centre strip down a robe and the hem on some robes)
05 Armor colour (and major trimming on robe - cross trim and cape trim on robe of archmagi)
06 Hair colour
16 Quillons or Crossguard
20 Grip (usually not visible as it's in the characters hand)
21 Blade or major portion of weapon
32 Shield hub
33 Shield interior
34 Shield panelling
34 Helmet misc
37 Shield rim
48 Helm ornamentation - i.e. wings
49 Helm ornamentation - i.e. feathers/horsehair
50 Helm ornamentation - i.e. feathers/horsehair
52 Helm face
53 Helm - the main covering

#53 (0x35) Graphics: Animation Change Variants: IWD1 IWD2 PST
Parameter #1: Animation ID
Parameter #2: Type
Description:
Alters the animation of the targeted creature(s) to the animation specified by the 'Animation ID' field, in the style specified by the 'Type' field.
Known values for Animation ID' are: (from ANIMATE.IDS - in decimal)
Known values for 'Type' are:
0 Change animation - non-permanently
1 Remove any non-permanent animation change ('Animation ID' is unused)
2 Change animation - permanently

#54 (0x36) Stat: THAC0 Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> THAC0 = THAC0 + 'Statistic Modifier' value
1 Flat Value Modifier -> THAC0 = 'Statistic Modifier' value
2 Percentage Modifier -> THAC0 = (THAC0 * 'Statistic Modifier' value) / 100
Note: This effect adjusts the base stat, rather than modified THAC0.

#55 (0x37) Death: Kill Creature Type Variants: PST
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Kills the targeted creature(s) with HD less than those specified by the Dice values, if the target(s) match the IDS mask.
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids (EE-only)
'IDS Entry' is a value from the specified IDS file, indicating the specific creature type to affect.

#56 (0x38) Alignment: Invert Variants: PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Inverts the alignment of the targeted creature(s).
Important: Both parameters should be 0 (zero).

#57 (0x39) Alignment: Change Variants: PST
Parameter #1: Irrelevant
Parameter #2: Alignment
Description:
Alters the alignment of the targeted creature(s) to the value specified by 'Alignment'.
Known values for 'Alignment' are:
00 None
17 Lawful Good
18 Lawful Neutral
19 Lawful Evil
33 Neutral Good
34 True Neutral
35 Neutral Evil
49 Chaotic Good
50 Chaotic Neutral
51 Chaotic Evil

#58 (0x3A) Cure: Dispellable Effects (Dispel Magic)
Parameter #1: Level
Parameter #2: Type
Description:
Dispels magic from the targeted creature(s) (excepting magical weapons eg. Spirtual Hammer). Depending on the value of the 'Type' field, the 'Level' field can be used to set the level of the effect.
Known values for 'Type' are:
0 Always dispel
1 Use Caster Level
2 Use 'Level' field
With 'Type' of 1 or 2, the base chance of successfully dispelling is 50%. This chance is modified by the relative levels of the dispeller to the caster. Each level below gives a -10% chance, each level above gives a +5% chance. There is always a 1% chance of success or failure.

#59 (0x3B) Stat: Stealth Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Stealth = Stealth + 'Statistic Modifier' value
1 Flat Value Modifier -> Stealth = 'Statistic Modifier' value
2 Percentage Modifier -> Stealth = (Stealth * 'Statistic Modifier' value) / 100
Note: In BG2 and EEs, this effect alters the Move Silently skill.

#60 (0x3C) Stat: Miscast Magic Variants: IWD1 BG1
Parameter #1: Percent Chance
Parameter #2: Type
Description:
The targeted creature(s) will fail to cast the type of spell specified by the 'Type' field, 'Percent Chance' percent of the time.
Known values for 'Type' are:
0 Mage Spells
1 Cleric Spells
2 Innate
3 Mage Spells
4 Cleric Spells
5 Innate
'Type' values of 0,1 or 2 display a message -'Spell Failed: casting failure'
'Type' values of 3,4 or 5 display a message -'Spell failed due to dead magic'

#61 (0x3D) Crash Variants: IWD2
Parameter #1: Undefined
Parameter #2: Undefined
Description:
Warning: This effect crashes the game.
Note: This effect has previously been referenced as Alchemy.

#62 (0x3E) Spell: Priest Spell Slots Modifier Variants: IWD1
Parameter #1: Slot Amount Modifier
Parameter #2: Spell Level
Description:
Alters the number of priest spell slots available to the targeted creature(s), as specified by the 'Slot Amount Modifier' field, at the level specified by the 'Spell Level' field.
Known values for 'Spell Level' are:
0 Double spells
1 Level 1
2 Level 2
4 Level 3
8 Level 4
16 Level 5
32 Level 6
64 Level 7
For a 'Spell Level' of 0, the amount of spell slots is doubled for the level specified by the 'Slot Amount Modifier' value and all levels below. The target creature(s) must have at least 1 slot at the selected level to have their slot count changed. If the resultant slot count is negative, the creature is given 12 slots.

'Statistic Modifier' can be positive or negative.

#63 (0x3F) State: Infravision
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Gives the targeted creature(s) infravision.
Important: Both parameters should be 0 (zero).

#64 (0x40) State: Remove Infravision
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes infravision from the targeted creature(s).
This effect ignores durations attributed to it.
Note: This will not remove racial infravision.
Important: Both parameters should be 0 (zero).

#65 (0x41) Overlay: Blur
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the blur effect to the targeted creature(s). Graphical displacement is affected by movement rate.
Important: Both parameters should be 0 (zero).

#66 (0x42) Graphics: Transparency Fade Variants: IWD1 PST
Parameter #1: Fade Amount
Parameter #2: Visual Effect
Description:
Fades the targeted creature(s) by the value in the amount specified by the 'Fade Amount' field in the style specified by the 'Visual Effect' field.
Known values for 'Fade Amount' are:
1 Fully visible
..
255 Almost invisible
Known values for 'Visual Effect' are:
0 -> Draw instantly
1 -> Fade in
2 -> Fade out

This effect sets stat #60 (TRANSLUCENT) to param #1.

#67 (0x43) Summon: Creature Summoning Variants: IWD2 PST
Parameter #1: Unknown
Parameter #2: Control
Description:
Summons a creature, with EA set to the 'Control' field. The Resource key should be set to the filename of the creature to summon.
Known values for 'Control' are:
0 Match target (hostile if no target)
1 Match target (hostile if no target)
2 As creature file
3 Match target (hostile if no target)
4 As creature file
5 Hostile to target
6 As creature file
8 As creature file
255 As creature file

If effect's target is set as 'Original Caster' then the 'Control' parameter covers 'Location' as well as control. In this case, nown values for 'Control' are:
2 = Summoned at location of target creature
4 = Summoned at location of caster
6 = Summoned at location of caster

#68 (0x44) Summon: Unsummon Creature
Parameter #1: Text Notification
Parameter #2: Irrelevant
Description:
Unsummons a creature, with feedback controlled by 'Text Notification'.
Known values for 'Text Notification' are:
0 No text notification
1 Show text notification
Note: At least in BG2 and EEs, the Resource key should be set to the filename of the animation to play when unsummoning the creature, and defaults to SPGFLSH1 if left empty.

#69 (0x45) Protection: From Detection (Non-Detection)
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the non-detection effect to the targeted creature(s), setting STATE_NONDETECTION while active. This effect is negated by effect #70 Cure: Non-Detection. While in the non-detection state, the creature is immune to effects #47: Cure Invisibility and #116: Remove invisibilty, though they are affected by effects that remove illusionary protections by school or secondary type.

#70 (0x46) Cure: Non-Detection Variants: IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the Non-Detection effect from the targeted creature(s).
This effect ignores durations attributed to it.

#71 (0x47) IDS: Sex Change
Parameter #1: Gender Modifier
Parameter #2: Type
Description:
Alters the gender of the targetted creature(s) to the value specified by the 'Gender.ids' field, in the style specified by the 'Type' value.
Known values for 'Type' are:
0 Reverse Gender
1 Flat Value Modifier -> Gender = 'Statistic Modifier' value (values from gender.ids)

The effect modifies stat 193.

#72 (0x48) IDS: Set IDS State Variants: BG1 IWD2 PST
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Alters the IDS state of the targeted creature(s) specified by the 'IDS File' field, to the value specified by the 'IDS Entry' field.
Known values for 'IDS File' are:
0 EA
1 Generic / General
2 Race
3 Class
4 Specific
5 Gender
6 Align / Alignmen (iwd1, pst)

#73 (0x49) Stat: Extra Damage Modifier Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Modifier Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field. The effect is an additive modifier, like adding +10 damage.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100
Note: PST treats all Type values above 1 as 1 - it does not support the percentage modifier.

#74 (0x4A) State: Blindness Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the blindness effect to the targeted creature(s). This sets VISUALRANGE to 2, sets STATE_BLIND to true and incurs a cummulative 10 point base THAC0 penalty (unverified in PST).

#75 (0x4B) Cure: Blindness
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the blindness effect from the targeted creature(s).
This effect ignores durations attributed to it.
Important: Both parameters should be 0 (zero).

#76 (0x4C) State: Feeblemindedness Variants: IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the feeblemind effect to the targeted creature(s) - creatures are unselectable, immobile and do not respond to combat.
This effect ignores durations attributed to it.
Important: A creature's scripts do not run while the creature is feebleminded.

#77 (0x4D) Cure: Feeblemindedness
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the feeblemind effect from the targeted creature(s).
This effect ignores durations attributed to it.
Important: Both parameters should be 0 (zero).

#78 (0x4E) State: Disease Variants: BG1 BG2 IWD1 PST
Parameter #1: Amount
Parameter #2: Type
Parameter #4: Frequency Multiplier
Special: Icon
Description:
Set the 'Amount' parameter as the amount of damage, and the Disease Type parameter as how the disease functions.
Known values for 'Type' are:
  • 0 => Inflict 1 HP per second ('Frequency Multiplier' is ignored – 'Amount' needs to be non-zero)
  • 1 => Inflict 1 HP per second (for best results, leave 'Frequency Multiplier' at zero, 'Amount' between 1 and 101)
  • 2 => Deal 'Amount' damage every 'Frequency Multiplier' second(s)
  • 3 => Deal one damage every 'Amount' * 'Frequency Multiplier' second(s)
  • 4 => Reduce Strength score by 'Amount'
  • 5 => Reduce Dexterity score by 'Amount'
  • 6 => Reduce Constitution score by 'Amount'
  • 7 => Reduce Intelligence score by 'Amount'
  • 8 => Reduce Wisdom score by 'Amount'
  • 9 => Reduce Charisma score by 'Amount'
  • 10 => Slow Effect
  • 11 => Mold touch/Single
  • 12 => Mold touch/Decrement
  • 13 => Contagion


'Amount' can be positive (penalty) or negative (bonus).

'Icon' defines the index from STATDESC.2DA for custom portrait icons. Default value is none (no icon).
Important: Permanent timing modes require a duration for this effect to work.
Info: This opcode deals “Poison” damage, except Mold Touches, which deal “Magic” damage.
Info: If ‘Frequency Multiplier’ = 0, its value is treated as 1. This is the default value for SPL/ITM effects.
Info: The Slow effect is no different from that caused by opcode #40 (Slow), including its stacking interaction with Haste, except that it is blocked/removed as a disease, not as a slow effect.
Info: Contagion is a composite of Strength, Dexterity, Charisma drain and the Slow effect, each ability score reduced by ‘Amount’.
Note: When the ‘Type’ field is 1:
  • if the 'Frequency Multiplier' field is non-zero, damage is always dealt.
  • if the 'Amount' field is less than 256, damage is dealt while HP > 100 / 'Amount'.
Note: Mold touch is complicated and not consistent across the EE games. The general idea is that it deals x or xd6 damage and applies the SPL file specified by the resource key every (round or second) for either 1 round (single) or across multiple rounds dealing less each round (decrement). In particular:
  • If 'Type'=11, then the damage dealt is always 1
  • if 'Type'=12, then the damage dealt depends on the game:
    • IWD:EE uses 'Amount' for 'x', and calculates 'duration' as 6 * 'Amount'.
    • BG:EE calculates 'x' from 'duration' / 6. (It's reasonable to assume that BG2:EE uses this one as well).
    • If you set 'duration' = 6 * 'Amount', it should junction the same in both games.
‘Frequency Multiplier’ determines whether it deals damage every second or every round, and whether it deals x or xd6 damage.
  • 'Frequency Multiplier' = 0 => xd6 per round
  • 'Frequency Multiplier' = 65536 or greater (must be even) => x per round
  • 'Frequency Multiplier' = 65537 or greater (must be odd) => x per second
Regardless, the value of x decrements only once per round.

#79 (0x4F) Cure: Disease
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the disease effect from the targeted creature(s).
This effect ignores durations attributed to it.
Important: Both parameters should be 0 (zero).

#80 (0x50) State: Deafness Variants: IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the Deafness effect on the targeted creature(s) - creatures suffer a casting failure rate of 50% (20% in bg1, unknown in iwd1). This is cumulative with Miscast Magic.
Warning: PST: it is unclear if this effect exist or does anything!

#81 (0x51) Cure: Deafness
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Remove the deafness effect from the targeted creature(s).
This effect ignores durations attributed to it.
Important: Both parameters should be 0 (zero).
Warning: PST: it is unclear if this effect exists or does anything!

#82 (0x52) Set AI Script Variants: PST
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Sets the script type specified by the 'Type' value to the contents of the resource key.
Known values for 'Type' are:
0 OVERRIDE
1 AREA
2 SPECIFICS
4 CLASS
5 RACE
6 GENERAL
7 DEFAULT
Warning: This effect can unset scripts from a creature, which can break the game.

#83 (0x53) Protection: From Projectile Variants: BG1 IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Gives the targeted creature(s) immunity to the weapon type specified by the 'Type' value.
Values for 'Type' are taken from projectl.ids.

#84 (0x54) Stat: Magical Fire Resistance Modifier Variants: IWD1 IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

#85 (0x55) Stat: Magical Cold Resistance Modifier Variants: IWD1 IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

#86 (0x56) Stat: Slashing Resistance Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

#87 (0x57) Stat: Crushing Resistance Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

#88 (0x58) Stat: Piercing Resistance Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

#89 (0x59) Stat: Missiles Resistance Modifier Variants: IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

#90 (0x5A) Stat: Open Locks Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100

#91 (0x5B) Stat: Find Traps Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100

#92 (0x5C) Stat: Pick Pockets Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100

#93 (0x5D) Stat: Fatigue Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100

#94 (0x5E) Stat: Drunkenness Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100

#95 (0x5F) Stat: Tracking Skill Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100

#96 (0x60) Stat: Level Change Variants: BG1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Level = Level + 'Statistic Modifier' value
1 Flat Value Modifier -> Level = 'Statistic Modifier' value
2 Percentage Modifier -> Level = (Level * 'Statistic Modifier' value) / 100
Note: In IWD2 the class to receive the change is specified at 0x2C

#97 (0x61) Stat: Strength-Bonus Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Bonus = Bonus + 'Statistic Modifier' value
1 Flat Value Modifier -> Bonus = 'Statistic Modifier' value
2 Percentage Modifier -> Bonus = (Bonus * 'Statistic Modifier' value) / 100

#98 (0x62) HP: Regeneration Variants: BG1 IWD1 IWD2 PST BG2
Parameter #1: Amount_1
Parameter #2: Type
Parameter #3: Amount_2
Parameter #4: Frequency Multiplier
Special: Icon
Description:
Restores HP according to the style specified by the 'Type' field, to the targeted creature(s).
Known values for 'Type' are:
  • 0 => Restore 1 HP per second ('Amount_2' and 'Frequency Multiplier' are ignored – 'Amount_1' needs to be non-zero)
  • 1 => Restore 1 HP per second (for best results, leave both 'Amount_2' and 'Frequency Multiplier' at zero, 'Amount_1' between 1 and 101)
  • 2 => Restore 'Amount_1' HP every 'Frequency Multiplier' second(s)
  • 3 => Restore 1 HP every 'Amount_1' * 'Frequency Multiplier' second(s)
  • 4 => Restore 'Amount_2' HP every 'Amount_1' * 'Frequency Multiplier' second(s) – This is the only one that must be in external EFF files
'Icon' defines the index from STATDESC.2DA for custom portrait icons. Default value is none (no icon).
Warning: ‘Type’ values greater or equal to 5 will crash the game!
Important: Permanent timing modes require a duration for this effect to work.
Info: If ‘Frequency Multiplier’ = 0, its value is treated as 1. This is the default value for SPL/ITM effects.
Note: When the ‘Type’ field is 1:
  • if the 'Frequency Multiplier' field is non-zero, HP is always restored.
  • if the 'Amount_1' field is less than 256, HP is restored while HP > 100 / Amount_1.

#99 (0x63) Spell Effect: Duration Modifier
Parameter #1: Duration Modifier
Parameter #2: Type
Description:
Alters spell durations of the targeted creature(s), to the percentage specified by the 'Duration Modifier' field, affecting the spell type specified by the 'Type' field. Timing mode 0 is the only timing mode reliably affected. Timings handled through PRO files are ignored.
eg.
'Duration Modifier' = 0 -> Spells have no duration
'Duration Modifier' = 100 -> Spells have normal duration
'Duration Modifier' = 200 -> Spells have double duration
Known values for 'Type' are:
0 Mage
1 Priest
Note: Not seen to work in BG1.

#100 (0x64) Protection: from Creature Type Variants: IWD2
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Gives the targeted creature(s) protection from the creature type specified by the 'IDS File' and 'IDS Entry' fields.
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids / Alignmen.ids (in iwd1, pst)
9 Kit.ids (only in EEs)

To be protected from any creature, leave the Entry at zero, and the File at 2. Protection will grant the bearer immunity from being attacked, cast a spell at, or otherwise targeted by creatures with this type.

#101 (0x65) Protection: from Opcode
Parameter #1: Irrelevant
Parameter #2: opcode
Description:
Gives the targeted creature(s) protection from the opcode specified by the 'opcode' field.

#102 (0x66) Protection: from Spell Levels
Parameter #1: Spell Level
Parameter #2: Irrelevant
Description:
Gives the targeted creature(s) protection from spells up to the level specified by the 'Spell Level' field. A spell is assigned to a spell level by the power level of the first effect greater than the 'Spell Level' parameter in the extended header that is being called.
Known values for 'Spell Level' are:
1
..
9

#103 (0x67) Text: Change Name
Parameter #1: String Reference
Parameter #2: Irrelevant
Description:
Alters the name of the targeted creature(s) to the strref specified by the 'String Reference' field. When used with a duration timing, after the duration, the name will be set to a blank entry.

#104 (0x68) Stat: Experience Points
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> XP = XP + 'Statistic Modifier' value
1 Flat Value Modifier -> XP = 'Statistic Modifier' value
2 Percentage Modifier -> XP = (XP * 'Statistic Modifier' value) / 100

#105 (0x69) Stat: Gold Variants: BG1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Gold = Gold - 'Statistic Modifier' value
1 Flat Value Modifier -> Gold = 'Statistic Modifier' value
2 Percentage Modifier -> Gold = (Gold * 'Statistic Modifier' value) / 100
Note: ‘Type’ 1 can only remove gold. Gold amount has a lower bound of 0.

#106 (0x6A) Stat: Morale Break Modifier
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Morale Break = Morale Break + 'Statistic Modifier' value
1 Flat Value Modifier -> Morale Break = 'Statistic Modifier' value
2 Percentage Modifier -> Morale Break = (Morale * 'Statistic Modifier' value) / 100

#107 (0x6B) Portrait Change
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Sets the portrait of the targeted creature(s) to that specified in the resource key, based on the 'Type' value. This effect ignores durations attributed to it.
Known values for 'Type' are:
0 Small portrait
1 Large portrait

#108 (0x6C) Stat: Reputation
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Sets the individual reputation of the targeted creature(s) to the value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
This does not affect the main reputation of the Party, unless 'Type' 3 or 4 are used. Though it can affect ranger/paladinhood of any target.
Known values for 'Type' are:
0 Cumulative Modifier -> Reputation = Reputation + 'Statistic Modifier' value
1 Flat Value Modifier -> Reputation = 'Statistic Modifier' value
2 Percentage Modifier -> Reputation = (Reputation * 'Statistic Modifier' value) / 100
3 Increment Party Reputation -> by 10x param#1, cannot lower reputation below 100, will raise reputation to 100 if already less (only in EEs)
4 Reset Party Reputation to 100 (only in EEs)

#109 (0x6D) State: Hold Variants: BG2 PST BG1
Parameter #1: IDS Entry
Parameter #2: IDS File
Special: Mode
Description:
Applies the hold effect to the targeted creature(s), if the targeted creature(s) match the value specified by the 'IDS Entry' field, in the specified 'IDS File'.
Known values for 'IDS File' are:
2 EA.IDS
3 GENERAL.IDS
4 RACE.IDS
5 CLASS.IDS
6 SPECIFIC.IDS
7 GENDER.IDS
8 ALIGN.IDS
9 KIT.IDS

The affected creature becomes immobile and its AI scripts stop running.
This effect sets stat #58 (HELD) to 1. It also sets the STATE_HELPLESS flag.

Known values for 'Mode' are:
  • 0 -> Default
  • Non-zero -> False Petrify
    • In addition to the normal paralyze effect, it maintains a detectable STATE_STONE_DEATH and the stone overlay, but does not directly kill, award XP, or chunk when attacked. Only functions like this against non-party members.
    • Against party members, it functions as normal, unless you save and reload while the effect is active. Upon reloading, the stone overlay will be applied and the character will be dropped to 0 hit points, but not killed, and no STATE_STONE_DEATH (this is probably to avoid kicking the character from the party)

#110 (0x6E) Empty: Variants: BG1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This opcode has no effect.

#111 (0x6F) Item: Create Magical Weapon
Parameter #1: Amount
Parameter #2: Irrelevant
Description:
Creates the item specified by the resource key. The number of items created is controlled by the 'Amount' field. The item is created in the Magical Weapon slot (SLOT_MISC19 - #34).
Important: The Magical Weapon slot does not allow Item Abilities (header_type = 3).
Warning: The resource field should not be empty, or the game will crash (not consistently, but it happens).

#112 (0x70) Item: Remove Item
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes a single instance (or stack) of the item specified by the resource key from the targeted creature(s). Items in container items (e.g. Bags of Holding) will not be removed. If a creature has multiple instances of the item, the one in the lowest slot number (see slots.ids) is removed. EFF_M02 is hard-coded to play when an item is removed. This effect should be used to remove equipped items (use opcode #123 for inventory items).

#113 (0x71) Empty: Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This opcode has no effect.

#114 (0x72) Graphics: Dither Variants: IWD1
Parameter #1: Undefined
Parameter #2: Undefined
Description:
The use of this effect is unknown, and effect of its parameters are undefined.
Warning: This effect has never been seen to work.

#115 (0x73) Detect: Alignment Variants: IWD2
Parameter #1: Irrelevant
Parameter #2: Alignment Mask
Description:
Detects the alignment specified by the 'Alignment Mask' field.
Known values for 'Alignment Mask' are:
0 Evil (Glow red)
1 Neutral (Glow blue)
2 Good (Glow Green)

#116 (0x74) State: Cure Invisibility
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes invisibility from the targeted creature(s).
This effect ignores durations attributed to it.
Important: Both parameters should be 0 (zero).

#117 (0x75) Spell Effect: Reveal Area Variants: IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Reveals the current area.
Note: This does not remove the fog of war.

#118 (0x76) Empty: Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This opcode has no effect.

#119 (0x77) Spell Effect: Mirror Image Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the mirror image effect to the targeted creature(s). The number of images is dicated by the level of the caster.

#120 (0x78) Protection: from Melee Weapons
Parameter #1: Enchantment
Parameter #2: Type
Description:
Gives the targeted creature(s) immunity to melee weapons as specified by the 'Type' field. The 'Enchantment' field is used if 'Type' is set to 0.
Known values for 'Type' are:
0 Enchantment
1 Magical
2 Non-Magical
3 Silver
4 Non-Silver
5 Silver / Non-Magical
6 Two-Handed
7 Non Two-Handed
8 Cursed
9 Non-Cursed
10 Cold-Iron
11 Non Cold-Iron

#121 (0x79) Empty:
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This opcode has no effect. Sometimes known as "Graphics: (Visual Animation Effect)".

#122 (0x7A) Item: Create Inventory Item Variants: BG1 IWD2
Parameter #1: Charges
Parameter #2: Irrelevant
Description:
Creates the item specified by the resource key. The number of items created is controlled by the 'Charges' field. The number of secondary charge is determined by P3. The number of tertiary charges is determined by P4 (external eff's). The item is created in the Inventory.

#123 (0x7B) Item: Remove Inventory Item
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the item specified by the resource key from the targeted creature(s). This effect should be used to remove inventory items (use opcode #112 for equipped items).

#124 (0x7C) Spell Effect: Teleport (Dimension Door) Variants: PST BG1
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Teleports the targeted creature(s) in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Default
1 Source to Target
2 Return to Saved Location
3 Exchanged Source and Target
Important: In IWD2 both parameters should be 0.

#125 (0x7D) Spell Effect: Unlock (Knock)
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the knock effect to the targeted creature(s).
Important: Both parameters should be 0 (zero).

#126 (0x7E) Stat: Movement Modifier Variants: PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
The engine allows values for 'Statistic Modifier' from 0 (immobile) to 255 (instantaneous), though behaviour is only consistent in the range 0 - 30.
Known values for 'Type' are:
0 Cumulative Modifier -> Movement = Movement + 'Statistic Modifier' value
1 Flat Value Modifier -> Movement = 'Statistic Modifier' value
2 Percentage Modifier -> Movement = (Movement * 'Statistic Modifier' value) / 100
Note: BG1 does not support the cumulative modifier and will behave as if in flat modifier mode.

#127 (0x7F) Summon: Monster Summoning Variants: IWD2 PST
Parameter #1: Number
Parameter #2: Type
Special: Mode
Description:
Summons a number of monsters.
Each CRE files has a Creature Power Level number (at 0x18). The amount of monsters summoned by this effect depends on this value, the special parameter and if it's used in SPL / ITM or from an external EFF.
When used in SPL/ITM, known value for 'Mode' are:
  • 0 => Summon until Creature Power Level equals/exceeds 'Number'
  • 1 => Summon amount equal to 'Number'
  • 2 => Summon until Creature Power Level equals/exceeds "Caster Level"

When used in EFF, known value for 'Mode' are:
  • 0 => Summon until Creature Power Level equals/exceeds 'Number'
  • 1 => Summon amount equal to ('Number' + Dice rolls)
  • 2 => Summon until Creature Power Level equals/exceeds "Caster Level" field of EFF (located at offset 0xc8)

The 'Type' field sets which 2DA file to pick the creatures to summon from. The 2da files are monsumX and anisumX, where X = 'Type' + 1. 0-4 are allied , 5-9 are hostile. The specific 2da files used are:
  • 0 MONSUM01 Monster Summon 1
  • 1 MONSUM02 Monster Summon 2
  • 2 MONSUM03 Monster Summon 3
  • 3 ANISUM01 Animal Summon 1
  • 4 ANISUM02 Animal Summon 2
  • 5 MONSUM01 Monster Summon 1 Hostile
  • 6 MONSUM02 Monster Summon 2 Hostile
  • 7 MONSUM03 Monster Summon 3 Hostile
  • 8 ANISUM01 Animal Summon 1 Hostile
  • 9 ANISUM02 Animal Summon 2 Hostile

A custom .2da file can be entered in the resource field (untested in bg1).
If used from an external effect (.eff), the vvc field controls the bam file played when summoning.

#128 (0x80) State: Confusion
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the confusion effect the targeted creature(s). The creature will run around uncontrollable, randomly attacking.

#129 (0x81) State: Aid Variants: PST
Parameter #1: Statistic Modifier
Parameter #2: Irrelevant
Description:
Applies a bless effect, a bonus to HP and a bonus to saving throws to the targeted creature(s). The bonus is a number of 8-sided dice, with the number of dice controlled by the 'Statistic Modifier' value.

#130 (0x82) State: Bless Variants: PST
Parameter #1: Modifier
Parameter #2: Irrelevant
Description:
Modifies the THAC0, damage and morale of the target creature(s) by the amount specified by the 'Modifier' parameter.
Note: In IWD2 the effect is non-cumulative and also removes any Bane effects. This does not apply to Doom in other games.

#131 (0x83) State: Positive Chant Variants: IWD2
Parameter #1: Modifier
Parameter #2: Irrelevant
Description:
Applies the chant effect to the targeted creature(s). Chant affects the minimum damage caused by a weapon (up to the normal maximum damage of the weapon) and the attack roll modifier (up to a maximum of 20, excluding natural attack roll modifiers, e.g. high STR, invisibility etc) by 'Statistic Modifier' amount. The effect sets STATE_CHANT.
'Modifier' must be in the [-6,5] range.
Note: Multiple chant effects are not cumulative.

#132 (0x84) State: Raise Strength, Constitution, & Dexterity Non-Cumulative
Parameter #1: Statistic Modifier
Parameter #2: Irrelevant
Description:
Raises the strength, constitution and dexterity of the targeted creature(s) by the value specified by the 'Statistic Modifier' field. A negative value of 'Statistic Modifier' sets the strength, constitution and dexterity of the targeted creature(s) to 25.

#133 (0x85) Spell Effect: Luck Non-Cumulative
Parameter #1: Statistic Modifier
Parameter #2: Irrelevant
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field to the targetted creatures luck. Luck affects the minimum damage caused by a weapon (up to the normal maximum damage of the weapon) and the attack roll modifier (up to a maximum of 20, excluding natural attack roll modifiers, e.g. high STR, invisibility etc) by 'Statistic Modifier' amount. 'Statistic Modifier' also affects the damge rolls of opponents (in feature blocks, not extension headers). The effect sets STATE_LUCK.

#134 (0x86) State: Petrification
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the petrification effect to the targeted creature(s). This effects kills & removes PC's from the party, and ends the game if used on the Protagonist (not in IWDs or PST).
Important: Both parameters should be 0 (zero).

#135 (0x87) Graphics: Polymorph into Specific Variants: BG1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Polymorphs the targeted creature(s) into the creature specified by the resource key, in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Gain Resistances/statistics (spell-casting disabled)
1 Appearance only

This effect sets stat #59 (POLYMORPHED) to 1 but only if param #2 is 0.
If the resource key is empty, other polymorph effects are removed, allowing for removal of permanent effects.
Note: When param #2 is 0, this opcode sets Strength, Dexterity, Resistances (excluding Poison and Magic Damage), Base AC, Specific AC (Crush/Slash/Pierce/Missile), and Base APR.
Note: When the resource key is empty, and it subsequently clears other Polymorph Effects, param#2 is used just like param#1 of opcode #337. As a result, it will clear all Polymorph effects if param#2 = “-1”, else it will only clear Polymorph effects that have a param#2 that matches.
Warning: The creature you’re polymorphing into cannot have STATE_SLEEPING, STATE_FROZEN_DEATH, STATE_STONE_DEATH, STATE_FLAME_DEATH, or STATE_DEAD set in its CRE file, or the game will crash.

#136 (0x88) State: Force Visible
Parameter #1: Undefined
Parameter #2: Undefined
Description:
Renders the targeted creature(s) partially visible: removes normal invisibility, but not the improved invisibility state; the targeted is visible and attackable, but not targetable by spells.

The effect has no meaning on visible targets.
This effect has no duration.
Important: Leave both parameters at zero for this effect to work.

#137 (0x89) State: Negative Chant Variants: IWD2
Parameter #1: Modifier
Parameter #2: Irrelevant
Description:
Applies the chant effect to the targeted creature(s).

This effect works as the reverse of chant. The effect sets STATE_CHANTBAD.

#138 (0x8A) Graphics: Character Animation Change Variants: BG1 IWD1 PST
Parameter #1: Irrelevant
Parameter #2: Animation Sequence
Description:
The targeted creature(s) shows the animation sequence specified by the 'Animation Sequence' field.
Known values for 'Type' are (from SEQ.IDS):
0 Attack
1 Awake
2 Cast
3 Conjure
4 Damage
5 Die
6 Turn head
7 Ready
8 Shoot
9 Twitch
10 Walk
11 Attack (Slash)
12 Attack (Backslash)
13 Attack (Jab)
14 Emerge
15 Hide
16 Sleep

#139 (0x8B) Text: Display String
Parameter #1: String Reference
Parameter #2: Irrelevant
Description:
Displays the strref specified by the 'String Reference' value.
Info: At least in EE games, it is possible to colorize the string. In order to do so, follow the instructions concerning the colorization of the name of your character during Character Creation.

#140 (0x8C) Graphics: Casting Glow Variants: IWD2 PST BG1
Parameter #1: Projectile Index
Parameter #2: Type
Description:
Creates the specified projectile at the targeted creature's location. These effects are usually used for casting glows based on the spell school.
Known values for 'Type' are:
  • 0 => Use 'Projectile Index' projectile value.
  • 1 .. 8 => Crash
  • 9 => PROJECTL[110], Default file: "CGNECROM.PRO"
  • 10 => PROJECTL[111], Default file: 'CGALTERA.PRO'
  • 11 => PROJECTL[112], Default file: 'CGENCHAN.PRO'
  • 12 => PROJECTL[113], Default file: 'CGABJURA.PRO'
  • 13 => PROJECTL[114], Default file: 'CGILLUSI.PRO'
  • 14 => PROJECTL[115], Default file: 'CGCONJUR.PRO'
  • 15 => PROJECTL[116], Default file: 'CGINVOCA.PRO'
  • 16 => PROJECTL[117], Default file: 'CGDIVINA.PRO'
Info: ‘Projectile Index’ must be treated as in spells, i.e.: value in PROJECTL.IDS + 1
Note: This projectile does not deliver any effects.
Note:
The speed of the projectiles animations ARE affected by STATE[BIT15 STATE_HASTED] and STATE[BIT16 STATE_SLOWED] of the target.

#141 (0x8D) Graphics: Lighting Effects Variants: IWD2 PST BG1
Parameter #1: Target
Parameter #2: Type
Description:
Actually creates the projectile (not just a BAM file) specified by the 'Type' value at the location specified by 'Target'. These effects are usually used for spell hits based on the spell school.
Known values for 'Target' are:
  • 0 => Current Location
  • Non-zero => Target Location

Known values for 'Type' are:
  • 0 => PRO[Index]:118, Animation: "SHAIR.BAM", Palette Notes: (default) (ice)
  • 1 => PRO[Index]:119, Animation: "SHEARTH.BAM", Palette Notes: (default) (ice)
  • 2 => PRO[Index]:120, Animation: "SHWATER.BAM", Palette Notes: (default) (ice)
  • 4 => PRO[Index]:121, Animation: "SHAIR.BAM", Palette Notes: "SHAIR1.BMP" (blue)
  • 5 => PRO[Index]:122, Animation: "SHEARTH.BAM", Palette Notes: "SHEARTH1.BMP" (blue)
  • 6 => PRO[Index]:123, Animation: "SHWATER.BAM", Palette Notes: "SHWATER1.BMP" (blue)
  • 8 => PRO[Index]:124, Animation: "SHAIR.BAM", Palette Notes: "SHAIR2.BMP" (gold)
  • 9 => PRO[Index]:125, Animation: "SHEARTH.BAM", Palette Notes: "SHEARTH2.BMP" (gold)
  • 10 => PRO[Index]:126, Animation: "SHWATER.BAM", Palette Notes: "SHWATER2.BMP" (gold)
  • 12 => PRO[Index]:127, Animation: "SHAIR.BAM", Palette Notes: "SHAIR3.BMP" (green)
  • 13 => PRO[Index]:128, Animation: "SHEARTH.BAM", Palette Notes: "SHEARTH3.BMP" (green)
  • 14 => PRO[Index]:129, Animation: "SHWATER.BAM", Palette Notes: "SHWATER3.BMP" (green)
  • 16 => PRO[Index]:130, Animation: "SHAIR.BAM", Palette Notes: "SHAIR4.BMP" (magenta)
  • 17 => PRO[Index]:131, Animation: "SHEARTH.BAM", Palette Notes: "SHEARTH4.BMP" (magenta)
  • 18 => PRO[Index]:132, Animation: "SHWATER.BAM", Palette Notes: "SHWATER4.BMP" (magenta)
  • 20 => PRO[Index]:133, Animation: "SHAIR.BAM", Palette Notes: "SHAIR5.BMP" (purple)
  • 21 => PRO[Index]:134, Animation: "SHEARTH.BAM", Palette Notes: "SHEARTH5.BMP" (purple)
  • 22 => PRO[Index]:135, Animation: "SHWATER.BAM", Palette Notes: "SHWATER5.BMP" (purple)
  • 24 => PRO[Index]:136, Animation: "SHAIR.BAM", Palette Notes: "SHAIR6.BMP" (red)
  • 25 => PRO[Index]:137, Animation: "SHEARTH.BAM", Palette Notes: "SHEARTH6.BMP" (red)
  • 26 => PRO[Index]:138, Animation: "SHWATER.BAM", Palette Notes: "SHWATER6.BMP" (red)
  • 28 => PRO[Index]:139, Animation: "SHAIR.BAM", Palette Notes: "SHAIR7.BMP" (stone)
  • 29 => PRO[Index]:140, Animation: "SHEARTH.BAM", Palette Notes: "SHEARTH7.BMP" (stone)
  • 30 => PRO[Index]:141, Animation: "SHWATER.BAM", Palette Notes: "SHWATER7.BMP" (stone)
  • 32 => PRO[Index]:142, Animation: "SPBOOM.BAM", Palette Notes: MPALETTE[67] (shiny gold)
  • 33 => PRO[Index]:143, Animation: "SPBOOM.BAM", Palette Notes: MPALETTE[65] (really dark gray)
  • 34 => PRO[Index]:144, Animation: "SPBOOM.BAM", Palette Notes: MPALETTE[69] (shiny green)
  • 35 => PRO[Index]:145, Animation: "FLMSTRK.BAM", Palette Notes: (default) (BG1 flamestrike)
  • 36 => PRO[Index]:146, Animation: "HLYMITE.BAM", Palette Notes: (default) (BG1 draw upon holy might)
  • 37 => PRO[Index]:147, Animation: "SHAIR.BAM", Palette Notes: (default) (white)
  • 38 => PRO[Index]:109, Animation: "SPDIMNDR.BAM", Palette Notes: (default) (BG1 dimension door)
  • 39 => PRO[Index]:207, Animation: "SPFDEATH.BAM", Palette Notes: (default) (BG1 finger of death)
Note: All of these projectiles are hardcoded, but can be overridden in PROJECTL.IDS
Note: This projectile does not deliver any effects.
Note:
The speed of the projectiles animations ARE NOT affected by STATE[BIT15 STATE_HASTED] and STATE[BIT16 STATE_SLOWED] of the target.

#142 (0x8E) Graphics: Display Special Effect Icon Variants: BG1 IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Icon
Description:
Shows the icon specified by the 'Icon' field on the targeted creature(s) portrait.
All values are drawn directly from STATES.BAM in the GUIBam.bif starting at sequence 65.
Known values for 'Icon' are:
0 Charm
1 Dire Charm
2 Rigid Thinking
3 Confusion
4 Berserk
5 Intoxicated
6 Poisoned
7 Nauseated
8 Blind
9 Protection from Evil
10 Protection from Petrification
11 Protection from Missiles
12 Magic Armour
13 Held
14 Sleep
15 Shielded
16 Protection from Fire
17 Blessed
18 Chant
19 Free Action
20 Barkskin
21 Strength
22 Heroism
23 Invulnerable
24 Protection from Acid
25 Protection from Cold
26 Resist Fire/Cold
27 Protection from Electricity
28 Protection from Magic
29 Protection from Undead
30 Protection from Poison
31 Non-detection
32 Good luck
33 Bad luck
34 Silenced
35 Cursed
36 Panic
37 Resist Fear
38 Haste
39 Fatigue
40 Bard Song
41 Slow
42 Regenerate
43 Domination
44 Hopelessness
45 Greater Malison
46 Spirit Armour
47 Chaos
48 Feebleminded
49 Defensive Harmony
50 Champion's Strength
51 Dying
52 Mind Shield
53 Level Drain
54 Polymorph Self
55 Stun
56 Regeneration
57 Perception
58 Master Thievery
59 Energy Drain (Psionic/Mindflayer)
60 Holy Power
61 Cloak of Fear
62 Iron Skins
63 Magic Resistance
64 Righteous Magic
65 Spell Turning
66 Repulsing Undead
67 Spell Deflection
68 Fire Shield Red
69 Fire Shield Blue
70 Protection from Normal Weapons
71 Protection from Magic Weapons
72 Tenser's Transformation
73 Protection from Magical Energy
74 Mislead
75 Contingency Active
76 Protected from the Elements
77 Projected Image
78 Maze
79 Imprisonment
80 Stoneskin
81 KAI
82 Called Shot
83 Spell Failure
84 Offensive Stance
85 Defensive Stance
86 Intelligence Drained by Mind Flayer
87 Regenerating
88 Dialog Mode
89 At a Store
90 Negative Plane Protection
91 Ability Score Drained
92 Spell Sequencer Active
93 Protected from Energy
94 Magnetized
95 Able to Poison Weapons
96 Setting Trap
97 Glass Dust
98 Blade Barrier
99 Death Ward
100 Doom
101 Decaying
102 Acid
103 Vocalize
104 Mantle
105 Miscast Magic
106 Magic Resistance Lowered
107 Spell Immunity
108 True Seeing
109 Detecting Traps
110 Improved Haste
111 Spell Trigger
112 Deaf
113 Enfeebled
114 Infravision
115 Friends
116 Shield of the Archons
117 Spell Trap
118 Absolute Immunity
119 Improved Mantle
120 Farsight
121 Globe of Invulnerability
122 Minor Globe of Invulnerability
123 Spell Shield
124 Polymorphed
125 Otiluke's Resilient Sphere
126 Nauseated
127 Ghost Armor
128 Glitterdust
129 Webbed
130 Unconscious
131 Mental Combat
132 Physical Mirror
133 Repulse Undead
134 Chaotic Commands
135 Draw Upon Holy Might
136 Strength of One
137 Bleeding
138 Barbarian Rage
139 Boon of Lathander
140 Storm Shield
141 Enraged
142 Stunning Blow
143 Quivering Palm
144 Entangled
145 Grease
146 Smite
147 Hardiness
148 Power Attack
149 Whirlwind Attack
150 Greater Whirlwind
151 Magic Flute
151 Chaos of Battle (IWD:EE only)
152 Critical Strike
153 Greater Deathblow
154 Deathblow
155 Avoid Death
156 Assassination
157 Evasion
158 Greater Evasion
159 Improved Alacrity
160 Aura of Flaming Death
161 Globe of Blades
162 Improved Chaos Shield*
163 Chaos Shield*
164 Fire Elemental Transformation
164 Shield of Lathander (IWD:EE only)
165 Earth Elemental Transformation
165 Greater Shield of Lathander (IWD:EE only)
166 Mind Blank (IWD:EE only)
167 Aid (IWD:EE only)
168 Phased (IWD:EE only)
169 Pain (IWD:EE only)
170 Impervious Sanctity of Mind (IWD:EE only)
171 Petrified (IWD:EE only)
172 Iron Body (IWD:EE only)
173 Animal Rage (IWD:EE only)
174 Exaltation (IWD:EE only)
175 Recitation (IWD:EE only)
176 Blood Rage (IWD:EE only)
177 The Ballad of Three Heroes (IWD:EE only)
178 The Tale of Curran Strongheart (IWD:EE only)
179 Tymora's Melody (IWD:EE only)
180 The Song of Kaudies (IWD:EE only)
181 The Siren's Yearning (IWD:EE only)
182 War Chant of Sith (IWD:EE only)
183 Prayer (IWD:EE only)
184 Righteous Wrath of the Faithful (IWD:EE only)
185 Cat's Grace (IWD:EE only)
186 Hope (IWD:EE only)
187 Courage (IWD:EE only)
188 Enchanted Weapon (EE only)
189 Spirit Ward (EE only)
190 Ether Gate (EE only)
191 Shamanic Dance (EE only)
192 Chaos of Battle (BG:EE only)
192 Repulsion (IWD:EE only)
193 Marek's Poison (BG:EE only)
193 Increased Movement Rate (IWD:EE only)
194 Repulsion (BG:EE only)
194 Immunity: Abjuration (IWD:EE only)
195 Increased Movement Rate (BG:EE only)
195 Immunity: Conjuration (IWD:EE only)
196 Immunity: Abjuration (BG:EE only)
196 Immunity: Divination (IWD:EE only)
197 Immunity: Conjuration (BG:EE only)
197 Immunity: Enchantment (IWD:EE only)
198 Immunity: Divination (BG:EE only)
198 Immunity: Illusion (IWD:EE only)
199 Immunity: Enchantment (BG:EE only)
199 Immunity: Evocation (IWD:EE only)
200 Immunity: Illusion (BG:EE only)
200 Immunity: Necromancy (IWD:EE only)
201 Immunity: Evocation (BG:EE only)
201 Immunity: Alteration (IWD:EE only)
202 Immunity: Necromancy (BG:EE only)
203 Immunity: Alteration (BG:EE only)
Note: The engine refuses to show portrait 79 (Imprisonment).
Note: In EE games, values 0 – 190 are drawn directly from “STATES.BAM” from sequences 65 – 255, but can be overridden in STATDESC.2DA. Additional values must be added to STATDESC.2DA.

#143 (0x8F) Item: Create Item in Slot Variants: IWD2 PST
Parameter #1: Slot
Parameter #2: Irrelevant
Description:
Creates the item specified by the resource key in the slot specified by the 'Slot' field, on the targeted creature(s).
Known values for 'Slot' (from slots.ids) are:
0 AMULET
1 ARMOR
2 BELT
3 BOOTS
4 CLOAK
5 GAUNTLETS
6 HELMET
7 RING_LEFT
8 RING_RIGHT
9 SHIELD
10 FIST
11 AMMO
15 MISC
35 WEAPON
11 AMMO0
12 AMMO1
13 AMMO2
14 AMMO3
15 MISC0
16 MISC1
17 MISC2
18 MISC3
19 MISC4
20 MISC5
21 MISC6
22 MISC7
23 MISC8
24 MISC9
25 MISC10
26 MISC11
27 MISC12
28 MISC13
29 MISC14
30 MISC15
31 MISC16
32 MISC17
33 MISC18
34 MISC19 – Magical Weapon slot
35 WEAPON0
36 WEAPON1
37 WEAPON2
38 WEAPON3
Important: The Magical Weapon slot does not allow Item Abilities (header_type = 3).
Moreover, unlike opcode #111, this opcode will not "equip" the item that's created in this particular slot.
Note: When using a non-permanent timing mode, it applies a delayed opcode #123 effect based on the duration, but with an empty resource field, resulting in nothing being removed.

#144 (0x90) Button: Disable Button Variants: BG1 IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Button
Description:
Disabled the button specified by the 'Button' field. The resource field acts as a matching key to the resource field of the Enable Button, allowing separate enable/disable reasons.
Known values for 'Button' are:
0 Stealth Button
1 Thieving Skill Button
2 Spell Select Button
3 First Quick Spell Button
4 Second Quick Spell Button
5 Third Quick Spell Button
6 Turn Undead Button
7 Talk Button
8 Use Item Button
9 First Quick Item Button
10 Bard Song Button (only in EEs)
11 Second Quick Item Button
12 Third Quick Item Button
13 Innate Ability Button
14 Find Traps Button
15 Inventory Button (only in EEs)

#145 (0x91) Spell: Disable Spell Casting Abilities Variants: IWD2
Parameter #1: Irrelevant
Parameter #2: Spell Type
Special: Show message?
Description:
Disables spell casting abilities of the targeted creature(s), in the style specified by the 'Spell Type;' field.
Known values for 'Type' are:
0 Wizard
1 Priest
2 Innate
3 Innate, only 'magical' abilities (SPL flags bit 14 "Ignore dead/wild magic" unset) (BGEE)

#146 (0x92) Spell: Cast Spell (at Creature) Variants: IWD2 PST
Parameter #1: Casting Level
Parameter #2: Type
Description:
Casts the spell specified by the resource key at the level specified by the 'Casting Level' field, in the style specified by the 'Type' field. A 'Casting Level' of 0 casts at the level of the casting creature.
Known values for 'Type' are:
0 Normal Casting
1 Cast Instantly
If the target is a container, the Type parameter is ignored and treated as 0

#147 (0x93) Spell: Learn Spell Variants: IWD2 PST BG1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
The targeted creature(s) tries to learn the spell specified by the resource key.
Learning is successful when 1D100 <= the INT-dependent LEARN_SPELL value in INTMOD.2DA.
The LEARN_SPELL value is modified for mage specialists, with +15 for same school spells, and -15 for non-same school spells.

#148 (0x94) Spell: Cast Spell (at Point)
Parameter #1: Casting Level
Parameter #2: Type
Description:
Casts the spell specified by the resource key, at the level specified by the 'Casting Level' field, in the style specified by the 'Type' field. A 'Casting Level' of 0 casts at the level of the casting creature.
Known values for 'Type' are:
0 Normal Casting
1 Cast Instantly
Note: This opcode does not work if the target is a container in non-ee versions.

#149 (0x95) (Identify)
Parameter #1: Undefined
Parameter #2: Undefined
Description:
The use of this effect is unknown, and effect of its parameters are undefined.

#150 (0x96) Spell Effect: Find Traps
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the find traps effect to the targeted creature(s).
Important: Both parameters should be 0 (zero).
Important: This effect is automatically successful, but can only find traps that are normally detectable by the Find Traps skill.

#151 (0x97) Summon: Replace Creature Variants: IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Replaces the targeted creature(s) with creature specified by the resource key, in the style specified by the 'Type' value.
Known values for 'Type' are:
  • 0 => Remove targeted creature via opcode #168
  • 1 => Kill targeted creature via opcode #13*8 (Chunking death)
  • 2 => Kill targeted creature via opcode #13*4 (Normal death)
  • 3 => No effect on targeted creature – New creature (specified by the resource key) is spawned at target's location
Note: Experience is given as normal for a kill (the party still has to be the one applying the effect to earn experience).

#152 (0x98) Spell Effect: Play Movie Variants: BG1 IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Plays the movie specified by the resource key.

BG2 TOB All EE games BG:EE BG:SoD BG2:EE
BISLOGO INTRO LOGO – WotC logo DEATHAND – Death SODCIN01 – Siege of Dragonspear Introduction NITEDAY – Sunrise
BWDRAGON MANAFORG INTRO – Baldur's Gate: Enhanced Edition Introduction SODCIN02 – Boarskyr Bridge DAYNITE – Sunset
DAYNITE MELISSAN REST – Resting Outside SODCIN03 – Murder DEATHAND – Death
DEATHAND OUTRO RESTDUNG – Resting in Dungeon SODCIN05 – Epilogue INTRO15F – Shadows of Amn Intro
END15FPS SARADUSH RESTINN – Resting at Inn FLYTHR01 – Asylum
ENDCRDIT POCKETZZ BGENTER – Entering Baldur's Gate FLYTHR02 – Underdark
FLYTHR01 FRARMINN – Friendly Arm Inn FLYTHR03 – Suldanessellar
FLYTHR02 NASHKELL – Nashkell FLYTHR04 – Hell
FLYTHR03 CAMP – Bandit Camp INTRO – Throne of Bhaal Intro
FLYTHR04 MINEFLOD – Flooding Cloakwood Mines POCKETZZ – Pocket Plane Rest
INTRO15F ELDRCITY – Undercity SARADUSH – Saradush Flythrough
NITEDAY ENDMOVIE – Epilogue MANAFORG – Mana Forge Flythrough
RESTCAMP ENDCRDIT – Credits MELISSAN – Melissan's Demise
RESTDUNG WRECK – Wrecked Ship (Werewolf Island) OUTRO – Closing the Book
RESTINN BLACKPIT – The Black Pits Introduction HEXXATDR – Dragomyr's Crypt (Hexxat)
WOTC DORNGORG – Resurrection Gorge (Dorn)
DORNTREE – Ritual Circle (Dorn)
NEERAES – Town Bell (Neera)
RASAADMI – Sharran (Rasaad)
RASAADTE – Temple (Rasaad)

#153 (0x99) Overlay: Sanctuary Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Mode
Description:
Applies the sanctuary effect to the targeted creature(s).

Known values for 'Mode' are:
  • 0 => Default overlay, "SANCTRY.BAM"
  • 1 => Custom overlay, Resource field: Animation file (VVC or BAM)

This effect sets STAT #63 to 1.
Important: Both parameters should be 0 (zero).

#154 (0x9A) Overlay: Entangle Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Mode
Description:
Applies the entangle visual effect to the targeted creature(s). Does not actually prevent the target from moving.

Known values for 'Mode' are:
  • 0 => Default overlay, "SPENTACI.BAM"
  • 1 => Custom overlay, Resource field: Animation file (VVC or BAM)

This effect sets STAT #62 to 1.
Important: Both parameters should be set to 0.

#155 (0x9B) Overlay: Minor Globe Variants: IWD2 BG1
Parameter #1: Irrelevant
Parameter #2: Mode
Description:
Applies the minor globe visual effect to the targeted creature(s).

Known values for 'Mode' are:
  • 0 => Default overlay, "MINORGLB.BAM"
  • 1 => Custom overlay, Resource field: Animation file (VVC or BAM)

This effect sets STAT #64 to 1.

#156 (0x9C) Overlay: Protection from Normal Missiles Cylinder Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Mode
Description:
Applies the protection from normal missiles cylinder visual effect to the targeted creature(s).

Known values for 'Mode' are:
  • 0 => Default overlay, "SPSHIELD.BAM"
  • 1 => Custom overlay, Resource field: Animation file (VVC or BAM)

This effect sets STAT #65 to 1.
Important: Both parameters should be 0 (zero).

#157 (0x9D) State: Web Effect Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Mode
Description:
Applies the web effect to the targeted creature(s). The affected creature becomes immobile and its AI scripts stop running.

Known values for 'Mode' are:
  • 0 => Default overlay, "WEBENTD.BAM"
  • 1 => Custom overlay, Resource field: Animation file (VVC or BAM)

This effect sets STAT #58 and STAT #67 to 1. It also sets the STATE_HELPLESS flag.
Important: Both parameters should be 0 (zero).
Note: It cannot be removed by any of the stun/held removal opcodes.

#158 (0x9E) Overlay: Grease Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Mode
Description:
Applies the grease visual effect to the targeted creature(s). Does not actually affect the target's movement rate.

Known values for 'Mode' are:
  • 0 => Default overlay, "GREASED.BAM"
  • 1 => Custom overlay, Resource field: Animation file (VVC or BAM)

This effect sets STAT #66 to 1.
Important: Both parameters should be 0 (zero).

#159 (0x9F) Spell Effect: Mirror Image (Exact Number)
Parameter #1: Amount
Parameter #2: Irrelevant
Description:
Applies the mirror image effect to the targeted creature(s), creating a number of images equal to the 'Amount' value.

#160 (0xA0) Remove Sanctuary Variants: IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the sanctuary effect from the targeted creature(s).
Important: Both parameters should be 0 (zero).

#161 (0xA1) Cure: Horror
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the horror effect from the targeted creature(s).
This effect ignores durations attributed to it.

#162 (0xA2) Cure: Hold Variants: PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the paralysis effect (opcode #109 and opcode #175) from the targeted creature(s).
Important: This effect should be used with an instant timing mode.

#163 (0xA3) Protection: Free Action Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the free action effect to the targeted creature(s), restoring the creatures movement rate to its default value.
In particular, it only removes opcode #126 effects using 'param2 = 1' (Set value), if the creature's current movement rate is less than the default movement rate for its current animation (Haste/Slow are not factored in this).
Important: Does NOT remove "Increment" or "Set % Value" effects, nor any using the alternate movement rate opcode, opcode #176.
Note: Similarly affects opcode #177/opcode #283 effects if the EFF file is using the above values.

#164 (0xA4) Cure: Drunkeness Variants: BG1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Clears the drunkeness stat (as modified by opcode #94).

#165 (0xA5) Spell Effect: Pause Target
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the pause effect to the targeted creature(s).
In particular:
  • Their inventory is still access-able.
  • They are still select-able, and can be issued orders (for instance, activating modal abilities), though not all actions can be taken.
  • It does not interrupt/end modal abilities the creature is currently using.
  • They are not "helpless", an attack roll is still required to hit them.
  • Their scripts stop running.

This effect sets STAT #70 to 1.
Important: Both parameters should be 0.

#166 (0xA6) Stat: Magic Resistance Modifier Variants: BG1 PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Resistance = Resistance + 'Statistic Modifier' value
1 Flat Value Modifier -> Resistance = 'Statistic Modifier' value

#167 (0xA7) Stat: THAC0 Modifier with Missile Weapons Variants: IWD2 PST
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> THAC0 = THAC0 + 'Statistic Modifier' value
1 Flat Value Modifier -> THAC0 = 'Statistic Modifier' value
2 Percentage Modifier -> THAC0 = (THAC0 * 'Statistic Modifier' value) / 100

#168 (0xA8) Summon: Remove Creature Variants: PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Moves the targeted creature(s) to area ".ARE" (a non-existent area). Also known as Script: Destroy Self.

This deletes non-global creatures from the game (most common usage).

For Global Creatures:
  • This effect removes the creature from the player's party (if they were in it).
  • The effect will keep the creature out of the party and any other Area for its duration, but does not re-instate the creature once it expires.
  • They can still be recovered through script actions once the effect expires.
Important: Both parameters should be 0 (zero).

#169 (0xA9) Graphics: Prevent Special Effect Icon Variants: BG1 IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Icon
Description:
Prevents the icon specified by the 'Icon' field from being displayed.
All values are drawn directly from "STATES.BAM" in the "GUIBam.bif" starting at sequence 65.
Known values for 'Icon' are:
0 Charm
1 Dire Charm
2 Rigid Thinking
3 Confusion
4 Berserk
5 Intoxicated
6 Poisoned
7 Nauseated
8 Blind
9 Protection from Evil
10 Protection from Petrification
11 Protection from Missiles
12 Magic Armour
13 Held
14 Sleep
15 Shielded
16 Protection from Fire
17 Blessed
18 Chant
19 Free Action
20 Barkskin
21 Strength
22 Heroism
23 Invulnerable
24 Protection from Acid
25 Protection from Cold
26 Resist Fire/Cold
27 Protection from Electricity
28 Protection from Magic
29 Protection from Undead
30 Protection from Poison
31 Non-detection
32 Good luck
33 Bad luck
34 Silenced
35 Cursed
36 Panic
37 Resist Fear
38 Haste
39 Fatigue
40 Bard Song
41 Slow
42 Regenerate
43 Domination
44 Hopelessness
45 Greater Malison
46 Spirit Armour
47 Chaos
48 Feebleminded
49 Defensive Harmony
50 Champion's Strength
51 Dying
52 Mind Shield
53 Level Drain
54 Polymorph Self
55 Stun
56 Regeneration
57 Perception
58 Master Thievery
59 Energy Drain (Psionic/Mindflayer)
60 Holy Power
61 Cloak of Fear
62 Iron Skins
63 Magic Resistance
64 Righteous Magic
65 Spell Turning
66 Repulsing Undead
67 Spell Deflection
68 Fire Shield Red
69 Fire Shield Blue
70 Protection from Normal Weapons
71 Protection from Magic Weapons
72 Tenser's Transformation
73 Protection from Magical Energy
74 Mislead
75 Contingency Active
76 Protected from the Elements
77 Projected Image
78 Maze
79 Imprisonment
80 Stoneskin
81 KAI
82 Called Shot
83 Spell Failure
84 Offensive Stance
85 Defensive Stance
86 Intelligence Drained by Mind Flayer
87 Regenerating
88 Dialog Mode
89 At a Store
90 Negative Plane Protection
91 Ability Score Drained
92 Spell Sequencer Active
93 Protected from Energy
94 Magnetized
95 Able to Poison Weapons
96 Setting Trap
97 Glass Dust
98 Blade Barrier
99 Death Ward
100 Doom
101 Decaying
102 Acid
103 Vocalize
104 Mantle
105 Miscast Magic
106 Magic Resistance Lowered
107 Spell Immunity
108 True Seeing
109 Detecting Traps
110 Improved Haste
111 Spell Trigger
112 Deaf
113 Enfeebled
114 Infravision
115 Friends
116 Shield of the Archons
117 Spell Trap
118 Absolute Immunity
119 Improved Mantle
120 Farsight
121 Globe of Invulnerability
122 Minor Globe of Invulnerability
123 Spell Shield
124 Polymorphed
125 Otiluke's Resilient Sphere
126 Nauseated
127 Ghost Armor
128 Glitterdust
129 Webbed
130 Unconscious
131 Mental Combat
132 Physical Mirror
133 Repulse Undead
134 Chaotic Commands
135 Draw Upon Holy Might
136 Strength of One
137 Bleeding
138 Barbarian Rage
139 Boon of Lathander
140 Storm Shield
141 Enraged
142 Stunning Blow
143 Quivering Palm
144 Entangled
145 Grease
146 Smite
147 Hardiness
148 Power Attack
149 Whirlwind Attack
150 Greater Whirlwind
151 Magic Flute
151 Chaos of Battle (IWD:EE only)
152 Critical Strike
153 Greater Deathblow
154 Deathblow
155 Avoid Death
156 Assassination
157 Evasion
158 Greater Evasion
159 Improved Alacrity
160 Aura of Flaming Death
161 Globe of Blades
162 Improved Chaos Shield*
163 Chaos Shield*
164 Fire Elemental Transformation
164 Shield of Lathander (IWD:EE only)
165 Earth Elemental Transformation
165 Greater Shield of Lathander (IWD:EE only)
166 Mind Blank (IWD:EE only)
167 Aid (IWD:EE only)
168 Phased (IWD:EE only)
169 Pain (IWD:EE only)
170 Impervious Sanctity of Mind (IWD:EE only)
171 Petrified (IWD:EE only)
172 Iron Body (IWD:EE only)
173 Animal Rage (IWD:EE only)
174 Exaltation (IWD:EE only)
175 Recitation (IWD:EE only)
176 Blood Rage (IWD:EE only)
177 The Ballad of Three Heroes (IWD:EE only)
178 The Tale of Curran Strongheart (IWD:EE only)
179 Tymora's Melody (IWD:EE only)
180 The Song of Kaudies (IWD:EE only)
181 The Siren's Yearning (IWD:EE only)
182 War Chant of Sith (IWD:EE only)
183 Prayer (IWD:EE only)
184 Righteous Wrath of the Faithful (IWD:EE only)
185 Cat's Grace (IWD:EE only)
186 Hope (IWD:EE only)
187 Courage (IWD:EE only)
188 Enchanted Weapon (BG:EE only)
189 Spirit Ward (EE only)
190 Ether Gate (EE only)
191 Shamanic Dance (EE only)
192 Chaos of Battle (BG:EE only)
192 Repulsion (IWD:EE only)
193 Marek's Poison (BG:EE only)
193 Increased Movement Rate (IWD:EE only)
194 Repulsion (BG:EE only)
194 Immunity: Abjuration (IWD:EE only)
195 Increased Movement Rate (BG:EE only)
195 Immunity: Conjuration (IWD:EE only)
196 Immunity: Abjuration (BG:EE only)
196 Immunity: Divination (IWD:EE only)
197 Immunity: Conjuration (BG:EE only)
197 Immunity: Enchantment (IWD:EE only)
198 Immunity: Divination (BG:EE only)
198 Immunity: Illusion (IWD:EE only)
199 Immunity: Enchantment (BG:EE only)
199 Immunity: Evocation (IWD:EE only)
200 Immunity: Illusion (BG:EE only)
200 Immunity: Necromancy (IWD:EE only)
201 Immunity: Evocation (BG:EE only)
201 Immunity: Alteration (IWD:EE only)
202 Immunity: Necromancy (BG:EE only)
203 Immunity: Alteration (BG:EE only)
Important: Only blocks opcode #142 effects with a matching 'param2' value. Cannot block portrait icons generated by any other mechanic.
Note: In EE games, can also block opcode #177/opcode #283 effects if their EFF file uses opcode #142 with a matching ‘param2’ value.

#170 (0xAA) Graphics: Play Damage Animation Variants: PST
Parameter #1: Irrelevant
Parameter #2: Animation
Description:
Plays the damage animation specified by the 'Animation' field.
Known values for 'Type' are:
0 Blood (behind)
1 Blood (front)
2 Blood (left)
3 Blood (right)
4 Fire 1
5 Fire 2
6 Fire 3
7 Electricity 1
8 Electricity 2
9 Electricity 3

#171 (0xAB) Spell: Give Ability Variants: PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Gives the spell specified by the resource key to the targeted creature(s).

#172 (0xAC) Spell: Remove Spell Variants: BG1 IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the spell specified by the resource key from the targeted creature(s) spellbook.

If the key is not 8 characters long, all memorized copies will be removed.
If the key is 8 characters, memorized copies will remain intact.

Important: Both parameters should be 0 (zero). Two 8 characters long keys that are identical up to the 7th character are indistinguishable!

#173 (0xAD) Stat: Poison Resistance Modifier Variants: BG1
Parameter #1: Statistic Modifier
Parameter #2: Irrelevant
Description:
Sets the Poison Resistance of the target creature(s) to the value specified by 'Statistic Modifier'.
Also known as "Stat: Set Poison Resistance".
Note: In v2.3 and prior, this opcode always “Set” Poison Resistance; in v2.5 and later, it always “increments” Poison Resistance (it stacks).

#174 (0xAE) Spell Effect: Play Sound Effect Variants: BG1 IWD1 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Plays the sound effect specified by the resource key.
Known Sound Effects are:
EFF_E01 Expire Illusionary Spell
EFF_E02 Expire Abjuration Spell
EFF_E03 Expire Conjuration Spell
EFF_E04 Expire Divination Spell
EFF_E05 Expire Enchantment Spell
EFF_E06 Expire Invocation Spell
EFF_E07 Expire Necromancy Spell
EFF_E08 Expire Alteration Spell
EFF_M02 Wizard Abjuration Spell Effect
EFF_M03 Wizard Conjuration Spell Effect
EFF_M04 Wizard Divination Spell Effect
EFF_M05 Wizard Enchantment Spell Effect
EFF_M07 Wizard Necromancy Spell Effect
EFF_M08 Wizard Alteration Spell Effect
EFF_M09 Dimension Door
EFF_M10 Dispel, Expire Illusionary Spell Effect
EFF_M11A Expire Protection from Petrification
EFF_M11B Expire Protection from Normal Missiles
EFF_M11C Protection from Normal Missiles
EFF_M12A Minor Globe Spell Effect
EFF_M12B Expire Minor Globe Spell Effect
EFF_M13 Monster Summoning
EFF_M15 Wizard Hold Person/Undead/Monster
EFF_M16 Confusion Spell Effect
EFF_M18D Melf's Acid Arrow
EFF_M20 Melf's Minute Meteors Impact
EFF_M20 Fireball Impact
EFF_M26 Animate Dead
EFF_M28 Haste
EFF_M29 Slow
EFF_M31A Grease Area Effect Duration
EFF_M31B Grease Start Area Effect
EFF_M31C Grease Affect Creature
EFF_M32 Blur
EFF_M33 Wizard Illusionary Spell Effect
EFF_M34 Ice Storm
EFF_M35 Tree of Life Parasite Destruction
EFF_M36 Viekang Teleport
EFF_M36A Skull Trap (untriggered)
EFF_M36B Skull Trap shatter
EFF_M38 Teleport Without Error
EFF_M41 Disintegrate dust
EFF_M38 ic Armor
EFF_M52 Protection from Acid/Cold/Electricity/Fire
EFF_M53 Spell Protection Removal
EFF_M55 Weapon Protection Effect (e.g. Mantle, etc.)
EFF_M58 Melf's Minute Meteors creation
EFF_M59 Fire
EFF_M60 Stoneskin
EFF_M61 Polymorph/Shapeshift
EFF_M68 Melf's Acid Arrow Impact
EFF_M69 Improved Alacrity/Use Any Item
EFF_M70 Cacofiend, Gate, Summon Fiend
EFF_M71 Power Word: Blind, Kill, Silence, Sleep, Stun
EFF_M71B Wizard Conjure Elemental Mental Combat
EFF_M71C Wizard Conjure Elemental Mental Combat (Won)
EFF_M71D Wizard Conjure Elemental Mental Combat (Lost)
EFF_M73 Summon Hakeashar, Nishruu
EFF_M74 Imprisonment, Maze 1
EFF_M74B Imprisonment, Maze 2
EFF_M76 True Sight/Seeing
EFF_M77 Wizard Eye
EFF_M79 Spook
EFF_M80 Mislead, Project Image, Simulacrum
EFF_M82 Emotion, Greater Malison, Resist Magic
EFF_M86 Contingency & Sequencer -type spells
EFF_M87 Wizard Rapture of the Father
EFF_M89 Wail of the Banshee
EFF_M90 Timestop (Start)
EFF_M91 Timestop (Expire)
EFF_M92 Mirror Image/Priest Illusionary Spell Effect
EFF_M108 Dragon's Breath
EFF_M110 Bigby's Hand Spells
EFF_P01 Priest Abjuration Spell Effect
EFF_P02 Priest Conjuration Spell Effect
EFF_P03 Priest Divination Spell Effect
EFF_P04 Priest Enchantment Spell Effect
EFF_P05 Priest Invocation Spell Effect
EFF_P06 Priest Necromancy Spell Effect
EFF_P07 Priest Alteration Spell Effect
EFF_P08 Animal Summoning
EFF_P11 Hold Animal/Person (Priest)
EFF_P12 Protection from Evil/Magic Energy/The Elements/Energy
EFF_P13 Miscast Magic
EFF_P14 ic Vitriolic Sphere
EFF_P15 ic Recitation
EFF_P16 Flame Strike
EFF_P18 Raise Dead
EFF_P19 Call Lightning
EFF_P21A Sanctuary Start
EFF_P21B Sanctuary Duration
EFF_P21C Sanctuary Expire
EFF_P22A Glyph of Warding non-triggered
EFF_P22B Glyph of Warding Shatter
EFF_P24 BG1 Armor/Shield
EFF_P25 Restoration (Lesser, Greater) casting completion
EFF_P40 Free Action
EFF_P43 Cloak of Fear start/Nature's Beauty
EFF_P51 Remove Fear
EFF_P54 Shillelagh, Spiritual Hammer
EFF_P55 Silence 15' radius
EFF_P56 Barkskin
EFF_P60 Aid
EFF_P61 Ironskins
EFF_P64A Creature Summoning Flash
EFF_P65 Creature Summoning Circle
EFF_P66 Call Woodland Beings
EFF_P69 Unholy Word
EFF_P70 Holy Word
EFF_P72 Command Word
EFF_P73 Charm/Domination
EFF_P76 Flameblade
EFF_P77 Spiritual Hammer Hit
EFF_P80 Blade Barrier Creation
EFF_P83 Bolt of Glory
EFF_P89 Restoration (Greater, Lesser)
EFF_P90 Regeneration
EFF_P92 Earthquake
EFF_P93 Cause Wounds
EFF_P97 Armor of Faith wings
EFF_P115 Implosion
EFF_P116 Conjure Fallen Deva/Planetar
EFF_P117 Conjure Deva/Planetar

#175 (0xAF) State: Hold Variants: BG1 IWD2 IWD1
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Applies a yellow fade in graphic effect to the targeted creature(s), and shows the 'Held' icon, if the targeted creature(s) match the value specified by the 'IDS Entry' field, in the specified 'IDS File'. The affected creature becomes immobile and its AI scripts stop running.
Known values for 'IDS File' are:
This effect sets STAT #58 to 1. It also sets the STATE_HELPLESS flag.
Note: At least in EEs, this opcode automatically displays the string specified by STRREF_EFFECT_HOLD defined in ENGINEST.2DA in the combat log. It even overrides the entries in EFFTEXT.2DA.

#176 (0xB0) Stat: Movement Modifier (II)
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
(As #126, but unaffected by Free Action).
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
The engine allows values for 'Statistic Modifier' from 0 (immobile) to 255 (instantaneous), though behaviour is only consistent in the range 0 - 30.
Known values for 'Type' are:
0 Cumulative Modifier -> Movement = Movement + 'Statistic Modifier' value
1 Flat Value Modifier -> Movement = 'Statistic Modifier' value
2 Percentage Modifier -> Movement = (Movement * 'Statistic Modifier' value) / 100
Warning: PST: This effect doesn’t exist and always crashes the game.

#177 (0xB1) Use EFF File
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Applies the eff file specified by the resource key to the targeted creature(s), if the targeted creature(s) match the value specified by the 'IDS Entry' field, in the specified 'IDS File'.
NB. When using an eff to alter thac0/dmg bonus, set param1 = 0, and param2 = 2.
Known values for 'IDS File' are:
Warning: This effect causes a crash if used by a container
PST: This effect doesn’t exist and always crashes the game.
IWD2: there was a note to not use this effect in older IESDP.

#178 (0xB2) Spell Effect: THAC0 vs. Creature Type Modifier Variants: PST BG1
Parameter #1: IDS Entry
Parameter #2: IDS File
Special: Statistic Modifier
Description:
Alters the targeted creature(s) THAC0 against the creature type specified by the 'IDS Entry' field in the specified 'IDS File'.
The actual modifier value is placed in the Parameter 3 field in an external effect.
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids (EE only)
Note:
  • It will affect all attacks, not just the weapon it's on, which would be incorrect when dual-wielding.
  • Multiple opcode #178 effects only allow additional targeting, they do not stack their THAC0 bonus.
Note: This opcode uses a reverse stacking order: the “oldest” effect with matching IDS values for the target is used, not the most recent, and equipped effects take priority over non-equipped effects.

#179 (0xB3) Spell Effect: Damage vs. Creature Type Modifier Variants: PST BG1
Parameter #1: Reference Value
Parameter #2: Reference IDS
Special: Statistic Modifier
Description:
Alters the targeted creature(s) damage against the creature type specified by the 'IDS Entry' field in the specified 'IDS File'. The actual modifier value is placed in the Parameter 3 field in an external effect - dice values are ignored.
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids (EE only)
Note:
  • It will affect all attacks, not just the weapon it's on, which would be incorrect when dual-wielding.
  • For two-handed/ranged weapons, it can be ideal if a base weapon damage bonus is desired.
  • Damage is multiplied by critical hits (and maybe backstabs).
  • Multiple opcode #179 effects only allow additional targeting, they do not stack their damage bonus.
Note: This opcode uses a reverse stacking order: the “oldest” effect with matching IDS values for the target is used, not the most recent, and equipped effects take priority over non-equipped effects.

#180 (0xB4) Item: Can't Use Item Variants: IWD2 PST
Parameter #1: String Reference
Parameter #2: Undefined
Description:
The targeted creatures(s) cannot use the item specified by the resource key. The strref specified by the 'String Reference' field is displayed when an attempt to use the item is made.

#181 (0xB5) Item: Can't Use Itemtype Variants: BG1 BG2 IWD1 IWD2 PST
Parameter #1: Item Type
Parameter #2: Restriction
Special: Description note
Description:
The targeted creature(s) cannot use the item type specified by the 'Item Type' field for the purpose specified by the 'Restriction' field.
Known values for 'Restriction' are:
0 Equip
1 Use

The message defined in 'Description note' will be displayed whenever this effect is triggered.

#182 (0xB6) Item: Apply Effect Item
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Applies an effect when the specified item is equipped.
Warning: This effect has never been seen to work.
Warning: PST: This effect doesn’t exist and always crashes the game.

#183 (0xB7) Item: Apply Effect Itemtype Variants: IWD2 PST
Parameter #1: Undetermined
Parameter #2: Type
Description:
Applies the effect specified by the resource key to the targeted creature(s) when an item of the item type specified by the 'Type' field is equipped.
Note: Ammo (i.e., Arrows(5), Bullets(14) and Bolts(31)) does not work well with this opcode. The Ammo Slots are always “Equipped”, even when they are not in use. In other words: they trigger opcode #183 just by being in a quiver slot, regardless of whether the correct launcher is equipped or even active.
The offhand has the same issue – even when disabled, it’s detected by this opcode as equipped.
Having said that, this opcode currently allows detecting a launcher using its automated ammo (such as Shortbow of Gesen).
Warning: This effect has never been seen to work. This is not true for EE games.

#184 (0xB8) Graphics: Passwall (Don't Jump)
Parameter #1: Undefined
Parameter #2: Jump
Description:
Allows creatures to be placed in impassable areas, based on the value of the 'Jump' field.
Known values for 'Jump' are:
0 Do Jump from impassable areas
1+ Don't Jump from impassable areas
Warning: PST: This effect doesn’t exist and always crashes the game.
IWD2: Don’t use.

#185 (0xB9) State: Hold Variants: BG1 IWD2 PST
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Applies a yellow fade in graphic effect to the targeted creature(s), and shows the 'Held' icon, if the targeted creature(s) match the value specified by the 'IDS Entry' field, in the specified 'IDS File'. The affected creature becomes immobile and its AI scripts stop running.
This effect is not removed by effect #162.
Known values for 'IDS File' are:
This effect sets STAT #58 to 1. It also sets the STATE_HELPLESS flag.
Note: At least in EEs, this opcode automatically displays the string specified by STRREF_EFFECT_HOLD defined in ENGINEST.2DA in the combat log. It even overrides the entries in EFFTEXT.2DA.

#186 (0xBA) Script: MoveToArea Variants: PST
Parameter #1: Delay
Parameter #2: Orientation
Description:
Marks the targetted creature(s) as travelling to the area specified by the resource key. The creature appears in the specified area after a delay (specified by the 'Delay' field), with the orientation specified by the 'Orientation' field. The creature appears at the point specified by the Target Point fields (external EFF files only).
Warning: IWD2: there was a note to not use this effect in older IESDP.
There is some confusion whether the Target (bg1, iwds) or the Caster point field is used.

#187 (0xBB) Script: Store Local Variable Variants: BG1 PST
Parameter #1: Value
Parameter #2: Irrelevant
Description:
This effect stores a various data types, usually a variable in the 'variable' field.
Resistance.param3: Point
Param4: Float
Param1: Int
Param2: Any
Resource1+2+3: String
Important: This effect can only be used in an external effect (ie. an eff file).

#188 (0xBC) Spell Effect: Aura Cleansing Variants: PST
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
Set the 'Stat Value' field to any non-zero value if you want no time needed between spells.

The effect modifies STAT #76 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#189 (0xBD) Stat: Casting Time Modifier Variants: BG1 PST
Parameter #1: Speed Modifier
Parameter #2: Type
Description:
Alters the casting time of spells by the value specified by the 'Speed Modifier' field. This effect is cummulative.
This effect sets stat #77 (MENTALSPEED) to param #1. Known value for param2 are:
0: Increment by param#1. Positive values decrease the casting time, negative values increase the casting time.
1: Set casting time of every spell to param#1. Negative values set casting time to 0
2: Set casting time of spells with casting time higher than param#1 to param#1. Other spells are unaffected.
Note: Param#2==2 was tested only for BGEE and might not work on non-EE.

#190 (0xBE) Stat: Attack Speed Factor Variants: PST
Parameter #1: Speed Modifier
Parameter #2: Irrelevant
Description:
Alters the weapon's attack speed by the value specified by the 'Speed Modifier' field. This effect is not cumulative. Attack speed ranges from 0 (good) to 10 (bad). This effect acts as a bonus, so a high 'Speed Modifier' is good.
This effect sets stat #78 (PHYSICALSPEED) to param #1.

#191 (0xBF) Spell: Casting Level Modifier Variants: BG2 IWD1 PST
Parameter #1: Modifier
Parameter #2: Type
Description:
Applies the value specified by the 'Modifier' field as a bonus to casting spell levels, of a type specified by the 'Type' field.
Known values for 'Type' are:
0 Mage
1 Cleric

This effect modifies stats #79 (CASTINGLEVELBONUSMAGE) or #80 (CASTINGLEVELBONUSCLERIC) depending on param #2.

#192 (0xC0) Spell Effect: Find Familiar Variants: IWD1 PST
Parameter #1: Irrelevant
Parameter #2: Upgrade Marker
Description:
Summons a familiar for the Protagonist player. The familiar summoned is based on the alignment of the Protagonist, and values stored in the GAM file.
The 'Upgrade Marker' field is used internally to indicate the familiar has received the ToB upgrades.
Default creatures for familiars are:
Lawful Good Pseudo Dragon (FAMPSD)
Lawful Neutral Ferret (FAMFER)
Lawful Evil Imp (FAMIMP)
Neutral Good Pseudo Dragon (FAMPSD)
True Neutral Rabbit (FAMRAB)
Neutral Evil Dust Mephit (FAMDUST)
Chaotic Good Fairy Dragon (FAMFAIR)
Chaotic Neutral Cat (FAMCAT)
Chaotic Evil Quasit (FAMQUAS)

#193 (0xC1) Spell Effect: Invisible Detection by Script Variants: IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
Allows invisible creatures to be attacked (via scripts) and makes it possible to target improved invisible creatures with spells.

The effect modifies STAT #81 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#194 (0xC2) Ignore Dialog Pause Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
Allows the targeted creature(s) to carry on their actions during dialogs which pause action.

The effect modifies STAT #82 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#195 (0xC3) Spell Effect: Death Dependent Constitution Loss Variants: IWD1 PST
Parameter #1: HP Modifier
Parameter #2: Undefined
Description:
When a creature with this effect applied to it dies, the Protagonist enacts the damage animation, loses 1 Constitution point, and has their HP modified as dictated by the 'HP Modifier' field.
If 'HP Modifier' is positive, Maximum and Current HP are increased by 'HP Modifier' (though the message ' - was immune to my damage' is displayed).
If 'HP Modifier' is negative, Maximum HP is lowered by 'HP Modifier', and Current HP is lowered by twice 'HP Modifier'.

#196 (0xC4) Spell Effect: Familiar Block Variants: IWD1 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
If this effect is found on any creature in the GAM file, the engine will block summoning of more familiars.
Important: The effect should be set with a timing mode of 9.

#197 (0xC5) Spell: Bounce Projectile Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Reflected Projectile
Description:
The targeted creature(s) will reflect the projectile specified by the 'Reflected Projectile' field back to the attacker.
Values for 'Reflected Projectile' are taken from projectl.ids.

#198 (0xC6) Spell: Bounce Opcode Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Opcode
Description:
The targeted creature(s) will reflect attacks containing the opcode specified by the 'Opcode' field.
Warning: This can cause a crash if two creatures end up reflecting to each other.

#199 (0xC7) Spell: Bounce Spell Level Variants: IWD1 IWD2 PST
Parameter #1: Reflected Level
Parameter #2: Irrelevant
Description:
The targeted creature(s) will reflect spells from the spell level specified in the 'Reflected Level' field.

#200 (0xC8) Spell: Decrementing Bounce Spells Variants: IWD1 IWD2 PST
Parameter #1: Amount
Parameter #2: Level
Description:
The targeted creature(s) will reflect a number of spells (specified by the 'Amount' field), from the spell level specified in the 'Level' field. A spell is assigned to a spell level by the power level of the first effect greater than the 'Level' parameter in the extended header that is being called.

#201 (0xC9) Spell: Decrementing Spell Immunity Variants: IWD1 IWD2 PST
Parameter #1: Amount
Parameter #2: Level
Description:
The targeted creature(s) will absorb a number of spells (specified by the 'Amount' field), from the spell level specified in the 'Level' field. A spell is assigned to a spell level by the power level of the first effect greater than the 'Level' parameter in the extended header that is being called.
Note: It cannot deflect effects through AoE projectiles.

#202 (0xCA) Spell: Bounce Spell School Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Spell School
Description:
The targeted creature(s) will turn spells from the school specified by the 'Spell School' field.
Known values for 'Spell School' are:
1 Abjuration
2 Conjuration
3 Divination
4 Enchantment
5 Illusion
6 Evocation
7 Necromancy
8 Alteration

#203 (0xCB) Spell: Bounce Secondary Type Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Secondary Type
Description:
The targeted creature(s) will turn spells with a secondary type matching that specified by the 'Secondary Type' field.
Known values for 'Secondary Type' are:
1 Spell Protections
2 Specific Protections
3 Illusionary Protections
4 Magic Attack
5 Divination Attack
6 Conjuration
7 Combat Protections
8 Contingency
9 Battleground
10 Offensive Damage
11 Disabling
12 Combination
13 Non-Combat

#204 (0xCC) Spell: Protection from Spell (School) Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Spell School
Description:
Gives the targeted creature(s) immunity to spells from the school specified by the 'Spell School' field.
Known values for 'Spell School' are:
1 Abjuration
2 Conjuration
3 Divination
4 Enchantment
5 Illusion
6 Evocation
7 Necromancy
8 Alteration

#205 (0xCD) Spell: Protection from Spell (Secondary Type) Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Gives the targeted creature(s) immunity to the spell type specified by the 'Type' field.
Known values for 'Type' are:
1 Spell Protections
2 Specific Protections
3 Illusionary Protections
4 Magic Attack
5 Divination Attack
6 Conjuration
7 Combat Protections
8 Contingency
9 Battleground
10 Offensive Damage
11 Disabling
12 Combination
13 Non-Combat

#206 (0xCE) Spell: Protection from Spell Variants: IWD1 IWD2 PST
Parameter #1: String Reference
Parameter #2: Irrelevant
Description:
Gives the targeted creature(s) immunity from the spell specified in the resource key. The strref specified by the 'String Reference' field is displayed when the spell is absorbed.
Info: At least in EEs, this opcode can block EFF files too.
In order to do so, both the “Resource” field of op#206 and the “Parent resource” field (located at offset 0x94) of the EFF file must be the same string (max. 8 character long); moreover, you must set the “Resource type” field (located at offset 0x90) of the EFF file to 1 (Spell).

#207 (0xCF) Spell: Bounce Specified Spell Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
The targeted creature(s) will reflect the spell specified by the resource key.

#208 (0xD0) HP: Minimum Limit Variants: PST
Parameter #1: Minimum Value
Parameter #2: Irrelevant
Description:
The targeted creature(s) HP value will not drop below the value specified by the 'Minimum Value' field.
This effect sets stat #83 (MINHITPOINTS) to param #1.

#209 (0xD1) Death: Kill 60HP Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Instantly kills the targeted creature(s), if the targeted creature(s) has less than 60 HP.

#210 (0xD2) Spell Effect: Stun 90HP Variants: IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the stun effect to the targeted creature(s), if the targeted creature(s) has less than 90 HP.
The duration of the effect is:
1 to 29 HP -> stunned for 4d4 rounds
30 to 59 HP -> stunned for 2d4 rounds
60 to 89 HP -> stunned for 1d4 rounds

#211 (0xD3) Spell Effect: Imprisonment Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the imprisonment effect to the targeted creature(s).
The field at 0xcc can be used to prevent death related effects (e.g. removal from party) running on the targetted creature(s) – not verified on EE games.

#212 (0xD4) Protection: Freedom Variants: IWD1 IWD2 PST
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the freedom effect to the targeted creature(s).
The freedom effect frees creatures trapped by the imprisonment effect.

#213 (0xD5) Spell Effect: Maze Variants: IWD1 IWD2
Parameter #1: Type
Parameter #2: Irrelevant
Special: Icon
Description:
Applies the maze effect to the targeted creature(s).
Known values for 'Type' are:
  • 0 => Use intelligence based duration (via INTMOD.2DA)
  • 1 => Use 'Duration' field

The duration of the effect is set in INTMOD.2DA, default values are:
  • 0 to 2 int -> 20d4 rounds
  • 3 to 5 int -> 10d4 rounds
  • 6 to 8 int -> 5d4 rounds
  • 9 to 11 int -> 4d4 rounds
  • 12 to 14 int -> 3d4 rounds
  • 15 to 17 int -> 2d4 rounds
  • 18+ int -> 1d4 rounds

'Icon' defines the index from STATDESC.2DA for custom portrait icons (EE only).

#214 (0xD6) Spell Effect: Select Spell Variants: IWD1 BG2
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Uses the 2da specified by the resource key to display multiple spell options, based on the 'Type' field.
Known values for 'Type' are:
  • 0 => Use "resource" 2da list
  • 1 => Known mage spells, except Identify (SPWI110), and Nahal's Reckless Dweomer (SPWI124)
  • 2 => Known mage spells, except the above, and those with spell flag BIT15 "Ignore Wild Surge"
When 'Type' is 0, the 2da file must follow the following format:
2DA V1.0
****
ResRef		Type
(name)		(RESREF)			(Casting Type)
(name)		(RESREF)			(Casting Type)

(name) can be any string of characters/numbers without any whitespace, and does not need to be unique. (RESREF) is the filename of the spell without its [.SPL] extension.
As far as (Casting Types) is concerned:
  • 0/1 => Spell completely mimics the mechanics of casting a spell from a quick-cast slot (including requiring and expending a memorization of the spell)
  • 3 => Ignores Spells/Round rule, ignores memorization.
  • 4 => Ignores Spells/Round rule, ignores memorization, spellcasting cannot be interrupted by damage.
  • 5 => Ignores Spells/Round rule, cast instantly, even if the game is paused, can be cast without memorization, but will decrement memorization if exists.
Important: The target of this effect must be the only currently selected character when it triggers, and remain the selected character until a spell is chosen, or the menu will terminate.
Note: The presence of this effect in any of a spell’s ability headers will force any Wild Surge of that spell to use the ‘Cast Normal’ result.

#215 (0xD7) Graphics: Play 3D Effect Variants: IWD1 IWD2
Parameter #1: Undetermined
Parameter #2: Effect State
Description:
Plays the BAM/VVC specified by the resource key, in the style specified by the 'Effect State' value.
Known values for 'Effect State' are:
  • 0 => Play on target (not attached)
  • 1 => Play on target (attached)
  • 2 => Play on point

Known BAM files are:
acidblob Ankheg Spit
aciddth Acid Hit
bloodcr Blood Splash
bloodl Blood Splash (Large)
bloodm Blood Splash (Medium)
bloods Blood Splash (Small)
burnhand Burning Hands
cgabjura Casting Glow (Abjuration)
cgaltera Casting Glow (Alteration)
cgconjur Casting Glow (Conjuration)
cgdivina Casting Glow (Divination)
cgenchan Casting Glow (Enchantment)
cgillusi Casting Glow (Illusion)
cginvoca Casting Glow (Invocation)
cgnecrom Casting Glow (Necromancy)
colrspry Colour Spray
explode Crash
fire Crash
firebrn Small Dot of Fire
flml Bolt Of Flame (Large)
flmm Small Bolt Of Flame (Medium)
flms Tiny Bolt Of Flame (Small)
flmstrk BG Flame Strike
glphwrdh Glyph of Warding (Part)
glphwrdt Glyph of Warding (Full)
greased Blob Of Grease
greaseh Blob Of Grease
grndglow Grey round ground Explosion
hlymite Call Upon Holy Might
magicstn Magic Stone
minorglb Minor Globe of Invulnerability
mmagich Burst of Yellowish Magic (like Bolt Of Glory)
sanctry Sanctuary
settrap Spell Icon
shacid Acid Damage
shair Green mist rises from head to air above
sharea Exploding Yellow Ring above head
shearth Blue drops from chest drop on ground
shglyph Rubbish
shskull Rubbish
shwater Potion of Healing
sklh is Skull trap (moving)
sklt is Skull Trap (stationary)
skybolt Call Lightning
spabjura Four cornered blue magic joins in middle
spagscho Unexplainable
spaltera Coloured magic rising from ground (Like Teleport Field)
spanisum Opening Plant (find familiar)
sparmour2 Magic helm forms above target
sparmouri golden armour joins together at chest of caster (armour)
sparmour snowball like balls swirl around target
spattck1 Globe of magic (Like ruby ray of reversal)
spattck2 swirling small ball of magic (umber hulk confusion)
spbaserd Golden Light with white rays of light coming from middle
spbasewt Blue Light with white rays of light coming from middle
spbdbur Lime green blob of magic
spbdburs Direct Vertical Strike of greenish blue magic
spbdimsp Greenish burst of magic upon target
spbehbla Purplish magic swirling on target
spbehray Fire like blob
spbhandi Small ball of burning red fire
spblbbtm Blade Barrier (bottom half)
spblbtop Blade Barrier (Top Half)
spbleshi 3 Golden rays converging upon target
spblood Chunk of flesh when body explodes due to too much damage
spboom Mushroom like cloud of fire
spbrnhnd Burning Hands
spburn Tiny blob of fire
spburns1 Round fire
spcagemz Maze (Only top 2 grates)
spcallli Strike of Lightning (not lightning strike)
spccmdsi Purplish red burst of magic
spccolde Round of blue ice with a trail of smoke smashing on target
spccoldl Travelling round blue ice with a trail of smoke
spccwoui Burst of Bluish light bursting on target
spchlgt1 Chain Lightning
spchlgt2 Chain Lightning
spchlgt3 Chain Lightning
spchchromi Orb of Translucent bluish green magic
spchrorb Chromatic Orb
spchunks Ice Chunks (when target is frozen and smashed)
spclcomp Blue cloud of mist
spclkfri Blue Cloak forming on target (cloak of fear)
spcloud1 Blue Cloud of mist
spcloud2 A better Blue cloud of mist
spcloud3 Small cloud of blue mist
spcloudi Burst of orangey red magic
spcmwoui Blue magic on target increases then shrinks and disappears
spcomend Tentacle Whip
spcomett A Purple Comet
spcomstt A whip
spconfus Confusion a ring of intertwined birds
spcontin A large white star forming a book which blasts white light
spcrtwpn Yellow and white rays circle forming hammer and anvil
spcspra2 Coloured ball of magic
spcspra3 Larger more clearer ball of magic
spcsprai Same as last one
spcswoui Blast of greenish yellowey white magic
spdeath3 Rising spirit (Finger of Death)
spdimdr1 Bg open dimension door
spdimdr2 Bg opening dimension door
spdimndr Bg2 dimension door
spdispma Swirling balls of blue magic (dispel magic)
spdivina Five balls of blue magic separating very small
spdusty2 Disintegration dust
spelltin Rubbish green square
spentaai Green vine from ground
spentaci A swarm of green vines
spentaxi A swarm of vines that disappear after intertwining
spfbsmal White Ball of fire
spfdeath Rising Spirit (Finger of Death)
spfdeth3 Rising Spirit (Finger Of Death)
spfearef Face on ground (Horror)
spfinodi A dieing Rose
spfire Flame Damage
spfirebl Fireball
spfirepl Burst of fire in middle with a circle of white light leaving
spfiresb Fire Shield Blue
spfiresr Fire Shield Red
spfiret Small Ball of Fire
spfiretr Better Small Ball Of Fire
spfirimp Fire Damage
spfirsdi Burst of Flames
spfirsed Fire Seed
spfladow Flame Strike
spflames Burst of Flames
spflast1 Burst Of Flames (Different)
spflast2 Flame Strike (different)
spfleshs Swirling white rays (when Irenicus petrifies people)
spflmarr is Flame Arrow (more real)
spflmbld is Rising Sword
spflmsti is Bottom half Of Icewind Dale Style Flame Strike
spflsrin is Central flaming ball ejecting 2 rings of white light
spflstri is Flamestrike with burning bright yellow at bottom
spfracti is a chain breaking in half, spfstrmi is Small meteor swarm
spgenhla is Ray of bluish light with rays of yellow light (Holy Power)
spgenhlb is Ray Above but forming (the one above forms and finishes)
spgflsh1 is Burst of yellow red magic (when monsters unsummon)
spglyphi is Travelling Coloured glyph of warding
spglypti is Floating coloured glyph
spgreaai is Purple oval of magic
spgreaci is same oval of magic but still the one above forms and goes
spgreaxi is Blob of purple goo exploding on target
spgreorb is green Orb
sphandat is A electrical looking hand appearing
sphealin is Healing
sphleft is left Half of Icewind style Heal
sphlhi01 is left half of icewinds Heal
sphlhi02 is Right half of icewinds heal
sphlybls is Aid
sphlysm2 is Lighter Ray of Holy Smite
sphlysm3 is Darker ray of Holy Smite
sphlysmt is Yellow ray of light striking target
sphollyw is A swirl of blue magic forming then exploding into many doves
spholmig is Already formed circle of magic with white rays shining out
spholymt is Yellow ray with bluish mist on side vertically on target
spholywd is Light blue ray of vertical energy with whitish mist on side
sphorpuf is Yellowish puff of smoke
sphorwil is Abi Dalzims horrid wilting
sphright is Right hands side of Icewinds spell heal
spicestm is Ice storm
spillus is a ball of blue magic swirling
spilusio is a ball of blue magic swirling
spinsect is Black swarm of Insects
spiplaai is Brown swarm of insects
spiplari is Brown swarm of insects
spiplaui is Forming swarm of brown insects
splightb is Lightning Bolt
spmagglo is Minor Spell Deflection
spmagmis is Magic Missile
spmetswa is Flaming ball of fire
spmetswm is Meteor Swarm
spmetswn is More Balls of Meteor swarm
spmindat is The swirling ball above head when you are held
spmirroi is A shining blue mirror
spmonsum is Monster Summoning
spnecro1 is Ring of circling reddish purplish magic
spnpoisi is Icewinds style of cure disease
spnwchrm is Green orbs rising from ground to head (charm)
sppfirai is Produce Fire
sppfirri is smaller burst of fire
sppfirxi is larger burst of flame
spplanar is Large yellow orb forming then shattering
sppolymp is Polymorph
spportal is Round portal forming
sppowwrd is One of the red Power Word effects
spprayri is Icewind Dales style of prayer
spprism2 is swirling orb of colour
spprism3 is swirling ball of colour
spprismt is swirling ball of colour
spproimg is Crack in ground forming some round circle
spprotec is Protection from normal weapons
spraised is animate dead
spraisei is growing rose (raise dead)
sprdrabu is Vertical strike of red magic
sprdrae2 is burst of yellow fire like magic
sprdraex is burst of yellow fire like magic
sprdraim is puff of red smoke exploding on target in a ring
sprdrasi is puff of red smoke formed and it stays formed
spresuri is growing silver rose (resurrection)
spring is grey travelling ray
sprmpari is Icewind Style of remove paralysis
sprotect is Protection from evil
sprwra2i is A blue symbol on the ground with rays of blue rising from it
sprwrati is green ray forming and bursting down on target
spsarmour is Forming wings
spschgi is Purple energy with a black ring around it swirling
spscorch is Fire thing again (so many of these)
spscoric is same as above
spsdbur is A ray of misty grey magic vertically striking fast
spsdimpa is Great sparks of white bursting
spsdrbur is a ray of misty grey magic vertically striking
spshadow is Nothing
spshield is Prot normal missiles
spshkimp is Electrical damage effect
spskullt is red eyed skull with a trail of green smoke
spsmkjet is nothing
spsmold is nothing
spsmpuff is white round puff of smoke disappearing
spsnrayi is Sunray
spsohopi is Symbol forming and ejecting a ray of magic (symbol hopeless)
spspaini is Symbol of Pain
spsparks is sparks
spspeart is Bolt of Glory
spspmaze is 4 lines forming a sharp cage of spears
spstink is small puff of smoke rising from ground
spstones is stoneskin
spstrenh is Whiteray shooting down forming a puff of magic on target (lesser restoration)
spstreni is Strength of One
spsturni is Minor Spell Turning
spsumgte is gate (ring of bones)
spsummon is Call Woodland Beings
spsunray is Larger sunray
sptrapbb is Snare Trap
sptrusee is Opening Eye (clairvoyance)
spturni2 is Already formed spell turning
spunhbl2 is unholy smite
spunhbl3 is darker version of above
spunhblt is Red bolt shooting
spunholy is Am orange glow exploding into many doves
spwi124a is Spell Icon
spwi124b is Spell Icon
spwi124c is Spell Icon
spwirbla is Some ring forming a circle with other lines coming from it with blades arching up forming some cage
spwrdfld is Teleport Field
stnkcldd is Stinking Cloud
stnkcldt is Travelling Ball of Stinking Cloud
travel is An orb of swirling magic orb that shoots out to everyone
trbloba is green blob forming and splatting on target
trblobb is green blob forming and splatting on target
trdartst is Shooting knife looking things
trgooyaa is green blob forming and splatting on target
trgooybb is green blob forming and splatting on target
trspeart is Spear rising from ground striking target
trventaa is Bottom part of opening vent
trventbb is top part of opening vent which sprays out mist
webbomb is A burst of webs
webc is entangled in web
webentd Other version of web
webenth Entangling web
webentt Travelling ball of shining web
Note: ‘Effect State’ 0 or 2 also supports VEF files.

#216 (0xD8) Spell Effect: Level Drain Variants: IWD1 IWD2 BG2
Parameter #1: Amount
Parameter #2: Irrelevant
Description:
Drains levels from the targeted creature(s) as specified by the 'Amount' field. 'Amount' can be positive or negative.
In particular:
  • Alters the targeted creature(s) Base THAC0, Saving Throws, Hit Points, and Spell Slots as appropriate for their new effective level.
  • Thief skills are adjusted depending of the class and kit of the creature.
  • Rangers, Shamans, and Bards have their value adjusted as appropriate for their new effective level based on files SKILLRNG.2DA, SKILLSHM.2DA, and SKILLBRD.2DA, respectively.
  • Monks and Thieves skills are all adjusted by the average amount of skill points they receive per level (regardless of which skills they were spent on), applied and capped (range: [0,255]) before racial and/or dexterity adjustments.
  • All effects using 'Timing Mode' 2 (equipped) that alter the above stats are suppressed.
  • The targeted creature(s) cannot level-up.
  • The targeted creature(s) current experience is hidden (they still gain experience as normal).
  • This effect is removed, regardless of 'Timing Mode', by any death that sets STATE[BIT11|STATE_DEAD].
Moreover:
  • Param#3 is used internally to store recalculated current hp.
  • Param4 is used internally to store recalculated max xp.

This effect sets STAT #200 to param #1.

#217 (0xD9) Spell Effect: Unconsciousness 20HP Variants: IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the unconsciousness effect to the targeted creature(s), if the targeted creature(s) has less than 20 HP. The effect always lasts 5 rounds, and ignores the duration field.

#218 (0xDA) Protection: Stoneskin Variants: BG2 IWD2
Parameter #1: Amount
Parameter #2: Use Dice
Special: Icon
Description:
Gives the targeted creature(s) a number of protections from physical attacks, as specified by the 'Amount' field.
Known values for 'Use Dice' are:
  • 0 => No
  • 1 => Yes


If 'Amount' and 'Use Dice' values are both non-zero, the total number of protections from physical attacks is: 'Amount' + Dice values.

This opcode maintains STAT #88 to the amount of skins left.
'Icon' defines the index from STATDESC.2DA for custom portrait icons. Default value is 80 – Stoneskin.

#219 (0xDB) Stat: AC vs. Creature Type Modifier Variants: BG2 IWD1 IWD2
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Gives the targeted creature(s) a 2 point bonus AC and Saving Throws against the creature type specified by the 'IDS Entry' in the IDS file specified by the 'IDS File' field. Note that the saving throws are not specified by the opcode name but are correctly rolled by the engine.
Known values for 'IDS File' are:
Note: Multiple instances of this effect do not stack their bonus, but can be used to specify multiple creature types.

#220 (0xDC) Removal: Remove School Variants: IWD1 IWD2
Parameter #1: Maximum Level
Parameter #2: School Type
Description:
Removes spells from the school specified by the 'School Type' field from the targeted creature(s), up to the level specified by the 'Maximum level' field.
Known values for 'School Type' are:
1 Abjurer
2 Conjurer
3 Diviner
4 Enchanter
5 Illusionist
6 Invoker
7 Necromancer
8 Transmuter
9 Generalist

#221 (0xDD) Removal: Remove Secondary Type Variants: IWD1 IWD2
Parameter #1: Maximum Level
Parameter #2: Secondary Type
Description:
Removes spells with a secondary type matching that specified by he 'Secondary Type' field from the targeted creature(s), up to the level specified by the 'Maximum level' field.
Known values for 'Secondary Type' are:
1 Spell Protections
2 Specific Protections
3 Illusionary Protections
4 Magic Attack
5 Divination Attack
6 Conjuration
7 Combat Protections
8 Contingency
9 Battleground
10 Offensive Damage
11 Disabling
12 Combination
13 Non-Combat

#222 (0xDE) Spell Effect: Teleport Field Variants: IWD1 IWD2
Parameter #1: Max Range
Parameter #2: Irrelevant
Description:
Applies the teleport field to the targeted creature(s).
The 'Max Range' field sets the maximum range of the teleporting effect.

#223 (0xDF) Spell Effect: Immunity School Decrement Variants: IWD1 IWD2
Parameter #1: Max Level
Parameter #2: School Type
Description:
Known values for 'School Type' are:
1 Abjurer
2 Conjurer
3 Diviner
4 Enchanter
5 Illusionist
6 Invoker
7 Necromancer
8 Transmuter
9 Generalist

#224 (0xE0) Cure: Level Drain (Restoration) Variants: IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the restoration effect to the targeted creature(s), resetting the level of the target.
Note: Removes op#216 (Level drain) effects from the creature, will not remove op#96 (Level change) effects.

#225 (0xE1) Spell: Reveal Magic Variants: IWD1 IWD2
Parameter #1: Undefined
Parameter #2: Undefined
Description:
Highlights the targeted creature(s) if they are affected by dispellable magic. The effect appears to be without duration.

#226 (0xE2) Spell: Immunity Secondary Type Decrement Variants: IWD1 IWD2
Parameter #1: Max Level
Parameter #2: Secondary Type
Description:
Known values for 'Secondary Type' are:
1 Spell Protections
2 Specific Protections
3 Illusionary Protections
4 Magic Attack
5 Divination Attack
6 Conjuration
7 Combat Protections
8 Contingency
9 Battleground
10 Offensive Damage
11 Disabling
12 Combination
13 Non-Combat

#227 (0xE3) Spell: Bounce School Decrement Variants: IWD1 IWD2
Parameter #1: Max Level
Parameter #2: School Type
Description:
Known values for 'School Type' are:
1 Abjurer
2 Conjurer
3 Diviner
4 Enchanter
5 Illusionist
6 Invoker
7 Necromancer
8 Transmuter
9 Generalist

#228 (0xE4) Spell: Bounce Secondary Type Decrement Variants: IWD1 IWD2
Parameter #1: Max Level
Parameter #2: Secondary Type
Description:
Known values for 'Secondary Type' are:
1 Spell Protections
2 Specific Protections
3 Illusionary Protections
4 Magic Attack
5 Divination Attack
6 Conjuration
7 Combat Protections
8 Contingency
9 Battleground
10 Offensive Damage
11 Disabling
12 Combination
13 Non-Combat

#229 (0xE5) Removal: Remove One School Variants: IWD1 IWD2 BG2
Parameter #1: Max Level
Parameter #2: School Type
Description:
Removes all effects with a matching 'School Type', with a non-zero 'Power Level' up to 'Max Level', of the first two valid 'Parent Resources' from the targeted creature(s).
Known values for 'School Type' are:
  • 0 => None
  • 1 => Abjurer
  • 2 => Conjurer
  • 3 => Diviner
  • 4 => Enchanter
  • 5 => Illusionist
  • 6 => Invoker
  • 7 => Necromancer
  • 8 => Transmuter
  • 9 => Generalist
The first valid 'Parent Resource' has a matching effect with a Timing Mode other than (2/5/8), all such matching effects of this 'Parent Resource' will be removed.

The second valid 'Parent Resource' has a matching effect with a Timing Mode (2/5/8), all such matching effects of this 'Parent Resource' will be removed.

If any effects are removed, the String Reference corresponding to the 'School Type' from MSCHOOL.2DA is returned to the combat log.
Info: Basically it removes one equipped resource effect list and one non-equipped resource effect list, except that equipped effects aren’t removable while its item is equipped, so this behavior is not common. The only way to really see this behavior (removing two separate resources) is to have a spell or item ability that only applies equipped effects.
Note: Effects with a ‘Power Level’ of 0 are completely ignored by this opcode.

#230 (0xE6) Removal: Remove One Secondary Type Variants: IWD1 IWD2 BG2
Parameter #1: Max Level
Parameter #2: Secondary Type
Description:
Removes all effects with a matching 'Secondary Type', with a non-zero 'Power Level' up to 'Max Level', of the first two valid 'Parent Resources' from the targeted creature(s).
Known values for 'Secondary Type' are:
  • 0 => None
  • 1 => SPELLPROTECTIONS
  • 2 => SPECIFICPROTECTIONS
  • 3 => ILLUSIONARYPROTECTIONS
  • 4 => MAGICATTACK
  • 5 => DIVINATIONATTACK
  • 6 => CONJURATION
  • 7 => COMBATPROTECTIONS
  • 8 => CONTINGENCY
  • 9 => BATTLEGROUND
  • 10 => OFFENSIVEDAMAGE
  • 11 => DISABLING
  • 12 => COMBINATION
  • 13 => NON-COMBAT
  • 14 => DORNS_SWORD
The first valid 'Parent Resource' has a matching effect with a Timing Mode other than (2/5/8), all such matching effects of this 'Parent Resource' will be removed.

The second valid 'Parent Resource' has a matching effect with a Timing Mode (2/5/8), all such matching effects of this 'Parent Resource' will be removed.

If any effects are removed, the String Reference corresponding to the 'Secondary Type' from MSECTYPE.2DA is returned to the combat log.
Info: Basically it removes one equipped resource effect list and one non-equipped resource effect list, except that equipped effects aren’t removable while its item is equipped, so this behavior is not common. The only way to really see this behavior (removing two separate resources) is to have a spell or item ability that only applies equipped effects.
Note: Effects with a ‘Power Level’ of 0 are completely ignored by this opcode.

#231 (0xE7) Spell Effect: Time Stop Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the time stop effect.
The timestop effect lasts half as long as the Duration specified for the effect.

In particular:
  • All creatures not immune to Time Stop will be rendered uncontrollable, can be hit automatically by attacks as if they were HELPLESS (but do not actually have STATE_HELPLESS set), and their frequency-based effects will not trigger (poison/regeneration), but their duration will run.
  • Projectiles are suspended mid-flight until the Time Stop ends, at which point they will resume normal function.
  • Area effect projectiles are suppressed until the Time Stop ends, at which point they will resume normal function, though their duration will run during the Time Stop.
  • Projectiles that hit "instantly" (#0 and #1 for spells/items) are unaffected by Time Stop, which includes all melee weapons.
Important: Both parameters should be 0 (zero).
Note: Only one creature may have a Time Stop effect running at a time, applying a Time Stop effect during another will override the previous. The caster is always immune to their own Time Stop effect, they do not require opcode #310, unless their own Time Stop is at risk of being overridden.

#232 (0xE8) Spell Effect: Cast Spell on Condition Variants: BG2 IWD1 IWD2
Parameter #1: Target
Parameter #2: Condition
Special: Extra
Description:
Casts the spell specified by the resource field on the target specified by the 'Target' field, when the condition from the 'Condition' field is true. The conditions are akin to various triggers.
Known values for 'Target' are:
0 Myself
1 LastHitter
2 NearestEnemyOf
3 Nearest

Known values for 'Condition' are:
0 HitBy([ANYONE]) – Checked every time
1 See(NearestEnemyOf(Myself)) – Checked once per round
2 HPPercentLT(Myself, 50) – Checked once per round
3 HPPercentLT(Myself, 25) – Checked once per round
4 HPPercentLT(Myself, 10) – Checked once per round
5 StateCheck(Myself,STATE_HELPLESS) i.e. unconscious – Checked once per round
6 StateCheck(Myself,STATE_POISONED) i.e. poisoned – Checked once per round
7 AttackedBy([ANYONE]) – Checked every time
8 Range([ANYONE],4) – Checked once per round
9 Range([ANYONE],10) – Checked once per round
10 Unknown - every round
11 TookDamage() – Checked every time
12 Killed([ANYONE]) – Checked every time
13 Time of Day is 'Extra' – Checked once per round
14 Range([ANYONE],'Extra') – Checked once per round
15 StateCheck(Myself,'Extra') – Checked once per round
16 Died(Myself) – Checked every time
17 Died([ANYONE]) – Checked every time
18 TurnedBy([ANYONE]) – Checked every time
19 HPLT(Myself,'Extra') – Checked once per round
20 HPPercentLT(Myself,'Extra') – Checked once per round
21 CheckSpellState(Myself,'Extra') – Checked once per round

The 'Extra' field is used for the following 'Target' values:
13: Use value from TIMEODAY.IDS
14: Range in feet
15: Use value from STATE.IDS
19: Any numeric value
20: Any numeric value
21: Use value from SPLSTATE.IDS

For a 'Condition' of 13, the 'Target' parameter must be 0.

When used in an external EFF file, "resource2" and "resource3" can also be specified – all spells will be cast when triggered.

When used in an external EFF file, known values for 'Parameter3' are:
  • 0 => Not a "real" contingency (Fire Shields, Globe of Blades, etc...)
  • 1 => Real contingency (Maintains 'Contingency' portrait icon, displays feedback message ENGINEST[246|STRREF_GUI_FEEDBACK_CONTINGENCY_TRIGGER] when triggered, and terminates this effect after first trigger. This value is always set when created by opcode #234.
When used in an external EFF file, 'Parent Type' (Source Type) may be manually set to influence its behavior. Known values for 'Parent Type' are:
  • 0 = None – Allows further effects with a matching "Parent Resource" to affect the target.
  • 1 = Spell – Any further effects with a matching "Parent Resource" will be blocked by the engine and string ENGINEST[42|STRREF_ERROR_CAN_NOT_CAST_TWO_CONT] is returned to the combat log. Spells must therefore either have this as the last effect, or use it in an EFF through opcode #177, specifying a 'Parent Type' of 0 or 2.
  • 2 = Item – Allows further effects with a matching "Parent Resource" to affect the target.
Note: If you need a condition which is always true, you could set ‘Condition’ to 20 and ‘Extra’ to 102 (“hp < 102%” will always be true; 102 is used because ‘Extra’ must be even or the combat log will be flooded with feedback messages).
Note: These triggers and objects are limited to their normal detection range: e.g., “Died([ANYONE])” won’t see someone dying on the other side of the map.
Note: Excluding the “Range()” checks, [ANYONE] includes “Myself”.
Note: The presence of this effect in any of a spell’s ability headers will force any Wild Surge of that spell to use the ‘Cast Normal’ result.

#233 (0xE9) Stat: Proficiency Modifier Variants: IWD1
Parameter #1: Amount
Parameter #2: Type
Description:
Sets the weapon proficiency points for the weapon type specified in the 'Type' field, to the value specified by the 'Amount' field, for the targeted creature(s).
Note: The Proficiency Modifier effect cannot increment or decrement proficiency points, it can only SET them. This is however not true for EEs, where param#2 (‘Type’) is split into two word subfields. By setting the second (high) one to 1 (INCREMENT), it’s possible to increment/decrement the proficiency points of the targeted creature(s) by the value specified by the ‘Amount’ parameter.
Known values for 'Type' are:
Axe 92
Bastard Sword 89
Blackjack 108
Club 115
Crossbow 103
Dagger 96
Darts 106
Flail/Morningstar 100
Gun 109
Halberd 99
Katana 94
Long Bow 104
Long Sword 90
Mace 101
Martial Arts 110
Quarter Staff 102
Scimitar/Wakizashi/Ninja-To 95
Short Bow 105
Short Sword 91
Single Weapon Skill 113
Sling 107
Spear 98
Sword and Shield Skill 112
Two-Handed Sword 93
Two-Handed Weapon Skill 111
Two Weapon Skill 114
War Hammer 97
Extra Proficiency 2(Unused) 116
Extra Proficiency 3(Unused) 117
Extra Proficiency 4(Unused) 118
Extra Proficiency 5(Unused) 119
Extra Proficiency 6(Unused) 120
Extra Proficiency 7(Unused) 121
Extra Proficiency 8(Unused) 122
Extra Proficiency 9(Unused) 123
Extra Proficiency 10(Unused) 124
Extra Proficiency 11(Unused) 125
Extra Proficiency 12(Unused) 126
Extra Proficiency 13(Unused) 127
Extra Proficiency 14(Unused) 128
Extra Proficiency 15(Unused) 129
Extra Proficiency 16(Unused) 130
Extra Proficiency 17(Unused) 131
Extra Proficiency 18(Unused) 132
Extra Proficiency 19(Unused) 133
Extra Proficiency 20(Unused) 134
Warning: In EE games, ‘Type’ 99 (Halberd) currently cannot use the “Increment” option without crashing (bug).
Important: In EE games, the 'Special' field must currently be "zero", due to an incomplete (bugged) feature added by Beamdog (it wasn't used before anyway, so there was no point in it not being zero).

#234 (0xEA) Spell Effect: Contingency Creation Variants: IWD1 IWD2 BG2
Parameter #1: Maximum Level Usable
Parameter #2: Amount/Type
Description:
Creates a custom spell contingency, storing a certain number of spells to be cast upon a specified condition.
The spells are stored using opcode #232, using 'Timing Mode' 1 and 'Parameter3' set to 1.
The 'Maximum Level' field indicates the maximum spell level that can be used in the contingency. The 'Amount/Type' field indicates the number of spells that can be used in the contingency, and the type of the contingency.
Known values for the 'Amount/Type' field are:
  • First word: Amount (1-3)
  • Second word:
    • 0 => Chain Contingency (See opcode #232 for target and condition descriptions)
    • 1 => Normal Contingency
      • Target choice is limited to '0|Myself', and only if it's listed in CONTTARG.2DA.
      • Condition choices limited to those listed in CONTCOND.2DA.
    • 2 => Sequencer
Important: As of v2.3, an entry for the "Parent Resource" or "Activation Key" must be added to the 'mageBookStrings{}' lua table for the UI, or the game will crash upon use.
Note: The presence of this effect in any of a spell’s ability headers will force any Wild Surge of that spell to use the ‘Cast Normal’ result.
Note: This opcode only works from party-members.

#235 (0xEB) Spell Effect: Wing Buffet Variants: IWD1
Parameter #1: Speed
Parameter #2: Direction
Description:
Applies the wing buffet effect centred on the casting creature(s), buffeting the targeted creature(s) at the speed specified by the 'Speed' field, in the direction specified by the 'Direction' field. 'Speed' ranges from 0 to 255.
Known values for 'Direction' are:
  • 0/1 => Away from the destination point (specified in EFF file)
  • 2 => Away from the source
  • 3 => Towards the destination point (specified in EFF file)
  • 4 => Towards source
Note: If used on creatures with the “pass-wall” effect applied, creatures can cross points marked as light obstacles on the search map.
In EEs, this effect can push creatures through closed (and locked) doors. (this does not require the “pass-wall” effect).
Note: ‘Direction’ options 1 and 3 “can” be overriden in external EFF files, but default to the ability target/location.
Note: Some animations are immune to this effect.

#236 (0xEC) Spell Effect: Image Projection Variants: IWD1 IWD2
Parameter #1: Undetermined
Parameter #2: Type
Description:
Creates an image of the caster, in the style specified by the 'Type' field. The type can be accessed via CheckStat, stat ID: PUPPETTYPE.
Note: When creating an image for use as in Mislead, the image will have a script assigned, with scriptname of ‘CASTERSCRIPTM’ where CASTERERSCRIPT is the death variable of the casting creature.

Known values for 'Type' are:
0 Talkative, uncontrollable
1 Can not attack, can not cast spells (Mislead.spl is cast on the creature)
2 Can attack, can not cast spells (ProjImag.spl is cast on the creature)
3 Can attack, can cast spells (Simulacr.spl is cast on the creature)
4+ As 0
Note: Keep in mind that if the caster is equipped with an irremovable item (e.g., Edwin’s Amulet), then its images will not inherit any bonuses/maluses from that specific item.

#237 (0xED) Spell Effect: Puppet ID Variants: IWD1 IWD2
Parameter #1: Master ID
Parameter #2: ID Number
Description:
This effect stores information in a Projected Image/Simulacrum. The type can be accessed via CheckStat, stat PUPPETMASTERTYPE. Applying this effect to a non-image creature will set that creature to behave as an image (e.g. image casting, invisibility and talking behaviour).
Known values for 'ID Number' are:
1 Mislead
2 Project Image
3 Simulacrum
The 'Master ID' field stores a value (0-5) representing the owning party member.

#238 (0xEE) Death: Disintegrate Variants: BG2 IWD1
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Disintegrates the targeted creature(s), if the targeted creature(s) match the 'IDS Entry' and in the specified 'IDS File', and if the targeted creature(s) hit-dice is less than those specified by the Dice Values.
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids

#239 (0xEF) Spell Effect: Farsight Variants: IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Allows viewing of the current area, based on the 'Type' field.
Known values for 'Type' are:
0 View explored sections only
1 View explored section and unexplored sections.

#240 (0xF0) Graphics: Remove Special Effect Icon Variants: IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Icon
Description:
Removes the icon specified by the 'Icon' field.
Known values for 'Icon' are:
0 Charm
1 Dire Charm
2 Rigid Thinking
3 Confusion
4 Berserk
5 Intoxicated
6 Poisoned
7 Nauseated
8 Blind
9 Protection from Evil
10 Protection from Petrification
11 Protection from Missiles
12 Magic Armour
13 Held
14 Sleep
15 Shielded
16 Protection from Fire
17 Blessed
18 Chant
19 Free Action
20 Barkskin
21 Strength
22 Heroism
23 Invulnerable
24 Protection from Acid
25 Protection from Cold
26 Resist Fire/Cold
27 Protection from Electricity
28 Protection from Magic
29 Protection from Undead
30 Protection from Poison
31 Non-detection
32 Good luck
33 Bad luck
34 Silenced
35 Cursed
36 Panic
37 Resist Fear
38 Haste
39 Fatigue
40 Bard Song
41 Slow
42 Regenerate
43 Domination
44 Hopelessness
45 Greater Malison
46 Spirit Armour
47 Chaos
48 Feebleminded
49 Defensive Harmony
50 Champion's Strength
51 Dying
52 Mind Shield
53 Level Drain
54 Polymorph Self
55 Stun
56 Regeneration
57 Perception
58 Master Thievery
59 Energy Drain (Psionic/Mindflayer)
60 Holy Power
61 Cloak of Fear
62 Iron Skins
63 Magic Resistance
64 Righteous Magic
65 Spell Turning
66 Repulsing Undead
67 Spell Deflection
68 Fire Shield Red
69 Fire Shield Blue
70 Protection from Normal Weapons
71 Protection from Magic Weapons
72 Tenser's Transformation
73 Protection from Magical Energy
74 Mislead
75 Contingency Active
76 Protected from the Elements
77 Projected Image
78 Maze
79 Imprisonment
80 Stoneskin
81 KAI
82 Called Shot
83 Spell Failure
84 Offensive Stance
85 Defensive Stance
86 Intelligence Drained by Mind Flayer
87 Regenerating
88 Dialog Mode
89 At a Store
90 Negative Plane Protection
91 Ability Score Drained
92 Spell Sequencer Active
93 Protected from Energy
94 Magnetized
95 Able to Poison Weapons
96 Setting Trap
97 Glass Dust
98 Blade Barrier
99 Death Ward
100 Doom
101 Decaying
102 Acid
103 Vocalize
104 Mantle
105 Miscast Magic
106 Magic Resistance Lowered
107 Spell Immunity
108 True Seeing
109 Detecting Traps
110 Improved Haste
111 Spell Trigger
112 Deaf
113 Enfeebled
114 Infravision
115 Friends
116 Shield of the Archons
117 Spell Trap
118 Absolute Immunity
119 Improved Mantle
120 Farsight
121 Globe of Invulnerability
122 Minor Globe of Invulnerability
123 Spell Shield
124 Polymorphed
125 Otiluke's Resilient Sphere
126 Nauseated
127 Ghost Armor
128 Glitterdust
129 Webbed
130 Unconscious
131 Mental Combat
132 Physical Mirror
133 Repulse Undead
134 Chaotic Commands
135 Draw Upon Holy Might
136 Strength of One
137 Bleeding
138 Barbarian Rage
139 Boon of Lathander
140 Storm Shield
141 Enraged
142 Stunning Blow
143 Quivering Palm
144 Entangled
145 Grease
146 Smite
147 Hardiness
148 Power Attack
149 Whirlwind Attack
150 Greater Whirlwind
151 Magic Flute
151 Chaos of Battle (IWD:EE only)
152 Critical Strike
153 Greater Deathblow
154 Deathblow
155 Avoid Death
156 Assassination
157 Evasion
158 Greater Evasion
159 Improved Alacrity
160 Aura of Flaming Death
161 Globe of Blades
162 Improved Chaos Shield*
163 Chaos Shield*
164 Fire Elemental Transformation
164 Shield of Lathander (IWD:EE only)
165 Earth Elemental Transformation
165 Greater Shield of Lathander (IWD:EE only)
166 Mind Blank (IWD:EE only)
167 Aid (IWD:EE only)
168 Phased (IWD:EE only)
169 Pain (IWD:EE only)
170 Impervious Sanctity of Mind (IWD:EE only)
171 Petrified (IWD:EE only)
172 Iron Body (IWD:EE only)
173 Animal Rage (IWD:EE only)
174 Exaltation (IWD:EE only)
175 Recitation (IWD:EE only)
176 Blood Rage (IWD:EE only)
177 The Ballad of Three Heroes (IWD:EE only)
178 The Tale of Curran Strongheart (IWD:EE only)
179 Tymora's Melody (IWD:EE only)
180 The Song of Kaudies (IWD:EE only)
181 The Siren's Yearning (IWD:EE only)
182 War Chant of Sith (IWD:EE only)
183 Prayer (IWD:EE only)
184 Righteous Wrath of the Faithful (IWD:EE only)
185 Cat's Grace (IWD:EE only)
186 Hope (IWD:EE only)
187 Courage (IWD:EE only)
188 Enchanted Weapon (BG:EE only)
189 Spirit Ward (EE only)
190 Ether Gate (EE only)
191 Shamanic Dance (EE only)
192 Chaos of Battle (BG:EE only)
192 Repulsion (IWD:EE only)
193 Marek's Poison (BG:EE only)
193 Increased Movement Rate (IWD:EE only)
194 Repulsion (BG:EE only)
194 Immunity: Abjuration (IWD:EE only)
195 Increased Movement Rate (BG:EE only)
195 Immunity: Conjuration (IWD:EE only)
196 Immunity: Abjuration (BG:EE only)
196 Immunity: Divination (IWD:EE only)
197 Immunity: Conjuration (BG:EE only)
197 Immunity: Enchantment (IWD:EE only)
198 Immunity: Divination (BG:EE only)
198 Immunity: Illusion (IWD:EE only)
199 Immunity: Enchantment (BG:EE only)
199 Immunity: Evocation (IWD:EE only)
200 Immunity: Illusion (BG:EE only)
200 Immunity: Necromancy (IWD:EE only)
201 Immunity: Evocation (BG:EE only)
201 Immunity: Alteration (IWD:EE only)
202 Immunity: Necromancy (BG:EE only)
203 Immunity: Alteration (BG:EE only)
Important: Only removes opcode #142 effects, with a matching 'param2' value. Cannot remove portrait icons generated by any other mechanic.
Note: In EE games, can also remove opcode #177/opcode #283 effects if their EFF file uses opcode #142 with a matching ‘param2’ value.

#241 (0xF1) Charm: Control Creature Variants: IWD1
Parameter #1: Creature ID
Parameter #2: Charm Type
Description:
As opcode #5.

#242 (0xF2) Cure: Confusion Variants: IWD1 IWD2 BG2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes STATE_CONFUSION and opcode #128 effects from the targeted creature(s).

#243 (0xF3) Item: Drain Item Charges Variants: BG2 IWD1 IWD2
Parameter #1: Item Type
Parameter #2: Number to Drain
Description:
Magical items matching the 'Item Type' value on the targeted creature(s) will have their charges drained by Number to Drain. Non-recharging items drained of all their charges are destroyed.
Known values for 'Item Type' are:
0 Magical items excluding weapons
1 Magical items including weapons
Charges are only drained from extended headers with of type magical (i.e. 3), for magical, displayable items. Items that do not that recharge are not destroyed. Items flagged as unsellable are not drained.

#244 (0xF4) Spell: Drain Wizard Spell Variants: IWD1 IWD2
Parameter #1: Number to Drain
Parameter #2: Irrelevant
Description:
Drains spells from a wizards memory. This effect always drains the highest level possible spell first and drains the number set by the Number to Drain parameter.

#245 (0xF5) Check For Berserk Variants: IWD1 IWD2
Parameter #1: Undefined
Parameter #2: Undefined
Description:
This effect enables a 1% chance of the targetted creature(s) going berserk on each attack it makes. This affect sets the berserk stat changes and then attaches affect 246.

#246 (0xF6) Spell Effect: Berserking Variants: IWD1 IWD2
Parameter #1: Undetermined
Parameter #2: Undetermined
Description:
This effect appears to be a combination of opcode #3 and the berserking portrait icon. This affect attaches affect 247.

#247 (0xF7) Spell Effect: Attack Nearest Creature Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Constant Value
Description:
Applies the attack nearest creature effect on the targeted creature(s).
This effect causes the targeted creature(s) to attack the nearest creature. The affected creature becomes berserk and its AI scripts stop running. Grants a +2 bonus to hit and damage with all weapons. Unlike opcode #3, this one can affect enemies as well.

This effect sets stat #144 (BERSERKSTAGE2) to param #2. It also sets the STATE_BERSERK flag.
Important: The 'Constant Value' parameter should be non-zero.
Note: At least in EEs, the only difference between opcodes #3 and #247, is that #247 will not force the creature(s) to use melee weapons, and is not removed by opcode #4 (Cure Berserk).

#248 (0xF8) Item: Set Melee Effect Variants: IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Fist only
Description:
Sets the effect specified by the resource key as a melee effect.
The specified effect will be applied to the target of each successful melee attack.
The resource key references a .EFF not a .SPL.
Note: At least in EEs, setting parameter2 to 4 (i.e., BIT2) results in restricting this effect to fists only. If you leave it at 0, then all melee weapons are eligible (including fists).
Note: It will always apply to both main and offhand weapon.
Note: This opcode applies its effect inbetween base weapon damage and the on-hit effects of the weapon.

#249 (0xF9) Item: Set Ranged Effect Variants: IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Sets the effect specified by the resource key as a ranged effect.
The specified effect will be applied to the target of each successful ranged attack.
The resource key references a .EFF not a .SPL.
Note: At least in EEs, this opcode applies its effect after both the base weapon damage and the on-hit effects of the weapon.

#250 (0xFA) Spell Effect: Damage Modifier Variants: IWD1 IWD2
Parameter #1: Damage Modifier
Parameter #2: Irrelevant
Description:
Applies the 'Damage Modifier' value to the damage caused by the targetted creature(s). The effect works as a minimum damage value, i.e. at least 'Damage Modifier' damage will always be caused (on a successful hit).
Info: This opcode works in the same manner as luck (and stacks with it), except that it only affects base weapon damage. It can be positive or negative.

#251 (0xFB) Spell Effect: Change Bard Song Effect Variants: IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Sets the Bard Song of the targeted creature to the spell specified by the resource key.
Note: The default Bard Song applies the following effects:
All effects are added to the entire party with timing 4096 (end at ticks) and duration (nGameTime + 100)
Display Special Effect Icon (0x8E)
param2 (Icon) = 40 Bard Song
Morale Modifier (0x17) - Sets the Morale stat of the targetted creature(s) to 10.
param1 (Ignored) = 10
param2 (Ignored) = 0
Cure Horror (0xA1)
param1 (Irrelevant) = 1
param2 (Irrelevant) = 0
Protection from Opcode (0x65)
param1 (Irrelevant) = 1
param2 (Opcode) = 24 (State: Horror)

#252 (0xFC) Spell Effect: Set Trap Variants: IWD1 IWD2 BG2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Attempts to set the spell specified by the resource key as a trap.
In particular:
  • If the caster is a party member, the number of traps in the current area must not exceed their class limit specified in TRAPLIMT.2DA.
  • Feedback string ENGINEST[172|STRREF_FEEDBACK_SNAREFAILED_TOOMANY] will be displayed if there are too many.
  • The caster cannot have any hostile creatures within their own visual range.
  • Feedback string ENGINEST[171|STRREF_FEEDBACK_SNAREFAILED_ENEMIES] will be displayed if there are enemies in sight.
  • If the caster succeeds the skill check, Feedback string ENGINEST[173|STRREF_FEEDBACK_SNARESUCCEEDED] will be displayed (and the spell "resource" cast).
  • If the caster fails the skill check, Feedback string ENGINEST[170|STRREF_FEEDBACK_SNAREFAILED] will be displayed.
  • If the caster has a critical failure, then they are struck by spell 'Resource'+'F'.
Note: Feedback from this effect is only given when used by party members.

#253 (0xFD) Spell Effect: Add Map Marker Variants: IWD1 IWD2
Parameter #1: String Reference
Parameter #2: Irrelevant
Description:
Applies the set map marker effect.
The String Reference parameter is a string reference to the dialog.tlk file that sets what the marker says when the marker is read. The Target of this effect should be set to Self to function correctly.
Important: This effect works in SoA but not ToB

#254 (0xFE) Spell Effect: Remove Map Marker Variants: IWD1
Parameter #1: String Reference
Parameter #2: Irrelevant
Description:
Applies the remove map marker effect. This effect removes the map marker (if any) at the position the effect is cast. The Target of this effect should be set to Pre-Target to function correctly.
Important: This effect works in SoA but not ToB

#255 (0xFF) Item: Create Inventory Item (days) Variants: IWD1
Parameter #1: Charges
Parameter #2: Irrelevant
Description:
Creates the item specified by the resource key. The number of items created is controlled by the 'Charges' field. The number of secondary charge is determined by P3. The number of tertiary charges is determined by P4 (external eff's). The item is created in the Inventory, and has the 'can not steal' bit set.
Note: The difference from opcode #122 is that when used in an external .eff, the duration (from the calling file) is specified in days.

#256 (0x100) Spell: Spell Sequencer Active Variants: BG2 IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This effect stores the spell resources for an active spell sequencer. These resources are stored in the resource key, VVC field (resource2), and resource3.
This effect stores spells to be cast through opcode #258 and opcode #260.
When used in an external EFF file, known values for 'Parameter3' (Type) are:
  • 0 => Hidden – this sequencer is not viewable in the MageBook 'Contingency' screen, and is not removed when activated.
  • 1 => Displayed – this sequencer is viewable in the MageBook 'Contingency' screen, and is removed when activated.
When used in an external EFF file, 'Parent Type' (Source Type) may be manually set to influence its behavior. Known values for 'Parent Type' are:
  • 0 = None – Allows further effects with a matching "Parent Resource" to affect the target.
  • 1 = Spell – Any further effects with a matching "Parent Resource" will be blocked by the engine and string ENGINEST[42|STRREF_ERROR_CAN_NOT_CAST_TWO_CONT] is returned to the combat log.
  • 2 = Item – Allows further effects with a matching "Parent Resource" to affect the target.
When used in an external EFF file, "Parent Resource" (Activation key) must be manually set to influence its behavior.
The 'Activation Key' is the "Resource" to be referenced by the effect(s) that will activate this sequencer.
When set manually, it cannot contain lowercase characters, it MUST be in ALLCAPS, numbers, and/or symbols, or the sequencer cannot be activated.
Note: The presence of this effect in any of a spell’s ability headers will force any Wild Surge of that spell to use the ‘Cast Normal’ result.
Note: ‘Activation Key’ does not have to reference an actual spell or item resource, it can be any valid string, so long as the effects involved (256/257 and 258/260) use the exact same string.

#257 (0x101) Spell: Spell Sequencer Creation Variants: BG2 IWD1
Parameter #1: Maximum Level Usable
Parameter #2: Amount
Description:
Creates a custom spell sequencer, storing a certain number of spells for later use.
It applies opcode #256 to the caster upon completing the spell selection process, and at the same time it grants you the -D or -P subspell (via opcode #171). In particular:
  • if all of the sequenced spells use ability target 4 (Target Point), it will grant spell 'Parent' + 'P' (provided such a spell exists – for instance: SPWI420P),
  • otherwise it will grant spell 'Parent' + 'D' (for instance: SPWI420D).
The chosen spells are stored using opcode #256, using 'Timing Mode' 1 (regardless of timing mode for opcode #257) and 'Parameter3' set to 1.
The 'Maximum Level' field indicates the maximum spell level that can be used in the sequencer. The 'Amount' field indicates the number of spells that can be used in the sequencer.

When used in an external EFF file, 'Parent Type' (Source Type) may be manually set to influence its behavior. Known values for 'Parent Type' are:
  • 0 = None – Allows further effects with a matching "Parent Resource" to affect the target.
  • 1 = Spell – Any further effects with a matching "Parent Resource" will be blocked by the engine and string ENGINEST[42|STRREF_ERROR_CAN_NOT_CAST_TWO_CONT] is returned to the combat log.
  • 2 = Item – Allows further effects with a matching "Parent Resource" to affect the target.
When used in an external EFF file, "Parent Resource" (Activation key) must be manually set to influence its behavior.
When set manually, it cannot contain lowercase characters, it MUST be in ALLCAPS, numbers, and/or symbols, or the sequencer cannot be activated.

If not used in an external EFF, the 'Activation Key' will be the "Parent Resource".
If used in an external EFF, the 'Activation Key' must be explicitly specified, but doesn't need to match its actual "Parent Resource".
For the vanilla spells, the 'Activation Key' is always the parent spell of opcode #257.
Important: As of v2.3, an entry for the "Parent Resource" or "Activation Key" must be added to the 'mageBookStrings{}' lua table, or the game will crash upon use.
Important: The filename of a spell containing this effect should be no more than 7 characters.
Note: The presence of this effect in any of a spell’s ability headers will force any Wild Surge of that spell to use the ‘Cast Normal’ result.
Note: ‘Activation Key’ does not have to reference an actual spell or item resource, it can be any valid string, so long as the effects involved (256/257 and 258/260) use the exact same string.

#258 (0x102) Spell: Spell Sequencer Activation Variants: IWD1 IWD2 BG2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Activates a spell sequencer at a single target.
Activates any opcode #256 effects with a matching resource ('Activation Key') of the targeted creature(s).
When used in combination with opcode #257 (Spell Sequencer Creation):
  • The resource key must be set to the filename of the spell which contains the Spell Sequencer Creation effect.
  • The spell which contains the Spell Sequencer Creation effect can have a maximum filename of 7 characters.
  • The spell which contains the Spell Sequencer Activation effect must have the same filename, suffixed with the D character, and should be an innate ability. For instance:
    • Spell Sequencer Creation filename = SPWI420
    • Spell Sequencer Activation filename = SPWI420D

Those spells are cast by the targeted creature(s) at "this" ability's target.
For each stored spell, "this" ability's target must be within range of that spell, or it will fail.

All opcode #256 effects with a matching 'Activation Key' are removed if their 'Parameter3' = 1 (those created by opcode #257 / opcode #234 have this value set to '1' by default).
Note: This opcode will fail if delivered directly in an area effect projectile (though it may still target “self” or be used in subsequent non-AoE subspells).
Note: ‘Activation Key’ does not have to reference an actual spell or item resource, it can be any valid string, so long as the effects involved (256/257 and 258/260) use the exact same string.

#259 (0x103) Protection: Spell Trap Variants: IWD1 IWD2
Parameter #1: Amount
Parameter #2: Level
Description:
Applies the spell-trap effect to the targeted creature(s), absorbing a number of spells as specified by the 'Amount' field, of the level specified by the 'Level' field, and recalling previously cast spells. A spell is assigned to a spell level by the power level of the first effect greater than the 'Level' parameter in the extended header that is being called.

#260 (0x104) Spell: Spell Sequencer Activation Variants: BG2 IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Activates a spell sequencer at a target point.
Activates any opcode #256 with a matching resource ('Activation Key') of the targeted creature(s).
When used in combination with opcode #257 (Spell Sequencer Creation):
  • The resource key must be set to the filename of the spell which contains the Spell Sequencer Creation effect.
  • The spell which contains the Spell Sequencer Creation effect can have a maximum filename of 7 characters.
  • The spell which contains the Spell Sequencer Activation effect must have the same filename, suffixed with the P character, and should be an innate ability. For instance:
    • Spell Sequencer Creation filename = SPWI420
    • Spell Sequencer Activation filename = SPWI420P

Those spells are cast by the targeted creature(s) at "this" ability's target.
For each stored spell, "this" ability's target must be within range of that spell, or it will fail.

All opcode #256 effects with a matching 'Activation Key' are removed if their 'Parameter3' = 1 (those created by opcode #257 / opcode #234 have this value set to '1' by default).
Note: ‘Activation Key’ does not have to reference an actual spell or item resource, it can be any valid string, so long as the effects involved (256/257 and 258/260) use the exact same string.

#261 (0x105) Spell: Restore Lost Spells Variants: IWD1
Parameter #1: Spell Level
Parameter #2: Spell Type
Description:
Applies the restore lost spell effect to the targeted creature(s).
This effect will restore 1 spell to memory, at the level specified by the 'Spell Level' field, and of the type specified by the 'Spell Type' filed. If there is no free slot at the specified level, the effect restores a spell at the next lowest level possible.
Known values for 'Spell Type' are:
0 Wizard / Bard
1 Cleric / Druid

#262 (0x106) Stat: Visual Range Variants: IWD1 IWD2
Parameter #1: Visual Range
Parameter #2: Type
Description:
Applies the visual range effect to the targeted creature(s).
This effect modifies the visual range of the targeted creature(s).
The Visual Range parameter seems to be in the 0-15 interval.
Known values for 'Type' are:
0 Cumulative Modifier -> Visual Range = Visual Range + 'Visual Range' value
1 Flat Value Modifier -> Visual Range = 'Visual Range' value
Info: With relation to this effect:
  • Each unit of visible range equals 2ft: 32px(horizontal)/24px(vertical)
  • Default Visual Range = 14
  • Maximum visual range to reveal "Fog of War" = 23

#263 (0x107) Stat: Backstab Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Backstab = Backstab + 'Statistic Modifier' value
1 Flat Value Modifier -> Backstab = 'Statistic Modifier' value
2 Percentage Modifier -> Backstab = (Backstab * 'Statistic Modifier' value) / 100

#264 (0x108) Spell Effect: Drop Weapons in Panic Variants: IWD1 BG2
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Applies the drop weapons effect to the targeted creature(s), in the style specified by the 'Type' field.
This effect causes the targeted creature(s) to drop a piece of equipment.
Known values for 'Type' are:
0 Drop random equipment
1 Drop weapons from Quick-Weapon Slot (slots #35 – #38).
Note: Can drop items located in the Magical Weapon Slot (slot #34 – SLOT_MISC19) if they are not flagged properly.
Will never drop items:
  • located in slot #10 – SLOT_FIST
  • flagged as "Critical" => BIT0 (INDESTRUCTIBLE) set to 1 in the ITM file
  • not flagged as "Droppable" => BIT2 (DROPPABLE) set to 0 in the ITM file
  • flagged as "Undroppable" => BIT3 (NONDROPABLE) set to 1 in the CRE file

#265 (0x109) Script: Modify Global Variable Variants: IWD1
Parameter #1: Value
Parameter #2: Type
Description:
Alters the global variable specified by the resource key, in the style specified by the 'Type' field, by the value specified by the 'Value' field.
Known values for 'Type' are:
0 Set Global (to 'Value')
1 Increment Global (by 'Value')
Note: Since the Resource Key can only be 8 characters long maximum, you can not set a Local Variable with this effect this has a name longer than this amount.
You can use the VVC field of external EFF files for an additional 8 characters of variable name.
You can use the 3rd resource field of EFF files for an additional 8 characters.
Note: All timing modes act as permanent for this effect.
Note: ‘Value’ can store integers or coordinates. Coordinates are stored as first 2 bytes X, last 2 bytes Y (f.i.: “310 + (30 « 16)”).
Warning: Make sure to set target. Target: Self (1) works well. If target is unset (0), the game will freeze.

#266 (0x10A) Spell: Remove Protection from Spell Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the protection from specific spell (as granted by #206) from the targeted creature(s) based on a matching resource key.

#267 (0x10B) Text: Protection from Display Specific String Variants: IWD1
Parameter #1: String Reference
Parameter #2: Irrelevant
Description:
Prevents the strref specified by the 'String Reference' field being displayed by the targeted creature(s).
Important: Only grants immunity to opcode #139 effects with a matching 'String Reference' value.
Cannot block string displays from any other mechanic.

#268 (0x10C) Spell Effect: Clear Fog of War (Wizard Eye) Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Applies the clear fog of war effect on the targeted creature(s).
The targeted creature(s) will be able to explore like a PC does.

This effect sets stat #148 (EXPLORE) to 1.
Important: Only 8 creatures in a given area can fully clear fog of war, with priority going to party members.

#269 (0x10D) Spell Effect: Shake Window Variants: IWD1
Parameter #1: Strength
Parameter #2: Undetermined
Description:
Applies the shake windows effect, with an intensity specified by the 'Strength' field

#270 (0x10E) Cure: Unpause Target Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the pause effect (#165) from the targeted creature(s).

#271 (0x10F) Graphics: Avatar Removal Variants: IWD1 BG2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Hides the creature's animation and selection circle, including illusionary images (Blur / Mirror Image).
Disables the creature's AI scripts.
The creature cannot take any action not listed in INSTANT.IDS (usually through ActionOverride().
The creature is still subject to area effect and may still be targeted directly by mouseover.

#272 (0x110) Spell: Apply Repeating EFF Variants: IWD1 BG2
Parameter #1: Amount_1
Parameter #2: Type
Parameter #3: Amount_2
Parameter #4: Frequency Multiplier
Special: Icon
Description:
Applies the EFF specified by the resource key to the targeted creature(s) as specified by the 'Type' field.
Known values for 'Type' are:
  • 0 => Apply once per second ('Amount_2' and 'Frequency Multiplier' are ignored – 'Amount_1' needs to be non-zero)
  • 1 => Unknown (see below for further details)
  • 2 => Apply 'Amount_1' times every 'Frequency Multiplier' second(s)
  • 3 => Apply once every 'Amount_1' * 'Frequency Multiplier' second(s)
  • 4 => Apply 'Amount_2' times every 'Amount_1' * 'Frequency Multiplier' second(s) – This is the only one that must be in external EFF files
  • 5+ => Crash
'Icon' defines the index from STATDESC.2DA for custom portrait icons. Default value is none (no icon).
Info: The timings are relative to the movement rate of the affected creature(s). opcode #40 (Slow) and opcode #78 (Disease) doubles the timing rate, effect opcode #16 (Haste) halves the timing rate.
Important: This opcode does not have any function when 'Type' = 1, thought the effect is still present (it doesn't just instantly terminate), and will generate a portrait icon if 'Icon' is non-zero.
Info: If ‘Frequency Multiplier’ = 0, its value is treated as 1. This is the default value for SPL/ITM effects.

#273 (0x111) Remove: Specific Area Effect(Zone of Sweet Air) Variants: IWD1
Parameter #1: Undetermined
Parameter #2: Undetermined
Description:
Removes projectiles listed in CLEARAIR.2DA.
Note: At least in EEs, If the resource field is filled, it will use a custom 2DA file to determine which projectiles to remove.
The custom 2DA file must be structured as CLEARAIR.2DA.

#274 (0x112) Spell Effect: Teleport to Target Variants: IWD1
Parameter #1: Undetermined
Parameter #2: Undetermined
Description:
Teleports the affected creature(s) to a random enemy (i.e. party members would teleport to a red circled creature, red circled creatures teleport to the party). If there are no enemies within visual range, no effect will occur.

#275 (0x113) Stat: Hide in Shadows Modifier Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100
Info: When ‘Type’ = 0 and ‘Timing Mode’ = 9, it modifies STAT #180. The final value for this stat is multiplied by its percentage entry in THIEFSCL.2DA capped to the range [0,255], before being included in the creature’s Hide in Shadows score.

#276 (0x114) Stat: Detect Illusion Modifier Variants: IWD1 IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100
Info: At least in EEs, when ‘Type’ = 0 and ‘Timing Mode’ = 9, it modifies STAT #181. The final value for this stat is multiplied by its percentage entry in THIEFSCL.2DA capped to the range [0,255], before being included in the creature’s Detect Illusions score.

#277 (0x115) Stat: Set Traps Modifier Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100
Info: At least in EEs, when ‘Type’ = 0 and ‘Timing Mode’ = 9, it modifies STAT #182. The final value for this stat is multiplied by its percentage entry in THIEFSCL.2DA capped to the range [0,255], before being included in the creature’s Set Traps score.

#278 (0x116) Stat: To Hit Modifier Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> To-hit = To-hit + 'Statistic Modifier' value
1 Flat Value Modifier -> To-hit = 'Statistic Modifier' value
2 Percentage Modifier -> To-hit = (To-hit * 'Statistic Modifier' value) / 100
Note: This effect adjusts modified THAC0, rather than the base stat.

#279 (0x117) Button: Enable Button Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Button
Description:
Enables the button specified by the 'Button Type' field. The resource field acts as a matching key to the resource field of the Enable Button, allowing separate enable/disable reasons.
Known values for 'Button' are:
0 Stealth Button
1 Thieving Skill Button
2 Spell Select Button
3 First Quick Spell Button
4 Second Quick Spell Button
5 Third Quick Spell Button
6 Turn Undead Button
7 Talk Button
8 Use Item Button
9 First Quick Item Button
10 Bard Song Button (only in EEs)
11 Second Quick Item Button
12 Third Quick Item Button
13 Innate Ability Button
14 Find Traps Button
15 Inventory Button (only in EEs)
Important: Removing opcode #144 is all it does, it cannot enable buttons disabled by other mechanics.

#280 (0x118) Spell Effect: Wild Magic Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Applies the wild magic effect to the targeted creature(s).
This effect causes other spells to be subject to wild magic throws.
Known values for 'Type' are:
1 Affect next spell cast
2 Affect all spells cast for effect duration
Note: Can only force Wild Surges on spells that are normally valid for them.
In particular, it doesn’t work for SPLs whose BIT14 (located at offset 0x18) is set to 1, subspells, as well as certain script actions – mostly the “instant-cast” ones.
Info: ‘Type’ = 1 also maintains STAT #153 to 1.

#281 (0x119) Stat: Wild Magic Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
This effect will alter the wild-surge roll, making the resultant effect either more or less beneficial.
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Chance = Chance + 'Statistic Modifier' value
1 Flat Value Modifier -> Chance = 'Statistic Modifier' value
2 Percentage Modifier -> Chance = (Chance * 'Statistic Modifier' value) / 100
Info: At least in EEs, the final value is added to the inherint level-based bonus of the Wild Mage.

#282 (0x11A) Script: Scripting State Modifier Variants: IWD1
Parameter #1: Value
Parameter #2: Scripting State
Description:
Modifies Scripting state to the given value. Scripting State range from 0 to 35. The scripting state can be checked via scripts (see STATS.IDS) subtract 156 from the stat value to get the scripting state.
Info:
  • On non-EE games, this effect does not have proper bounds checking. It can therefore be used in unintended ways. For example scripting state 13 equals with the NO_CIRCLE attribute (stat=169), and scripting state 1139 ties to PICKPOCKET (stat=29).
  • EEs have proper bounds checking for this opcode, can only modify stats #156 – #200, except #188 (SUMMON_DISABLE_ACTION), not all values are a straight "subtract 156 from their stat".
    For best results, it should only be used for stats #156 – #165, as all others have dedicated opcodes and hardcoded effects.

#283 (0x11B) Use EFF File (Cursed) Variants: BG2 IWD1
Parameter #1: IDS Entry
Parameter #2: IDS File
Description:
Applies the eff file specified by the resource key to the targeted creature(s), if the targeted creature(s) match the 'IDS Entry' in the specified 'IDS File'. The eff can be removed via the Remove Curse opcode (in addition to other standard methods).
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids

#284 (0x11C) Stat: Melee THAC0 Modifier Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> THAC0 = THAC0 + 'Statistic Modifier' value
1 Flat Value Modifier -> THAC0 = 'Statistic Modifier' value
2 Percentage Modifier -> THAC0 = (THAC0 * 'Statistic Modifier' value) / 100

The effect modifies STAT #166.

#285 (0x11D) Stat: Melee Weapon Damage Modifier Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

The effect modifies STAT #167.

#286 (0x11E) Stat: Missile Weapon Damage Modifier Variants: IWD1
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

The effect modifies STAT #168.

#287 (0x11F) Graphics: Selection Circle Removal Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Removes the selection circle from the targeted creature(s).

The effect modifies STAT #169.

#288 (0x120) Stat: Fist THAC0 Modifier Variants: IWD1 IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> THAC0 = THAC0 + 'Statistic Modifier' value
1 Flat Value Modifier -> THAC0 = 'Statistic Modifier' value
2 Percentage Modifier -> THAC0 = (THAC0 * 'Statistic Modifier' value) / 100

The effect modifies STAT #170.

#289 (0x121) Stat: Fist Damage Modifier Variants: IWD1 IWD2
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Damage = Damage + 'Statistic Modifier' value
1 Flat Value Modifier -> Damage = 'Statistic Modifier' value
2 Percentage Modifier -> Damage = (Damage * 'Statistic Modifier' value) / 100

The effect modifies STAT #171.

#290 (0x122) Text: Change Title Variants: IWD1 IWD2 BG2
Parameter #1: String Reference
Parameter #2: Position
Special: Class
Description:
Changes the title of the targeted creature(s), to the strref specified by the 'String Reference' field, at the location specified by the 'Position' field.
Known values for 'Position' are:
  • 0 Records Screen information section
  • 1 Various character screens (eg. Inventory and Records Screen)

The effect modifies STAT #172 and STAT #173.
'Class' specifies which classes title is replaced (values are from CLASS.IDS).

#291 (0x123) Graphics: Disable Visual Effect Variants: IWD1 IWD2 BG2
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
Blocks the hardcoded animations applied by the following opcodes: 201, 204, 205, 223, 226, 259, 197, 198, 199, 200, 202, 203, 207, 227, 228, 299.

The effect modifies STAT #174 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#292 (0x124) Protection: Backstab Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
Makes the targeted creature(s) immune to backstabbing.

The effect modifies STAT #175 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#293 (0x125) Script: Enable Offscreen AI Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
The targeted creature(s) will still run scripts when off-screen and out of combat.

The effect modifies STAT #183 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#294 (0x126) Spell Effect: Existance Delay Override Variants: IWD1
Parameter #1: Undefined
Parameter #2: Constant Value
Description:
Existance is the verbal constant group from 69 to 74 (or 70-74). These sounds are randomly played (for non global, alive characters, when not in cutscene or dialog). This stat tunes the frequency of these random strings.
Known values for 'Constant Value' are:
-1 - no existance sounds
0 - standard existance sound frequency
Other values - random existance sound frequency (the higher the rarer)
Info: The effect modifies stat 184, unless param2 is set to 1.

#295 (0x127) Graphics: Disable Permanent Death Variants: IWD1
Parameter #1: Undefined
Parameter #2: Stat Value
Description:
This targeted creature(s) will never suffer a permanent death (and will therefore always remain resurrectable) – exceptions include petrification and freeze-death.

The effect modifies STAT #186 to 'param2'.
'Timing Mode' should be set to 9 (Permanent after Death).
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#296 (0x128) Graphics: Protection from Specific Animation Variants: IWD1
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Provides the targeted creature(s) with immunity to opcode #215 effects with a matching "Resource" specified by the resource key.
Note: It does not remove any opcode #215 effect already present on the targeted creature.
Important: It cannot block animations from any other source.

#297 (0x129) Spell Effect: Immunity to Turn Undead Variants: IWD2
Parameter #1: Undefined
Parameter #2: Stat Value
Description:
Makes the targeted creature(s) immune to the Turn Undead effect.

The effect modifies STAT #187 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#298 (0x12A) Spell Effect: Execute Script cut250a Variants: IWD2 BG2
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Executes script "cut250a.bcs". By default this script teleports the party to the Pocket Plane area (AR4500).
Warning: Game will become locked in cutscene mode if “cut250a.bcs” doesn’t exist.

#299 (0x12B) Spell Effect: Chaos Shield Variants: BG2
Parameter #1: Shield Amount
Parameter #2: Icon
Description:
This effect defends against wild surges and displays an associated icon as specified by the 'Icon' parameter.
Known values for 'Icon' are:
  • 0 Normal Chaos Shield
  • 1 Improved Chaos Shield

The effect modifies STAT #189.
Info: It displays animation “SPTURNI2.BAM” (Spell Turning Disk).
Info: It does not directly block opcode #281 (or opcode #280), it blocks the wild surge itself, which can be natural or forced.
Surges it prevents do not count towards the “Next Spell” option of opcode #280.

#300 (0x12C) Spell Effect: NPCBump
Parameter #1: Unknown
Parameter #2: Stat Value
Description:
This effect allows the targetted creature(s) to push other creatures out of the way while moving.

The effect modifies STAT #190 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#301 (0x12D) Stat: Critical Hit Modifier Variants: BG2
Parameter #1: Statistic Modifier
Parameter #2: Irrelevant
Parameter #3: Weapon Category
Special: Weapon Type
Description:
This effect improves the Critical Hit chances.
Critical hits will occur on a roll (on a 1d20) greater or equal to:
20 - 'Statistic Modifier'

Known values for 'Weapon Type' are:
0 All Weapons
1 Melee Weapon only
2 Ranged Weapon only

Known values for 'Weapon Category' are (based on values from itemcat.ids):
0 Any category
5 ARROW
14 BULLET
15 BOW
16 DAGGER
17 MACE
18 SLING
19 SMSWORD
20 BGSWORD
21 HAMMER
22 MSTAR
23 FLAIL
24 DART
25 AXE
26 STAFF
27 XBOW
28 FIST
29 SPEAR
30 POLEARM
31 BOLT
Note: In v2.3 and prior, only the latest instance of this opcode applies. In v2.5+, all instances stack together.

#302 (0x12E) Item: Can Use Any Item Variants: BG2
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
The targeted creature(s) can use any item.

The effect modifies STAT #191 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).
Important: It does not bypass item restrictions from ITEM_USE.2DA, Ability Score/Level requirements, or to scribing spells of opposition schools.

#303 (0x12F) Spell Effect: Backstab Every Hit Variants: BG2
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
The targeted creature(s) will backstab with every hit.

The effect modifies STAT #192 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).
Important: Creature must still be using a weapon valid for backstabbing.
Info: Backstabs no longer require the creature to be invisible.
Sneak Attacks no longer require the creature to be flanking their target.

#304 (0x130) Mass Raise Dead
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This effect will raise multiple dead Party Members (PCs).

#305 (0x131) Stat: THAC0 Modifier (Off-Hand)
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> THAC0 = THAC0 + 'Statistic Modifier' value
1 Flat Value Modifier -> THAC0 = 'Statistic Modifier' value
2 Percentage Modifier -> THAC0 = (THAC0 * 'Statistic Modifier' value) / 100

#306 (0x132) Stat: THAC0 Modifier (On-Hand)
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> THAC0 = THAC0 + 'Statistic Modifier' value
1 Flat Value Modifier -> THAC0 = 'Statistic Modifier' value
2 Percentage Modifier -> THAC0 = (THAC0 * 'Statistic Modifier' value) / 100

#307 (0x133) Ranger Tracking Ability
Parameter #1: Range
Parameter #2: Irrelevant
Description:
Activates the Tracking Ability. A string from TRACKING.2DA is shown, and arrows appear along the screen edge pointing to any creatures within range. The units of the range parameter are unknown.
Info: The arrow effect may be hardcoded to spell “SPCL922.SPL”.
Note: The file TRACKING.2DA lists the string reference that shows what information is learned from using this effect for each area.

#308 (0x134) Protection: From Tracking Variants: BG2
Parameter #1: Radius
Parameter #2: Stat Value
Description:
Protects the targeted creature(s) from the Tracking arrows effect (has no effect on the area string displayed).

The effect modifies STAT #195 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).
Warning: Using this effect “While Equipped” on an item will crash the game.
Important: Arrows do not display when using permanent or equipped timing modes.
Important: This effect is not saved to file, it will be lost if you save & reload.
Info: ‘Radius’: same scale as Area-Effect projectiles (16 units = 1ft).

#309 (0x135) Script: Modify Local Variable
Parameter #1: Value
Parameter #2: Type
Description:
Set both the local variable specified by the resource key to the value specified by the 'Value' field.
Known values for 'Type' are:
0 Set Local (to 'Value')
1 Increment Local (by 'Value')
Info: Since the Resource Key can only be 8 characters long maximum, you can not set a variable with this Effect this has a name longer than this amount.
You can use the VVC field of external EFF files for an additional 8 characters of variable name.
You can use the 3rd resource field of EFF files for an additional 8 characters.
Info: ‘Value’ can store integers or coordinates. Coordinates are stored as first 2 bytes X, last 2 bytes Y (f.i.: “310 + (30 « 16)”).

#310 (0x136) Protection: from Timestop
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
The targeted creature(s) becomes immune to time-stop.

The effect modifies STAT #197 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value.
If you set it to 0, you will disable the effect (for its duration). For instance, a Time Stop spell that applies (to everyone) op#310 with ‘Stat Value’ = 0 for 18s would trap those such as Demogorgon in the time stop.
Note: Creatures are naturally immune to their own Time Stop effects, without needing this effect or setting stat #197 (IMMUNE_TO_TIME_STOP).

#311 (0x137) Spell: Random Wish Spell
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This effect casts a wish spell (SPWISH01 - SPWISH25), selected based on the casting creatures Wisdom attribute, as outlined below.
SPWISHxx MinWis MaxWis
01 10 25
02 10 25
03 10 25
04 10 25
05 0 25
06 10 25
07 0 25
08 15 25
09 0 25
10 0 25
11 0 25
12 0 25
13 0 25
14 0 25
15 15 25
16 0 25
17 0 25
18 0 17
19 0 9
20 0 17
21 0 17
22 0 9
23 0 9
24 0 9
25 0 25

#312 (0x138) Crash Variants: BG2
Parameter #1: Undefined
Parameter #2: Stat Value
Description:
The effect modifies STAT #198 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#313 (0x139) High-Level Ability Denotation
Parameter #1: Undetermined
Parameter #2: Undetermined
Description:
This effect denotes that the high level ability specified by the resource key has been gained. Used for pre-requisites/count limits.

#314 (0x13A) Spell: Golem Stoneskin
Parameter #1: Amount
Parameter #2: Irrelevant
Description:
Gives the targeted creature(s) a number of protections from physical attacks, as specified by the 'Amount' field.
This opcode maintains STAT #199 to the amount of skins left.
Warning: Do not use this effect in conjunction with the Juggernaut Golem Manual as it will corrupt the use of that item. In particular, the Juggernaut Golem “TOMEGOL4.CRE” is scripted by “TOMEGOL4.BCS” to “Kill()” itself if its Summoner and none of the Players Party have stat #199 (STONESKINSGOLEM) set to a non-zero value.

#315 (0x13B) Graphics: Animation Removal
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
This effect will remove the animation of the targeted creature(s).

The effect modifies STAT #201 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).

#316 (0x13C) Spell: Magical Rest
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This effect will refresh spells and remove any fatigue.

#317 (0x13D) State: Haste 2
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Applies the Haste effect, in the style specified by the 'Type' value.
Known values for 'Type' are:
0 Normal Haste
1 Improved Haste
2 Weak Haste – Speed haste without attack bonuses
Note: This effect is functionally identical to opcode #16. The only difference between the two is that some ITMs/SPLs/abilities will specifically block/remove opcode #16 but not opcode #317 (e.g., Monks are immune to opcode #16 but not opcode #317).

#318 (0x13E) Protection from Resource Variants: BG2
Parameter #1: Value
Parameter #2: Stat Type
Description:
The creature type specified by the 'Type' field becomes immune to the spell or item specified in the 'Resource' field. See opcode #324 for more information.
Info: This opcode can block EFF files too.
In order to do so, both the “Resource” field of op#318 and the “Parent resource” field (located at offset 0x94) of the EFF file must be the same string (max. 8 character long). Unlike opcode #206, this one can innately block any type of resource (None/Spell/Item).

#319 (0x13F) Usability: Item Usability
Parameter #1: IDS Entry
Parameter #2: IDS File
Special: Description note
Description:
When 'Power' is set to 1, this effect restricts the item to creature(s) matching the object identifiers. When 'Power' is set to 0, creature(s) matching the object identifiers cannot use the item. The string to display when an invalid creature attempts to use the item is held in 0x2c.
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids
10 Actor's name
11 Actor's scripting name (8 maximum in resource field)

The message defined in 'Description note' will be displayed whenever this effect is triggered.
Info: If ‘IDS File’ is set to 10 and the strref held in parameter1 is set to “-1” (None), then you’re targeting player-created characters (e.g., “CHARNAME”).
Info: If ‘IDS File’ is set to 11 and no death variable is specified in the resource field, then you’re targeting player-created characters (e.g., “CHARNAME”).
Important: This opcode must be attached to the item itself, and does not work when applied in EFF files (such as through opcode 177).

#320 (0x140) Change Weather
Parameter #1: Weather
Parameter #2: Irrelevant
Description:
Changes the weather of the current area to the weather specified by 'Weather'.
Known values for 'Weather' are:
0 - Normal
1 - Rain
2 - Snow
3 - Fog (unimplemented)

#321 (0x141) Removal: Effects specified by Resource
Parameter #1: Irrelevant
Parameter #2: Type
Description:
Removes effects from the resource specified by the resouce key, in the style specified by the 'Type' field. Both spell and item resources are considered.
Known values for 'Type' are:
0 Default
1 Equipped effects list only
2 Timed effects list only
Note: It always needs to be the first effect for stacking prevention. Timing Mode should be either Instant/Limited(0) with 0 duration, or Instant/Permanent(1).
Warning: If the resource field is empty, it will remove level-up Weapon Proficiency effects.

#322 (0x142) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#323 (0x143) Stat: Turn Undead Level
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> TurnLevel = TurnLevel + 'Statistic Modifier' value
1 Flat Value Modifier -> TurnLevel = 'Statistic Modifier' value
2 Percentage Modifier -> TurnLevel = (TurnLevel * 'Statistic Modifier' value) / 100"
Note: Only Clerics and Paladins will display their Turn Undead level on the Record Screen.

#324 (0x144) Protection: Immunity to Resource and Message
Parameter #1: Value
Parameter #2: Stat Type
Description:
The creature type specified by the 'Type' field becomes immune to the spell or item specified in the 'Resource' field. It also gives a message on successful resist.
Known values for 'Stat Type' are defined in SPLPROT.2DA. SPLPROT.2DA uses three codes (labeled STAT, VALUE and RELATION) to define a targeting type.

STAT is either a straight stat value (listed in STATS.IDS) or a pseudo stat of the to be targeted creature:
0x100 - source equals target
0x101 - source is not target
0x102 - circle size
0x103 - use two rows of SPLPROT.2DA
0x104 - negate 0x103
0x105 - source and target morale match
0x106 - AREATYPE.IDS (like outdoors, forest, etc)
0x107 - time of day (in hours)
0x108 - source and target ethical match
0x109 - evasion
0x10a - EA.IDS
0x10b - GENERAL.IDS
0x10c - RACE.IDS
0x10d - CLASS.IDS
0x10e - SPECIFIC.IDS
0x10f - GENDER.IDS
0x110 - ALIGN.IDS
0x111 - STATE.IDS
0x112 - SPLSTATE.IDS
0x113 - source and target allies
0x114 - source and target enemies
0x115 - summon creature limit
0x116 - chapter check

VALUE is a number used to compare to the stat using a relational operator. Depending on the stat/operator it could be a bit value (hexadecimal allowed). If value is set to -1, then 'Value' of the opcode will be used.

RELATION is an index to a relational operator:
0 - less or equal
1 - equal
2 - less
3 - greater
4 - greater or equal
5 - not equal
6 - binary less or equal (stat doesn't contain extra bits not in value)
7 - binary more or equal (stat contains all bits of value)
8 - binary match (at least one bit is common)
9 - binary not match (none of the bits are common)
10 - binary more (stat contains at least one bit not in value)
11 - binary less (stat doesn't contain all the bits of value)
Info: This opcode can block EFF files too.
In order to do so, both the “Resource” field of op#324 and the “Parent resource” field (located at offset 0x94) of the EFF file must be the same string (max. 8 character long). Unlike opcode #206, this one can innately block any type of resource (None/Spell/Item).
Note: Feedback message displays ~Unaffected by (source of “this” effect)~, not the “Resource”, should they differ.

#325 (0x145) Stat: Save vs. all
Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Alters all saving throws by the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Save = Save + 'Statistic Modifier' value
1 Flat Value Modifier -> Save = 'Statistic Modifier' value
2 Percentage Modifier -> Save = (Save * 'Statistic Modifier' value) / 100
3 Increment Instantly -> Save = Save + 'Statistic Modifier' value
Info: When ‘Type’ = 3, this opcode processes before saving throws are checked for effects proceeding it in the same effect stack; when ‘Type’ = 0, it processes after.

#326 (0x146) Apply Effects List
Parameter #1: Value
Parameter #2: Stat Type
Description:
The creature type specified by the 'Stat Type' field will be affected by the spell in the 'Resource' field. See opcode #324 for more information.
The spell specified by the resource field is cast at the same level as "this" effect was cast, regardless of spell type.
Note: If this effect is applied through opcode #177, the spell is cast at the level specified at offset 0xc8 (Caster level) of the EFF.
Note: The only meaningful timing modes for this opcode are: Instant/Limited(0) with 0 duration (or, equivalently, Instant/Permanent(1)) and Delayed/Permanent(4).

#327 (0x147) Graphics: Icewind Visual Spell Hit (plays sound)
Parameter #1: Target
Parameter #2: Type
Description:
Shows the lighting effect specified by the 'Type' value. These effects are usually used for spell hits based on the spell school.
If Target is non-zero then the effect will be played in the original target point (ignores spell target).
Known values of type are listed in projectl.ids starting at offset 0x1000.

#328 (0x148) State: Set State
Parameter #1: Irrelevant
Parameter #2: Type
Special: Mode
Description:
Sets the state of the targetted creature(s) to the value specified by the 'Type' field.
These effects could be detected by the gamescript trigger ExtendedStateCheck. (see extstate.ids).
Known values for 'Type' are:
0 Chaotic Command
1 Miscast Magic
2 Pain
3 Greater Malison
4 Blood Rage
5 Cats Grace
6 Mold Touch
7 Shroud of Flame
If 'Mode' was set to 1, then this effect behaves like IWD2 Set State effect. (see splstate.ids)

#329 (0x149) Spell Effect: Slow Poison
Parameter #1: Slow Factor
Parameter #2: Irrelevant
Description:
Applies the slow poison effect to the targeted creature(s), using the 'Slow Factor' field.
Note: This opcode writes over the ‘Frequency Multiplier’ field of any opcode #25 effects on the targeted creature. As a result, it is useless against opcode #25 whose ‘Type’=(0 or 1), as well as any Poison effect that is used through opcode #177, as ‘Type’ = 4 requires.
Note: It can also accelerate Poisons if their ‘Frequency Multiplier’ field was already higher than the value specified in opcode #329.
Note: It does not alter the duration of the poison, nor does it affect any of the other frequency opcodes (78/98/272).

#330 (0x14A) Text: Float Text
Parameter #1: Strref
Parameter #2: Type
Parameter #3: Starting strref
Special: Count
Description:
Displays the text specified by the 'Strref' field, in the style specified by the 'Type' field.
Known values for 'Type' are:
  • 0 => Default (show strref)
  • 1 => Cynicism (show Cynicism strrefs)
About Cynicism option:
  • Uses a random String Reference from between 24916 – 24940.
  • Triggers at random intervals throughout its duration.
  • Maintains SPLSTATE[255|CYNICISM_EQUIPPED] on the targeted creature(s).
If used from an external effect (.eff), 'Strref' is set to 0 and 'Type' to 1, the third parameter will dictate the first strref and 'Special' will dictate the count. Then the number of lines of 'Special' will be displayed starting with the strref in 'Starting strref'.
Info: It is possible to colorize the string. In order to do so, follow the instructions concerning the colorization of the name of your character during Character Creation.

#331 (0x14B) Summon: Random Monster Summoning
Parameter #1: Count
Parameter #2: Type
Special: Mode
Description:
Each CRE files has a Creature Power Level number (at 0x18). This effect summons a number of monsters depending on this value, the special parameter and if it is used in SPL / ITM or from an external EFF.

When used in SPL/ITM, known value for 'Mode' are:
  • 0 => Summon amount equal to ('Count' + Dice rolls)
  • 1 => Summon amount equal to ('Count' + Dice rolls)
  • 2 => Summon until Creature Power Level equals/exceeds "Caster Level"

When used in EFF known value for 'Mode' are:
  • 0 => Summon until Creature Power Level equals/exceeds 'Count'
  • 1 => Summon amount equal to ('Count' + Dice rolls)
  • 2 => Summon until Creature Power Level equals/exceeds "Caster Level" field of EFF (located at offset 0xc8)

The 'Type' field sets which 2DA file to pick the creatures to summon from. The 2da files are listed in SMTABLES.2DA.
If the resource field is filled, it will use a custom .2da to determine which monsters to summon.
If used from an external effect (.eff), the vvc field controls the bam/vvc file played over the creatures when summoning.
If used from an external effect (.eff), the second vvc field controls the bam file played over the target area when summoning.
Note: As far as the allegiance of the summoned creatures is concerned, this opcode uses “Match Target”, which sets the summoned creature’s allegiance to one of 4 (Ally), 128 (Neutral), or 255 (Enemy), based on the summoner (whichever group the summoner belongs to).

#332 (0x14C) Stat: Specific Damage Modifier
Parameter #1: Modifier
Parameter #2: Type
Description:
Increases the damage caused by the character. The 'Type' parameter defines which damage type is increased. The modifier is either a flat value modifier for type 0, or a percentile modifier for all other cases.
Known values for 'Type' are:
0 all damage increased
1 Fire damage
2 Cold damage
3 Electricity damage
4 Acid damage
5 Magic damage
6 Poison damage
7 Slashing damage
8 Piercing damage
9 Crushing damage
10 Missile damage
Note: ‘Modifier’ is always a percentage, not a flat value. Multiple instances stack additively (+20% + 20% = +40%).

#333 (0x14D) Spell Effect: Static Charge
Parameter #1: Number
Parameter #2: Level
Special: Delay
Description:
Casts a secondary spell (default: original resource+B) on the target, for a number of strikes specified by the 'Number' field. The spell will be cast once per 'Special' through its projectile.
If a spell 'Level' is not specified, then the spell will be cast at level 1 and the damage opcodes will inherit the dice values of this effect, otherwise the spell will be cast at the given level.
'Delay' specifies the delay between hits, its default value is 6 (one round).

#334 (0x14E) Spell Effect: Turn Undead
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Turns undead just like the modal action. The caster must have some turn undead levels to be effective. See opcode #323

#335 (0x14F) Spell Effect: Seven Eyes
Parameter #1: Spellstate
Parameter #2: Row#
Special: Eye Group
Description:
When the opcode is applied, it checks if the creature currently has the spellstate specified by 'Spellstate' set. Known values for 'Spellstate' are defined in SPLSTATE.IDS.
  • If it's already set, this opcode is NOT applied, nothing happens.
  • Otherwise, the opcode is attached, the spellstate becomes set (for the duration of the effect), and the 'Resource' specified by the resource key (if any!) is granted to the character (as if through opcode #171)

The next time the row number specified by 'Row#' of 7EYES.2DA is triggered (blocks an effect), this effect will terminate, remove the spell it granted (as if through opcode #172) and decrement opcode #336 effects according to their 'Eye Group' (parameter2 for op#336, special field for op#335).
Note: Setting ‘Row#’ = “-1” will effectively have it last its full duration, blocking every effect listed for that spellstate in 7EYES.2DA.

#336 (0x150) Graphics: Display Eyes Overlay
Parameter #1: Sequence
Parameter #2: Eye Group
Description:
Displays 2 visual animations (VVC or BAM) similar to opcode #215 though only attached to a creature, not at a location (unattached). The animation filename is built from the 'resref' specified by the resource field and 'Sequence'.
Known values for 'Sequence' are:
  • 0 => None
  • 1 => A
  • 2 => B
  • 3 => C
  • 4 => D
  • 5 => E
  • 6 => F
  • 7 => G
  • ...
  • 26 => Z

The two animations that are played must be named in the following way:
  1. 'Resource'1'Sequence'.'extension'
  2. 'Resource'2'Sequence'.'extension'
For instance, in IWD:EE we have:
  • #7eyes1a.VVC, #7eyes1b.VVC, #7eyes1c.VVC, #7eyes1d.VVC, #7eyes1e.VVC, #7eyes1f.VVC
  • #7eyes2a.VVC, #7eyes2b.VVC, #7eyes2c.VVC, #7eyes2d.VVC, #7eyes2e.VVC, #7eyes2f.VVC

Whenever an opcode #335 effect with a matching 'Eye Group' (parameter2 for op#336, special field for op#335) terminates on the creature, the 'Sequence' value is reduced by 1, until it reaches 0 and terminates itself.

#337 (0x151) Remove: Opcode
Parameter #1: Param
Parameter #2: Opcode
Description:
Removes all 'Opcode' from target, that has the same param2 as 'Param'. Use -1 to ignore the parameter.
Important: This opcode cannot remove effects using 'Timing Mode' 9 (Instant/Permanent).

#338 (0x152) Disable Rest
Parameter #1: StrRef
Parameter #2: Mode
Description:
Disables save and/or rest, prints the string when they are attempted.
Known values for 'Mode' are:
0 - cannot rest
1 - cannot save
2 - cannot save or rest
Important: This effect cannot block autosaving or scripted resting.

#339 (0x153) Alter Animation
Parameter #1: Value and Modifier
Parameter #2: Projectile Type
Special: Range
Description:
Modifies an area animation's Cycle and plays an area hit animation over it indexed by 'Projectile Type'.
'Value' is the high word of the first parameter, 'Modifier' is a bitfield manipulation operation. 'Range' defines the range of effect.
Known values for 'Modifier' are:
0 - Set 'Value' - ignores original
1 - And 'Value' - keeps bits
2 - Or 'Value' - sets bits
3 - Xor 'Value' - toggles bits
4 - And not 'Value' - turns off bits

#340 (0x154) Spell Effect: Change Backstab Effect
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Sets the Back Stab effect of the targetted creature to the spell specified by the resource key. Both parameters should be 0 (zero).
In particular:
  • If the game option '3E Sneak Attacks' is not enabled, the spell is cast at the character's innate level.
  • If the game option '3E Sneak Attacks' is enabled, the spell is cast at level defined in CRIPPSTR.2DA + 1.
Note: If the game option ‘3E Sneak Attacks’ is enabled, the targeted creature will be affected by both “BACKSTAB.SPL” and the spell specified by the resource key.

#341 (0x155) Spell Effect: Change Critical Hit Effect
Parameter #1: Irrelevant
Parameter #2: Use
Parameter #3: Weapon Category
Special: Weapon Type
Description:
Sets the Critical Hit effect of the targetted creature to the spell specified by the resource key.
Known values for 'Use' are:
0 - Use spell for critical hits of both hands
1 - Use spell for critical hit only by this weapon

Known values for 'Weapon Type' are:
0 All Weapons
1 Melee Weapon only
2 Ranged Weapon only

Known values for 'Weapon Category' are: see opcode #301.
Note: This effect is not blocked from triggering by opcode #120 (Immunity to weapons).

#342 (0x156) Animation: Override Data
Parameter #1: Value
Parameter #2: Field
Description:
Overrides the character animation's blood color, body heat flag or personal space.
Known values for 'Field' are:
1 - Override body heat
2 - Override blood color
4 - Override personal space
Note: ‘Value’ = 0 causes infinite melee/spell range, both for their attacks/spells and when others target them.
Note: Does not alter selection circle size.

#343 (0x157) HP Swap
Parameter #1: Irrelevant
Parameter #2: Mode
Description:
Known values for 'Mode' are:
0 - Swap if caster HP > target HP
1 - Always swap
Note: This effect is always instantaneous.

#344 (0x158) Enchantment vs. creature type
Parameter #1: IDS Entry
Parameter #2: IDS File
Parameter #3: Weapon Slot
Parameter #4: Weapon Category
Special: Enchantment Level
Description:
Known values for 'IDS File' are:
2 EA.ids
3 General.ids
4 Race.ids
5 Class.ids
6 Specific.ids
7 Gender.ids
8 Align.ids
9 Kit.ids

Known values for 'Weapon Slot' are:
0 All Weapons
1 Melee Weapon only
2 Ranged Weapon only

Known values for 'Weapon Category' are: see opcode #301

#345 (0x159) Enchantment bonus
Parameter #1: Enchantment Level
Parameter #2: Type
Special: Weapon Slot
Description:
Known values for 'Type' are:
0 Magical weapons ('Enchantment Level' and below)
1 Magical weapons (all)
2 Non-magical weapons
3 Silver
4 Non-silver
5 Non-silver/Non-magical
6 Two-handed
7 Non two-handed
8 Cursed
9 Non-cursed
10 Cold iron
11 Non-cold iron

'Weapon Slot' can be one of the following:
0 - current weapon (the one to which this opcode is attached as an equipped effect)
1 - main hand weapon
2 - off hand weapon
3 - both weapons
Note: ‘Parameter4’ is the item type of the affected weapon (0 matches all). This can be set to affect only fists, for example.
Note: ‘Type’ values 2, 4, 5, 7, 9, and 11 do nothing (the “non-“ versions), as the opcode can only add properties, not remove them.

#346 (0x15A) Save vs. school bonus
Parameter #1: Statistic Modifier
Parameter #2: Type
Special: Primary Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Save = Save + 'Statistic Modifier' value
1 Flat Value Modifier -> Save = 'Statistic Modifier' value
2 Percentage Modifier -> Save = (Save * 'Statistic Modifier' value) / 100

'Primary Type' defines the school of magic to save against (see MSCHOOL.2DA).

#347 (0x15B) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#348 (0x15C) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#349 (0x15D) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#350 (0x15E) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#351 (0x15F) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#352 (0x160) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#353 (0x161) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#354 (0x162) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#355 (0x163) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#356 (0x164) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#357 (0x165) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#358 (0x166) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#359 (0x167) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#360 (0x168) Stat: Ignore Reputation Breaking Point
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
Allows joinable NPCs stay in the party regardless of reputation.

#361 (0x169) Cast spell on critical miss
Parameter #1: Unused
Parameter #2: Use
Parameter #3: Weapon Category
Special: Weapon Type
Description:
Applies the spell specified by the resource key when the target suffers a critical miss. The target of the critical miss effect is the attacker.
Known values for 'Use' are:
0 - Apply Critical Miss chance for both hands
1 - Apply Critical Miss chance only for this weapon

Known values for 'Weapon Type' are:
0 All Weapons
1 Melee Weapon only
2 Ranged Weapon only

Known values for 'Weapon Category' are: see opcode #301
Note: This effect is not blocked from triggering by opcode #120 (Immunity to weapons).

#362 (0x16A) Critical miss bonus
Parameter #1: Statistic Modifier
Parameter #2: Use
Parameter #3: Weapon Category
Special: Weapon Type
Description:
This effect increases the chance of suffering a Critical Miss. Critical Misses will occur on a roll (on a 1d20) lower or equal to: 1 + 'Statistic Modifier'.
Known values for 'Use' are:
0 - Apply Critical Miss chance for both hands
1 - Apply Critical Miss chance only for this weapon

Known values for 'Weapon Type' are:
0 All Weapons
1 Melee Weapon only
2 Ranged Weapon only

Known values for 'Weapon Category' are: see opcode #301
Note: In v2.3 and prior, only the latest instance of this opcode applies. In v2.5+, all instances stack together.

#363 (0x16B) Modal state check
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Special: Modal State
Description:
Trying to move will break the current modal action, and breaking the modal action will remove this effect and any other effects applied by the same spell.
The targeted creature must already be in the specified Modal State when this opcode is applied.

'Modal State' defines the modal state to check (see MODAL.IDS).
Note: If ‘Modal State’ = 0, then any modal state is eligible, but not “none”, it must be an actual Modal State.
Note: When used in EFF files, “Parent Resource” field must be used to specify which resources effects will be removed (an empty field will remove effects applied by the engine, such as level-up proficiencies).

#364 (0x16C) Unused
Parameter #1: Unknown
Parameter #2: Unknown
Description:
Unused

#365 (0x16D) Make unselectable
Parameter #1: Dialogue enabled
Parameter #2: AI enabled
Special: Selection circle color
Description:
This effects makes the targeted creature unselectable.
Known values for 'Dialogue enabled' are:
BG:EE/SoD:
  • 0 => Enabled
  • 1 => Disabled
BG2:EE:
  • 0 => Disabled
  • 1 => Enabled

Known values for 'AI enabled' are:
  • 0 => Disabled
  • 1 => Enabled

Known values for 'Selection circle color' are:
  • 0 => Purple Selection Circle
  • non-zero => Normal Selection Circle
Note: ‘AI enabled’ doesn’t work in BG:EE/SoD games (i.e., you cannot disable the AI of the targeted creature).

#366 (0x16E) Spell: Apply Spell On Move
Parameter #1: Irrelevant
Parameter #2: Irrelevant
Description:
This opcode applies the spell file (SPL) specified in the resref field to the target creature if it moves.
The spell should be applied instantly and any casting times in the SPL file should be ignored.

Note: This effect only triggers once, then terminates.

#367 (0x16F) Minimum base stats
Parameter #1: Irrelevant
Parameter #2: Stat Value
Description:
This is used in story mode. Any non-zero value in 'Stat Value' enables it. Ensures that base stats of the affected creature can not be reduced to 0.

The effect modifies STAT #202 to 'param2'.
Note: The ‘Stat Value’ parameter can take any value. If you set it to 0, you will disable the effect (for its duration).