Skip to content

script to execute player death (preventing perma-death)

quvtiquvti Member Posts: 1
Hi, I was wondering if someone could point me in the right direction to either write this, or someone more familiar with what would need to be written.

OPCODE 295 does not protect party members from permadeath, at least not on LoB difficulty.
It seems the only reliable way to do it is to either set player2-6 as "player1" in addition to the protagonist cannot die mod... Or to use this OPCODE:

#208 (0xD0) HP: Minimum Limit V
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.

I think if the MINHP is set to 1, in addition with OPCODE 13:
#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

If effect #4 is chosen (4 Normal death
Sets state STATE_DEAD (0x00000800)
Drops inventory)


... Then that combined with some sort of trigger to happen when a players 2-6 reach 1 hp would thereby prevent every death OPCODE aside from 512, and 16 from perma-killing the party member while still retaining the ability to die normally.

Obviously the resurrection spells would have to be modified so they resurrect the target with 2 HP instead of 1.

In addition to maybe using Spell Revisions version of FtS with a permastun rather than turning a target to stone.
Disintegration could be changed to just do a lot of damage instead.



I think the script would maybe be placed in the BALDUR.bcs area in NI?

With something along the lines of...

IF player2 MINHP=1
THEN OPCODE13 #4

I tried this through EEKeeper, but there doesn't seem to be a way to make an effect trigger combing two of them.
Sign In or Register to comment.