Jump to content

IWDEE: New opcodes


Recommended Posts

It took some new code to get all of the IWD spells to work in IWDEE; some of these debuted in BGIIEE (321). Here are the new opcodes, with a few notes from me following each in italics. Some of these also require lookup tables, which will be noted in another post.

 

Protection: Immunity to Spell [318]

Parameter 1: IDS Entry if Parameter 2 > 101. Otherwise it should be 0.
Parameter 2: Type

Description:
The creature type specified by the 'Type' field becomes immune to the spell specified by the resource key. Can be used to grant protection from items as well as spells.

Known values for 'Type' are:
0 Default
1 Undead
2 Not Undead
3 Fire Using/Dwelling
4 Not Fire Using/Dwelling
5 Humanoid
6 Not Humanoid
7 Animal
8 Not Animal
9 Elemental
10 Not Elemental
11 Fungus
12 Not Fungus
13 Huge Creature
14 Not Huge Creature
15 Elf
16 Not Elf
17 Umber Hulk
18 Not Umber Hulk
19 Half-Elf
20 Not Half-Elf
21 Humanoid or Animal
22 Not Humanoid or Animal
23 Blind
24 Not Blind
25 Cold Using/Dwelling
26 Not Cold Using/Dwelling
27 Golem
28 Not Golem
29 Minotaur
30 Not Minotaur
31 Undead or Fungus
32 Not Undead or Fungus
33 Good
34 Not Good
35 Neutral
36 Not Neutral
37 Evil
38 Not Evil
39 Paladin
40 Not Paladin
41 Same Moral Alignment as Source
42 Not Same Moral Alignment as Source
43 Source
44 Not Source
45 Water Using/Dwelling
46 Not Water Using/Dwelling
47 Breathing
48 Not Breathing
49 Allies
50 Not Allies
51 Enemies
52 Not Enemies
53 Fire or Cold Using/Dwelling
54 Not Fire or Cold Using/Dwelling
55 Unnatural
56 Not Unnatural
57 Male
58 Not Male
59 Lawful
60 Not Lawful
61 Chaotic
62 Not Chaotic
63 Evasion Check (Thief)
64 Orc
65 Not Orc
66 Deaf
67 Not Deaf
...
102 EA
103 GENERAL
104 RACE
105 CLASS
106 SPECIFIC
107 GENDER
108 ALIGNMENT
109 KIT

 

Notes: The parameters here are basically IWD's original 206, with the addition of standard EFF targeting for values > 100.

Removal: Effects specified by Resource [321]

Parameter 1: Irrelevant
Parameter 2: Type

Description:
Removes effects from the resource specified by the resource key, in the style specified by the 'Type' field.

Known values for 'Type' are:
0 Default
1 Equipped effects list only
2 Timed effects list only

 

You can use 321 to avoid stacking issues; for example Armor of Faith in EE uses a self-targeted 321 to remove prior castings before applying fresh effects. This lets you refresh buffs without having illegal stacking. In vBG2, you had to prevent stacking with 206, which would prevent you from re-upping your buffs before expiry and (worse) wasting your spell if you tried.

Stat:Turn Undead Level [323]

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

Protection: Immunity to Spell and Message [324]

Parameter 1: IDS Entry if Parameter 2 > 101. Otherwise it should be 0.
Parameter 2: Type

Description:
The creature type specified by the 'Type' field becomes immune to the spell specified by the resource key. Can be used to grant protection from items as well as spells. This opcode also displays a message then the target is immune to the specified spell i.e. "Unaffected by effects from ".

