// Town 7: Bahssikava Catacombs
begintownscript;

variables;

short dummy,choice,i,j,some_dead,none_dead;
string dlgstr,secdlgstr;

body;

beginstate INIT_STATE;
turn_off_training(1);

if (get_flag(7,4) == 0)
	{change_blocked(37,58,1);
	change_blocked(37,59,1);
	change_blocked(37,60,1);
	}

if (get_flag(7,2) == 0)
	{change_blocked(4,48,1);
	change_blocked(5,48,1);
	change_blocked(6,48,1);
	change_blocked(4,47,1);
	change_blocked(5,47,1);
	change_blocked(6,47,1);
	change_blocked(4,46,1);
	change_blocked(5,46,1);
	change_blocked(6,46,1);
	}

if (get_flag(7,9) == 0)
	{change_blocked(39,41,1);
	change_blocked(40,40,1);
	change_blocked(41,40,1);
	change_blocked(42,40,1);
	change_blocked(43,40,1);
	change_blocked(44,40,1);
	change_blocked(45,40,1);
	change_blocked(46,40,1);
	change_blocked(47,40,1);
	change_blocked(48,40,1);
	change_blocked(49,40,1);
	change_blocked(50,40,1);
	change_blocked(51,40,1);
	
	change_blocked(39,40,1);
	change_blocked(40,40,1);
	change_blocked(42,40,1);
	change_blocked(44,40,1);
	change_blocked(45,40,1);
	change_blocked(46,40,1);
	change_blocked(48,40,1);
	change_blocked(50,40,1);
	change_blocked(51,40,1);
	change_blocked(39,39,1);
	change_blocked(40,39,1);
	change_blocked(42,39,1);
	change_blocked(44,39,1);
	change_blocked(45,39,1);
	change_blocked(46,39,1);
	change_blocked(48,39,1);
	change_blocked(50,39,1);
	change_blocked(51,39,1);
	}
	
if (get_flag(7,19) == 0)
	{change_blocked(24,26,1);
	change_blocked(24,27,1);
	change_blocked(24,28,1);
	change_blocked(24,29,1);
	change_blocked(24,30,1);
	change_blocked(25,30,1);
	
	change_blocked(25,25,1);
	change_blocked(24,25,1);
	change_blocked(23,25,1);
	change_blocked(23,27,1);
	change_blocked(23,28,1);
	change_blocked(23,29,1);
	change_blocked(23,30,1);
	change_blocked(24,31,1);
	}

if (get_flag(7,20) == 0)
	{change_blocked(29,17,1);
	change_blocked(29,18,1);
	change_blocked(29,19,1);
	change_blocked(28,17,1);
	change_blocked(28,18,1);
	change_blocked(28,19,1);
	change_blocked(27,17,1);
	change_blocked(27,18,1);
	change_blocked(27,19,1);
	}
	
if (get_flag(7,21) == 0)
	{change_blocked(27,22,1);
	change_blocked(27,23,1);
	change_blocked(27,24,1);
	change_blocked(28,22,1);
	change_blocked(28,23,1);
	change_blocked(28,24,1);
	change_blocked(29,22,1);
	change_blocked(29,23,1);
	change_blocked(29,24,1);
	}

if (get_flag(7,22) == 0)
	{change_blocked(30,27,1);
	change_blocked(30,28,1);
	change_blocked(31,27,1);
	change_blocked(31,28,1);
	change_blocked(32,27,1);
	change_blocked(32,28,1);
	}

if (get_flag(7,27) == 1)
	{set_terrain(40,7,44);
	set_terrain(41,7,40);
	set_terrain(42,7,40);
	set_terrain(43,7,40);
	set_terrain(43,7,44);
	}

if (get_flag(8,11) == 1)
	{relocate_character(3,9,62);
	relocate_character(2,8,62);
	relocate_character(1,8,61);
	relocate_character(0,8,60);
	set_character_facing(0,0);
	set_character_facing(1,0);
	set_character_facing(2,0);
	set_character_facing(3,2);
	i = 0;
	while (char_ok(i) == 0)
		{i = i + 1; }
	force_view_center(char_loc_x(i),char_loc_y(i));
	force_instant_terrain_redraw();
	set_flag(8,11,0);
	}

if (get_flag(7,10) == 1)
	{set_terrain(49,21,375);
	set_terrain(42,23,0);
	set_terrain(43,23,0);
	set_terrain(44,23,0);
	set_terrain(45,23,0);
	set_terrain(46,23,0);
	set_terrain(42,24,0);
	set_terrain(42,25,0);
	set_terrain(42,26,0);
	set_terrain(42,27,0);
	set_terrain(46,24,0);
	set_terrain(46,25,0);
	set_terrain(46,27,0);
	set_terrain(43,27,0);
	set_terrain(44,27,0);
	set_terrain(45,27,0);
	set_terrain(46,26,0);
	}

if (get_flag(7,11) == 3)
	{set_terrain(22,26,231);
	set_terrain(23,26,276);
	set_terrain(24,26,231);
	}

if (get_flag(7,0) == 1)
	end();
	
	force_instant_terrain_redraw();
	reset_dialog();
	clear_buffer();
	append_string("You climb down the ladder into the catacombs beneath Ancient Bahssikava.");
	if (get_flag(6,19) > 0)
		append_string(" Somewhere down here should be one of the metal triangles you seek.");
	if ((get_flag(6,19) == 0) && (get_flag(3,9) > 0))
		append_string(" Maybe down here you will find another of the metal triangles you need.");
	get_buffer_text(dlgstr);
	add_dialog_str(0,dlgstr,0);
	add_dialog_str(1,"The air is musty. Dust floats everywhere, choking you. Nothing living has disturbed this place in decades, if not centuries. There is not a trace of the Empire here.",0);
	add_dialog_str(2,"Any sort of monsters could be down here. After what you saw in the library, you can't be too careful. You step lightly.",0);
	dummy = run_dialog(1);
	set_flag(7,0,1);
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
	if (is_combat() == 1)
		{block_entry(1);
		print_str("You can't climb up in combat.");
		end();
		}
	else
		{reset_dialog();
		add_dialog_str(0,"Do you wish to climb back up to Ancient Bahssikava?",0);
		add_dialog_choice(0,"Leave.");
		add_dialog_choice(1,"Climb up.");
		choice = run_dialog(1);
		if (choice == 2)
			move_to_new_town(6,25,31);
		}
