// Town 15: Lava Ocean Camp
// Two pens are 6 x 8 and 8 x 8; lizard pen is 5 x 4
// All tents and portables are 4 x 4
begintownscript;

variables;

short choice,i,j,k;
string dlgstr;

body;

beginstate INIT_STATE;
	set_crime_tolerance(2);
	
	set_char_dialogue_pic(9,585,0); // Phaedra
	set_name(10,"Machrone"); // type 78
	set_name(11,"Legare"); // type 119
	set_name(12,"Silthokh"); // type 111
	set_name(13,"Ithik"); // type 112
	set_level(13,60);
	set_name(14,"Kass"); // type 36
	set_char_dialogue_pic(14,583,0);
	set_name(15,"Pithoss"); // type 112
	set_char_dialogue_pic(15,580,0);
	set_name(16,"Ethass"); // type 111
	set_char_dialogue_pic(16,584,0);
	
	set_name(6,"Bitey");
	set_name(7,"Hissy");
	set_name(8,"Snarly");
	
	if (get_flag(15,4) == 1) {
		activate_hidden_group(2);
		set_name(20,"Talas"); // type 112
		set_char_dialogue_pic(20,582,0);
		relocate_character(16,35,12);
		set_character_facing(18,6);
		}
	
	if (get_flag(290,7))
		make_town_hostile();
	
	if (get_flag(15,9) == 1)
		set_terrain(12,11,138);
			
	if (get_flag(18,4) == 1)
		if (get_flag(15,7) == 0) {
			force_instant_terrain_redraw();
			set_flag(15,7,1);
			message_dialog("You re-enter the Island Camp nervously. You have promised a demon lord that you will kill Legare. Time to fulfill that vow.","");
			}
	
	if ((get_flag(18,3) == 1) && (get_flag(15,4) == 0))
		set_state_continue(14);
	
	if (get_flag(15,0) == 0) {
		march_party(10,28);
		march_party(11,28);
		march_party(12,28);
		march_party(13,28);
		force_instant_terrain_redraw();
		
		message_dialog("After the long journey, you set up your tent and rest again for a few hours, this time sleeping a blank and dreamless while.","Now you are awake, and it is time to see what Talas has done with that wall.");
		set_flag(15,0,1);
		}
	
	if (get_flag(22,1) < 2)
		end();
		
		force_instant_terrain_redraw();
		message_dialog("Finally you return to camp with the good news: the Berekh Hive is actually the way out of the Lava Ocean, so that the expedition need not die here.","However, as you return, you again hear the sounds of commotion. Silthokh appears to be at it again, but this time, instead of standing outside Kass's door, he's outside Phaedra's tent. You approach to see what is going on.");
		
		i = 0;
		while (char_ok(i) == 0)
			{i = i + 1; }
		
		// Set up positions
		march_party(34,21);
		march_party(34,20);
		march_party(34,19);
		march_party(34,18);
		
		force_view_center(33,17);
		set_character_facing(12,6);
		relocate_character(12,32,16); // Silthokh
		set_character_facing(13,6);
		relocate_character(13,32,15); // Ithik
		set_character_facing(13,6);
		relocate_character(20,32,17); // Talas
		set_character_facing(20,6);
		relocate_character(10,35,14); // Machrone
		activate_hidden_group(3);
		force_instant_terrain_redraw();
	
		text_bubble_on_char(20,"We know you're in there!");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
	
		text_bubble_on_char(20,"");
		text_bubble_on_char(13,"What are you hiding?");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
	
		set_character_facing(12,4);
		text_bubble_on_char(13,"");
		text_bubble_on_char(12,"We all know, don't we?");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		text_bubble_on_char(12,"She's hiding");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		text_bubble_on_char(12,"that her child is DEMON-SPAWN!");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		force_instant_terrain_redraw();
		
		reset_dialog();
		add_dialog_str(0,"Images of the berekh hive come flooding back into your mind. Human-looking women copulating with demons, slaughtering and consuming their own children, slaking their thirst for violence and sex and death all at once, these images return full as life.",0);
		add_dialog_str(1,"What do you say?",0);
		add_dialog_choice(0,"(Nothing.)");
		add_dialog_choice(1,"Surely not! Phaedra is innocent!");
		add_dialog_choice(2,"Vile whore! How could she?");
		choice = run_dialog(1);
		if (choice == 1)
			message_dialog("The situation is tense, far too tense for you to say anything. You stand silent, watching. There is scattered murmuring in the crowd at Silthokh's inflammatory words.","");
		if (choice == 2) {
			text_bubble_on_char(i,"Surely not! Phaedra is innocent!");
			force_instant_terrain_redraw();
			pause(get_flag(290,0) * 5);
			
			text_bubble_on_char(i,"");
			force_instant_terrain_redraw();
			
			message_dialog("There is scattered murmuring in the crowd at Silthokh's inflammatory words, but you remember how Phaedra has been acting. Her smiles at the mention of her baby do not at all resemble the actions of the berekhs, nor does she seem demon-raped.","Silthokh glances at you darkly.");
			
			text_bubble_on_char(12,"You had best hear the evidence");
			force_instant_terrain_redraw();
			pause(get_flag(290,0) * 5);
			
			text_bubble_on_char(12,"");
			text_bubble_on_char(12,"before you come to a rash conclusion.");
			force_instant_terrain_redraw();
			pause(get_flag(290,0) * 5);
			
			text_bubble_on_char(12,"");
			force_instant_terrain_redraw();
			
			message_dialog("Funny. You could say the same to him.","");
			}
		if (choice == 3) {
			text_bubble_on_char(i,"Vile whore! How could she?");
			force_instant_terrain_redraw();
			pause(get_flag(290,0) * 5);
			
			text_bubble_on_char(i,"");
			force_instant_terrain_redraw();
			
			message_dialog("There is scattered murmuring in the crowd at Silthokh's inflammatory words, and you remember how evasive Phaedra has been about the identity of her baby's father. Silthokh clearly has it right.","");
			
			text_bubble_on_char(12,"See?");
			force_instant_terrain_redraw();
			pause(get_flag(290,0) * 5);
			
			text_bubble_on_char(12,"");
			text_bubble_on_char(12,"It is obvious to all.");
			force_instant_terrain_redraw();
			pause(get_flag(290,0) * 5);
			
			text_bubble_on_char(12,"");
			force_instant_terrain_redraw();
			
			message_dialog("The mood of the crowd is quickly turning fouler.","");
			}
		
		set_character_facing(12,6);
		text_bubble_on_char(12,"Phaedra! Come out!");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		text_bubble_on_char(12,"Unless you are afraid of the truth!");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		force_instant_terrain_redraw();
		
		message_dialog("You hear the sound of Phaedra's voice, barely audible, not loud enough that you can tell what she's saying. Then, louder, _No, that does it. He's gone too far. Help me up._","");
		
		relocate_character(9,34,15);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		
		text_bubble_on_char(9,"The only person here");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"who is afraid of the truth, Silthokh,");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"is you.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(9,"");
		force_instant_terrain_redraw();
		
		message_dialog("Silthokh growls angrily.","");
		
		text_bubble_on_char(12,"Whore! Demon slut!");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		text_bubble_on_char(12,"How dare you?");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		force_instant_terrain_redraw();
		
		reset_dialog();
		add_dialog_str(0,"Phaedra faces Silthokh's glare unflinchingly. She seems not to care that most of the expedition has surrounded her or that they are all about ready to slit her belly and her throat.",0);
		add_dialog_str(1,"What do you say?",0);
		add_dialog_choice(0,"(Nothing.)");
		if (party_size() == 1)
			add_dialog_choice(1,"Hey, this really doesn't matter. I found a way out!");
		else
			add_dialog_choice(1,"Hey, this really doesn't matter. We found a way out!");
		if (run_dialog(1) == 2) {
			text_bubble_on_char(i,"Hey, this really doesn't matter.");
			force_instant_terrain_redraw();
			pause(get_flag(290,0) * 5);
			
			text_bubble_on_char(i,"");
			force_instant_terrain_redraw();
			
			message_dialog("Before you can continue, Silthokh cuts you off.","");
			}
			
		text_bubble_on_char(12,"Depraved meretricious demon-lover!");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		text_bubble_on_char(12,"Can you truly tell us");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		text_bubble_on_char(12,"that the father of your child");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		text_bubble_on_char(12,"is not a demon from the abyss?");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(12,"");
		force_instant_terrain_redraw();
		
		message_dialog("Phaedra takes a deep breath. She closes her eyes for a moment, apparently weighing her options. Evidently she comes to a decision, re-opening her eyes.","_Yes,_ she says, sighing. _All right. You win. I will tell you who he is._");
		
		text_bubble_on_char(9,"He is not a demon,");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"not a terrible monster or fiend,");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"but simply a good, kind man.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"The father of my baby is");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"Machrone.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(9,"");
		force_instant_terrain_redraw();
		
		message_dialog("No one speaks. No one even moves. The tension is palpable.","");
		pause(get_flag(290,0) * 5);
		
		message_dialog("Then, suddenly, Talas bursts out laughing.","");
		
		text_bubble_on_char(20,"*chuckle*");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(20,"");
		text_bubble_on_char(20,"*snort*");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(20,"");
		text_bubble_on_char(20,"*wheeze*");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(20,"");
		text_bubble_on_char(20,"It's... Machrone?!");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(20,"");
		force_instant_terrain_redraw();
		
		message_dialog("His laughs grow larger and less contained. Tears begin streaming down his green, scaled face as he clutches his stomach, bent halfway over, almost on his knees with laughter. _Machrone?_ he manages to sputter out between gasps.","The entire gathered crowd begins laughing uproariously. The tension of a few moments before entirely defuses with howls of deep-gutted laughter. Phaedra's face turns a bright red.");
		
		text_bubble_on_char(13,"Is that really true, Phaedra?");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(13,"");
		text_bubble_on_char(9,"Y... yes.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		relocate_character(10,35,15);
		text_bubble_on_char(9,"");
		text_bubble_on_char(9,"Yes, it's true.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		set_character_facing(10,2);
		text_bubble_on_char(9,"");
		text_bubble_on_char(10,"Was that really wise, Phaedra?");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		set_character_facing(9,6);
		text_bubble_on_char(10,"");
		text_bubble_on_char(9,"It's time they knew, Richard.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		set_character_facing(9,2);
		text_bubble_on_char(9,"");
		text_bubble_on_char(13,"Richard?");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(13,"");
		text_bubble_on_char(10,"Yes, ah, well, ah, yes.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(10,"");
		text_bubble_on_char(10,"Machrone is just a pen name.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(10,"");
		text_bubble_on_char(10,"My real name is Richard White.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(10,"");
		text_bubble_on_char(11,"Well!");
		relocate_character(11,21,14);
		set_character_facing(11,6);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		
		relocate_character(11,22,14);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		
		relocate_character(11,23,14);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		
		relocate_character(11,24,14);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		
		relocate_character(11,25,14);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		
		text_bubble_on_char(11,"");
		text_bubble_on_char(11,"I hope you are all now contented");
		relocate_character(11,26,14);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		
		set_character_facing(11,5);
		relocate_character(11,27,15);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 1);
		
		set_character_facing(11,6);
		relocate_character(11,28,15);
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 3);
		
		text_bubble_on_char(11,"");
		text_bubble_on_char(11,"that Phaedra may bear this child.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(11,"");
		text_bubble_on_char(11,"Her pregnancy is a gift of the Goddess");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(11,"");
		text_bubble_on_char(11,"for which we praise her name.");
		force_instant_terrain_redraw();
		pause(get_flag(290,0) * 5);
		
		text_bubble_on_char(11,"");
		force_instant_terrain_redraw();
		
		reset_dialog();
		add_dialog_str(0,"The crowd shifts awkwardly for a moment as all realize how foolish they've been. Then they rapidly begin to disperse. Kass appears behind Legare and sees that you've returned. He takes you aside.",0);
		add_dialog_str(1,"_What did you find?_ he asks you. You fill him in on the details of the exit from the Lava Ocean.",0);
		add_dialog_str(2,"_Excellent!_ he says. _We will leave immediately. You should get some rest, though, before you set out. You know the way; just follow behind us when you're ready._",0);
		add_dialog_str(3,"You go back to your tent to rest.",0);
		run_dialog(1);
		
		toggle_quest(15,0);
		march_party(10,30);
		march_party(11,30);
		march_party(12,30);
		march_party(13,30);
		force_view_center(13,30);
		
		set_flag(15,11,1);
	
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
if (get_flag(15,5) == 1)
	begin_talk_mode(35);
	
if (get_crime_level() == 0)
	end();
if (get_flag(290,7) > 0)
	end();
	
	print_str_color("You have made the expedition angry with you.",1);
	make_town_hostile();
	set_flag(290,7,1);
break;

beginstate 10;
if (get_flag(15,12) == 0) {
	reset_dialog();
	add_dialog_str(0,"You are about to start speaking to Machrone when he begins speaking himself. _You missed that? Which part?_ He appears to be speaking into the orb on the ground in front of him.",0);
	add_dialog_str(1,"A voice from the orb replies, _All of it, buddy._",0);
	add_dialog_str(2,"_All right. I'll give you the last bit again._ He clears his throat. _The expedition has now moved beyond the comfort of the walls of Thassaka into the strange realm of fire of this Lava Ocean. We have set up camp on a small island in the lava._",0);
	add_dialog_str(3,"He continues, _Although we set out from Avernum with only Avernite sliths, we have picked up travelers along the way. Many from Vasskolis and Thassaka have joined up with the expedition, hoping to reunite finally with the distant slith empire._",0);
	add_dialog_str(4,"He adds, _So far all is smooth. We brought many rations with us from Thassaka, and it appears that we will need them: almost no food grows in this area. We hope to move on soon, or else we may have to forage for scraps among the flames._",0);
	add_dialog_str(5,"He pauses. _You get that, Federic?_ He waits for an answer, but none comes out. _Federic? Are you there?_ A voice responds, joltedly, as if waking from sleep, _What? Er... no. Better repeat it, Machrone._ Machrone sighs.",0);
	run_dialog(1);
	}
else {
	reset_dialog();
	add_dialog_str(0,"Machrone speaks into the orb on the ground before him. _Here, in the depths of the Lava Ocean, the expedition has found itself in terrible danger: we are low on supplies and unable to find an exit.",0);
	add_dialog_str(1,"_Backtracking to Thassaka would be dangerous and potentially fruitless. Barbarians might attack struggling travelers. However, we cannot remain here, for the lava lizards are no more merciful: they will soon be picking at our corpses if we cannot escape.",0);
	add_dialog_str(2,"_Tensions are running high. The expedition is fragmenting. The members do not trust each other, and rumors are spreading that there are traitors among us. Devil-worship, perhaps? None are sure, and few will speak in public.",0);
	add_dialog_str(3,"_One thing is certain, though: we must get out of here. Believers and non-believers alike know that escape is the only alternative, and we must find a way, or we shall all certainly die._",0);
	run_dialog(1);
	}
break;

beginstate 11;
if (get_flag(15,1) != 0)
	end();
	
	i = 0;
	while (char_ok(i) == 0)
		{i = i + 1; }
	
	set_flag(15,1,1);
	block_entry(1);
	
	message_dialog("Suddenly you hear the sound of Ethass's raised voice.","");
	
	force_view_center(20,28);
	set_total_visibility(1);
	
	text_bubble_on_char(16,"No!");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 4);
	
	text_bubble_on_char(16,"");
	text_bubble_on_char(16,"I'm telling you, no!");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 4);
	
	text_bubble_on_char(16,"");
	text_bubble_on_char(12,"Shh!");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 4);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"Quiet!");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 4);
	
	text_bubble_on_char(12,"");
	force_instant_terrain_redraw();
	
	message_dialog("You watch for another long moment as Ethass chokes back whatever she's about to say. She looks as though she is going to tell Silthokh off, but she doesn't.","Whatever that just was, it's over now.");
	
	set_total_visibility(0);
	force_view_center(char_loc_x(i),char_loc_y(i));
	force_instant_terrain_redraw();
	
