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 );
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)
Description
Set one of the X0_COMBAT_FLAG_* values on the target.
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
Requirements
#include "x0_i0_combat"
Version
???
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);
}
}
See Also
| functions: | GetCombatCondition |
| categories: | Combat Functions |
author: Baragg, editor: Mistress