GetNumberOfMeleeAttackers
From NWN Lexicon
Jump to navigationJump to search
GetNumberOfMeleeAttackers()
Determines the number of enemies within a 5 meter radius of the target object.
Description
Returns the number of enemies located within a 5 meter radius, attacking the target object.
Remarks
GetNumberOfMeleeAttackers() retrieves the number of melee attackers where the source object is the object executing the script.
Requirements
#include " x0_i0_enemy "
Version
1.22
Example
// Demonstrates how to yield speach based on the number of melee attackers
#include "x0_i0_enemy"
void main()
{
if(GetNumberOfMeleeAttackers()>8)
{
ActionSpeakString("Zounds! Get these hellspawn off me!");
}
}
#include "x0_i0_enemy"
void main()
{
if(GetNumberOfMeleeAttackers()>8)
{
ActionSpeakString("Zounds! Get these hellspawn off me!");
}
}
See Also
functions: |
author: Sarev0k, editor: Tom Cassiotis, Mistress