Retrieves the current AI (artificial intelligence) level that a creature is running at.
Creature to check the AI level of. (Default: OBJECT_SELF)
Returns the current AI_LEVEL_* value that a creature is running at. Different AI levels indicate how smart a creature acts and how much CPU time and priority it receives. Creatures that are standing by doing nothing generally have AI_LEVEL_LOW, but when a creature enters combat it will have AI_LEVEL_NORMAL by default.
Too many creatures with AI_LEVEL_NORMAL will tax the processor and performance degradation will occur.
AI_LEVEL_DEFAULT is recommended. Also note that the "smartness" is not actual "The AI will decide to do a worse action" but, "The AI doesn't have as much time from the CPU, and may have delayed actions".
On a creature with unset AI level or ai level set to -1 (default or invalid), function returns AI_LEVEL_LOW when there is a player character in same area as creature or AI_LEVEL_VERY_LOW when not.
author: Charles Feduke, editor: Jasperre