Known values for 'Type' are:
0 Default
1 Undead
2 Not Undead
3 Fire Using/Dwelling
4 Not Fire Using/Dwelling
5 Humanoid
6 Not Humanoid
7 Animal
8 Not Animal
9 Elemental
10 Not Elemental
11 Fungus
12 Not Fungus
13 Huge Creature
14 Not Huge Creature
15 Elf
16 Not Elf
17 Umber Hulk
18 Not Umber Hulk
19 Half-Elf
20 Not Half-Elf
21 Humanoid or Animal
22 Not Humanoid or Animal
23 Blind
24 Not Blind
25 Cold Using/Dwelling
26 Not Cold Using/Dwelling
27 Golem
28 Not Golem
29 Minotaur
30 Not Minotaur
31 Undead or Fungus
32 Not Undead or Fungus
33 Good
34 Not Good
35 Neutral
36 Not Neutral
37 Evil
38 Not Evil
39 Paladin
40 Not Paladin
41 Same Moral Alignment as Source
42 Not Same Moral Alignment as Source
43 Source
44 Not Source
45 Water Using/Dwelling
46 Not Water Using/Dwelling
47 Breathing
48 Not Breathing
49 Allies
50 Not Allies
51 Enemies
52 Not Enemies
53 Fire or Cold Using/Dwelling
54 Not Fire or Cold Using/Dwelling
55 Unnatural
56 Not Unnatural
57 Male
58 Not Male
59 Lawful
60 Not Lawful
61 Chaotic
62 Not Chaotic
63 Evasion Check (Thief)
64 Orc
65 Not Orc
66 Deaf
67 Not Deaf
...
102 EA
103 GENERAL
104 RACE
105 CLASS
106 SPECIFIC
107 GENDER
108 ALIGNMENT
109 KIT

 

Like 318, except this one doesn't print a message in the feedback window.

Stat: Save vs. all [325]

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

'Statistic Modifier' can be positive or negative.

 

Same as the individual save vs. X opcodes.

Add Effects List [326]

Parameter 1: IDS Entry if Parameter 2 > 101. Otherwise it should be 0.
Parameter 2: Type

Description:
The creature type specified by the 'Type' field will be affected by the spell in the 'Resource' field.

Known values for 'Type' are:
0 Default
1 Undead
2 Not Undead
3 Fire Using/Dwelling
4 Not Fire Using/Dwelling
5 Humanoid
6 Not Humanoid
7 Animal
8 Not Animal
9 Elemental
10 Not Elemental
11 Fungus
12 Not Fungus
13 Huge Creature
14 Not Huge Creature
15 Elf
16 Not Elf
17 Umber Hulk
18 Not Umber Hulk
19 Half-Elf
20 Not Half-Elf
21 Humanoid or Animal
22 Not Humanoid or Animal
23 Blind
24 Not Blind
25 Cold Using/Dwelling
26 Not Cold Using/Dwelling
27 Golem
28 Not Golem
29 Minotaur
30 Not Minotaur
31 Undead or Fungus
32 Not Undead or Fungus
33 Good
34 Not Good
35 Neutral
36 Not Neutral
37 Evil
38 Not Evil
39 Paladin
40 Not Paladin
41 Same Moral Alignment as Source
42 Not Same Moral Alignment as Source
43 Source
44 Not Source
45 Water Using/Dwelling
46 Not Water Using/Dwelling
47 Breathing
48 Not Breathing
49 Allies
50 Not Allies
51 Enemies
52 Not Enemies
53 Fire or Cold Using/Dwelling
54 Not Fire or Cold Using/Dwelling
55 Unnatural
56 Not Unnatural
57 Male
58 Not Male
59 Lawful
60 Not Lawful
61 Chaotic
62 Not Chaotic
63 Evasion Check (Thief)
64 Orc
65 Not Orc
66 Deaf
67 Not Deaf
...
102 EA
103 GENERAL
104 RACE
105 CLASS
106 SPECIFIC
107 GENDER
108 ALIGNMENT
109 KIT

Graphics: Icewind Visual Spell Hit (plays sound) [327]

Parameter 1: Irrelevant
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.

State: Set State [328]

Parameter 1: Irrelevant
Parameter 2: Type

Description:
Sets the state of the targeted 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 the 'special' field was set to 1, then this effect behaves like IWD2 Set State effect. (see splstate.ids)

Spell Effect: Slow Poison [329]

Parameter 1: Slow Factor
Parameter 2: Irrelevant

Description:
Applies the slow poison effect to the targeted creature(s), using the 'Slow Factor' field.

Text: Float Text [330]

Parameter 1: Strref
Parameter 2: Type

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)

Summon: Random Monster Summoning [331]

Parameter 1: Count
Parameter 2: Type

