GetIsFighting
From NWN Lexicon
Jump to navigationJump to search
GetIsFighting(object)
Determines whether a creature is "fighting".
int GetIsFighting(
object oFighting
);
Parameters
oFighting
Not used
Description
Returns TRUE if the NPC whose script this function is called from has attempted to cast a spell or attack any targets, otherwise FALSE.
Remarks
Uses GetAttemptedSpellTarget () to determine if the creature is fighting.
Requirements
#include " x0_inc_generic "
Version
1.22
Example
// This is the source code for the function
int GetIsFighting(object oFighting)
{
object oAttack = GetAttemptedAttackTarget();
object oSpellTarget = GetAttemptedSpellTarget();
if(GetIsObjectValid(oAttack) || GetIsObjectValid(oSpellTarget))
{
return TRUE;
}
return FALSE;
}
See Also
| functions: |
author: Tom Cassiotis, editors: John Shuell, Mistress