Returns number of enemies perceived and their combined levels.

struct DetermineEnemies();


Uses four general categories to determine what kinds of enemies the NPC is facing. 4 categories are: fighter, cleric, mage, and monster. Function uses only first class-slot of a perceived creature to determine enemy class.


The following classes count as fighters: animals, barbarians, beasts, commoners, constructs, elementals, fighters, giants humanoid, monstrous, paladins, rangers, rogues, vermin, monks, and shapechangers.

The following classes count as clerics: clerics and druids.

The following classes count as mages: bards, fey, sorcerers, and wizards.

The following classes count as monsters: aberrations, dragons, magical beasts, and outsiders.

The struct used by DetermineEnemies is called sEnemies and looks like this (the spelling mistake in MONTERS_LEVELS is Bioware’s, not mine):
struct sEnemies
     int FIGHTERS;
     int CLERICS;
     int MAGES;
     int MAGE_LEVELS;
     int MONSTERS;
     int TOTAL;
     int TOTAL_LEVELS;


#include "x0_i0_enemy"




#include "x0_i0_enemy"

void main()
   struct sEnemies strEnemies=DetermineEnemies();

   //how many fighter-types are we facing
   int nFighters=strEnemies.FIGHTERS;

   //what are their combined levels
   int nFighterLevels=strEnemies.FIGHTER_LEVELS;

   //how many cleric-types are we facing
   int nClerics=strEnemies.CLERICS;

   //what are their combined levels
   int nClericLevels=strEnemies.CLERIC_LEVELS;

   //how many mage-types are we facing
   int nMages=strEnemies.MAGES;

   //what are their combined levels
   int nMageLevels=strEnemies.MAGE_LEVELS;

   //how many monster-types are we facing
   int nMonsters=strEnemies.MONSTERS;

   //what are their combined levels - I've made no spelling
   //mistakes, Bioware has: it really does say MONTERS
   int nMonsterLevels=strEnemies.MONTERS_LEVELS;

   //how many enemies are there all in all (we could
   //also just add up all the previous numbers)
   int nTotal=strEnemies.TOTAL;

   //what are their combined levels
   int nTotalLevels=strEnemies.TOTAL_LEVELS;

See Also

functions: TalentAdvancedProtectSelf
categories: Combat Information Functions | Perception Functions

 author: Jody Fletcher, editors: Lilac Soul, Mistress, additional contributor: Lilac Soul