Description:
Summons a number of monsters, equal to the Dice rolls+'Count'. The 'Type' field set 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 .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.
Setting the special field to 2 will use the caster's level instead of Dice rolls.

Stat: Specific Damage Modifier [332]

Parameter 1: Damage 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

Spell Effect: Static Charge [333]

Parameter 1: Number
Parameter 2: Level

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 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. The spell is applied once per round (every 6 seconds) by default. Setting the special field to 60 will make the spell apply once per turn (every 60 seconds) instead.

Spell Effect: Turn Undead [334]

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

Spell Effect: Seven Eyes [335]

Parameter 1: State
Parameter 2: Type

Description:
This effect sets the spellstate defined under 'State', increases the seven eyes stat and grants the special ability named in the resource field.
'Type' selects the blocked spell or effect, the blocking criteria are listed in 7eyes.2da thus works like a very selective spell trap.
The special field may be used to define separate eye groups (it will remove 336 opcodes of the same type).

Graphics: Display Eyes Overlay [336]

Parameter 1: Sequence
Parameter 2: Type

Description:
Displays a twin VVC linked to the target. The last letter of the VVC is stored in 'Sequence'

Remove: Opcode [337]

Parameter 1: Parameter Value
Parameter 2: Opcode

Description:
Removes all 'Opcode' from target, that has the same parameter 2 as 'Parameter Value'. Use -1 to ignore the Parameter Value.

Disable Rest [338]

Parameter 1: Strref
Parameter 2: Mode

Description:
Disables save and/or rest, prints the relevant string when they are attempted.

Known values for 'Mode' are:
0 - cannot rest
1 - cannot save
2 - cannot save or rest

Alter Animation [339]

Parameter 1: Value and Modifier
Parameter 2: Projectile Type

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. The special field is containing 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

Spell Effect: Change Backstab Effect [340]

Parameter 1: Irrelevant
Parameter 2: Irrelevant

Description:
Applies the spell specified by the resource key when the target successfully performs a backstab.
Both parameters should be 0 (zero).

Spell Effect: Change Critical Hit Effect [341]

Parameter 1: Irrelevant
Parameter 2: Use

Description:
Applies the spell specified by the resource key when the target successfully performs a critical hit.

Known values for 'Use' are:
0 - Use spell for critical hits of both hands
1 - Use spell for critical hit only by this weapon

Animation: Override Data [342]

Parameter 1: Value
Parameter 2: Field

Description:
Overrides the character animation's blood color or body heat flag.

Known values for 'Field' are:
1 - Override body heat
2 - Override blood color

Spell Effect: HP Swap [343]

Parameter 1: Irrelevant
Parameter 2: Mode

Description:
Swaps the current hit points of the source and target.

Known values for 'Mode' are:
0 - Swap only if the caster has more current hit points than the target (default)
1 - Always swap

Link to comment

From what I've seen of effect opcode 327 (Icewind Visual Spell Hit), param2 (type) uses a hardcoded id for the lighting effect. I'm only judging from the single instance found in the game (SPPR326B.SPL) however, which uses type=88 (Mold touch). Any confirmation?

Effect opcode 336 (Seven eyes overlay) uses param1=7 (sequence) in SPWI725.SPL. How does it relate to "The last letter of the VVC"? Does it specify the letter position in the resource name? How is param2 (type) used?

I've also seen descriptions of an effect opcode 360 (Reputation breaking point) somewhere. Is it actually implemented? If yes, what are the parameters?

Link to comment

