// v 1.1.0

// Town script for town 29: Testing halls

begintownscript;

variables;

int y,x,i,j,choice,s;

body;

beginstate INIT_STATE;

	set_level(58,33);

break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;

	if (get_flag(29,1) == 1) {
			message_dialog("It takes you some time to stand up. When you eventually do stand up and look around, you see that you are in a level under Thralni's castle. The floor is quite beautiful and the walls are also rather nice.","The one thing that does worry you is the fact that you are in a place with almost no energy, health or potions, and that there may be swarms of monsters down here.");
			set_flag(29,1,2);
			}
	
	if (get_flag(29,8) == 1)
			set_terrain(54,21,385);
	
	if (get_flag(29,10) == 1)
			set_terrain(56,21,385);	
	
	if (get_flag(29,11) == 1)
			set_terrain(55,23,385);	
	
	if (get_flag(29,12) == 1)
			set_terrain(55,26,385);	
	
	if (get_flag(29,15) == 1) {
			set_terrain(9,51,137);
			set_terrain(8,51,137);
			set_terrain(7,51,0);
			set_terrain(7,50,137);
			set_terrain(8,50,137);
			set_terrain(9,50,137);
			set_terrain(9,49,0);
			set_terrain(7,49,137);
			set_terrain(5,49,137);
			set_terrain(5,48,0);
			set_terrain(7,48,0);
			set_terrain(9,48,137);
			set_terrain(10,48,137);
			}

if (get_flag(5,18) > 0) {
	if (get_flag(31,4) == 1) {	
			if (get_flag(31,5) == 1) {
					if (get_flag(31,6) == 1) {
							if (get_flag(31,7) == 1) {
									if (get_flag(29,17) == 0) {
											set_flag(29,17,1);
											}
									}
							}
					}
			}
	}
break;

beginstate 10;
	move_to_new_town(30,7,26);
break;

beginstate 11;
	move_to_new_town(30,7,18);
break;

beginstate 12;
	if (get_flag(29,0) == 0) {
			message_dialog("You search this small box and are surprised to find a small iron key. It shines in the light and is quite beautiful. You pocket it.","");
			change_spec_item(8,1);
			set_flag(29,0,1);
			end();
			}
		message_dialog("You return to the box where you found the key. There is nothing in there anymore.","");
break;

beginstate 13;
	move_to_new_town(31,5,13);
break;

beginstate 14;
break;

beginstate 15;
	if (get_flag(29,2) == 0) {
			message_dialog("You search this small box for loot, but only find some unusual herbs. You decide to take them.","");
			change_spec_item(10,1);
			set_flag(29,2,1);
			end();
			}
		message_dialog("You return to the box where you found the herbs. There is nothing in there anymore.","");
break;

beginstate 16;
reset_dialog();
add_dialog_str(0,"The book on this pedestal in filthy, but relatively new. Under the stains you can still decipher the script. Apparently, it has something to do with the three runes on the floor in front of you. Read it?",0);
add_dialog_choice(0,"Leave it");
add_dialog_choice(1,"Read it");
choice = run_dialog(0);

	if (choice == 2) {
			message_dialog("You quickly see this book contains an enchantment. You read the book. However, by the time you understand this is about demons, you can't stop reading! Eventually, you are blinded by a bright light. Demons.","");
			activate_hidden_group(4);
			put_boom_on_char(59,2,0);
			put_boom_on_char(60,2,0);
			put_boom_on_char(61,2,0);
			run_animation_sound(10);
			pause(10);
			
			message_dialog("Yep, it was indeed an enchantment to summon demons. Two mung demons and a normal one. This may get nasty.","");
			}
break;

beginstate 17;
if (get_flag(29,3) == 1)
		end();
	message_dialog("It looks as though you can't continue through this passage. You'll have to walk around it, which means through the dungeon: there were all altered beasts live(d)","");
	set_flag(29,3,1);
break;

beginstate 18;
if (get_flag(29,4) == 1)
		end();
	message_dialog("As you try to proceed through this room, you hear rattling of chains and gears grinding. You suspect Thralni is trying to kill you with some altered beasts.","");
	flip_terrain(5,13);
	flip_terrain(5,15);
	flip_terrain(5,17);
	set_flag(29,4,1);
