begintownscript;

variables;
short passage;

body;

beginstate 0;

	set_crime_tolerance(5);

	if(get_flag(5,0) == 1){
		set_terrain(30,32,68);
		set_terrain(31,32,68);
		set_terrain(32,32,68);
		set_terrain(33,32,68);
		set_terrain(34,32,68);
	}

break;

beginstate 1;
break;

beginstate START_STATE;

	if(get_crime_level() > 0){
		message_dialog("You are sitting in the middle of a fortress lined with lasers and stuffed with the nation's most elite soldiers.  All of these things are now hostile to you.","You are restrained, imprisoned, and killed slowly and painfully.");
		kill_char(1000,3,0);
	}

break;

beginstate 10;

	if(get_flag(5,0) == 0){
		if(party_size() > 1)
			message_dialog("The guard lowers his halberd.  _You, Specialists!  No leaving._","_The Leader has summoned you, and told us not to let you leave until you speak with him first._");
		if(party_size() == 1)
			message_dialog("The guard lowers his halberd.  _You, Specialist!  No leaving._","_The Leader has summoned you, and told us not to let you leave until you speak with him first._");
		block_entry(1);
	}
break;

beginstate 11;
	if(is_combat() == TRUE){
		block_entry(1);
		end();
	}
	move_to_new_town(4,27,46);
break;

beginstate 12;
	if(is_combat() == TRUE){
		block_entry(1);
		end();
	}
	move_to_new_town(4,37,46);
break;

beginstate 13;
	if(is_combat() == TRUE){
		block_entry(1);
		end();
	}
	if(get_flag(3,0) >= 2){
		reset_dialog();
		add_dialog_str(0,"Would you like to climb down the secret passage into Schwertschrein?",0);
		add_dialog_choice(0,"Yes.");
		add_dialog_choice(1,"Leave it be.");
		passage = run_dialog(1);
		if(passage == 2)
			end();
		move_to_new_town(4,13,10);
	}
break;

beginstate 14;
	block_entry(1);
break;