function AISMN_Monitor_Threats::OnEnter(%this,%obj)
{
   return;
}

function AISMN_Monitor_Threats::OnExit(%this,%obj)
{
   return;
}

//EXIT 0: ALLY IS BEING ATTACKED
//EXIT 1: THREATENED
function AISMN_Monitor_Threats::Update(%this, %data)
{
   if (%data.isDead() == true)
   {
      ReturnValue(%data, -1);
      return;
   }
   
   %object = GetThisObject(%data);
   %team = %object.getTeam();
   %action = %data.getCurrAction();
   if (%data.isAttacking() == false && %data.getCurrAction() $= "")
   {
      if (%data.isUnderAttack() == true)
      {
         ReturnValue(%data, 0);
         return;
      }
      
      if (%data.allyIsUnderAttack() == true)
      {
         ReturnValue(%data, 1);
         return;
      }
      
      if (%data.enemyIsThreat() == true)
      {
         ReturnValue(%data, 2);
         return;
      }
   }
   
   ReturnValue(%data, -1);
}