break;

beginstate 19;
if (get_flag(29,5) == 1)
		end();
	message_dialog("Trying to pass here would be a hell of a job. Luckily, you saw when you came here, that there's another corridor going the other way. Maybe you can go through there.","");
	set_flag(29,5,1);
break;

beginstate 20;
reset_dialog();
add_dialog_str(0,"This is a quite peculiar stand. Its made of stone, as if for a book, but then it also looks too crumbled to be able to support anything. Then you also notice a gap on one side of the stand. Maybe you should push it down?",0);
add_dialog_choice(0,"Leave it");
add_dialog_choice(1,"Push it down");
choice = run_dialog(0);

	if (choice == 2) {
			message_dialog("You push the top of the stand down, and you see what it was meant for. A whole bookshelf slides away, revealing a secret passage!","");
			set_terrain(45,38,0);
			set_terrain(44,38,234);
			set_terrain(45,37,0);
			}
break;

beginstate 21;
reset_dialog();
add_dialog_str(0,"This is an old book which has been used many times. You can already see it wouldn't harm you when reading it. Read it?",0);
add_dialog_choice(0,"Leave it");
add_dialog_choice(1,"Read it");
choice = run_dialog(0);

	if (choice == 2) {
			message_dialog("You read the book. In it is written a potion recipe. You'll now be able to use a new ability: _Make special potion._ The potion you can make is an explosive potion. There are special herbs you'll need, though.","It says here that the herbs can be found at two places: There is a small storage room at some laboratory where there is a box containing them, and there are several patches of them in the tunnels beyond Thralni's testing halls.");
			
			i = 0;
			while (i < 4) {
				change_custom_abil_uses(i,0,1);
				i = i + 1;
				}
			}
break;

beginstate 22;
if (get_flag(29,6) == 1)
		end();
	message_dialog("The air in this corridor is terrible. A strong smell of chemical waste, acids and just rotting fish isn't a nice mixture of smells. Whatever is here, it can't be nice and friendly.","");
	set_flag(29,6,1);
break;

beginstate 23;
if (get_flag(29,7) == 2)
		end();
	message_dialog("As you try to walk on after your fight with these beasts, you think you hear some big creature walking around. You hear it breathing. You decide to walk onwards, very, very carefully...","");
	set_flag(29,7,2);

