ChangeToStandardFaction(object, int)

From NWN Lexicon
Jump to: navigation, search

Changes a creature's faction to one of the four standard factions.

void ChangeToStandardFaction(
    object oCreatureToChange,
    int nStandardFaction
);

Parameters

oCreatureToChange
A creature whose faction you will alter.
nStandardFaction
A STANDARD_FACTION_* constant representing the faction to join.

Description

Make oCreatureToChange join one of the standard factions ("Hostile", "Commoner", "Merchant", or "Defender").

Remarks

To assign a creature to a non-standard faction, use ChangeFaction() instead.

Version

1.22

Example

// In the "Actions Taken" script of an NPC's final conversation node.
// This will make the NPC attack the PC.
void main()
{
  ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_HOSTILE);
  DetermineCombatRound();
}

See Also

functions:  ChangeFaction
constants:  STANDARD_FACTION_* Constants


 author: Iskander Merriman, editor: Charles Feduke