// Town 3: Bahssikava Deeps
begintownscript;

variables;


short dummy,choice,i,j,k,view_x,view_y;
string dlgstr;

body;

beginstate INIT_STATE;
set_name(10,"Talas");
set_char_dialogue_pic(10,532,0);
set_name(11,"Slith engineer");
set_name(12,"Slith engineer");

if (get_flag(7,27) == 1)
	{set_terrain(37,13,0);
	set_terrain(37,12,0);
	set_terrain(36,11,0);
	}

set_crime_tolerance(2);

if (get_flag(3,1) == 0)
	{force_instant_terrain_redraw();
	message_dialog("Down in the deeps of the tunnels under Bahssikava, the air is beginning to get cooler. The hisses have died down. Whatever you must face down here, it is not lizards or drakes.","This may or may not be a good sign.");
	set_flag(3,1,1); 
	end(); }

if (get_flag(3,6) == 1)
	{force_instant_terrain_redraw();
	message_dialog("You have returned to the deepest depths underneath Bahssikava. Down here, somewhere, should be the steel doors that are the object of your quest.","You can't hear much of anything down here. The hisses of the tunnels and the clamor of the battle around the city do not reach this far.");
	set_flag(3,6,2); 
	end(); }

if (get_flag(3,12) == 1)
	{set_terrain(37,13,0);
	set_terrain(37,12,0);
	set_terrain(36,11,0);
	force_instant_terrain_redraw();
	reset_dialog();
	add_dialog_str(0,"Just as you leave, you hear another large cave-in behind you. You left not a moment too soon.",0);
	clear_buffer();
	append_string("You wind through the tunnels up from the catacombs for a while. After some time, you arrive at an area that looks vaguely familiar.");
	if (get_flag(3,13) == 1)
		{append_string(" In fact, you recognize this place!");
		if ((get_flag(3,10)) || (get_flag(3,9)))
			append_string(" It is near the huge gates! You are close to completing your quest!");
		else
			append_string(" It is near the ruins of Ancient Bahssikava.");
		}
	else
		{append_string(" You're not exactly sure where you are, but it smells like the area near");
		if ((get_flag(3,10)) || (get_flag(3,9)))
			append_string(" the gates in front of the steel doors.");
		else
			append_string(" the ruins of Ancient Bahssikava.");
		}
	get_buffer_text(dlgstr);
	add_dialog_str(1,dlgstr,0);
	if (get_flag(3,9) == 1)
		add_dialog_str(2,"Now it is time to return to the huge metal gates, open them, and complete your quest.",0);
	else
		add_dialog_str(2,"Now, after you've gone to all that effort to collect those metal triangles, they should be useful somewhere.",0);
	set_flag(3,12,run_dialog(1) + 1);
	end();
	}
	
if (get_flag(6,0) == 1)
	{force_instant_terrain_redraw();
	reset_dialog();
	add_dialog_str(0,"You return to the Deeps. You can probably rest here undisturbed if you like. What do you do?",0);
	add_dialog_choice(0,"Continue without resting.");
	add_dialog_choice(1,"Rest.");
	if (run_dialog(1) == 2)
		{revive_party();
		set_ticks_forward(5000);
		message_dialog("You rest well for a while. When you are fully revived, you get up and move on.","");
		}
	}

break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
// This is where text bubbles go
break;

beginstate 10;
	move_to_new_town(2,1,3);
break;

beginstate 11;
	if (get_flag(3,2) == 0)
		{set_flag(3,0,1);
		message_dialog("The bridge here has fallen down. You'll have to find another way across.",""); }
	else
		{set_flag(3,0,1);
		message_dialog("This bridge has fallen, too. As much as you look, you can't find another way across. It looks as though you are stuck. The steel doors are beyond this river, but you can't get to them.","You will have to go back to Kass and tell him about the problem."); }
break;

beginstate 12;
	if (get_flag(3,0) == 0)
		{set_flag(3,2,1);
		message_dialog("The bridge here has fallen down. You'll have to find another way across.",""); }
	else
		{set_flag(3,2,1);
		message_dialog("This bridge has fallen, too. As much as you look, you can't find another way across. It looks as though you are stuck. The steel doors are beyond this river, but you can't get to them.","You will have to go back to Kass and tell him about the problem."); }
break;

beginstate 13;
if (get_flag(3,3) == 1)
	end();
	else
	{reset_dialog();
	add_dialog_str(0,"This appears to be an abandoned drake's nest. Signs of an old battle remain, as if something chased off this drake.",0);
	add_dialog_str(1,"Based on the chill that permeates this area, and based on the scratch markings all over the walls, you have one guess: undead.",0);
	add_dialog_str(2,"And if these undead were strong enough to chase off a drake, they were not normal zombies or ghouls.",0);
	dummy = run_dialog(1);
	set_flag(3,3,1); }
break;

