SetImmortal(object, int)

From NWN Lexicon
Jump to: navigation, search

Sets a creature as immortal.

void SetImmortal(
    object oCreature,
    int bImmortal
);

Parameters

oCreature
Creature to affect the mortality of.
bImmortal
Sets the creature to immortal (TRUE) or mortal (FALSE).


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.


Remarks

Immortal creatures take damage, but can never be killed. Personally, I'd consider it bad form to use these too much, and never without giving the PC a clue that they might not be able to kill this particular monster. Nothing is more annoying than struggling to get a creature to near death, and then fighting it for ten more minutes before you get up, since the creature could actually never be killed.

The immortal effect also makes you immune to most complex effects that utilise statescripts.2da, similar to being plot. This presumably is to also make it so they can't change faction or run away.

A list of effects immortal characters are simply immune to (no feedback is presented to the creator of the effect, or the creature who is immortal):

Other negative and positive effects should work fine although EffectDamage of course is capped so they never fall below 1HP.


Version

1.30

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);
}

See Also

functions: 

GetImmortal

SetPlotFlag

GetPlotFlag


 author: Charles Feduke, editor: Jasperre