// Start cutscene

	march_party(16,6);
	run_animation_sound(49);
	force_view_center(16,6);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(17,6);
	run_animation_sound(49);
	force_view_center(17,6);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(18,6);
	run_animation_sound(49);
	force_view_center(18,6);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(19,6);
	run_animation_sound(49);
	force_view_center(19,6);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(20,6);
	run_animation_sound(49);
	force_view_center(20,6);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(21,7);
	run_animation_sound(49);
	force_view_center(21,7);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(22,7);
	run_animation_sound(49);
	force_view_center(22,7);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(23,7);
	run_animation_sound(49);
	force_view_center(23,7);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(24,8);
	run_animation_sound(49);
	force_view_center(24,8);
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(25,8);
	run_animation_sound(49);
	force_view_center(25,8);
	force_instant_terrain_redraw();
	pause(15);
	
	message_dialog("Suddenly you stop walking, terrified. There's the monster. There's the beast that is going to kill you, tear your flesh from your bones, the end of your adventure. That is, if you let it get to you.","");
	
	set_total_visibility(1);
	force_view_center(35,12);
	force_instant_terrain_redraw();
	pause(30);
	
	message_dialog("Its a drake. Not just any drake, no. Its a lord. This must have been one of Thralni's creations. Now it guards the exit of this damn place. It would be foolish to attack it, but what else can you do? You charge it.","");
	
	set_total_visibility(0);
	force_view_center(25,8);
	force_instant_terrain_redraw();
	pause(15);
	
	set_character_pose(0,2);
	set_character_pose(1,2);
	set_character_pose(2,2);
	set_character_pose(3,2);
	run_animation_sound(18);
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(0,"Okay everybody!");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"Stay calm!");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"everybody behind a pillar!");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"Go!");
	force_instant_terrain_redraw();
	pause(20);
	
	message_dialog("Meanwhile, somewhere else in Thralni's castle...","");
	
	// Thralni talks
	
	text_bubble_on_char(0,"");
	set_total_visibility(1);
	force_view_center(21,58);
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"he he he");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"This will be very");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"pleasant to look at");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"Don't you agree with me?");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(15,"Oh sure");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(16,"No doubt");
	text_bubble_on_char(19,"I agree");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(15,"");
	text_bubble_on_char(18,"Indeed");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(16,"");
	text_bubble_on_char(19,"");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(18,"");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"Levitus?");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(17,"Um");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	text_bubble_on_char(17,"Yes? What's wrong?");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"YOU DIDN'T SAY");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"IF YOU AGREE!!");
	force_instant_terrain_redraw();
	pause(7);
	
	text_bubble_on_char(17,"I'm sorry!");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(17,"");
	text_bubble_on_char(17,"I'm sorry Emperor!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	text_bubble_on_char(17,"Of course I agree!");
	force_instant_terrain_redraw();
	pause(15);

	text_bubble_on_char(17,"");
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"Good");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"Now");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"Let us enjoy");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"the show");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"he he he");
	force_instant_terrain_redraw();
	pause(20);
	
	// party starts fighting
	
	set_total_visibility(0);
	force_view_center(25,8);
	set_character_facing(2,0);
	force_instant_terrain_redraw();
	pause(10);
	
	relocate_character(0,26,7);
	relocate_character(1,25,9);
	relocate_character(2,23,7);
	relocate_character(3,22,8);
	force_instant_terrain_redraw();
	pause(3);
	
	relocate_character(0,27,7);
	relocate_character(1,26,10);
	set_character_facing(2,6);
	relocate_character(3,23,9);
	force_instant_terrain_redraw();
	pause(3);

	relocate_character(1,27,10);
	set_character_facing(1,6);
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(0,"Now don't move!");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"I'm going in...");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(0,"");
	text_bubble_on_char(1,"Wait!");
	force_instant_terrain_redraw();
	pause(10);
	
	relocate_character(0,28,7);
	force_instant_terrain_redraw();
	pause(5);
	
	force_view_center(29,8);
	relocate_character(0,29,8);
	set_character_facing(58,2);
	text_bubble_on_char(1,"");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(58,"?");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(58,"");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(58,"?");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(58,"");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(58,"?");
	force_instant_terrain_redraw();
	pause(5);
	
	text_bubble_on_char(58,"");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"oops");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(0,"");
	force_instant_terrain_redraw();
	pause(10);
	
	message_dialog("The dragon stands still. He looks at you. He doesn't seem very pleased with your presence, though...,","");
	
	set_character_pose(58,1);
	force_instant_terrain_redraw();
	pause(2);
	
	put_straight_zap(35,12,29,8,2);
	run_animation_sound(112);
	
	put_boom_on_char(0,1,0);
	run_animation_sound(152);
	
	if (get_species(0) == 0)
			s = 84;
		if (get_species(0) == 2)
				s = 105;
			if (get_species(0) == 3)
					s = 103;
	
	run_animation_sound(s);
	set_character_pose(0,11);
	set_character_pose(58,2);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(0,12);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(0,13);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(0,14);
	force_instant_terrain_redraw();
	pause(1);
	
	message_dialog("Your fellow falls, severely wounded. The others look at him with bewilderment. They run to their friend, only to receive the same treatment as their fellow got.","");
	
	set_character_facing(58,0);
	set_character_pose(1,0);
	set_character_pose(2,0);
	set_character_pose(3,0);
	relocate_character(1,28,9);
	relocate_character(2,24,9);
	relocate_character(3,24,7);
	force_instant_terrain_redraw();
	pause(4);
	
	
	text_bubble_on_char(3,"No!");
	relocate_character(1,29,9);
	relocate_character(2,25,9);
	relocate_character(3,25,7);
	relocate_character(58,35,11);
	force_instant_terrain_redraw();
	pause(4);
	
	
	set_character_facing(1,0);
	relocate_character(2,26,9);
	relocate_character(3,26,7);
	force_instant_terrain_redraw();
	pause(4);
	
	
	relocate_character(2,27,9);
	relocate_character(3,27,7);
	relocate_character(58,35,10);
	force_instant_terrain_redraw();
	pause(4);
	
	text_bubble_on_char(3,"");
	relocate_character(2,28,8);
	relocate_character(3,28,7);
	force_instant_terrain_redraw();
	pause(4);
	
	text_bubble_on_char(2,"*whining*");
	relocate_character(3,29,7);
	relocate_character(58,35,9);
	force_instant_terrain_redraw();
	pause(4);
	
	set_character_facing(3,4);
	force_instant_terrain_redraw();
	pause(4);
	
	text_bubble_on_char(2,"");
	relocate_character(58,35,8);
	force_instant_terrain_redraw();
	pause(4);
	
	text_bubble_on_char(2,"*whining*");
	force_instant_terrain_redraw();
	pause(4);
	
	set_character_facing(58,2);
	force_instant_terrain_redraw();
	pause(4);
	
	text_bubble_on_char(2,"");
	force_instant_terrain_redraw();
	pause(4);
	
	relocate_character(58,34,8);
	set_character_facing(1,6);
	set_character_facing(3,6);
	force_instant_terrain_redraw();
	pause(4);
	
	force_instant_terrain_redraw();
	pause(4);
	
	relocate_character(58,33,8);
	force_instant_terrain_redraw();
	pause(15);
	
	message_dialog("There you are. One fallen, three to go. The dragon attacks. You didn't stand a chance.","");
	
	
	// character 1
	
	set_character_pose(58,1);
	force_instant_terrain_redraw();
	pause(2);
	
	put_straight_zap(34,8,29,9,2);
	run_animation_sound(112);
	
	put_boom_on_char(1,1,0);
	run_animation_sound(152);
	
	if (get_species(1) == 0)
			s = 84;
		if (get_species(1) == 2)
				s = 105;
			if (get_species(1) == 3)
					s = 103;
	
	run_animation_sound(s);
	set_character_pose(1,11);
	set_character_pose(58,2);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(1,12);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(1,13);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(1,14);
	force_instant_terrain_redraw();
	pause(1);
	
	// character 2	
	
	set_character_pose(58,1);
	force_instant_terrain_redraw();
	pause(2);
	
	put_straight_zap(34,8,28,8,2);
	run_animation_sound(112);
	
	put_boom_on_char(2,1,0);
	run_animation_sound(152);
	
	if (get_species(2) == 0)
			s = 84;
		if (get_species(2) == 2)
				s = 105;
			if (get_species(2) == 3)
					s = 103;
	
	run_animation_sound(s);
	set_character_pose(2,11);
	set_character_pose(58,2);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(2,12);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(2,13);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(2,14);
	force_instant_terrain_redraw();
	pause(1);

	// character 3

	set_character_pose(58,1);
	force_instant_terrain_redraw();
	pause(2);
	
	put_straight_zap(34,8,29,7,2);
	run_animation_sound(112);
	
	put_boom_on_char(3,1,0);
	run_animation_sound(152);
	
	if (get_species(3) == 0)
			s = 84;
		if (get_species(3) == 2)
				s = 105;
			if (get_species(3) == 3)
					s = 103;
	
	run_animation_sound(s);
	set_character_pose(3,11);
	set_character_pose(58,2);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(3,12);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(3,13);
	force_instant_terrain_redraw();
	pause(1);
	set_character_pose(3,14);
	force_instant_terrain_redraw();
	pause(5);
	
	set_character_pose(58,0);
	force_instant_terrain_redraw();
	pause(10);

	// Thralni talks again after your death

	text_bubble_on_char(8,"");
	set_total_visibility(1);
	force_view_center(21,58);
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"he he he");
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"So");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"that's the end");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"of that tale");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"Let us celebrate!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"let's go,");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"to the throne room");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"where we shall feast");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	force_instant_terrain_redraw();
	pause(10);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"In the meantime");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"GUARDS!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"Dump the fallen ones");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(8,"in the trashpits!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(8,"");
	force_instant_terrain_redraw();
	pause(20);
	
	message_dialog("Thralni and his wife stand up, ready to leave. They walk down the stairs, and the guards open the doors. they walk to the throne room, where a mighty feast is being prepared.","Three hours later...");
	
	force_view_center(35,56);
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(8,"");
	text_bubble_on_char(24,"Its time");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(24,"");
	text_bubble_on_char(24,"to eat!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(24,"");
	force_instant_terrain_redraw();
	pause(15);
	
	message_dialog("While everybody happily starts eating, four guards come down to the laboratories and move you to the trashpits. There you are thrown down into a filthy looking place. You'll have to get out of there, but how?","");
	
	set_total_visibility(0);
	force_view_center(57,58);
	relocate_character(0,57,57);
	relocate_character(1,58,59);
	relocate_character(2,55,59);
	relocate_character(3,56,56);
	force_instant_terrain_redraw();
	pause(20);
	
	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"Ungh");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"Headache");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(3,"");
	force_instant_terrain_redraw();
	pause(15);
	
	set_character_pose(3,14);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(3,13);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(3,12);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(3,11);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(3,0);
	set_character_facing(3,6);
	force_instant_terrain_redraw();
	pause(10);
	
	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"Hello?");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(3,"");
	set_character_facing(3,4);
	force_instant_terrain_redraw();
	pause(5);
	
	set_character_facing(3,6);
	force_instant_terrain_redraw();
	pause(10);
	
	text_bubble_on_char(3,"Are they asleep?");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"Ungh...");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"What is this place?");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"HEY EVERYBODY!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"WAKE UP!");
	force_instant_terrain_redraw();
	pause(15);
	
	set_character_pose(0,14);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(0,13);
	set_character_pose(2,14);
	force_instant_terrain_redraw();
	text_bubble_on_char(3,"");
	pause(3);
	set_character_pose(0,12);
	set_character_pose(2,13);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(0,11);
	set_character_pose(2,12);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(0,0);
	set_character_pose(2,11);
	set_character_facing(0,4);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(2,0);
	set_character_facing(2,0);
	force_instant_terrain_redraw();
	pause(3);
	
	set_character_pose(1,14);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(1,13);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(1,12);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(1,11);
	force_instant_terrain_redraw();
	pause(3);
	set_character_pose(1,0);
	set_character_facing(1,0);
	force_instant_terrain_redraw();
	pause(10);
	
	message_dialog("Now that everybody seems to be awake, its maybe time to continue on your journey. It looks like there are some cracks on the north wall...","");

	march_party(59,56);
	force_instant_terrain_redraw();
	pause(10);
	
	move_to_new_town(29,56,56);
	