beginstate 14;
	if (get_flag(3,4) == 1)
	end();
	else
	{reset_dialog();
	add_dialog_str(0,"Before you is the strangest sight you've ever seen. Right in front of you are statues of unmistakably slithzerikai subject and origin. But in the distant darkness, you can see two... no, three large buildings, presumably also built by sliths.",0);
	add_dialog_str(1,"The buildings are easily hundreds of years old. They must have been built by the original Bahssikavans. But if that is true, then why did the Bahssikavans move to the higher caves by Legare's day?",0);
	add_dialog_str(2,"You can see frescoes decorating the walls of the buildings. They are strange: some show giant sliths, clearly larger than any you've ever encountered. Some show strangely colored sliths, red, blue, or white.",0);
	add_dialog_str(3,"Without doubt, the sliths who built these buildings were skilled at construction and at painting. They are a far cry from the Darkling sliths who dominated the caves of Avernum for most of the history of the exiles.",0);
	dummy = run_dialog(1);
	message_dialog("Adding to the strangeness of this place, to your right are bodies clearly of Empire soldiers. Their equipment is shattered, and their bodies are mutilated.","Their dark blood stains the entire area around the Empire's flag on the wall. The Empire's expedition ran afoul of something down here.");
	set_flag(3,4,1); }
break;

beginstate 15;
	message_dialog("Strange. This is the body of an Empire mage, and from the blast marks and wounds around, you guess that she died while she was reading the book on the pedestal. Something just burst in and killed her without her even having time to react.","");
break;

beginstate 16;
	message_dialog("This book rotted away long ago. You can't read a word of it.","");
break;

beginstate 17;
	if (get_flag(3,5) == 1)
	end();
	else
	{message_dialog("You can feel powerful, holy, disapproving magic emanating from the altar here. You can also see several completely obliterated bodies of Empire soldiers. They are riddled with roughly circular holes, as if blasted with bolts of energy.","The altar has a few dents, too. You deduce that the Empire soldiers tried to destroy the altar, thinking it was evil, and they got blown out of existence.");
	set_flag(3,5,1); }
break;

beginstate 18;
	reset_dialog();
	add_dialog_str(0,"Inspecting the altar closely, you notice that it has an ankh on it! You thought that was a strictly human symbol. Clearly it is not.",0);
	add_dialog_str(1,"This altar still contains energy. And it did kill the Empire soldiers, after all. It could be dangerous. What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Attempt to destroy it.");
	choice = run_dialog(1);
	if (choice == 2)
		{message_dialog("You start to hit the altar with your weapons. It begins to glow with  a bright, white light, and it starts shooting out bolts of energy at you.","As you die, you feel pretty stupid.");
		i = 0;
		while (party_size() >= 1)
			{put_jagged_zap(1,42,char_loc_x(i),char_loc_y(i),5);
			put_boom_on_char(i,6,0);
			run_animation_sound(102);
			kill_char(i,2,0);
			i = i + 1; }
		}
break;

beginstate 19;

break;

beginstate 20;
	if (get_flag(3,7) == 1)
	end();
	else
	{reset_dialog();
	if (get_flag(250,2) == 0)
		add_dialog_str(0,"In front of you are two huge, faintly glowing, steel gates. They are covered in writing that you can't understand, but which looks old.",0);
	else
		add_dialog_str(0,"In front of you are two huge, faintly glowing, steel gates. They are covered in writing that you can almost understand. It contains the words _HOME_ and _HOLY_ repeated several times. In Ancient Bahssikavan, this _holy_ also means _protected._",0);
	add_dialog_str(1,"Beyond these gates, you see huge steel doors! If you can open these gates, you will have done what the Prophet has asked you to do; you will have cleared a way to the steel doors! Your quest may be almost over!",0);
	add_dialog_str(2,"Above the rings to pull to open the gate is a design. It is a six-pointed star, but it is missing all its points!",0);
	if (has_special_item(1) < 6)
		{if (has_special_item(1) > 0)
			{add_dialog_str(3,"You notice that a triangle in your pack matches the size and shape of the missing points of the star. You fit what you have into the holes in the star, but there are still pieces missing.",0);
			set_flag(3,9,1); }
		add_dialog_str(4,"You pull on the pull-rings, but nothing happens. You can't get these gates open.",0);
		dummy = run_dialog(1);
		set_flag(3,10,1);
		end();
		}
	if (has_special_item(1) >= 6)
		{add_dialog_str(3,"You notice that the triangles in your pack match the size and shape of the missing points of the star. You fit them into the holes in the star, and you hear a clicking sound. You pull the gates open.",0);
		add_dialog_str(4,"After everything that you've been through, you should walk all the way to the steel doors to make sure that you've really cleared the way, however. It is not time to relax just yet.",0);
		dummy = run_dialog(1);
		play_sound(94);
		play_sound(94);
		flip_terrain(41,39);
		flip_terrain(42,39);
		set_flag(3,7,1);
		}
	}
break;