break;

beginstate 12;
if (get_flag(18,4) == 0)
	message_dialog("This is Legare's door. You don't have anything important to talk to him about, though, so you don't disturb him.","");
else 
	if (get_flag(15,9) == 0) {
		reset_dialog();
		add_dialog_str(0,"You reach Legare's door. Do you bash it open?",0);
		add_dialog_choice(0,"Leave.");
		add_dialog_choice(1,"Break it down.");
		if (run_dialog(1) == 2) {
			set_flag(15,9,1);
			set_terrain(12,11,138);
			force_instant_terrain_redraw();
			play_sound(9);
			}
		}
break;

beginstate 13;
	reset_dialog();
	add_dialog_str(0,"You have returned to your tent. What would you like to do?",0);
	add_dialog_choice(0,"Nothing.");
	add_dialog_choice(1,"Rest.");
	if (run_dialog(1) == 1)
		end();
	
	message_dialog("You lay down in your tent, preparing to rest.","");
	
	force_view_center(37,6);
	force_instant_terrain_redraw();
	
	block_entry(1);
	
	i = 0;
	while (char_ok(i) == 0)
		{i = i + 1; }
	march_party(10,30);
	march_party(11,30);
	march_party(12,30);
	march_party(13,30);
	
	revive_party();
	play_sound(20);
	