break;

beginstate 24;
if (get_flag(29,8) == 1)
		end();

if (has_item(82) == 1) {
		message_dialog("You insert the pointiest point of the staff between two badly attached titanium plates. Now you must use force to get the plates together. You start pulling and pushing, until one of the plates comes lose.","After removing the plates, you start bashing with your weapons, until this power source is totally dead.");
		set_terrain(54,21,385);
		set_flag(29,8,1);
		end();
		}
		
	message_dialog("These machines wouldn't be so easy to demolish. They have a hard, titanium skin. With your sword you wouldn't get through it. However, it looks as though the plates weren't attached to one and other in a good fashion.","If you could find something long, like a stick or a staff somewhere, you might be able to get these plates off the machines and then demolish it.");
break;

beginstate 25;
	message_dialog("This control panel wouldn't help you in the process of trying to destroy these machines. You will have to try to bash the power sources with something in order to destroy these machines.","");
break;

beginstate 26;
if (get_flag(29,10) == 1)
		end();

if (has_item(82) == 1) {
		message_dialog("You insert the pointiest point of the staff between two badly attached titanium plates. Now you must use force to get the plates together. You start pulling and pushing, until one of the plates comes lose.","After removing the plates, you start bashing with your weapons, until this power source is totally dead.");
		set_terrain(56,21,385);	
		set_flag(29,10,1);
		end();
		}
		
	message_dialog("These machines wouldn't be so easy to demolish. The have a hard, titanium skin. With your sword you wouldn't get through it. However, it looks as though the plates weren't attached to one and other in a good fashion.","If you could find something long, like a stick or a staff, somewhere, you might be able to get these plates off the machines and then demolish it.");