break;

beginstate 11;
if (get_flag(7,1) != 0)
	end();
else
	{reset_dialog();
	add_dialog_str(0,"A strange, sibilant voice begins to speak in your mind.",0);
	add_dialog_str(1,"_These are the ancient graves of Bahssikava,_ it says. _They are protected by the magic of the sliths who once lived here. Do not disturb these graves._",0);
	add_dialog_str(2,"_If you do, you risk the vengeance of Bahssikava._",0);
	clear_buffer();
	append_string("It would be very, very dangerous to proceed.");
	if (get_flag(6,19) > 0)
		append_string(" However, at least one of the metal triangles is down here, and you must get the metal triangles to open the gates.");
	get_buffer_text(dlgstr);
	add_dialog_str(3,dlgstr,0);
	add_dialog_str(4,"The choice is yours.",0);
	dummy = run_dialog(1);
	set_flag(7,1,1); }
break;

beginstate 12;
if (get_flag(7,2) != 0)
	end();
else
	{reset_dialog();
	add_dialog_str(0,"You can feel powerful magical energy emanating from these runes. Do you want to keep walking?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Proceed.");
	choice = run_dialog(1);
	if (choice == 1)
		{block_entry(1);
		end(); }
	else
		{place_monster(4,46,100,0);
		place_monster(6,46,100,0);
		place_monster(4,44,100,0);
		place_monster(6,44,100,0);
		put_boom_on_char(86,6,0);
		put_boom_on_char(87,6,0);
		put_boom_on_char(88,6,0);
		put_boom_on_char(89,6,0);
		set_terrain(4,43,14);
		set_terrain(5,43,14);
		set_terrain(6,43,14);
		run_animation_sound(25);
		change_blocked(4,48,0);
		change_blocked(5,48,0);
		change_blocked(6,48,0);
		change_blocked(4,47,0);
		change_blocked(5,47,0);
		change_blocked(6,47,0);
		change_blocked(4,46,0);
		change_blocked(5,46,0);
		change_blocked(6,46,0);
		set_flag(7,2,1);
		}
	}
break;

beginstate 13;
	if (is_combat() == 1)
		{block_entry(1);
		print_str("You can't climb down in combat.");
		end();
		}
	else
	{reset_dialog();
	add_dialog_str(0,"There are some steep, downwardly declining stairs here. What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Descend.");
	choice = run_dialog(1);
	if (choice == 1)
		block_entry(1);
	if (choice == 2)
		move_to_new_town(8,3,45);
	}
break;

beginstate 14;
if (get_flag(7,3) != 0)
	end();
else
	{reset_dialog();
	add_dialog_str(0,"This is astonishing. The ancient sliths of Bahssikava did not bury their dead in graves, nor did they adorn them with trinkets. They buried them with information.",0);
	add_dialog_str(1,"This whole area is a vast library of the knowledge from the lost days of Bahssikava. Presumably these were not intended to be accessed very often.",0);
	add_dialog_str(2,"Even though some of these books have decayed, there is still enough information here to occupy years of study. Unfortunately, you don't know the script.",0);
	dummy = run_dialog(1);
	set_flag(7,3,1); }
break;

beginstate 15;
if (get_flag(250,2) == 0)
	{message_dialog("You page through this book, but you can't read it. You don't know the ancient script in which it is written.","");
	end(); }
else
	{reset_dialog();
	add_dialog_str(0,"The knowledge that you gained from the mind crystal flows into you. You can't understand this book perfectly, but you get the gist of part of it.",0);
	add_dialog_str(1,"It describes the efforts made to open the huge steel doors blocking the way back to the homeland. Evidently the sliths tried everything.",0);
	add_dialog_str(2,"They blasted the door with fire, ice, and lightning. They cast their most powerful unlocking spells, and they prayed for divine intervention.",0);
	add_dialog_str(3,"For each attempt, they describe in detail their procedures and the results.",0);
	add_dialog_str(4,"The last attempt is recorded in particularly excruciating detail. They prayed to every god they could think of, including some dark ones, and then threw an enormous, white-hot fireball at the door.",0);
	add_dialog_str(5,"Their procedure is detailed to the point of redundancy, but the result is two words, translating quite simply as: CAVE QUAKE.",0);
	dummy = run_dialog(1);
	}
break;

beginstate 16;
if (get_flag(7,4) != 0)
	end();
else
	{i = 86;
	while (char_ok(i))
		{i = i + 1; }
	place_monster(29,56,95,0);
	put_boom_on_char(i,6,0);
	run_animation_sound(-102);
	place_monster(33,56,95,0);
	put_boom_on_char(i + 1,6,0);
	run_animation_sound(-102);
	place_monster(29,60,95,0);
	put_boom_on_char(i + 2,6,0);
	run_animation_sound(-102);
	place_monster(33,60,95,0);
	put_boom_on_char(i + 3,6,0);
	run_animation_sound(-102);
	message_dialog("The protective spell activates! Four mung demons appear and attack you!","");
	
	change_blocked(37,58,0);
	change_blocked(37,59,0);
	change_blocked(37,60,0);
	set_flag(7,4,1);
	}
break;

beginstate 17;
if (get_flag(7,5) != 0)
	end();
else
	{message_dialog("You smell sulfur in the air. There was a protective spell laid on this room separate from the one that guards the rest of the catacombs.","");
	set_flag(7,5,1); }
break;

beginstate 18;
if (get_flag(7,6) != 0)
	end();
