SetImmortal(object, int)

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

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.


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.


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: SetPlotFlag
categories: Miscellaneous Functions


 author: Charles Feduke, editor: Jasperre