beginstate 21;
	if (is_combat())
		{print_str("This space cannot be entered in combat mode.");
		block_entry(1); }
	
	if (get_flag(250,9)) {
		reset_dialog();
		add_dialog_str(0,"You have reached another cut scene. In this one, Legare attempts to open the steel doors. If you only watch two in the entire scenario, I recommend that this be one of them.",0);
		add_dialog_str(1,"Do you wish to skip this one or watch it?",0);
		add_dialog_choice(0,"Skip it.");
		add_dialog_choice(1,"Watch it.");
		if (run_dialog(1) == 1)
			set_state_continue(33);
		}
	
	force_view_center(42,42);
	force_instant_terrain_redraw();

	reset_dialog();
	add_dialog_str(0,"Finally, you have reached your goal. The huge steel doors in front of you cannot be anything but the steel doors that you have been sent to find.",0);
	add_dialog_str(1,"The doors are covered with what appear to be slith gods and goddesses, all carrying enormous spears and wearing battle armor. They stand ready to fight... perhaps ready to fight anyone who would dare to come through these doors.",0);
	add_dialog_str(2,"As you approach, you hear a voice in your minds. _ Be it known that the servants of Thsss, and all his progeny, are banished from our civilized lands._",0);
	add_dialog_str(3,"_Spread whatever evil you want, fight whatever senseless wars you want, but do it far from us. Never will any of the dark progeny of Thsss return through this portal, until they have at least learned the virtues of patience and peace._",0);
	add_dialog_str(4,"_Farewell. May the Gods watch you and grant you wisdom._",0);
	add_dialog_str(5,"You stand at the door, in awe of the power and majesty of the sliths who were capable of creating what is in front of you.",0);
	dummy = run_dialog(1);
	
	march_party(char_loc_x(0),char_loc_y(0) + 1);
	force_instant_terrain_redraw();
	
	toggle_quest(1,0);

	// This is a time when a pause won't be noticed, so find first and last characters
	i = 0;
	while (char_ok(i) == 0)
		{i = i + 1; }
	j = 3;
	while (char_ok(j) == 0)
		{j = j - 1; }

	if (get_flag(3,16))
		message_dialog("The engineers from just north of here come running.","");
	else
		message_dialog("Some sliths who appear to be engineers come running.","");

	set_character_facing(0,0);
	set_character_facing(1,0);
	set_character_facing(2,0);
	set_character_facing(3,0);

	relocate_character(10,41,35);
	set_character_facing(10,4);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(10,41,36);
	relocate_character(11,41,35);
	set_character_facing(11,4);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	text_bubble_on_char(10,"They did it!");
	relocate_character(10,41,37);
	relocate_character(11,41,36);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(10,41,38);
	relocate_character(11,41,37);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(10,41,39);
	relocate_character(11,41,38);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(10,40,40);
	relocate_character(11,41,39);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	text_bubble_on_char(10,"");
	relocate_character(10,40,41);
	relocate_character(11,40,40);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(10,41,41);
	set_character_facing(10,6);
	relocate_character(11,40,41);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(10,42,41);
	relocate_character(11,41,41);
	set_character_facing(11,6);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	set_character_facing(10,4);
	set_character_facing(11,4);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	if (get_flag(3,17) == 0)
		{text_bubble_on_char(i,"Who are you?");
		force_instant_terrain_redraw();
		pause(5 * get_flag(250,8));

		text_bubble_on_char(i,"");
		text_bubble_on_char(10,"My name is Talas. We are engineers.");
		force_instant_terrain_redraw();
		pause(5 * get_flag(250,8));

		text_bubble_on_char(10,"");
		text_bubble_on_char(10,"Kass sent us.");
		force_instant_terrain_redraw();
		pause(5 * get_flag(250,8));

		text_bubble_on_char(10,"");
		text_bubble_on_char(i,"Oh.");
		force_instant_terrain_redraw();
		pause(5 * get_flag(250,8));

		text_bubble_on_char(i,"");
		force_instant_terrain_redraw();
		}

	text_bubble_on_char(10,"You did it!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(10,"");
	text_bubble_on_char(10,"You opened the gates!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(10,"");
	text_bubble_on_char(i,"Yes, we did.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(i,"");
	text_bubble_on_char(10,"We have sent a messenger");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(10,"");
	text_bubble_on_char(10,"to announce that you have succeeded.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(10,"");
	text_bubble_on_char(10,"Kass should be here any minute.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(10,"");
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	message_dialog("You wait briefly for Kass. As you do, you reflect on what you have experienced in Bahssikava so far.","");
	add_dialog_str(0,"Lost Bahssikava had near mythical status in slith culture. The same heroes who slew Sss-Thsss and Emperor Hawthorne said that they found Lost Bahssikava, but they disappeared before their discovery could be verified.",0);
	add_dialog_str(1,"Legare has made two major claims. The first is that he knew the location of Lost Bahssikava, which has proved to be true. He knew something that no other scholar, slith or otherwise, knew.",0);
	add_dialog_str(2,"His second major claim, however, has yet to be verified. He has claimed that he can open these steel doors that have shut the sliths out of their homeland for two hundred years.",0);
	add_dialog_str(3,"Come to think of it, you have never seen any evidence of this Goddess in which he believes so fervently. (You haven't seen Legare himself, either, but you have more faith that Legare exists than that his Goddess does.)",0);
	add_dialog_str(4,"It will be very interesting to see what the leaders of these sliths do here.",0);
	dummy = run_dialog(1);

	relocate_character(0,43,45);
	relocate_character(1,42,45);
	relocate_character(2,41,45);
	relocate_character(3,40,45);

	place_monster(41,35,36,0);
	set_character_facing(86,4);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(86,41,36);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(86,41,37);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(86,42,38);
	set_character_facing(86,5);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(86,42,39);
	set_character_facing(86,4);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(86,43,40);
	set_character_facing(86,5);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	text_bubble_on_char(86,"Congratulations, adventurers.");
	relocate_character(86,43,41);
	set_character_facing(86,4);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(86,42,42);
	set_character_facing(86,3);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	set_character_facing(86,4);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"You have done it.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"You cleared a way to the steel doors.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"You have done what we asked of you.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"However, I have a new...");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"proposition for you.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"You have proved your usefulness.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"I ask you to come with us");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"as we make the journey");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"to our homeland.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"Think about it!");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"Why are you adventurers?");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"Is it for the money?");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"The fame?");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"Or are you hoping for more?");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"You have the opportunity");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"to go on a TRUE adventure.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(86,"");
	if ((get_flag(250,0) < 4) && (party_size() == 1))
		text_bubble_on_char(86,"Even though you are not a slith,");
	if ((get_flag(250,0) < 4) && (party_size() > 1))
		text_bubble_on_char(86,"Even though you are not sliths,");
	if ((get_flag(250,0) == 4) && (party_size() == 1))
		text_bubble_on_char(86,"As a slith,");
	if ((get_flag(250,0) == 4) && (party_size() > 1))
		text_bubble_on_char(86,"As sliths,");
	if ((get_flag(250,0) > 4) && (get_flag(251,3) == 1))
		text_bubble_on_char(86,"Since there is a slith among you,");
	if ((get_flag(250,0) > 4) && (get_flag(251,3) > 1))
		text_bubble_on_char(86,"Since there are sliths among you,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"the chance to go");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"to the slith homeland");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	if (get_flag(250,0) < 4)
		text_bubble_on_char(86,"must be exciting.");
	else
		text_bubble_on_char(86,"must be especially exciting.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"What do you say?");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	reset_dialog();
	add_dialog_str(0,"You have seen some incredible things here in Bahssikava already. A journey to the slith homeland could only bring more wonderment.",0);
	add_dialog_str(1,"Still, it sounds dangerous, and it is not part of what you agreed to do. You have finished your obligation to these sliths. What do you say?",0);
	add_dialog_choice(0,"Yes, Kass, I will go with the sliths on the journey to their homeland.");
	add_dialog_choice(1,"No, Kass. I did not agree to this. I am done here. I will not go with you.");
	set_flag(250,3,run_dialog(1));

	if (get_flag(250,3) == 1)
		{text_bubble_on_char(86,"Very good.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"I hoped you would feel that way.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"You will not regret your decision.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		force_instant_terrain_redraw();
		}

	if (get_flag(250,3) == 2)
		{text_bubble_on_char(86,"*sigh*");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"I hoped you would feel differently.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"In that case,");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"I must tell you:");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"you have no choice.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"There is no way out.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));
		
		text_bubble_on_char(86,"");
		text_bubble_on_char(i,"What?!");
		force_instant_terrain_redraw();
		pause(5 * get_flag(250,8));

		text_bubble_on_char(i,"");
		text_bubble_on_char(i,"You can't be serious!");
		force_instant_terrain_redraw();
		pause(5 * get_flag(250,8));

		text_bubble_on_char(86,"I assure you,");
		force_instant_terrain_redraw();
		pause(1 * get_flag(250,8));

		text_bubble_on_char(i,"");
		force_instant_terrain_redraw();
		pause(5 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"I am.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));
		
		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"We are still under siege.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"We will not defeat the forces above,");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"and you cannot pass them.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		if (party_size() == 1)
			text_bubble_on_char(86,"They think you are one of us.");
		else
			text_bubble_on_char(86,"They think you are followers of me.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"Even Phaedra and Machrone,");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"who are humans,");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"are trapped with us.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"You will come with us,");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		text_bubble_on_char(86,"or you will die.");
		force_instant_terrain_redraw();
		pause(6 * get_flag(250,8));

		text_bubble_on_char(86,"");
		force_instant_terrain_redraw();

		message_dialog("Inwardly, you groan, but there is nothing you can do.","");
		}

	text_bubble_on_char(86,"It is good to have you with us");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"on this great expedition.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));

	set_character_facing(86,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));

	text_bubble_on_char(86,"Clear the way!");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	text_bubble_on_char(86,"He comes!");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(86,"");
	march_party(43,44);
	// the engineers
	relocate_character(10,40,40);
	set_character_facing(10,1);
	relocate_character(11,41,41);
	set_character_facing(11,2);
	// Kass
	relocate_character(86,41,43);
	set_character_facing(86,3);
	// Machrone and Phaedra
	place_monster(41,35,78,0);
	set_character_facing(87,4);
	place_monster(42,35,255,0);
	set_character_facing(88,4);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	march_party(43,43);
	relocate_character(10,39,39);
	set_character_facing(10,1);
	relocate_character(11,40,40);
	set_character_facing(11,1);
	relocate_character(86,40,43);
	set_character_facing(86,2);
	relocate_character(87,41,36);
	relocate_character(88,42,36);
	// 2 priests
	place_monster(41,35,36,0);
	set_character_facing(89,4);
	place_monster(42,35,250,0);
	set_character_facing(90,4);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	march_party(44,43);
	relocate_character(10,38,39);
	set_character_facing(10,2);
	relocate_character(11,39,39);
	relocate_character(86,39,43);
	relocate_character(87,41,37);
	relocate_character(88,42,37);
	relocate_character(89,41,36);
	relocate_character(90,42,36);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	march_party(45,43);
	set_character_facing(10,4);
	set_character_facing(11,4);
	set_character_facing(86,6);
	relocate_character(87,41,38);
	relocate_character(88,42,38);
	relocate_character(89,41,37);
	relocate_character(90,42,37);
	// 2 chiefs
	place_monster(41,35,38,0);
	set_character_facing(91,4);
	place_monster(42,35,107,0);
	set_character_facing(92,4);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	march_party(45,44);
	relocate_character(87,41,39);
	relocate_character(88,42,39);
	relocate_character(89,41,38);
	relocate_character(90,42,38);
	relocate_character(91,41,36);
	relocate_character(92,42,36);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	march_party(45,45);
	relocate_character(87,42,38);
	set_character_facing(87,7);
	relocate_character(88,43,39);
	set_character_facing(88,6);
	relocate_character(89,41,39);
	relocate_character(90,42,39);
	relocate_character(91,41,37);
	relocate_character(92,42,37);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(3,45,42);
	relocate_character(87,43,39);
	set_character_facing(87,5);
	relocate_character(88,44,39);
	relocate_character(89,40,40);
	set_character_facing(89,3);
	relocate_character(90,41,39);
	set_character_facing(90,2);
	relocate_character(91,41,38);
	relocate_character(92,42,38);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	set_character_facing(0,2);
	set_character_facing(1,2);
	set_character_facing(2,2);
	set_character_facing(3,2);
	relocate_character(87,44,39);
	set_character_facing(87,6);
	relocate_character(88,45,39);
	relocate_character(89,39,41);
	relocate_character(90,40,40);
	set_character_facing(90,3);
	relocate_character(91,41,39);
	relocate_character(92,42,39);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	set_character_facing(87,4);
	set_character_facing(88,4);
	relocate_character(89,38,42);
	relocate_character(90,39,41);
	relocate_character(91,40,40);
	set_character_facing(91,3);
	relocate_character(92,41,39);
	set_character_facing(92,2);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(89,38,43);
	set_character_facing(89,4);
	relocate_character(90,38,42);
	relocate_character(91,39,41);
	relocate_character(92,40,40);
	set_character_facing(92,3);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(89,38,44);
	relocate_character(90,38,43);
	set_character_facing(90,4);
	relocate_character(91,38,41);
	set_character_facing(91,2);
	relocate_character(92,39,41);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(89,38,45);
	relocate_character(90,38,44);
	set_character_facing(91,6);
	set_character_facing(92,6);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	set_character_facing(89,6);
	set_character_facing(90,6);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	text_bubble_on_char(87,"I should get closer.");
	force_instant_terrain_redraw();
	pause(4 * get_flag(250,8));

	text_bubble_on_char(87,"");
	relocate_character(87,45,40);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(87,44,41);
	set_character_facing(87,3);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(87,43,42);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	relocate_character(87,44,43);
	set_character_facing(87,5);
	force_instant_terrain_redraw();
	pause(1 * get_flag(250,8));

	set_character_facing(87,2);
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	if (char_ok(2))
		{text_bubble_on_char(87,"You don't mind, do you?");
		set_character_facing(87,6);
		force_instant_terrain_redraw();
		pause(5 * get_flag(250,8));

		text_bubble_on_char(87,"");
		text_bubble_on_char(2,"Um...");
		force_instant_terrain_redraw();
		pause(3 * get_flag(250,8));

		text_bubble_on_char(2,"");
		text_bubble_on_char(86,"Shhh!");
		force_instant_terrain_redraw();
		pause(3 * get_flag(250,8));

		text_bubble_on_char(86,"");
		set_character_facing(87,2);
		}

	text_bubble_on_char(86,"He is here!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(86,"");
	force_instant_terrain_redraw();

	message_dialog("So this is it. You finally get your first glimpse of the legendary Prophet.","");

	place_monster(42,37,109,0);
	set_character_facing(93,4);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(93,42,38);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(93,42,39);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(93,43,40);
	set_character_facing(93,5);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(93,43,41);
	set_character_facing(93,4);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	relocate_character(93,42,42);
	set_character_facing(93,3);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));

	set_character_facing(93,4);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));

	message_dialog("He is tall, standing a head above any of the other sliths in the room. He shows the signs of having been muscular once, but his body has been irreparably damaged by twenty years of fasting. He has a fierce, two-tined spear at his side.","Every eye in the room is glued to his slow, deliberate, intense movements. This is the moment for which everyone has been hoping, working, and sacrificing. This is the moment when Legare is put to the test.");

	set_character_facing(93,0);
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	message_dialog("His eyes take in every person watching. He slowly scans from where you're standing all the way around the room to Kass. He closes his eyes for a moment and then re-opens them.","Then he begins speaking, in a gently sibilant, softly rhythmic, melodic tone.");

	text_bubble_on_char(93,"In dreams she came to me");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"with whispers soft,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"To tell me now was time,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"the time foretold,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"When to our home");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"we would return with joy,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"Receiving welcome, cousin to cousin,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"Estranged races meeting long at last;");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"To home we go,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"to home unknown, unseen,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"Unheard, but not unfelt,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"unwanted, lov'd,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"As prodigal slithzerikai we come,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"And humbly beg forgiveness generous");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"Of brethren wronged,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"gods scorned, land fail'd:");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"To make amends our goal,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"with malice none,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"We now embrace");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"our just, true cousins home:");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"Where wounds forgot,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"new hopes shall soon arise.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	set_character_facing(93,4);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));

	text_bubble_on_char(93,"O Great Goddess,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"I have done as you instructed.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"I have gathered my people,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"and we have made the journey here.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"We have lost our old homes,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"our old lives.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"We have given you all we have,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"and none of us regret it.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"We, your faithful children,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"understand now the mistakes");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"made by our ancestors,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"and we have learned,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"with exacting care,");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"the virtues of patience and peace.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"We desire nothing less");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"than to return to the land");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"from which we were justly banished");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"more than two centuries ago.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	text_bubble_on_char(93,"");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(93,"We await your decision.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	text_bubble_on_char(93,"");
	force_instant_terrain_redraw();

	message_dialog("Legare closes his eyes and lifts his hands towards the heavens. He continues speaking, softly, murmuring words in a strange, sibilant language.","");
	if (get_flag(250,2) > 0)
		message_dialog("You understand some of what he is saying! He is speaking the ancient language of Bahssikava!","It sounds like a continuing prayer and more praise of the Goddess, with a few words of magic here and there.");

	pause(3 * get_flag(250,8));

	text_bubble_on_char(87,"Fascinating!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(87,"");
	text_bubble_on_char(87,"Truly fascinating!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	text_bubble_on_char(87,"");
	force_instant_terrain_redraw();
	pause(5 * get_flag(250,8));

	message_dialog("The journalist jots notes. The warrior in the corner shifts uneasily. All of the other sliths in the room, Legare's followers, stare in fascination, not at the doors, but at Legare, their prophet.","You wait and watch.");

	pause(3 * get_flag(250,8));

	place_monster(40,40,99,2);
	text_bubble_on_char(94,"Minutes pass...");
	force_instant_terrain_redraw();
	pause(30);

	text_bubble_on_char(94,"");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));

	message_dialog("Suddenly you feel the entire room fill with magical energy! It is happening! It is truly happening!","");

	set_character_facing(0,4);
	set_character_facing(1,4);
	set_character_facing(2,4);
	set_character_facing(3,4);
	set_character_facing(87,4);
	set_character_facing(89,4);
	set_character_facing(90,4);
	set_character_pose(93,1);
	put_boom_on_space(40,45,4,0);
	put_boom_on_space(41,45,4,0);
	put_boom_on_space(42,45,4,0);
	put_boom_on_space(43,45,4,0);
	run_animation_sound(164);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));

	set_character_pose(93,1);
	play_sound(163);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));

	set_character_pose(93,1);
	put_boom_on_space(40,45,1,0);
	put_boom_on_space(41,45,1,0);
	put_boom_on_space(42,45,1,0);
	put_boom_on_space(43,45,1,0);
	run_animation_sound(152);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));

	set_character_pose(93,1);
	put_boom_on_space(40,45,1,0);
	put_boom_on_space(41,45,1,0);
	put_boom_on_space(42,45,1,0);
	put_boom_on_space(43,45,1,0);
	run_animation_sound(152);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));

	set_character_pose(93,1);
	set_floor(40,45,80);
	set_floor(41,45,80);
	set_floor(42,45,80);
	set_floor(43,45,80);
	force_instant_terrain_redraw();
	play_sound(165);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));
	
	message_dialog("Magical energy begins to fly around the room! The ground is shaking! You have enough self-control and experience to be able not to run for your life, but it is amazing that everyone else is still here.","");

	set_character_pose(93,1);
	put_boom_on_space(40,45,6,0);
	put_boom_on_space(41,45,6,0);
	put_boom_on_space(42,45,6,0);
	put_boom_on_space(43,45,6,0);
	put_jagged_zap(42,42,40,45,6);
	put_jagged_zap(42,42,41,45,6);
	put_jagged_zap(42,42,42,45,6);
	put_jagged_zap(42,42,43,45,6);
	run_animation_sound(65);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));
	
	put_jagged_zap(40,45,10,32,4);
	put_jagged_zap(41,45,46,23,4);
	put_jagged_zap(42,45,17,36,4);
	put_jagged_zap(43,45,24,25,4);
	run_animation_sound(102);
	pause(3 * get_flag(250,8));

	set_character_pose(93,1);
	put_boom_on_space(40,45,6,0);
	put_boom_on_space(41,45,6,0);
	put_boom_on_space(42,45,6,0);
	put_boom_on_space(43,45,6,0);
	put_jagged_zap(42,42,40,45,6);
	put_jagged_zap(42,42,41,45,6);
	put_jagged_zap(42,42,42,45,6);
	put_jagged_zap(42,42,43,45,6);
	run_animation_sound(65);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));
	
	put_jagged_zap(40,45,10,32,4);
	put_jagged_zap(41,45,46,23,4);
	put_jagged_zap(42,45,17,36,4);
	put_jagged_zap(43,45,24,25,4);
	run_animation_sound(102);
	pause(3 * get_flag(250,8));

	set_character_pose(93,1);
	put_boom_on_space(40,45,0,0);
	put_boom_on_space(41,45,0,0);
	put_boom_on_space(42,45,0,0);
	put_boom_on_space(43,45,0,0);
	put_jagged_zap(42,42,40,45,0);
	put_jagged_zap(42,42,41,45,0);
	put_jagged_zap(42,42,42,45,0);
	put_jagged_zap(42,42,43,45,0);
	run_animation_sound(51);
	pause(3 * get_flag(250,8));

	// Make the screen shake.
	i = 0;
	while (i < 4)
		{play_sound(-51);
		view_x = 42;
		view_y = 42;
		j = get_ran(1,0,4);
		k = get_ran(1,0,4);
		
		// + x, - y
		while ((view_x < 42 + j) || (view_y > 42 - k))
			{if (view_x < 42 + j)
				{force_view_center(view_x + 2,view_y);
				view_x = view_x + 2; }
			if (view_y > 42 - k)
				{force_view_center(view_x,view_y - 2);
				view_y = view_y - 2; }
			force_instant_terrain_redraw();
			pause(1);
			}
		// returning
		while ((view_x > 42) || (view_y > 42))
			{if (view_x > 42)
				{force_view_center(view_x - 2,view_y);
				view_x = view_x - 2; }
			if (view_y < 42)
				{force_view_center(view_x,view_y + 2);
				view_y = view_y + 2; }
			force_instant_terrain_redraw();
			pause(1);
			}

		// - x , + y
		while ((view_x > 42 - j) || (view_y < 42 + k))
			{if (view_x > 42 - j)
				{force_view_center(view_x - 2,view_y);
				view_x = view_x - 2; }
			if (view_y < 42 + k)
				{force_view_center(view_x,view_y + 2);
				view_y = view_y + 2; }
			force_instant_terrain_redraw();
			pause(1);
			}
		// returning
		while ((view_x < 42) || (view_y > 42))
			{if (view_x < 42)
				{force_view_center(view_x + 2,view_y);
				view_x = view_x + 2; }
			if (view_y > 42)
				{force_view_center(view_x,view_y - 2);
				view_y = view_y - 2; }
			force_instant_terrain_redraw();
			pause(1);
			}
		i = i + 1;
		}
		
	put_effect_on_space(40,45,10,1,2);
	put_effect_on_space(41,45,10,1,2);
	put_effect_on_space(42,45,10,1,2);
	put_effect_on_space(43,45,10,1,2);
	run_animation_sound(28);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));
	
	set_character_pose(93,1);
	put_effect_on_space(40,45,10,1,2);
	put_effect_on_space(41,45,10,1,2);
	put_effect_on_space(42,45,10,1,2);
	put_effect_on_space(43,45,10,1,2);
	run_animation_sound(28);
	set_character_pose(93,0);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));
	
	put_boom_on_space(40,45,3,0);
	put_boom_on_space(41,45,3,0);
	put_boom_on_space(42,45,3,0);
	put_boom_on_space(43,45,3,0);
	run_animation_sound(60);
	
	pause(6 * get_flag(250,8));
	
	relocate_character(93,41,43);
	set_character_facing(93,3);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));
	
	relocate_character(93,41,44);
	set_character_facing(93,4);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));
	
	relocate_character(93,41,45);
	force_instant_terrain_redraw();
	pause(2 * get_flag(250,8));
	
	flip_terrain(41,46);
	flip_terrain(42,46);
	play_sound(58);
	force_instant_terrain_redraw();
	pause(3 * get_flag(250,8));
	
	text_bubble_on_char(93,"The way...");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	text_bubble_on_char(93,"");
	text_bubble_on_char(93,"is open.");
	force_instant_terrain_redraw();
	pause(6 * get_flag(250,8));
	
	text_bubble_on_char(93,"");
	force_instant_terrain_redraw();
	
	message_dialog("The room erupts in celebration. Even you find yourself cheering. Legare has made good on the second of his major promises to the slithzerikai people. He has opened the doors that have for all their known history barred them from their home.","Now all that remains is to pass through these doors and find out what the slith homeland is like.");

	move_to_new_town(9,21,4);