else
	{reset_dialog();
	add_dialog_str(0,"Of all the strange things you've found in the ruins of Bahssikava, this is by far the most inexplicable. It appears to be a mind crystal.",0);
	add_dialog_str(1,"Mind crystals are vahnatai inventions. They instantly train their user in a skill. Which skill varies from crystal to crystal.",0);
	add_dialog_str(2,"The peculiar thing is that the vahnatai were in their Resting from before the sliths were exiled to after this place was abandoned. This crystal was made by sliths.",0);
	clear_buffer();
	append_string("How that is possible, you can't even begin to guess.");
	if (get_flag(1,19) == 1)
		append_string(" But Phaedra was right. The secrets of Bahssikava are of importance to all living things, not just the sliths.");
	get_buffer_text(dlgstr);
	add_dialog_str(3,dlgstr,0);
	add_dialog_str(4,"Do you wish to attempt to use the mind crystal?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Use.");
	choice = run_dialog(1);
	if (choice == 1)
		end();
	else
		{add_dialog_str(0,"As you stare deep into the Mind Crystal, you start to hear strange, whispering voices in your mind. The words are barely audible, but they seem to be trying to teach you something.",0);
		add_dialog_str(1,"You concentrate, and you start to get an impression of what ability the item is trying to teach you.",0);
		add_dialog_str(2,"Ancient Slithzerikai Language",15);
		add_dialog_str(3,"Learning some of the ancient slithzerikai language will allow you to read better the cursive letters that you find around Bahssikava.",15);
		add_dialog_str(4,"This crystal can only be used once, so choose carefully whether or not to use it now.",0);
		add_dialog_choice(0,"Don't use it yet.");
		add_dialog_choice(1,"Use the crystal.");
		choice = run_dialog(1);
		if (choice == 2)
			{message_dialog("Words and images flow across the surface of the crystal, and a soft, sibilant voice whispers into your mind.","When it is done, you are not fluent in ancient slitherzerikai, but you understand it far better.");
			inc_flag(250,2,1);
			set_flag(7,6,1);
			}
		}
	}
break;

beginstate 19;
	if ((get_flag(7,6) != 0) && (get_flag(7,7) == 0))
		{message_dialog("Despite what you learned from the mind crystal, you still can't read the texts on these shelves. They are too advanced, and most of them are probably useless to you anyway.","");
		set_flag(7,7,1); }
break;

beginstate 20;
if (get_flag(250,2) > 0)
	message_dialog("This sign says, _In case of emergency._","");
else
	message_dialog("You can't read this sign.","");
break;

beginstate 21;
if (get_flag(250,2) > 0)
	message_dialog("This sign says, _WARNING! DANGER!_ followed by several words you can't read.","It also says something about _ACROSS THE HALL, BEHIND YOU._");
else
	message_dialog("You can't read this sign, but it looks like something dire.","");
break;

beginstate 22;
if (get_flag(250,2) > 0)
	message_dialog("This sign says, _STORAGE._","");
else
	message_dialog("You can't read this sign, but you can guess that it says _Storage,_ or something of that nature.","");
break;

beginstate 23;
if (get_flag(250,2) > 0)
	{reset_dialog();
	add_dialog_str(0,"You can read a bit of this book. It describes the elaborate water management system in place in Ancient Bahssikava.",0);
	add_dialog_str(1,"Apparently a river ran through the center of the city, and the sliths had a complex plumbing system to distribute the water. Sliths need water to live and breed, so this system was the lifeline of the city.",0);
	add_dialog_str(2,"A note is written in the margin: DESTROYED BY CAVE QUAKE.",0);
	dummy = run_dialog(1);
	set_flag(7,29,1);
	}
else
	message_dialog("This book contains a lot of writing in a script that you can't read.","");
break;

beginstate 24;
if (get_flag(7,8) != 0)
	end();

	block_entry(1);
	i = 0;
	while (char_ok(i) == 0)
		{i = i + 1; }
	
	if (char_loc_y(i) <= 41)
		march_party(59,42);
	else
		march_party(59,48);
	force_instant_terrain_redraw();
	
	message_dialog("Explosions fill the room! Ghosts appear!","");
	
	put_boom_on_space(57,43,1,0);
	put_boom_on_space(61,43,1,0);
	put_boom_on_space(57,47,1,0);
	put_boom_on_space(61,47,1,0);
	run_animation_sound(-152);
	
	put_boom_on_space(58,44,1,0);
	put_boom_on_space(60,44,1,0);
	put_boom_on_space(58,46,1,0);
	put_boom_on_space(60,46,1,0);
	run_animation_sound(-152);
	
	put_boom_on_space(59,45,1,0);
	run_animation_sound(-152);
	
	place_monster(57,43,254,0);
	place_monster(61,43,254,0);
	place_monster(57,47,249,0);
	place_monster(61,47,249,0);
	put_boom_on_space(57,43,6,0);
	put_boom_on_space(61,43,6,0);
	put_boom_on_space(57,47,6,0);
	put_boom_on_space(61,47,6,0);
	run_animation_sound(-54);
	
	set_flag(7,8,1);
break;

beginstate 25;
if (get_flag(250,2) > 0)
	message_dialog("This sign says, _IN CASE OF EMERGENCY_ and something about _TO THE WEST._","");
else
	message_dialog("You can't read this sign.","");
break;

beginstate 26;
	block_entry(1);
	reset_dialog_preset_options(2);
	choice = run_dialog(1);
	if (choice == 2)
		{set_flag(7,9,2);
		set_total_visibility(1);
		force_view_center(45,37);
		force_instant_terrain_redraw();
		message_dialog("The altar deactivates.","");
		
		put_boom_on_space(45,32,1,0);
		run_animation_sound(51);
		
		set_total_visibility(0);
		force_view_center(37,31);
		force_instant_terrain_redraw();
		}
break;

beginstate 27;
if (get_flag(7,9) != 0)
	end();
