420 wrote...
The variable must be set in the blueprint, before the monster spawns. Edit the blueprint, click the "Advanced" tab then the "Variables" button.)
I believe it replaces the combat AI so it may override multiple events. If it replaced anything specific it's probably the monster's OnCombatRoundEnd event.
-420
The varaiable does not have to be set in the blueprint. It can be set at any time. It can even be changed via scripting at any time that you want to change the creatures behavior.
You are correct that it is in the on combat round that the changes take effect. To narrow it down just a little more it is in the DetermineCombatRound function that the hook is set. Right after the the first checks to see if the creature is peterfied or random walking it has this:
// ----------------------------------------------------------------------------------------
// July 27/2003 - Georg Zoeller,
// Added to allow a replacement for determine combat round
// If a creature has a local string variable named X2_SPECIAL_COMBAT_AI_SCRIPT
// set, the script name specified in the variable gets run instead
// see x2_ai_behold for details:
// ----------------------------------------------------------------------------------------
string sSpecialAI = GetLocalString(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT");
if (sSpecialAI != "")
{
SetLocalObject(OBJECT_SELF,"X2_NW_I0_GENERIC_INTRUDER", oIntruder);
ExecuteScript(sSpecialAI, OBJECT_SELF);
if (GetLocalInt(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT_OK"))
{
DeleteLocalInt(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT_OK");
return;
}
}