Jump to content

Protecting a joined NPC against permanent death (only)


Recommended Posts

I want to protect a joined NPC against permanent death for a certain period of time. I know how to apply the effect spell and remove it, but what exactly would I need to include into such a protection spell to make sure the NPC will not be chunked or die a permanent death by other means? Normal death (i.e. with a greyed-out portrait) should still be possible.

The obvious things are:

  • protection against disintegration
  • protection against Imprisonment and Maze

Second, related question: is such an effect put onto the NPC by a spell one of those things that would be removed by cntrl+R? Is there any other things I need to consider, like the effect being removed if the NPC rejoins the group or something?

Link to comment

A Fixpacked or EE version of minhp1.itm has a pretty good rundown of ways to die.

  • Hit points to 0 (use min HP 208 to prevent)
  • Stat drain to 0 (use op 367 on EE or immunity to stat changes (all six) on non-EE)
  • Polymorph (135) can kill if it's used with the replace option
  • Imprisonment (211) is technically not death, but counts as such in the engine
  • Disintegration (238)
  • Petrification (134)
  • Power Word: Kill (209)
  • Slay (55)
  • Kill Target (13)
  • Level drain (216) to level 0
  • Undead being turned by high-level clerics  (use op 297)

Story mode in the EEs is done using spells, so starting with ohsmode1 (applies it) and ohsmode2 (removes it) may be useful places to start, though they add quite a bit beyond just preventing death.

CTRL-R does remove stuff like this, so you probably need a script block to detect its absence and re-apply it. EEs use a spell state (STORY_MODE) to detect if it needs to be re-applied, for example.

Link to comment

Thank you nevertheless for the suggestions, I'll put something together that might protect in 95% of the cases. I might have to live with the fact that I cannot prevent every quirk on a player's playthrough.

One more related question, though: how would I "re-initiate" an NPC that died a permanent death or was imprisoned - do I see it right that something like

-set SPRITE_IS_DEAD to 0

-cast a resurrection spell (e.g. "SPPR712")

-MoveGlobal to the wanted destination

would restore the NPC to alive'n kickin'? Or would e.g. imprisonment lead to problems?

Link to comment

This is the parameter used by the mod:

LPF ADD_CRE_EFFECT INT_VAR opcode=295 parameter2=1 target=1 timing=9 END

The target=1 is because it's being applied directly to the joinable NPC, but otherwise the timing and parameter2 are directly from the IESDP. According to the section on 295, it doesn't prevent permanent death via shattering from cold damage and petrification.

Link to comment
1 hour ago, jastey said:

Thank you nevertheless for the suggestions, I'll put something together that might protect in 95% of the cases. I might have to live with the fact that I cannot prevent every quirk on a player's playthrough.

One more related question, though: how would I "re-initiate" an NPC that died a permanent death or was imprisoned - do I see it right that something like

-set SPRITE_IS_DEAD to 0

-cast a resurrection spell (e.g. "SPPR712")

-MoveGlobal to the wanted destination

would restore the NPC to alive'n kickin'? Or would e.g. imprisonment lead to problems?

All that should be fine, though Imprisonment might be a problem. You could always apply freedom (op 212) but I'm not sure if it works outside of the area where the character is imprisoned.

Link to comment

Thank you! I guess I'll use immunity to 295 and inprisonment then.

Is there the possibility to protect against cold damage death in a reasonable manner or is it not a specific kind of death but just the kind of damage applied which incidently kills the NPC?

Link to comment

I have to refine one of my questions. If I apply such a protection effect via "secondary spell type" - which gives me the possibility to apply a bunch of effects and undo them later in the old engine - will those be removed by ctrl+R, as well?

And, are there any restriction to how many secondary spell type things the old engine can handle if applied by ADD_SECTYPE?

Link to comment
4 hours ago, Ardanis said:

Imprisonment should be curable if you apply the freedom effect directly, like resurrection.

But Freedom doesn't have a target, it's current area, unlike Resurrection which is a point a target(3). And by the by, Imprisonment kicks out the member of the party. Yes... you can make it ever lasting maze... but that's not a fix directly at Freedom.

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...