begintownscript;

variables;
short ranpc,why,bigmessage;
short talk;

body;

beginstate 0;

	if(get_flag(68,5) >= 1){
			set_terrain(24,13,0);
			set_terrain(24,15,0);
			set_terrain(24,17,0);
	}

break;

beginstate 1;

break;

beginstate START_STATE;

if(get_flag(26,0) < 45){

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

	message_dialog("This mezzanine is the key floor of Fortress Grenze.  What appear to be powerful lasers on magical platforms line the walls.","Unfortunately, this floor is also occupied, and you fear thusly that your reception here will be less than cordial.");

	set_total_visibility(1);
	force_view_center(16,14);
	set_character_facing(1000,0);
	force_instant_terrain_redraw();

	ranpc = random_party_member();
	text_bubble_on_char(ranpc,"Oh, great.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(ranpc,"");
	text_bubble_on_char(ranpc,"Another pompous bad guy to beat.");
	force_instant_terrain_redraw();
	pause((talk + 5));

	text_bubble_on_char(ranpc,"");
	reset_dialog();
	add_dialog_str(0,"_Fools!  Have you ever asked, 'Why?'  It's a simple question._",0);
	add_dialog_str(1,"_This place stands for freedom.  Fortress Grenze is the wish, the wish of a wise General who came from Sud Canopy._",0);
	add_dialog_str(2,"_Trahison listened to him, and so did I.  So did Klugmann, so did Todmacher, so did Fusei.  We chose to rebel in hopes for a new ambiguity._",0);
	add_dialog_str(3,"_You may know the name of the man who delivered us from Leader.  His name is Zauberer._",0);
	add_dialog_choice(0,"Or at least, it was!");
	bigmessage = run_dialog(1);

	text_bubble_on_char(ranpc,"");
	text_bubble_on_char(34,"It...  ...was?");
	force_instant_terrain_redraw();
	pause(talk);

	ranpc = random_party_member();
	text_bubble_on_char(34,"");
	if(party_size() > 1)
		text_bubble_on_char(ranpc,"We slew him.");
	if(party_size() == 1)
		text_bubble_on_char(ranpc,"I slew him.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(ranpc,"");
	if(party_size() > 1)
		text_bubble_on_char(ranpc,"Let us pass NOW,");
	if(party_size() == 1)
		text_bubble_on_char(ranpc,"Let me pass NOW,");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(ranpc,"");
	text_bubble_on_char(ranpc,"or you're next.");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(ranpc,"");
	text_bubble_on_char(34,"You slew Zauberer?  Impossible!");
	force_instant_terrain_redraw();
	pause(talk);

//	text_bubble_on_char(34,"");
//	text_bubble_on_char(34,"Is that the true power");
//	force_instant_terrain_redraw();
//	pause(15);
//
//	text_bubble_on_char(34,"");
//	text_bubble_on_char(34,"of Leader's Specialists?");
//	force_instant_terrain_redraw();
//	pause(15);
//
//	ranpc = random_party_member();
//	text_bubble_on_char(34,"");
//	text_bubble_on_char(ranpc,"Shut up NOW!");
//	force_instant_terrain_redraw();
//	pause(15);

	text_bubble_on_char(34,"");
	if(party_size() > 1)
		text_bubble_on_char(ranpc,"Shut up, and let us pass!");
	if(party_size() == 1)
		text_bubble_on_char(ranpc,"Shut up, and let me pass!");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(ranpc,"");
	text_bubble_on_char(34,"You slew Zauberer.");
	force_instant_terrain_redraw();
	pause(talk);

	set_character_pose(34,2);
	put_boom_on_char(34,0,0);
	force_instant_terrain_redraw();
	run_animation_sound(152);
	pause(5);

	text_bubble_on_char(34,"");
	text_bubble_on_char(34,"No way in hell!");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(34,"");
	text_bubble_on_char(34,"I, Unumstš§lich,");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(34,"");
	text_bubble_on_char(34,"will murder you!");
	force_instant_terrain_redraw();
	pause(talk);

	text_bubble_on_char(34,"");
	set_character_pose(34,1);
	set_terrain(14,20,475);
	set_terrain(18,20,475);
	put_effect_on_space(14,20,8,4,0);
	put_effect_on_space(18,20,8,4,0);
	force_instant_terrain_redraw();
	run_animation_sound(89);
	pause(5);

	set_character_pose(34,2);
	set_attitude(11,10);
	set_attitude(12,10);
	set_attitude(13,10);
	set_attitude(14,10);
	set_attitude(15,10);
	set_attitude(16,10);
	set_attitude(17,10);
	set_attitude(18,10);
	set_attitude(19,10);
	set_attitude(20,10);
	set_attitude(21,10);
	set_attitude(22,10);
	set_attitude(23,10);
	set_attitude(24,10);
	set_attitude(25,10);
	set_attitude(34,10);
	force_instant_terrain_redraw();
	pause(5);

	set_character_pose(34,1);
	set_terrain(20,12,0);
	set_terrain(20,15,0);
	set_terrain(12,12,0);
	set_terrain(12,15,0);
	set_terrain(16,17,0);
	put_boom_on_space(20,12,1,0);
	put_boom_on_space(20,15,1,0);
	put_boom_on_space(12,12,1,0);
	put_boom_on_space(12,15,1,0);
	put_boom_on_space(16,17,1,0);
	activate_hidden_group(1);
	force_instant_terrain_redraw();
	run_animation_sound(152);

	set_total_visibility(0);
	set_character_pose(34,2);
	force_view_center(14,19);
	force_instant_terrain_redraw();
	set_flag(26,0,45);
	block_entry(1);

}

break;

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

beginstate 11;
	if(get_flag(26,0) >= 50){
		move_to_new_town(15,18,19);
	}
	else{
		block_entry(1);
	}
break;
