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 calledslf- will be inserted into globalselfinstanceoth- will be inserted into globalotherinstance
AI_startTriggerScript
AI_startTriggerScript
Creates a trigger script that calls function funcName once every interval in milliseconds
funcName- name of the function to be calledinterval- call period in millisecondsreturn- 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 calledinterval- call period in millisecondsslf- will be inserted into globalselfinstanceoth- will be inserted into globalotherinstancevct- will be inserted into globalvictiminstancereturn- 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 idreturn- 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 scriptnpcID- NPC idreturn- active C_Trigger instance
AI_GetTriggerFunc
AI_GetTriggerFunc
Returns the function associated with the specified C_Trigger
trigger- C_Trigger scriptreturn- trigger function
AI_GetTriggerFuncName
AI_GetTriggerFuncName
Returns the function name of a function associated with the specified C_Trigger
trigger- C_Trigger scriptreturn- 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 fromfunction- function to be matchedreturn- 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 fromfunctionName- name of a function to be matchedreturn- 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 fromself- C_NPC instancereturn- 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 fromother- C_NPC instancereturn- 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 fromvictim- C_NPC instancereturn- 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 fromself- self C_NPC instanceother- other C_NPC instancevictim- victim C_NPC instancereturn- C_Trigger instance