if (get_flag(15,3) == 1) {
	reset_dialog(); // dialog after FL1
	add_dialog_str(0,"You sleep for hours. In your sleep, you toss and turn, troubled by strange, dark dreams.",0);
	add_dialog_str(1,"In your dreams, demons assault a small vahnatai settlement, tearing it to pieces and slaughtering all the inhabitants. You watch, helpless, as each one is cut down before you.",0);
	add_dialog_str(2,"Amidst the fleeing vahnatai, you catch sight of a few reptile-men, most fleeing alongside the vahnatai, but some captured by the demons and brought trembling before the leader, a giant monster with haunting, green, glowing eyes.",0);
	add_dialog_str(3,"The demon lord's vicious tail whips around and seizes one of the sliths by its wrist. You smell the stench of burning flesh as the tail burns the slith's scales right off.",0);
	add_dialog_str(4,"_Yesss,_ rasps the creature hideously, looking at its captive. _You... and your kind... will do. In the name of NATHAGANTH!_ He lunges towards the slith.",0);
	add_dialog_str(5,"You wake, bathed in sweat. It is time to speak to Kass about your next task.",0);
	inc_flag(15,3,run_dialog(1));
	}

if (get_flag(15,5) == 2) {
	reset_dialog(); // dialog after FL2
	add_dialog_str(0,"You settle down for sleep, but you cannot immediately drift off. The expedition cannot proceed out of the Lava Ocean by any of the routes that you have found. You cannot remain here for much longer without supplies, though.",0);
	add_dialog_str(1,"It would be difficult to return to Thassaka. It is not certain that you could avoid the barbarians, nor that you have enough supplies to make it if you tried, nor even that you would be able to find another exit once you returned.",0);
	add_dialog_str(2,"The mood of the expedition is not pleasant, either. Silthokh is on edge, and he is not the only one. Something must be bugging him, and with him, many others.",0);
	add_dialog_str(3,"Your encounter with Dalaghant answered some questions, but many more remain. It must have been he who destroyed the vahnatai outpost under the lava lizard cave, and, because of him, the sliths have left this area alone since then.",0);
	add_dialog_str(4,"What the vahnatai were doing here in the first place, and what happened to them, and how they were connected to the sliths all remain unanswered questions, though. The meaning of Dalaghant's curse as he vanished also has yet to become clear.",0);
	add_dialog_str(5,"Eventually, you drift off to sleep, and you manage to get some rest before you must wake and speak with Kass.",0);
	inc_flag(15,5,run_dialog(1));
	set_flag(15,12,1);
	}
	
	force_view_center(char_loc_x(i),char_loc_y(i));
	force_instant_terrain_redraw();
	
	