else
	{change_blocked(39,41,0);
	change_blocked(40,40,0);
	change_blocked(41,40,0);
	change_blocked(42,40,0);
	change_blocked(43,40,0);
	change_blocked(44,40,0);
	change_blocked(45,40,0);
	change_blocked(46,40,0);
	change_blocked(47,40,0);
	change_blocked(48,40,0);
	change_blocked(49,40,0);
	change_blocked(50,40,0);
	change_blocked(51,40,0);
	
	change_blocked(39,40,0);
	change_blocked(40,40,0);
	change_blocked(42,40,0);
	change_blocked(44,40,0);
	change_blocked(45,40,0);
	change_blocked(46,40,0);
	change_blocked(48,40,0);
	change_blocked(50,40,0);
	change_blocked(51,40,0);
	change_blocked(39,39,0);
	change_blocked(40,39,0);
	change_blocked(42,39,0);
	change_blocked(44,39,0);
	change_blocked(45,39,0);
	change_blocked(46,39,0);
	change_blocked(48,39,0);
	change_blocked(50,39,0);
	change_blocked(51,39,0);
	set_flag(7,9,1);
	reset_dialog();
	clear_buffer();
	append_string("The moment you step into this room, a feeling of holiness washes over you.");
	if (get_flag(250,0) < 4)
		append_string(" Although you are not a slith, you can feel the power of the room.");
	if (get_flag(250,0) == 4)
		append_string(" The magic of this room calls to your slith blood, and you feel the need to go to the altar and pray.");
	if ((get_flag(250,0) > 4) && (get_flag(251,3) == 1))
		append_string(" You glance at the slith in your party. Even a non-slith can feel the power of this room, and it must be far more intense for one whose heart is reptilian.");
	if ((get_flag(250,0) > 4) && (get_flag(251,3) > 1))
		append_string(" You glance at the sliths in your party. Even a non-slith can feel the power of this room, and it must be far more intense for those whose hearts are reptilian.");
	get_buffer_text(dlgstr);
	add_dialog_str(0,dlgstr,0);
	if (get_flag(250,0) == 4)
		add_dialog_str(1,"After a lifetime of being around humans, humans who believe that all sliths are like the Darklings, to know that sliths are capable of such powerful good magic is like a warm kiss from the Goddess herself.",0);
	if ((get_flag(250,0) > 4) && (get_flag(251,3) == 1))
		add_dialog_str(1,"You can't quite be sure what the slith is feeling, but the expression on its face is enough. You have never seen your comrade smile so brightly.",0);
	if ((get_flag(250,0) > 4) && (get_flag(251,3) > 1))
		add_dialog_str(1,"You can't quite be sure what the sliths are feeling, but the expression on their faces is enough. You have never seen your comrades smile so brightly.",0);
	add_dialog_str(2,"You take a look around the room.",0);
	dummy = run_dialog(1);
	
	force_view_center(42,41);
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));
	
	force_view_center(42,40);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(42,39);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(42,38);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(42,37);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(42,36);
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));
	
	force_view_center(43,36);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(44,36);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(45,36);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(46,36);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(47,36);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(48,36);
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));
	
	force_view_center(48,37);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(48,38);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(48,39);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(48,40);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(48,41);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));
	
	force_view_center(char_loc_x(0),char_loc_y(0));
	force_instant_terrain_redraw();
	
	reset_dialog();
	add_dialog_str(0,"The room is filled with beautiful artwork and flawless architecture which have withstood decades without maintenance.",0);
	if (get_flag(250,0) < 4)
		add_dialog_str(1,"None of the sliths you have ever known (or have even heard of) have been remotely capable of this. The sliths of Ancient Bahssikava must have been truly remarkable.",0);
	if (get_flag(250,0) == 4)
		add_dialog_str(1,"That your people, sliths, could create this is a shock and a vindication. All your life, you have believed that you were warlike and stupid by nature. This is clearly not true.",0);
	if ((get_flag(250,0) > 4) && (get_flag(251,3) == 1))
		add_dialog_str(1,"You glance at your companion. The modern sliths of Avernum are not even remotely capable of this. Sliths grow up believing that they are warlike and stupid by nature. This must be a great vindication.",0);
	if ((get_flag(250,0) > 4) && (get_flag(251,3) > 1))
		add_dialog_str(1,"You glance at your companions. The modern sliths of Avernum are not even remotely capable of this. Sliths grow up believing that they are warlike and stupid by nature. This must be a great vindication.",0);
	dummy = run_dialog(1);
	
	message_dialog("Suddenly you feel a strange sensation wash over you. You are being scanned.","");

	force_view_center(45,37);
	force_instant_terrain_redraw();
	
	put_boom_on_space(45,32,1,0);
	run_animation_sound(51);
	
	activate_hidden_group(1);
	
	reset_dialog();
	add_dialog_str(0,"And you are rejected! The temple must know that you are intruders, and it activates its defenses!",0);
	if (get_flag(250,0) == 4)
		add_dialog_str(1,"You shake off the magnificent feeling from moments before. Your life is in danger now. You must fight.",0);
	if ((get_flag(250,0) > 4) && (get_flag(251,3) == 1))
		add_dialog_str(1,"You nudge your slith companion to alert it. Now you must fight.",0);
	if ((get_flag(250,0) > 4) && (get_flag(251,3) > 1))
		add_dialog_str(1,"You nudge your slith companions to alert them. Now you must fight.",0);
	add_dialog_str(2,"There must be a way to shut off the altar that is summoning these vengeful spirits, if only you can find it. You think you can see it! There is a small opening in the wall in the northwest corner of the room! Now you must only get there.",0);
	dummy = run_dialog(1);
	
	force_view_center(char_loc_x(0),char_loc_y(0));
	force_instant_terrain_redraw();
	}
break;

beginstate 28;
if (get_flag(7,9) != 0)
	end();
else
	{add_dialog_str(0,"This is where the sliths' honored dead were laid to rest. You can tell that just by looking at the room.",0);
	add_dialog_str(1,"You get the strange feeling that you are looking at a sight not seen by very many people in history. That trap outside was older than the defenses that you set off at the entrance to the catacombs.",0);
	add_dialog_str(2,"This place was probably not open to the general public of Bahssikava. You are privileged indeed to be here.",0);
	dummy = run_dialog(1);
	set_flag(7,9,1);
	}
break;

beginstate 29;
	if (get_terrain(49,21) != 374)
		end();
	else
	{block_entry(1);
	reset_dialog();
	add_dialog_str(0,"There is a lever here, which presumably controls the barrier fields in the area below. It may be connected to the same alarm system that you have been setting off all over, though.",0);
	add_dialog_str(1,"Do you wish to pull it, despite the danger?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Pull it.");
	choice = run_dialog(1);
	if (choice == 1)
		end();
	if (choice == 2)
		{message_dialog("Disaster fails to occur. However, the barriers do come down!","The lever also locks in place.");
		set_terrain(49,21,375);
		set_terrain(42,23,0);
		set_terrain(43,23,0);
		set_terrain(44,23,0);
		set_terrain(45,23,0);
		set_terrain(46,23,0);
		set_terrain(42,24,0);
		set_terrain(42,25,0);
		set_terrain(42,26,0);
		set_terrain(42,27,0);
		set_terrain(46,24,0);
		set_terrain(46,25,0);
		set_terrain(46,27,0);
		set_terrain(43,27,0);
		set_terrain(44,27,0);
		set_terrain(45,27,0);
		set_terrain(46,26,0);
		
		put_boom_on_space(42,23,2,0);
		put_boom_on_space(43,23,2,0);
		put_boom_on_space(44,23,2,0);
		put_boom_on_space(45,23,2,0);
		put_boom_on_space(46,23,2,0);
		put_boom_on_space(42,24,2,0);
		put_boom_on_space(42,25,2,0);
		put_boom_on_space(42,26,2,0);
		put_boom_on_space(42,27,2,0);
		put_boom_on_space(46,24,2,0);
		put_boom_on_space(46,25,2,0);
		put_boom_on_space(46,27,2,0);
		put_boom_on_space(43,27,2,0);
		put_boom_on_space(44,27,2,0);
		put_boom_on_space(45,27,2,0);
		put_boom_on_space(46,26,2,0);
		
		run_animation_sound(10);
		
		set_flag(7,10,1);
		}
	}
