"HUMAN_LIGHT_INF_CLOSE_ENTRANCE"
{
	INT my_unit_recno 
	INT dist_to_entrance_a
	INT dist_to_entrance_b

	INT item_recno

	my_unit_recno = FUNC("get_character_recno") 

	// distance to entrance a and b
	dist_to_entrance_a = FUNC("get_distance", my_unit_recno, 23074, 5708, -105 )
	dist_to_entrance_b = FUNC("get_distance", my_unit_recno, 22935, 5908, -111 )

	// get weapon	
	if(dist_to_entrance_a < 10 || dist_to_entrance_b < 10)
	{
		if ( dist_to_entrance_a < 10 )
		{
			ACTION("give_order" , my_unit_recno, "TURN" , 90 , 0 , 325 , 0 , 0 , 0, 5000)
		}

		if ( dist_to_entrance_b < 10 )
		{
			ACTION("give_order" , my_unit_recno, "TURN" , 90 , 0 , 325 , 0 , 0 , 0, 5000)
		}

		item_recno = FUNC("get_curr_task_para" , my_unit_recno, 1)

		if( dist_to_entrance_a < 10 )
		{
			ACTION("give_order" , my_unit_recno , "SPECIAL_MOVEMENT" , 70 , 0 , 11 , 0, 1, 0, 40000)
			FUNC("add_gate_trigger", FUNC("get_curr_task_para", my_unit_recno, 1), 0)
			FUNC("stop_curr_task", my_unit_recno)
		}

		if( dist_to_entrance_b < 10 )
		{
			ACTION("give_order" , my_unit_recno , "SPECIAL_MOVEMENT" , 70 , 0 , 13 , 0 , 1, 0, 40000)
			FUNC("add_gate_trigger", FUNC("get_curr_task_para", my_unit_recno, 1), 0)
			FUNC("stop_curr_task", my_unit_recno)
		}

	}
	else if ( dist_to_entrance_a < dist_to_entrance_b )
	{
		ACTION("give_order", my_unit_recno, "MOVE_TO_TARGET", 110, 0, 23074, 5708, -105, 0, 5000)
	}
	else
	{
		ACTION("give_order", my_unit_recno, "MOVE_TO_TARGET", 110, 0, 22935, 5908, -111, 0, 5000)
	}
}
