begintownscript;

variables;
short ranpc;
short talk;

body;

beginstate 0;

	if(get_flag(30,0) >= 1){
		erase_char(11);
		erase_char(12);
		erase_char(13);
	}

break;

beginstate 1;

break;

beginstate START_STATE;

if(get_flag(26,0) < 40){
	set_character_facing(1000,0);
	set_total_visibility(1);
	force_view_center(16,11);
	force_instant_terrain_redraw();
	pause(5);

		if(get_flag(75,0) == 0){
			talk = 14;
		}
		else{
			talk = get_flag(75,0);
		}

	if(party_size() > 1)
		text_bubble_on_char(11,"Greetings, Specialists!");
	if(party_size() == 1)
		text_bubble_on_char(11,"Greetings, Specialist!");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"I am General Trahison,");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"at your service.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"These two are my lieutenants.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(11,"");
	text_bubble_on_char(12,"I am Klugmann.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(12,"");
	text_bubble_on_char(13,"Call me Todmacher.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(13,"");
	text_bubble_on_char(11,"You are quite skilled");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"to have made it this far.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(11,"");
	ranpc = random_party_member();
	text_bubble_on_char(ranpc,"Enough!");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(ranpc,"");
	text_bubble_on_char(ranpc,"You are a traitor.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(ranpc,"");
	text_bubble_on_char(11,"...");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"Very well then.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(11,"");
	if(party_size() > 1)
		text_bubble_on_char(11,"You die here, Specialists!");
	if(party_size() == 1)
		text_bubble_on_char(11,"You die here, Specialist!");
	force_instant_terrain_redraw();
	pause(talk);

	set_character_pose(11,1);
	set_terrain(18,20,475);
	put_effect_on_space(18,20,8,4,0);
	force_instant_terrain_redraw();
	run_animation_sound(89);
	pause(5);

	set_attitude(11,10);
	set_attitude(12,10);
	set_attitude(13,10);
	set_total_visibility(0);
	set_character_pose(11,2);
	force_view_center(char_loc_x(0),char_loc_y(0));
	force_instant_terrain_redraw();
	set_flag(26,0,40);
	block_entry(1);
}

break;

beginstate 10;
	if(get_flag(30,0) >= 1){
		move_to_new_town(14,14,19);
	}
	else{
		block_entry(1);
	}
break;

beginstate 11;
	move_to_new_town(12,18,19);
break;