break;

beginstate 30;
	message_dialog("You look at the outside of this coffin, noting how impressively it is decorated. It must be the final resting place of one of the great heroes of Bahssikava.","You take care not to touch it, though. You've already set off enough alarms.");
break;

beginstate 31;
if (get_flag(250,2) == 0)
	{message_dialog("You can't read the script alphabet in this book. It looks like a description of the lives of those entombed here, with a few heroic illustrations, but you can't glean more than the barest details.","");
	end(); }
else
	{reset_dialog();
	add_dialog_str(0,"This book details the lives of the sliths entombed here.",0);
	add_dialog_str(1,"From what you can read, these sliths were great warriors. They defended Bahssikava when it was attacked by Darklings, all four performing unsurpassed acts of bravery and honor.",0);
	add_dialog_str(2,"Their leader -- whose name was apparently Calindor, a strange name for a slith -- used a halberd to slay Thsss, the leader of the Darklings. That halberd was buried between the four of them.",0);
	add_dialog_str(3,"The date that it gives for Thsss's death is just over a century ago, if your mental arithmetic is correct. From context, this Thsss is clearly the same Thsss who led the sliths into exile.",0);
	add_dialog_str(4,"But he led them into exile more than TWO centuries ago. If this is correct, Thsss lived well over a hundred years! It is impossible. Your understanding of their dates must be wrong.",0);
	run_dialog(1);
	set_flag(7,11,1);
	}
break;

beginstate 32;
	if (get_flag(7,12) == 1)
		end();
	reset_dialog();
	clear_buffer();
	append_string("You open the lid of this box and see a glint of metal inside. You look further and discover a metal triangle.");
	if (get_flag(3,9) == 1)
		append_string(" It matches what you have in your pack! It is one of the ones that you need.");
	get_buffer_text(dlgstr);
	add_dialog_str(0,dlgstr,0);
	add_dialog_str(1,"What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Take it.");
	choice = run_dialog(1);
	if (choice == 2)
		{change_spec_item(1,1);
		clear_buffer();
		append_string("You pocket the triangle.");
		if (get_flag(3,9) == 0)
			append_string(" You never know when it might be useful.");
		else
			append_string(" You are one triangle closer to being able to open the huge metal gates that lead to the steel doors and finishing your mission.");
		get_buffer_text(dlgstr);
		message_dialog(dlgstr,"");
		if (has_special_item(1) > 1)
			print_big_str("You now have ",has_special_item(1)," metal triangles.");
		else
			print_str("You now have 1 metal triangle.");
		set_flag(7,12,1);
		}
break;

beginstate 33;
	message_dialog("There is nothing in this chest. Perhaps the Bahssikavans or their ghosts moved whatever was here, or perhaps there was nothing here to begin with.","");
break;

beginstate 34;
	if (get_flag(7,13) == 1)
		end();
	message_dialog("This room appears to have been for making statues. Statues are a significant part of slith culture, and the Bahssikavans were obviously master blacksmiths.","");
	set_flag(7,13,1);
break;

beginstate 35;
	if (get_flag(7,14) == 1)
		end();
	message_dialog("This hallway is peculiar. In contrast to the entire rest of Ancient Bahssikava, which appears to be old beyond your ability to judge, at least a few decades, this hallway is new. Very new.","In fact, you'd guess that it was built no more than fifteen or twenty years ago.");
	set_flag(7,14,1);
break;

beginstate 36;
	if (get_flag(7,15) == 1)
		end();
	reset_dialog();
	clear_buffer();
	append_string("The door in front of you is massive. Just above the handle is a five-pointed star, but oddly enough, it is missing all of its points.");
	if ((get_flag(3,9) == 1) || (get_flag(3,10) == 1))
		append_string(" It is much like the six-pointed star on the huge gates above.");
	get_buffer_text(dlgstr);
	add_dialog_str(0,dlgstr,0);
	if (has_special_item(1) < 5)
		{if (has_special_item(1) > 0)
			add_dialog_str(1,"You fit one of your metal triangles into one of the missing points, and sure enough, it fits. However, you don't have enough triangles to fill all of the missing points.",0);
		add_dialog_str(2,"You push on the door, but it won't budge. You won't be able to get through here right now.",0);
		dummy = run_dialog(1);
		end();
		}
	add_dialog_str(1,"You fit all five of your metal triangles into the missing points, and sure enough, they fit! You hear a _click_ sound, and the door unlocks.",0);
	play_sound(9);
	set_flag(7,15,1);
	dummy = run_dialog(1);
break;

beginstate 37;
	if (get_flag(7,16) == 1)
		end();
	message_dialog("You step on the rune.","");
	place_monster(26,14,254,2);
	i = 119;
	while (char_ok(i) == 0)
		{i = i - 1; }
	set_character_facing(i,6);
	force_instant_terrain_redraw();
	pause(3);
	
	reset_dialog();
	add_dialog_str(0,"A ghost appears and begins hissing at you! It sounds as though he is saying something.",0);
	if (get_flag(250,2) == 0)
		{add_dialog_str(1,"However, you can't understand him.",0);
		add_dialog_str(2,"He finishes and stares at you. Seeing no response is forthcoming, he waves his arms and disappears. The rune flashes brightly, and you feel it getting hot. You step back before it explodes and kills you.",0);
		}
	else
		{add_dialog_str(1,"With some effort, you manage to understand him. He is saying something about a password.",0);
		if (get_flag(7,17) == 0)
			add_dialog_str(2,"After you make a few lame guesses, the ghost becomes fed up with you. He waves his arms and disappears. The rune flashes brightly, and you feel it getting hot. You step back before it explodes and kills you.",0);
	}
	if (get_flag(7,17) == 0)
		{add_dialog_str(3,"You can't pass.",0);
		dummy = run_dialog(1);
		block_entry(1);
		put_boom_on_space(26,14,1,0);
		erase_char(i);
		run_animation_sound(10);
		end();
		}
	
		add_dialog_str(2,"Remembering what you saw in the secret passage in the janitorial closet, you say, _Sss-Calindor._",0);
		add_dialog_str(3,"The ghost nods approvingly and vanishes. The rune flashes momentarily.",0);
		add_dialog_str(4,"You may pass.",0);
		set_flag(7,16,run_dialog(1));
		
		put_boom_on_space(26,14,1,0);
		erase_char(i);
		run_animation_sound(10);
