GetAILevel() NWScript command returns the "intensity" at which the AI of a creature should be operating.
(For non-creature objects, the returned level is "very low", not "invalid" as might be expected.)
BioWare uses this command to abort the standard OnHeartbeat event handler (
nw_c2_default1) when the AI level is "very low" (typically meaning that the area can be considered "inactive" due to a lack of players seeing it).
int GetAILevel (object oTarget=OBJECT_SELF
- The object whose AI level is to be returned.
The return value is an AI_LEVEL_* constant. (For creatures whose AI was set to AI_LEVEL_DEFAULT, the level chosen by the default algorithm is returned, not AI_LEVEL_DEFAULT.)