This script is fired automatically, such as the heartbeat, every 6 or 3 seconds (dependent upon haste). It causes the creature to pick a target, and attack it with spells, heal itself, heal allies and so on. If there is no valid targets (IE all dead or similar) at the end of combat, they will heal themselves to full health (if they have appropriate healing, and will not waste healing).
A word of warning is that this calls ClearAllActions before all actions. Note: There is also UDE_FLAG_COMBAT_ACTION_EVENT, and its pre-UDE version, which is a good way to makes sure some overriding action is taken rather then depending upon this script, which may not always fire when you want it to.
Also note that you could use a custom AI file, which will be fired as normal instead of the default AI file, which you can perform your own AI files. This is good to keep things running fast - boring sets of creatures can use some simple scripts and reduce CPU useage.
All Action's and ClearAllActions are probably the most useful. These are more AI ones:
/************************ [On Combat Round End] ******************************** Filename: nw_c2_default3 or j_ai_oncombatrou ************************* [On Combat Round End] ******************************** This is run every 3 or 6 seconds, if the creature is in combat. It is executed only in combat automatically. It runs what the AI should do, bascially. ************************* [History] ******************************************** 1.3 - Executes same script as the other parts of the AI to cuase a new action ************************* [Workings] ******************************************* Calls the combat AI file using the J_INC_OTHER_AI include function, DetermineCombatRound. ************************* [Arguments] ****************************************** Arguments: GetAttackTarget, GetLastHostileActor, GetAttemptedAttackTarget, GetAttemptedSpellTarget (Or these are useful at least!) ************************* [On Combat Round End] *******************************/ #include "j_inc_other_ai" void main() { // Pre-combat-round-event if(FireUserEvent(AI_FLAG_UDE_END_COMBAT_ROUND_PRE_EVENT, EVENT_END_COMBAT_ROUND_PRE_EVENT)) // We may exit if it fires if(ExitFromUDE(EVENT_END_COMBAT_ROUND_PRE_EVENT)) return; // AI status check. Is the AI on? if(GetAIOff()) return; // It is our normal call (every 3 or 6 seconds, when we can change actions) // so no need to delete, and we fire the UDE's. // Determine combat round against an invalid target (as default) DetermineCombatRound(); // Fire End of end combat round event FireUserEvent(AI_FLAG_UDE_END_COMBAT_ROUND_EVENT, EVENT_END_COMBAT_ROUND_EVENT); }