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 GetAttemptedAttackTarget() and 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: GetAttackTarget | GetAttemptedAttackTarget
categories: Combat Functions | Core AI Functions


 author: Tom Cassiotis, editors: John Shuell, Mistress