function AISMN_GoToNearbySpot::OnEnter(%this,%obj)
{
   SetPathForNearbySpot(%obj, $AI_PATHQUERYCOUNT);
   if(%obj.isDrunk())
      GetThisObject(%obj).playThread( 0, "drunkwalk");
   else
      GetThisObject(%obj).playThread( 0, "run");
   return;
}

function AISMN_GoToNearbySpot::OnExit(%this,%obj)
{
   if(%obj.isDrunk())
      GetThisObject(%obj).playThread( 0, "drunkroot");
   else
      GetThisObject(%obj).playThread( 0, "root");
   return;
}

//EXIT 0: ARRIVED AT LOCATION (FOR NON-DRUNKS)
//EXIT 1: ARRIVED AT LOCATION (FOR DRUNKS)
function AISMN_GoToNearbySpot::Update(%this,%obj)
{   
   if(!IsFollowingPath(%obj))
   {
      if(!%obj.isDrunk())
         ReturnValue(%obj,0);
      else
         ReturnValue(%obj,1);
      return;
   }
   ReturnValue(%obj,-1);
   return;
}