SetPlotFlag(object, int)

From NWN Lexicon
Revision as of 00:36, 14 July 2021 by Jasperre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Sets an object's plot status.

void SetPlotFlag(
    object oTarget,
    int bPlotFlag


Target object (creature, placeable, door, item).
A TRUE or FALSE value.


Sets the plot flag of object oTarget to the boolean value bPlotFlag. The parameter bPlotFlag can be either TRUE or FALSE.

It will do the same as checking the checkbox for "Plot" on a creature or items properties.

Note DMs are always considered to have the plot flag.


A plot flag affects an item, placeable, door, or creature considerably. It is meant to protect the item, placeable, door or creature from death or destruction. It also has an affect on the AI of a creature. A creature that is plot will not turn hostile against others, for instance. It will still attack those that it was hostile against at the time of becoming plot, though. Also, attacking a plot creature can actually cause it to strike back at you, and then your only solution is to run away and wait for the plot creature to exit combat mode. A plot object does not take any damage and plot items cannot be sold.

Almost every negative effect will not affect a plot creature, but positive and healing effects will work as normal. These effects will have no effect on a plot creature:

If a creature is already under these effects and plot is granted to them, they are usually not removed. This is useful since cutscene mode will apply the plot flag while in the cutscene.

Any effects in a linked chain of these kinds will stop the entire link. Any effects not listed should work but make sure to test them. Notable bad effects include EffectMissChance, EffectSpellFailure (rarely used in the game!), EffectTurnResistanceDecrease (noting the bug it won't affect PCs regardless).

They are also immune to all melee/ranged damage, any killing abilities, SKILL_TAUNT, FEAT_DISARM, etc.

You also need to remove the plot flag before DestroyObject will work.

Items which are plot have some special properties:

  • If they are lost in some way (eg a creature is destroyed with DestroyObject, or the item is dropped from an inventory by ActionPutDownItem) the items should be copied (not moved!) to a store tagged "LostItems". See the OC for how this operates (also it allows you to duplicate plot items very easily...).
  • They cannot be sold to stores (but can be purchased from them for 0 gold)
    • Note cursed items also cannot be sold to stores
  • Single use spell items (eg; scrolls) which are plot will not disappear if used but the spell will not be usable

An alternative for creatures to the plot flag is immortality which while it restricts some hostile effects including EffectDeath, the majority (and importantly EffectDamage) still work, with the creature not able to go under 1HP, allowing suitable "boss-talk" when the creature is defeated.




void main()
    // mark this object as not able to be destroyed
    SetPlotFlag(OBJECT_SELF, TRUE);

See Also



 author: Daniel Beckman, editor: Jasperre