break;

beginstate 27;
if (get_flag(29,11) == 1)
		end();

if (has_item(82) == 1) {
		message_dialog("You insert the pointiest point of the staff between two badly attached titanium plates. Now you must use force to get the plates together. You start pulling and pushing, until one of the plates comes lose.","After removing the plates, you start bashing with your weapons, until this power source is totally dead.");
		set_terrain(55,23,385);	
		set_flag(29,11,1);
		end();
		}
		
	message_dialog("These machines wouldn't be so easy to demolish. The have a hard, titanium skin. With your sword you wouldn't get through it. However, it looks as though the plates weren't attached to one and other in a good fashion.","If you could find something long, like a stick or a staff, somewhere, you might be able to get these plates of the machines and then demolish it.");
break;

beginstate 28;
if (get_flag(29,12) == 1)
		end();

if (has_item(82) == 1) {
		message_dialog("You insert the pointiest side of the staff between two badly attached titanium plates. Now you must use force to get the plates together. You start pulling and pushing, until one of the plates comes lose.","After removing the plates, you start bashing with your weapons until this power source is totally dead.");
		set_terrain(55,26,385);	
		set_flag(29,12,1);
		end();
		}
		
	message_dialog("These machines wouldn't be so easy to demolish. They have a hard, titanium skin. With your sword you wouldn't get through it. However, it looks as though the plates weren't attached to one and other in a good fashion.","If you could find something long, like a stick or a staff, somewhere, you might be able to get these plates off the machines and then demolish it.");