break;
		
beginstate 38;
if (get_flag(250,2) == 0)
	{message_dialog("You can't read this sign.","");
	end(); }
	
	reset_dialog();
	add_dialog_str(0,"This sign says...",0);
	add_dialog_str(1,"_IN CASE OF EMERGENCY",0);
	add_dialog_str(2,"PASSWORD: SSS-CALINDOR_",0);
	add_dialog_str(3,"... whatever that means.",0);
	set_flag(7,17,run_dialog(1));
break;

beginstate 39;
if (get_flag(250,2) == 0)
	{message_dialog("You can't read this sign.","");
	end(); }
	
	message_dialog("This sign says, _EMERGENCY GENERATOR DEACTIVATION._","Well, at least that's your best guess.");
break;

beginstate 40;
	if (get_flag(7,2) == 2)
		{message_dialog("This lever no longer does anything. You flick it back and fortha few times to make sure, but nothing happens.","");
		end();
		}
		
	reset_dialog();
	add_dialog_str(0,"You reach the lever on this platform. It is vibrating with all the power running through this machinery. What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Pull it.");
	choice = run_dialog(1);
	
	if (choice == 2)
		{some_dead = 0;
		none_dead = 0;
		i = 23;
		while ((some_dead == 0) && (none_dead == 0))
			{if (char_ok(i))
				some_dead = 1;
			else
				i = i + 1;
			if (i == 34)
				none_dead = 1;
			}
				
		if (some_dead)
			{message_dialog("All of your enemies around you react quite suddenly and violently to you pulling the lever.","");
			i = 22;
			while (i <= 33)
				{kill_char(i,2,0);
				i = i + 1; }
			}
			
		i = 86;
		while (i <= 120)
			{erase_char(i);
			i = i + 1; }
			
		message_dialog("You can feel the heat from an intense energy build-up in the generator. It is about to explode!","");
		put_boom_on_space(18,28,1,0);
		put_boom_on_space(18,29,1,0);
		put_boom_on_space(18,30,1,0);
		run_animation_sound(152);
		
		put_boom_on_space(18,28,1,0);
		put_boom_on_space(18,29,1,0);
		put_boom_on_space(18,30,1,0);
		run_animation_sound(152);
		
		set_terrain(18,28,138);
		set_terrain(18,29,137);
		set_terrain(18,30,385);
		
		put_boom_on_space(18,28,1,0);
		put_boom_on_space(18,29,1,0);
		put_boom_on_space(18,30,1,0);
		run_animation_sound(152);
		
		message_dialog("Miraculously, the explosion does not harm you. It should be far easier to walk through the hallways now.","");
		
		set_flag(7,2,2);
		}
break;

beginstate 41;
	if (get_flag(7,20) == 1)
		end();
		
	activate_hidden_group(3);
	i = 34;
	while (i <= 38)
	{put_boom_on_char(i,6,0);
	i = i + 1; }
	run_animation_sound(54);
	change_blocked(29,17,0);
	change_blocked(29,18,0);
	change_blocked(29,19,0);
	change_blocked(28,17,0);
	change_blocked(28,18,0);
	change_blocked(28,19,0);
	change_blocked(27,17,0);
	change_blocked(27,18,0);
	change_blocked(27,19,0);
	set_flag(7,20,1);
break;

beginstate 42;
	if (get_flag(7,21) == 1)
		end();
		
	activate_hidden_group(4);
	i = 39;
	while (i <= 43)
	{put_boom_on_char(i,6,0);
	i = i + 1; }
	run_animation_sound(54);
	change_blocked(27,22,0);
	change_blocked(27,23,0);
	change_blocked(27,24,0);
	change_blocked(28,22,0);
	change_blocked(28,23,0);
	change_blocked(28,24,0);
	change_blocked(29,22,0);
	change_blocked(29,23,0);
	change_blocked(29,24,0);
	set_flag(7,21,1);
break;

beginstate 43;
if (get_flag(7,22) == 1)
		end();
		
	activate_hidden_group(5);
	put_boom_on_char(45,6,0);
	put_boom_on_char(46,6,0);
	run_animation_sound(54);
	change_blocked(30,27,0);
	change_blocked(30,28,0);
	change_blocked(31,27,0);
	change_blocked(31,28,0);
	set_flag(7,22,1);
break;

beginstate 44;
	if (get_flag(7,18) == 1)
		end();
	
	message_dialog("As you enter this room, you see VERY active machinery. This may be what is generating the ghosts out in the hallways! All you have to do is reach the lever on the platform to shut down the generator!","");
	set_flag(7,18,1);
break;

beginstate 45;
	if (get_flag(7,19) == 1)
		end();
	
	message_dialog("Unfortunately, an adventurer's life is never easy.","");
	j = 23;
	while (j >= 18)
		{i = 25;
		while (i <= 32)
			{put_boom_on_space(j,i,1,0);
			i = i + 1; }
		run_animation_sound(51);
		j = j - 1;
		}
		
	activate_hidden_group(2);
	i = 23;
	while (i <= 33)
		{put_boom_on_char(i,6,0);
		i = i + 1; }
	run_animation_sound(54);
	
	message_dialog("Although you are still a bit dazed from the explosions, you must fight if you wish to get to the lever.","");
	change_blocked(24,26,1);
	change_blocked(24,27,1);
	change_blocked(24,28,1);
	change_blocked(24,29,1);
	change_blocked(24,30,1);
	change_blocked(25,30,1);
	
	change_blocked(25,25,0);
	change_blocked(24,25,0);
	change_blocked(23,25,0);
	change_blocked(23,27,0);
	change_blocked(23,28,0);
	change_blocked(23,29,0);
	change_blocked(23,30,0);
	change_blocked(24,31,0);
	set_flag(7,19,1);