break;

beginstate 22;
if (get_flag(3,8) == 1)
	end();
	else
	{message_dialog("This bridge is new. Very new. Someone has been down here fixing things.","You think you can hear voices to the east.");
	set_flag(3,8,1); }
break;

beginstate 23;
	if (get_flag(3,12) == 2)
		{message_dialog("Somewhere in all of the cave-ins and earthquakes, this area became blocked off again. You can't get through.","");
		block_entry(1);
		end(); }

	reset_dialog();
	add_dialog_str(0,"There is a crack in the walls here, a sizable one. You think you could fit through if you struggled.",0);
	add_dialog_str(1,"As you inspect it closer, you see there is a tunnel through here!",0);
	add_dialog_str(2,"What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Squeeze through.");
	choice = run_dialog(1);
	if (choice == 1)
		block_entry(1);
	if (choice == 2)
		move_to_new_town(6,40,8);
break;

beginstate 24;
	if ((get_flag(3,10) == 1) && (get_flag(3,11) == 0))
		{message_dialog("You see a metallic glint out of the corner of your eye. Something shiny is to the west of you.","");
		set_flag(3,11,1); }
break;

beginstate 25;
	if (get_flag(3,11) == 1)
		{reset_dialog(); 
		add_dialog_str(0,"There is a small, metal triangle here, just about the size of a missing point in the six-pointed star in the gates to the south. 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);
			set_flag(3,11,2);
			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."); }
		}
break;

beginstate 26;
if (has_special_item(1) < 6)
	{move_to_new_town(2,21,32);
	end(); }

	block_entry(1);
	if (get_flag(3,9))
		message_dialog("As you are about to wander back up towards Lost Bahssikava, you remember that you have all of the metal triangles that you need to open the gates and complete your quest.","You turn back.");
	else
		message_dialog("You stop to think for a moment. You have explored the upper regions fairly thoroughly. If there is a place to use these metal triangles, it must be down here.","You turn back.");
break;

beginstate 27;
if (get_flag(3,7) != 1)
	end();

	block_entry(1);
	message_dialog("You can't leave until you've walked all the way up to the steel doors. If you haven't actually touched them, you can't be sure that you've completely cleared the way.","");
break;

beginstate 28;
if (get_flag(3,16))
	end();

	message_dialog("Some sliths huddle back here in the corner by a fire. They appear to be engineers based on the tools near them.","");
	set_flag(3,16,1);
break;

beginstate 29;
	message_dialog("The bridge here is still broken. You can't cross.","");
break;

beginstate 30;
	reset_dialog();
	add_dialog_str(0,"The ground slopes down here. Do you wish to descend back into the catacombs of Bahssikava?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Descend.");
	choice = run_dialog(1);
	if (choice == 2)
		move_to_new_town(7,42,5);
break;

beginstate 31;
if (get_flag(3,18) == 0)
	{set_flag(3,18,1);
	message_dialog("This passage is filled with garbage, but strangely enough, the garbage looks as though it has been sifted through. Someone in the past must have been searching for something in here, and by the looks of it, found it.","People lose things in the strangest places....");
	}
break;

beginstate 32;
	set_flag(3,13,1);
break;

beginstate 33;
	reset_dialog();
	add_dialog_str(0,"When you reach the steel doors, you hear several engineer sliths come running. Talas and his friends contact Kass, who informs Legare and comes down with a number of others, including Phaedra and Machrone. Then Legare arrives.",0);
	add_dialog_str(1,"Legare is an impressive figure, and he delivers a poetical oration before summoning down the power of the Goddess and opening the doors. The way to the slith homeland is open.",0);
	add_dialog_str(2,"You have completed the quest that you volunteered for. Kass offers you the chance to go with the sliths as they journey to the homeland. What do you say?",0);
	add_dialog_choice(0,"Yes, I'll go with the sliths on this journey.");
	add_dialog_choice(1,"No, I'm done here.");
	if (run_dialog(1) == 1) {
		message_dialog("Kass seems quite pleased that you have chosen to go with them.","");
		set_flag(250,3,1);
		}
	else {
		message_dialog("Kass looks disappointed. He informs you that there really is no choice, since there is no way out: the hostile sliths hold the entire area above, and they'd kill you on sight.","You're stuck with this expedition for a while longer.");
		set_flag(250,3,2);
		}
	
	message_dialog("You cross the threshold with him, and you discover a ruined, abandoned guardpost. There is a river running through the middle of it, and the bridge over the river needs to be fixed, so you go to a room in the west corner of the guardpost and rest.","When you wake, it is time to find Kass and learn about the next stage of your quest.");

	move_to_new_town(9,5,9);
	set_flag(9,0,1);
	
break;