break;

beginstate 29;
if (get_flag(29,9) == 1)
		end();
	message_dialog("These machines in this room remind you just a bit too much of the Creation halls. If you would want that Thralni or any of his followers, will be able to make a second Creation hall, you should destroy this place is too.","");
	set_flag(29,9,1);
break;

beginstate 30;
if (get_flag(29,13) == 1)
		end();
	message_dialog("In this corridor you can see magical barriers. There might be something important at the other side of the doors which you can at the end of the corridor. At least, you think these are doors. Its rather dark.","");
	set_flag(29,13,1);
break;

beginstate 31;
if (get_flag(29,14) == 1)
		end();
	message_dialog("You can see that there lies a Nephil body in this cell. Poor little bugger. He must have not had gotten the chance yet to be used in the experiments for the Creation halls.","");
	set_flag(29,14,1);
break;

beginstate 32;
if (get_flag(29,18) == 0) {
		message_dialog("That is where you came from. Don't forget that you are in a rather macabre position now. First you must see Mayor Ruth of Voughton, and then you may get brave and slay Thralni. First though, you must be healed.","");
		block_entry(1);
		end();
		}

if (get_flag(29,15) >= 1)
		end();
	if (has_item(484) == 1) {
			reset_dialog();
			add_dialog_str(0,"It seems as though you have made an explosive potion. This would be the perfect spot to use it. Use it?",0);
			add_dialog_choice(0,"Use the potion");
			add_dialog_choice(1,"Don't use it");
			choice = run_dialog(0);
			
				if (choice == 1) {
						message_dialog("You throw the potion to the boulders, hoping for an enormous explosion. You wait. The potion hits the ground. Nothing happens. You wait a bit more.","After five minutes of waiting, you are blinded by a white light and an intense heat fills the hall. The potion explodes, leaving almost nothing of the boulders.");
						take_item(484);
						set_terrain(9,51,137);
						set_terrain(8,51,137);
						set_terrain(7,51,0);
						set_terrain(7,50,137);
						set_terrain(8,50,137);
						set_terrain(9,50,137);
						set_terrain(9,49,0);
						set_terrain(7,49,137);
						set_terrain(5,49,137);
						set_terrain(5,48,0);
						set_terrain(7,48,0);
						set_terrain(9,48,137);
						set_terrain(10,48,137);
						set_flag(29,15,1);
						end();
						}
				
				if (choice == 2)
						end();
				
				}
		if (get_flag(29,16) == 1)
				end();
			message_dialog("Its a pity you don't have something to blow the boulders up. Maybe you can find something in the laboratories of Thralni.","");
			set_flag(29,16,1);
break;

beginstate 33;
	move_to_new_town(3,6,21);
break;

beginstate 34;
	message_dialog("The stench coming out of this pit is enormous. Whatever it is down there, you'd better not go in, unless you really have too.","It looks as though you don't need to go in there, so you'd better turn back.");
	block_entry(1);
break;