opcode 360 is not used in iwdee (probably not even present in it), i cannot tell if it is working or not (didn't write/use/test it). Lets say, it will work someday.

opcode 327 just shoots a projectile at the target (with no fx in it). The same (or similar) could also be achieved by the CG opcode (140).

opcode 336 uses 7 initially, but it is decreased by every eye spent (it is decreased by the engine).

When it creates a vvc resref to display, it takes the resource field and adds this number to it (as string). Like "#7EYES1A" (where A = 1, B = 2, etc).

Link to comment

It is all that BG[2]EE has, plus some more. Opcodes from vanilla IWD were ported to either simulating them by old opcodes, or tweaked opcodes or reimplemented them in a new slot.

DLTCEP uses the BG2 effect description file for IWDEE. Specifically: opcode 261 of iwd was relocated to 318.

[edit] Hmm, i think 261 is probably simulated by 101 (protection from opcode).

Edited by Avenger
Link to comment

Here is the opcode conversion table:

IWD Converter IWDEE
232 -> 400 -> 61 - "colour: Fade from Colour RGB" (Color Glow Dissipate)
206 -> ??? ->318 - "Protection: Immunity Spell" (IWD like spell immunities, see external table splprot.2da)
290 -> ??? ->324 - "Protection: from Spell (Message)" (Same as above with text feedback)
238 -> ??? ->325 - "Stat: Save vs. all" (modifier for all 5 Saving throws)
402 -> ??? ->326 - "Add Effects List" (based on spell immunities, applies a spell on target)
233 -> ??? ->327 - "Graphics: Icewind Visual Spell Hit (plays sound)" (Plays spell hit projectiles of IWD starting at 0x1000), most of these can be simulated by vvc, but not all
288 -> ??? ->328 - "State: Set State" (Sets extended state behavior can be HoW or IWD2 style)
239 -> 405 ->329 - "Spell Effect: Slow Poison" (Decreases poison effects by param1 factor)
283 -> ??? ->330 - "Text: Float Text [283]" (Used in Cynicism)
240 -> 401 ->331 - Monster summoning
243 -> 402 ->331 - Animate dead (Add 13 to param2)
246 -> 403 ->331 - Mixed summons (Add 15 to param2)
248 -> 404 ->331 - Shadow summons (Add 26 to param2)
73 -> 73 -> 332 - Specific damage bonus, if param2!=0
264 -> 407->333 - Static charge
282 -> 406 ->328 - Set State with param2 = 35 and special field = 1
280 -> 409 ->334 - Turn Undead
269-275 -> ? -> 335 - Seven Eyes effects, param1 = spell state (48+index), param2 = index, resource = SPIN107+index
? -> ? -> 336 - Seven Eyes Overlay (this one has no proper equivalent)
276 -> 500 -> 337 - Remove Effect by Opcode (used by seven eyes and cloudburst)
- - 338 - Cannot save or rest (from Seth)
- - 339 - Change Area Animation (IWD hardcoded projectile effect)
- - 340 - Set Backstab Spell (spell that is applied on victim of a backstab)
- - 341 - Set Critical Hit Spell (spell that is applied on victim of a critical hit)

Link to comment

The original post doesn't mention it, but am I correct if I will still assume that the IWDEE uses the BG2 opcode base ? So if I use a opcode 261 in IWDEE, it's the same as in BG2, and not the one in IWD1 ?

That's correct. We used all of the IWD-in-BG2 tricks to map as many opcodes as we could to existing BGIIEE ops, then turned Avenger loose on the ones that we either couldn't convert or were poorly simulated.
Link to comment

 

So...any chance these will be backported to bgee... =)

I second this!

Is there any possibility for unified Infinity engine THE ENGINETM? So we have some new stable grounds to build from...

How would they know this ? As a fact.

And by the by, your support here is as likely to be heard in as a fart from Venus.. I feel it's time to poke someone !

And the last reason to not port things is kinda bad, download size limit..

Edited by Jarno Mikkola
Link to comment

Yes, features are being backported between the games but it's not as high a priority as, say, bug fixing. Each bit of code added triggers a new round of regression testing so priority goes to code that's needed to address something. E.g. the expanded 232 options from IWDEE are coming in the BGIIEE 1.3 patch so that we can have the scriptless troll death/revive sequence.

 

In short, yes, we'd like to get everything onto the same level, but I have no idea about a time frame. Remember a lot of us are modders, too. :)

Link to comment

Yes, features are being backported between the games but it's not as high a priority as, say, bug fixing. Each bit of code added triggers a new round of regression testing so priority goes to code that's needed to address something. E.g. the expanded 232 options from IWDEE are coming in the BGIIEE 1.3 patch so that we can have the scriptless troll death/revive sequence.In short, yes, we'd like to get everything onto the same level, but I have no idea about a time frame. Remember a lot of us are modders, too. :)

Thanks for making my day!

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...