break;

beginstate 46;
	block_entry(1);
	message_dialog("The ghost in the corner begins speaking to you. He says the same thing as the other ghost, something about a password.","Having gotten lucky once before, you try the same password: Sss-Calindor. Unfortunately, it doesn't work this time. The ghost holds up his hand and you know you can't pass.");
break;

beginstate 47;
if (get_flag(7,17) == 0)
	block_entry(1);
break;

beginstate 48;
	reset_dialog();
	add_dialog_str(0,"A book lays open here. It looks interesting. It is blue and has runes written across the page. They look magical. Do you wish to try to read it?",0);
	add_dialog_choice(0,"No.");
	add_dialog_choice(1,"Yes.");
	if (run_dialog(1) == 1)
		end();
		
if (get_skill_total(42) <= 25)
	message_dialog("You open the book and page through, but the words are too foreign. You can't make out any of it. Your Rune Reading skill is not high enough.","");
	else {
		reset_dialog();
		add_dialog_str(0,"The book teaches you a better way of casting Repel Spirit.",0);
		if (char_ok(0)) {
			clear_buffer();
			append_char_name(0);
			if (get_spell_level(0,1,4) > 0) {
				if (get_spell_level(0,1,4) >= 5)
					append_string(" already knows the spell at level 5 or better.");
				else {
					append_string(" learns the spell.");
					change_spell_level(0,1,4,5 - get_spell_level(0,1,4));
					}
				}
			else
				append_string(" needs to know the spell at level 1 or higher to learn from this book.");
			get_buffer_text(dlgstr);
			add_dialog_str(1,dlgstr,0);
			}
		if (char_ok(1)) {
			clear_buffer();
			append_char_name(1);
			if (get_spell_level(1,1,4) > 0) {
				if (get_spell_level(1,1,4) >= 5)
					append_string(" already knows the spell at level 5 or better.");
				else {
					append_string(" learns the spell.");
					change_spell_level(1,1,4,5 - get_spell_level(1,1,4));
					}
				}
			else
				append_string(" needs to know the spell at level 1 or higher to learn from this book.");
			get_buffer_text(dlgstr);
			add_dialog_str(2,dlgstr,0);
			}
		if (char_ok(2)) {
			clear_buffer();
			append_char_name(2);
			if (get_spell_level(2,1,4) > 0) {
				if (get_spell_level(2,1,4) >= 5)
					append_string(" already knows the spell at level 5 or better.");
				else {
					append_string(" learns the spell.");
					change_spell_level(2,1,4,5 - get_spell_level(2,1,4));
					}
				}
			else
				append_string(" needs to know the spell at level 1 or higher to learn from this book.");
			get_buffer_text(dlgstr);
			add_dialog_str(3,dlgstr,0);
			}
		if (char_ok(3)) {
			clear_buffer();
			append_char_name(3);
			if (get_spell_level(3,1,4) > 0) {
				if (get_spell_level(3,1,4) >= 5)
					append_string(" already knows the spell at level 5 or better.");
				else {
					append_string(" learns the spell.");
					change_spell_level(3,1,4,5 - get_spell_level(3,1,4));
					}
				}
			else
				append_string(" needs to know the spell at level 1 or higher to learn from this book.");
			get_buffer_text(dlgstr);
			add_dialog_str(4,dlgstr,0);
			}
		}
	dummy = run_dialog(1);
break;

beginstate 49;
if (get_flag(7,23) == 1)
	end();
	
	message_dialog("It appears that these graves went on for some ways further at one point, but they do not any longer. A cave-in has destroyed the hastily excavated area.","");
	set_flag(7,23,1);
break;

beginstate 50;
if (get_flag(7,24) == 1)
	end();
	
	add_dialog_str(0,"This area is much less carefully crafted and beautifully designed than the rest of the catacombs. It appears that it was built quickly by non-experts.",0);
	add_dialog_str(1,"The dead are in the ground, rather than in caskets, as elsewhere. The area has been damaged during the years since it was abandoned, too.",0);
	if (get_flag(6,21) == 1)
		add_dialog_str(2,"If you had to guess, you'd say this built by the survivors after the cavequake right before they left Ancient Bahssikava.",0);
	dummy = run_dialog(1);
	set_flag(7,24,1);
break;

beginstate 51;
	if (get_flag(7,25) == 1)
		end();
	reset_dialog();
	clear_buffer();
	append_string("You open this box and find a small metal triangle.");
	if (get_flag(3,9) == 1)
		append_string(" It matches what you have in your pack! It is one of the ones that you need.");
	get_buffer_text(dlgstr);
	add_dialog_str(0,dlgstr,0);
	add_dialog_str(1,"What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Take it.");
	choice = run_dialog(1);
	if (choice == 2)
		{change_spec_item(1,1);
		clear_buffer();
		append_string("You pocket the triangle.");
		if (get_flag(3,9) == 0)
			append_string(" You never know when it might be useful.");
		else
			append_string(" You are one triangle closer to being able to open the huge metal gates that lead to the steel doors and finishing your mission.");
		get_buffer_text(dlgstr);
		get_buffer_text(secdlgstr);
		message_dialog(dlgstr,"");
		if (has_special_item(1) > 1)
			print_big_str("You now have ",has_special_item(1)," metal triangles.");
		else
			print_str("You now have 1 metal triangle.");
		set_flag(7,25,1);
		}
break;

