AI functions (zPE)
Functions to work with the new C_Trigger class and NPC's AI queue.
AI_CallScript
AI_CallScript
Adds a funcName function call to the AI queue
- funcName- name of the function to be called
- slf- will be inserted into global- selfinstance
- oth- will be inserted into global- otherinstance
AI_startTriggerScript
AI_startTriggerScript
Creates a trigger script that calls function funcName once every interval in milliseconds
- funcName- name of the function to be called
- interval- call period in milliseconds
- return- created C_Trigger instance
AI_startTriggerScriptEx
AI_startTriggerScriptEx
Extended version call - Creates a trigger script, that calls function funcName once every interval in milliseconds also updates the self, other and victim global instances based on slf, oth and vct parameters respectively
- funcName- name of the function to be called
- interval- call period in milliseconds
- slf- will be inserted into global- selfinstance
- oth- will be inserted into global- otherinstance
- vct- will be inserted into global- victiminstance
- return- created C_Trigger instance
AI_GetTriggerByID
AI_GetTriggerByID
Returns a C_Trigger instance from the array of active triggers by the array index ID
- ID- array id
- return- active C_Trigger instance
AI_GetTriggersNum
AI_GetTriggersNum
Returns the number of active C_Trigger scripts
- return- number of active C_Trigger scripts
AI_GetTriggerNPC
AI_GetTriggerNPC
Returns the npc associated with the C_Trigger script based on the ID selfID = 0; otherID = 1; victimID = 2;
- trigger- C_Trigger script
- npcID- NPC id
- return- active C_Trigger instance
AI_GetTriggerFunc
AI_GetTriggerFunc
Returns the function associated with the specified C_Trigger
- trigger- C_Trigger script
- return- trigger function
AI_GetTriggerFuncName
AI_GetTriggerFuncName
Returns the function name of a function associated with the specified C_Trigger
- trigger- C_Trigger script
- return- active C_Trigger instance
Ai_GetNextTriggerByFunc
Ai_GetNextTriggerByFunc
Returns the next trigger in the active trigger array based on the trigger function,
starting on the startTrigger trigger
- startTrigger- C_Trigger script to start the search from
- function- function to be matched
- return- C_Trigger instance
Ai_GetNextTriggerByFuncName
Ai_GetNextTriggerByFuncName
Returns the next trigger in the active trigger array based on the trigger function
name, starting on the startTrigger trigger
- startTrigger- C_Trigger script to start the search from
- functionName- name of a function to be matched
- return- C_Trigger instance
Ai_GetNextTriggerBySelf
Ai_GetNextTriggerBySelf
Returns the next trigger in the active trigger array based on the self trigger
parameter, starting on the startTrigger instance set in the trigger
- startTrigger- C_Trigger script to start the search from
- self- C_NPC instance
- return- C_Trigger instance
Ai_GetNextTriggerByOther
Ai_GetNextTriggerByOther
Returns the next trigger in the active trigger array based on the other trigger
parameter, starting on the startTrigger instance set in the trigger
- startTrigger- C_Trigger script to start the search from
- other- C_NPC instance
- return- C_Trigger instance
Ai_GetNextTriggerByVictim
Ai_GetNextTriggerByVictim
Returns the next trigger in the active trigger array based on the victim trigger
parameter, starting on the startTrigger instance set in the trigger
- startTrigger- C_Trigger script to start the search from
- victim- C_NPC instance
- return- C_Trigger instance
Ai_GetNextTriggerByNPCs
Ai_GetNextTriggerByNPCs
Returns the next trigger in the active trigger array based on all the NPCs
set in the trigger script self, other and victim,
starting on the startTrigger instance set in the trigger
- startTrigger- C_Trigger script to start the search from
- self- self C_NPC instance
- other- other C_NPC instance
- victim- victim C_NPC instance
- return- C_Trigger instance