SetImmortal

From NWN Lexicon

Contents

[edit] SetImmortal(object, int)

Sets a creature as immortal.

void SetImmortal(
    object oCreature,
    int bImmortal
);

[edit] Parameters

oCreature

Creature to affect the mortality of.

bImmortal

Sets the creature to immortal (TRUE) or mortal (FALSE).

[edit] Description

Marks a creature as immortal; that is immune to death (cannot die but still takes damage).

Remember to script it so a player either knows the creature cannot ever die, or that the flag is removed at some point, else they might die as it appears they are still damaging the NPC with it set - see below.

[edit] Remarks

The damage still appears to happen, EG: "Tomas damages Goblin for 4 damage" while it actually stops at 1 hit point. Effects such as EffectDeath will not work, but most other effects should work the same as if this flag wasn't set.

List of the effect that doesn't affect immortal creatures:
EffectConfused
EffectDazed
EffectDominated
EffectCharmed
EffectDeath
EffectTurned
EffectPetrify
EffectParalyze
EffectSleep
EffectFrightened
EffectHitPointChangeWhenDying (obviously)
EffectStunned
EffectRessurection (obviously)
EffectTurnResistanceDecrease (TODO: recheck)
EffectTurnResistanceIncrease (TODO: recheck)

Similar effect that however works:
EffectCutsceneDominated
EffectCutsceneImmobilize
EffectCutsceneParalyze

[edit] Known Bugs

Previous bug reported with EffectDeath has been solved (as well as Vorpal and other instant-kill effects on items)

Also, it appears that only creatures, not placeables can be set as immortal. This may not be a bug, though, but could be something intended.

[edit] Version

1.30

[edit] Example

// We set ourselves to Immortal On Spawn
void main()
{
    // We won't die, but get left at 1 hit point.
    SetImmortal(OBJECT_SELF, TRUE);
}

[edit] See Also

functions: 

SetPlotFlag


 author: Charles Feduke, editor: Jasperre

Personal tools
Categories