// TOWN DIALOGUE SCRIPT
//    Town 16: Lava Lizard Cave

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;
int i,j,k,choice;


// *** Talas ***

begintalknode 1;
	state = -1;
	personality = 160;
	nextstate = 1;
	condition = 1;
	question = "Talas";
	text1 = "Talas greets you. _I figured out the control panel, just as you requested. Hope whatever's beyond the wall is worth the effort._";
	text5 = "Talas stands by the control panel, waiting for your next question.";
	action = INTRO;

begintalknode 2;
	state = 1;
	personality = 160;
	nextstate = 1;
	condition = 1;
	question = "How does the control panel work?";
	text1 = "_Oh, it's simple, really. This button here_ -- he indicates -- _controls the power to the shifters. Then this switch controls the shifters. The shifters change the gears from forward to reverse. Then...._";
	text2 = "He goes on at length. You don't really understand what he's talking about, but you nod. How he figured this out from the control panel itself, you will never know.";
	
// *** Danren-Bok ***

begintalknode 20;
	state = -1;
	personality = 161;
	nextstate = 20;
	condition = 1;
	question = "Danren-Bok";
	text1 = "You approach the crystal soul carefully. You can feel its magic fill the room, making your skin tingle with its power. No completely healthy crystal soul would leak out energy like this.";
	text2 = "_Khi?_ it sputters out suddenly, its tone raspy. Startled, you mentally translate. _What?_ it just asked. It continues, _Khoo bitas thoo?_ -- Who beest thou?";
	text3 = "The dialect it is projecting into your mind -- as that is how crystal souls communicate -- is ancient beyond your reckoning, using consonants that no longer existed in the later language. Even the Khalthanad sounds modern by comparison.";
	text5 = "Danren-Bok sits silently, waiting for your next question.";
	action = INTRO;

begintalknode 21;
	state = 20;
	personality = 161;
	nextstate = 21;
	condition = get_flag(16,4) == 0;
	question = "Who are you?";
	text1 = "_I am Danren-Bok,_ the crystal soul replies slowly. _Who are you, having thus come into my chambers?_";

begintalknode 22;
	state = 21;
	personality = 161;
	nextstate = -1;
	condition = 1;
	question = "Who I am is not important. Tell me about this place.";
	text1 = "_I shall not speak to a stranger,_ Danren-Bok replies, falling completely silent.";
	action = END_TALK;

begintalknode 23;
	state = 21;
	personality = 161;
	nextstate = 20;
	condition = 1;
	question = "I am on an expedition from Avernum. (Tell him about your identity.)";
	text1 = "Danren-Bok sits in disquieted silence as you tell your story. He makes absolutely no comments, but you can feel the mental waves from his mind growing uncomfortable at points. When you finish, you stand awkwardly, waiting for him to respond.";
	text2 = "Finally, he does. _Strange... most wondrously strange,_ he says. _Avernum. Exiled sliths. A human empire on the surface. Humans exiled to the underworld. I know nothing of any such things._";
	text3 = "Know nothing! If that is true, then this crystal soul has not received news from the outside for hundreds of years!";
	text4 = "_Your word intends not harm to me; therefore I shall not give harm to you. If it please you, we may speak._";
	action = SET_SDF 16 4 1;

begintalknode 24;
	state = 20;
	personality = 161;
	nextstate = 22;
	condition = get_flag(16,4) == 1;
	question = "Tell me about yourself.";
	text1 = "_Please bear in patient sufferance my unsweet words. I am not fit for conversation, secluded thus for ages and aeons, rapt. I was once a vahnatai, long ago, strong and virtuous enough to merit crystallization. Once...._ He falls silent.";
	text2 = "_The memory flies from my disused mind. Atrophied thoughts return not. Yet I recall the beginning of the Resting, so long ago, when vahnatai encased themselves in tall crystal pillars, those which fill this room._";
	text3 = "He continues, _But something has gone awry: still we sleep, never again to wake._ He pauses awkwardly, confused. _I nothing remember. Thus the vahnatai sleep, forgotten by time._";
	text4 = "Evidently this is the answer to part of the mystery of the pillars: the vahnatai are encased inside. But what has gone wrong? Why will they not wake? Danren-Bok does not seem to know, nor is the answer obvious here. It must be elsewhere.";

begintalknode 25;
	state = 22;
	personality = 161;
	nextstate = 20;
	condition = 1;
	question = "How did the vahnatai come to slith caves?";
	text1 = "_Slith caves? Slith... you pronounce the name of the slithzerikai. These caves were ours before the slithzerikai were created. These are vahnatai caves. Our servants merely keep them for us until we wake._";
	text2 = "Confused, he cuts himself off. _But we shall not wake. O most bitter truth, you cut to the heart of it. The servants are now the masters, owners of the masters' land._ Seemingly caught up, the crystal soul falls silent.";

begintalknode 26;
	state = 20;
	personality = 161;
	nextstate = 20;
	condition = get_flag(16,4) == 1;
	question = "Do you know anything that might be useful to me?";
	text1 = "_I remember a spell yet that may prove useful to you. It concerns the travel through dangerous areas in a cautious manner._ (He teaches you Safe Travel at level 3.)";
	text3 = "_I remember a spell yet that may prove useful to you. It concerns the travel through dangerous areas in a cautious manner._ He begins teaching you a new spell, Safe Travel, but it is too complicated for you to understand.";
	text4 = "(You need to know it at level 1 or 2 before you can learn it at level 3.)";
	text5 = "_The spell I taught to you I presume will prove useful,_ he replies.";
	code =
	clear_strings();
	if (get_flag(16,5) == 0) {
		if (get_flag(293,4) > 0) {
			set_flag(16,5,1);
			set_flag(293,4,3);
			add_string(1);
			}
		else {
			add_string(3);
			add_string(4);
			}
		}
	else
		add_string(5);
break;