break;

beginstate 14;
	set_flag(15,4,1);
	
	message_dialog("As you are approaching the camp, you hear the sounds of a commotion. You draw near the source of the sound to investigate.","");
	
	i = 0;
	while (char_ok(i) == 0)
		{i = i + 1; }
		
	activate_hidden_group(1);
	activate_hidden_group(2);
	set_name(20,"Talas"); // type 112
	set_char_dialogue_pic(20,582,0);
	relocate_character(20,22,28);
	set_character_facing(20,0);
	relocate_character(13,29,11);
	set_character_facing(13,0);
	relocate_character(10,17,24);
	set_character_facing(10,6);
	set_character_facing(17,0);
	relocate_character(18,18,27);
	set_character_facing(18,0);
	relocate_character(16,35,12);
	set_character_facing(16,6);
	
	march_party(23,27);
	march_party(23,26);
	march_party(23,25);
	march_party(23,24);
	force_view_center(20,24);
	force_instant_terrain_redraw();
	
	message_dialog("Silthokh is speaking. You haven't heard much yet, though, so you don't know what he's talking about.","");
	
	text_bubble_on_char(12,"I say we talk to him.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"Surely he can answer us.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"Kass!");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"Kass, are you in there?");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	force_instant_terrain_redraw();
	
	message_dialog("The mood of the crowd is obviously ugly. You don't know what Silthokh has them riled up about, but they're clearly angry about something.","This is just what you need right now.");
	
	relocate_character(14,19,18);
	set_character_facing(14,6);
	set_terrain(20,18,15);
	run_animation_sound(58);
	
	relocate_character(14,20,18);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(14,21,18);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	set_character_facing(14,4);
	relocate_character(14,21,19);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(14,21,20);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(14,21,21);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	text_bubble_on_char(14,"What is it, Silthokh?");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(14,"");
	text_bubble_on_char(12,"Some of us are curious, Kass.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	force_instant_terrain_redraw();
	
	message_dialog("The tension is clear in Silthokh's voice. Of the many words you would use to describe Silthokh's tone, _curious_ is not one of them. _Infuriated_ might come closer to the mark.","");
	
	text_bubble_on_char(12,"I am the quartermaster of this trip,");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"so I know how our supplies are,");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"and I know that we're running out.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"Kass, how much longer can we stay here?");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"You've led us from our exile");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"to die out here in the wilderness!");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 2);
	
	text_bubble_on_char(24,"Yeah!");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 3);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(24,"");
	text_bubble_on_char(14,"Silthokh, have you so little faith?");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(14,"");
	text_bubble_on_char(14,"We're not going to die.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(14,"");
	force_instant_terrain_redraw();
	
	message_dialog("Kass meets Silthokh's gaze with equal fury. Throughout this trip, his authority has never been challenged, not even when the army of Gnass was chasing after the expedition in a misguided attempt to end the so-called blasphemy.","Now that Silthokh has raised the banner of mutiny, Kass is ready to bring down his response just as quickly and harshly.");
	
	text_bubble_on_char(14,"We are in the hands of the Goddess.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(14,"");
	text_bubble_on_char(14,"She will protect her faithful.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(14,"");
	force_instant_terrain_redraw();
	
	reset_dialog();
	add_dialog_str(0,"A brief pause comes between them. Silthokh stares at Kass, considering him carefully. Kass takes his word as final.",0);
	add_dialog_str(1,"What do you say?",0);
	add_dialog_choice(0,"(Stand silent).");
	add_dialog_choice(1,"Kass is right. Soon we'll find a way out.");
	add_dialog_choice(2,"Silthokh is right. We have no idea how to pass this land.");
	if (run_dialog(1) > 1)
		message_dialog("You steel yourself to say what you need to, but before you can begin to speak, another slith approaches.","You stay silent.");
	
	set_character_facing(11,4);
	relocate_character(11,22,16);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(11,22,17);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(11,22,18);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(11,22,19);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(11,22,20);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	relocate_character(11,22,21);
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 1);
	
	message_dialog("Everyone shifts uncomfortably, including Silthokh. Challenging Kass's authority is one thing, but challenging Legare's is quite another.","");
	
	text_bubble_on_char(11,"What is the problem, Silthokh?");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"I am sure we can find a solution.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	text_bubble_on_char(12,"It's the supplies, Prophet.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"We are almost out of water.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"You have....");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	force_instant_terrain_redraw();
	
	message_dialog("Silthokh's voice even falters for a moment. He is addressing the Prophet, with whom one does not trifle.","");
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"You have brought us here");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	text_bubble_on_char(12,"to die.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(12,"");
	force_instant_terrain_redraw();
	
	message_dialog("Legare does not speak for a long moment. First, he looks very carefully and calmly at Silthokh. Then he takes in the entire gathered mob with merely one more look. Then, without hesitation, he begins to speak again.","");
	
	text_bubble_on_char(11,"I understand your concern, Silthokh.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"I have prayed to the Goddess,");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"and I do not fear.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"She has assured me");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"that if we keep our faith,");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"we will see the homeland itself.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	text_bubble_on_char(11,"Keep strong, and persevere.");
	force_instant_terrain_redraw();
	pause(get_flag(290,0) * 5);
	
	text_bubble_on_char(11,"");
	force_instant_terrain_redraw();
	
	message_dialog("The mob still mutters quietly, but it disperses, and order is quickly restored. Silthokh looks deeply uncomfortable, but he says nothing, and Legare goes back to his small room.","Kass sees you, and he bids you to follow him back into his room. You do.");
	
	march_party(19,19);
	march_party(19,18);
	march_party(19,17);
	march_party(19,16);
	
	// Put everyone in their old/new places
	relocate_character(14,17,18);
	set_character_facing(14,6);
	relocate_character(10,35,12);
	set_character_facing(10,6);
	relocate_character(12,29,13);
	relocate_character(13,29,11);
	set_character_facing(13,4);
	relocate_character(20,30,12);
	set_character_facing(20,2);
	relocate_character(11,9,10);
	set_character_facing(11,6);
	set_terrain(20,18,11);
	erase_char(21);
	erase_char(22);
	erase_char(23);
	erase_char(24);
	erase_char(25);
	
	toggle_quest(6,0);
	
	force_view_center(char_loc_x(i),char_loc_y(i));
	force_instant_terrain_redraw();
	
	set_flag(15,5,1);
	set_flag(15,6,1);
	
break;

beginstate 15;
if ((get_flag(15,10) == 0) && (char_ok(11))) {
	set_flag(15,10,1);
	message_dialog("Legare has his back turned, praying. He is so deep in prayer he doesn't even seem to hear you as you break in. Now is the time to do what you came here to do.","");
	}
break;

beginstate 16;
	message_dialog("As you strike the killing blow, Legare whispers, _Forgive them, Goddess, for they know not what they do._ Then he sinks under the weight of his wounds, finally succumbing.","By all the gods, what have you done? What have you done?");
	set_flag(15,8,1);
break;

beginstate 17;
if (get_flag(15,11) == 1)
	move_to_new_town(23,53,38);
break;