beginstate 52;
	if (get_flag(7,27) == 1)
		end();
		
	reset_dialog();
	clear_buffer();
	append_string("You open this box and find a sixth metal triangle.");
	if (get_flag(3,9) == 1)
		append_string(" This is the last one you need! You can have all the triangles to open the metal gates now!");
	get_buffer_text(dlgstr);
	add_dialog_str(0,dlgstr,0);
	add_dialog_str(1,"You can feel some powerful magic in this room, ready to respond to whatever you do. After all of the curses and alarms and traps that you've had to fight through and defeat, you can't know what to expect.",0);
	add_dialog_str(2,"What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Take the metal triangle.");
	choice = run_dialog(1);
	if (choice == 2)
		{change_spec_item(1,1);
		message_dialog("As you take the metal triangle, you feel the magical energy in the room rush around, releasing.","");

		i = 3;
		while (char_ok(i) == 0)
			{i = i - 1; }
		text_bubble_on_char(i,"Not another trap!");
		force_instant_terrain_redraw();
		pause(20);
		
		text_bubble_on_char(i,"");
		force_instant_terrain_redraw();
		message_dialog("Everything around you explodes! Lightning shoots everywhere, and the ceiling begins to cave in!","");
		
		put_boom_on_space(41,13,1,0);
		put_boom_on_space(42,13,1,0);
		put_boom_on_space(43,13,1,0);
		run_animation_sound(169);
		pause(10);
		
		put_boom_on_space(41,13,1,0);
		put_boom_on_space(42,13,1,0);
		put_boom_on_space(43,13,1,0);
		run_animation_sound(169);
		pause(1 * get_flag(250,8));
		
		put_jagged_zap(41,13,39,6,0);
		put_jagged_zap(42,13,50,10,0);
		put_jagged_zap(43,13,50,17,0);
		run_animation_sound(102);
		pause(1 * get_flag(250,8));
		
		put_jagged_zap(41,13,34,13,0);
		put_jagged_zap(42,13,50,14,0);
		put_jagged_zap(43,13,45,23,0);
		run_animation_sound(102);
		pause(1 * get_flag(250,8));
		
		put_jagged_zap(41,13,48,6,0);
		put_jagged_zap(42,13,50,22,0);
		put_jagged_zap(43,13,36,24,0);
		run_animation_sound(102);
		pause(1 * get_flag(250,8));
		
		put_straight_zap(41,13,41,4,0);
		put_straight_zap(42,13,42,4,0);
		put_straight_zap(43,13,43,4,0);
		run_animation_sound(102);
		pause(1 * get_flag(250,8));
		
		// put rubble in between
		set_terrain(43,8,138);
		set_terrain(42,10,138);
		set_terrain(42,8,138);
		set_terrain(42,11,137);
		set_terrain(41,11,137);
		set_terrain(41,8,137);
		
		set_floor(42,10,0);
		set_floor(41,8,0);
		set_floor(42,11,0);
		play_sound(108);
		
		// build walls
		set_terrain(40,11,41);
		set_terrain(40,10,41);
		set_terrain(40,9,41);
		set_terrain(40,8,41);
		
		set_terrain(44,11,39);
		set_terrain(44,10,39);
		set_terrain(44,9,39);
		set_terrain(44,8,39);
		play_sound(108);
		
		// break walls
		set_terrain(41,12,137);
		set_terrain(42,12,138);
		set_floor(42,12,1);
		set_terrain(43,12,138);
		
		set_terrain(41,7,137);
		set_terrain(42,7,137);
		set_terrain(43,7,138);
		play_sound(108);
		
		put_straight_zap(41,13,41,4,0);
		put_straight_zap(42,13,42,4,0);
		put_straight_zap(43,13,43,4,0);
		run_animation_sound(102);
		pause(1 * get_flag(250,8));
		
		put_boom_on_space(41,13,1,0);
		put_boom_on_space(42,13,1,0);
		put_boom_on_space(43,13,1,0);
		run_animation_sound(169);
		pause(1 * get_flag(250,8));
		
		set_terrain(36,16,42);
		set_terrain(37,16,38);
		set_terrain(38,16,45);
		
		set_terrain(41,13,385);
		set_terrain(42,13,138);
		set_terrain(43,13,385);
		
		put_boom_on_space(41,13,1,0);
		put_boom_on_space(42,13,1,0);
		put_boom_on_space(43,13,1,0);
		run_animation_sound(51);
		
		message_dialog("Breathless, you look around and verify that everyone in your party is still alive. Amazingly enough, they are, and they are also unharmed by the explosions and lightning streaks.","The ceiling has collapsed enough that you seem to have only one way out, the new way created by the blasts. You should probably get out of here before the rest of the area caves in.");
		print_str("You now have 6 metal triangles.");
		set_flag(7,27,1);
		}
break;

beginstate 53;
	reset_dialog();
	if (get_flag(250,2) == 0)
		add_dialog_str(0,"There is a small sign here, but you can't read it.",0);
	else
		add_dialog_str(0,"There is a small sign here that says: ABLUTIONS.",0);
	add_dialog_str(1,"What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Drink some of the water.");
	add_dialog_choice(2,"Wash yourself lightly.");
	choice = run_dialog(1);
	if (choice == 2)
		message_dialog("The water tastes bitter as it goes down your throat. You feel ill, but not seriously.","");
	if (choice == 3)
		{message_dialog("You wash your hands, arms, and feet in the water. You can feel the powerful magic in the room approve of your action.","");
		set_flag(7,26,1); }
break;

beginstate 54;
if (get_flag(7,26) == 1)
	end();
	
	block_entry(1);
	message_dialog("You feel powerful magic preventing you from stepping on this platform. From what you've learned of slith customs, you guess that you must wash your hands in the pool first.","");
break;

beginstate 55;
if (get_flag(7,28) == 1)
	end();
	
	reset_dialog();
	add_dialog_str(0,"The moment you step into this room, magical energy buffets you. You can feel it permeate the room thick as hive-fresh honey.",0);
	add_dialog_str(1,"You can guess why the hallway and this room are so recent, too: they weren't built by the original living Bahssikavans. They were built by ghosts.",0);
	clear_buffer();
	append_string("The ghosts must have built this area to house the final remaining triangle");
	if (get_flag(3,9) == 1)
		append_string(" when they took it from the Empire soldiers.");
	else
		append_string(", whatever it is for. It must be important, though.");
	get_buffer_text(dlgstr);
	add_dialog_str(2,dlgstr,0);
	add_dialog_str(3,"It must be up in that box on the raised platform, which is the center of the magical energy in this room.",0);
	set_flag(7,28,run_dialog(1));
break;

beginstate 56;
	reset_dialog();
	add_dialog_str(0,"The cave slopes sharply up here, apparently from the massive cave-in that you caused. Do you wish to walk up?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Walk up.");
	choice = run_dialog(1);
	if (choice == 2)
		{if (get_flag(3,12) == 0)
			set_flag(3,12,1);
		move_to_new_town(3,37,13);
		}
break;

beginstate 57;
if (get_flag(250,2) == 0)
	message_dialog("You can't read this sign.","");
else
	message_dialog("This sign is written in the Bahssikavan script that you have partly learned. It says, _Machinery._ At least, you think it does.","");
break;