SetCombatCondition

From NWN Lexicon


Contents

[edit] SetCombatCondition(int, int, object)

Set one of the X0_COMBAT_FLAG_* values on the target.

void SetCombatCondition(
    int nCond,
    int bValid = TRUE,
    object oTarget = OBJECT_SELF
);

[edit] Parameters

nCond

The X0_COMBAT_FLAG_* reference to set on oTarget.

bValid

The condition to set to TRUE or FALSE. (Default: TRUE)

oTarget

The object to set the condition flag on. (Default: OBJECT_SELF)


[edit] Description

Set one of the X0_COMBAT_FLAG_* values on the target.



[edit] Remarks

The flags (nCond) that can be set are:
  X0_COMBAT_FLAG_AMBUSHER
  X0_COMBAT_FLAG_COWARDLY
  X0_COMBAT_FLAG_DEFENSIVE
  X0_COMBAT_FLAG_RANGED


[edit] Requirements

#include " x0_i0_combat "


[edit] Version

???

[edit] Example

// Check to see if we are an ambusher and if not set ourselves as such.
// If it is set, turn it off.
#include "x0_i0_combat"
 
void main()
{
    // Get weather or not it is set here.
    int nCheck = GetCombatCondition(X0_COMBAT_FLAG_AMBUSHER);
 
    // This means we are not set as an ambusher.
    if(nCheck == FALSE)
    {
        // Remember bValid defaults to TRUE, and oTarget defaults to OBJECT_SELF.
        // So this would set the flag as TRUE.
        SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER);
    }
 
    //This means we are already set as an ambusher.
    else
    {
        // Here we changed bValid from the default TRUE, to FALSE, shutting off this flag.
        // Remember oTarget defaults to OBJECT_SELF, but can be changed to suit your need.
        SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER, FALSE);
    }
}

[edit] See Also

functions: 

GetCombatCondition



author: Baragg, editor: Mistress

Personal tools
Categories