// TOWN DIALOGUE SCRIPT
// 	Town 14: Western Bahssikava

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

begintalkscript;

variables;

// *** Ithik ***

begintalknode 1;
	state = -1;
	personality = 140;
	nextstate = 1;
	condition = 1;
	question = "Ithik";
	text1 = "This tall, strong, and very much living slith watches as you approach. He is an adult, young but clearly seasoned in battle. He still carries his fierce, two-tined spear, presumably because the demons haven't bothered to take it away from him yet.";
	text5 = "_Sss._";
	action = INTRO;
	
begintalknode 2;
	state = 1;
	personality = 140;
	nextstate = 1;
	condition = 1;
	question = "Who are you?";
	text1 = "The slith stares at you uncomprehendingly. It speaks a few words in a strange, sibilant language.";
	text2 = "You can almost understand him! If you only spoke a little bit more of the ancient slithzerikai language that you've been learning from mind crystals, you might be able to converse with him.";
	text3 = "You can understand him, for the most part! He is asking you who you are, too!";
	code =
	if (get_flag(250,2) == 2)
		{remove_string(2);
		set_flag(14,3,1); }
	else
		set_flag(14,3,2);
	if (get_flag(250,2) < 2)
		remove_string(3);
	if (get_flag(250,2) == 0)
		remove_string(2);
break;

begintalknode 3;
	state = 1;
	personality = 140;
	nextstate = 1;
	condition = (get_flag(14,3) == 1) && (get_flag(14,4) == 0);
	question = "(Tell him who you are.)";
	text1 = "You try to explain, with the few words that you know, who you are and why you have come. He seems to understand you. Then he begins to reply. You mentally translate as he speaks.";
	text2 = "_That you are here is good. The demons nearly had killed us. You must open these gates and free us. We can help you defeat Nolagh-Khar._";
	action = SET_SDF 14 4 1;
	
begintalknode 4;
	state = 1;
	personality = 140;
	nextstate = 1;
	condition = get_flag(14,4) == 1;
	question = "How can we open the gates?";
	text1 = "_North. Far north. Key. Then wheel here._ He mimes turning a wheel. _That open gates._";

begintalknode 5;
	state = 1;
	personality = 140;
	nextstate = 2;
	condition = (get_flag(14,4) == 1) && (get_flag(14,5) == 0);
	question = "Who are you?";
	text1 = "_The name for me is Ithik. I am from Vasskolis, up the river. I am the leader of a scouting party. We had some bad luck._ He hisses softly, which you imagine is close to a sigh.";
	text2 = "_We crossed the dragon's mountain, but we could not return. We were stranded near the abandoned guardpost. Since we were the first group in years to go this far, I thought we should explore._";
	text3 = "_We went south, trying to find a route back into Bahssikava, our grandparents' city. But the demons captured us, and they have held us here for days. We need for you to free us._";
	action = SET_SDF 14 5 1;
	
begintalknode 6;
	state = 2;
	personality = 140;
	nextstate = 1;
	condition = 1;
	question = "Slow down. Vasskolis? Dragon's mountain? You are descended from Bahssikavans?";
	text1 = "Ithik sighs again. _There is no time. Free us first, and I will tell you all._";

// *** Boarag ***
	
begintalknode 10;
	state = -1;
	personality = 141;
	nextstate = 3;
	condition = 1;
	question = "Boarag";
	text1 = "This imp does not appear to be hostile to you. In fact, it looks at you with an almost hopeful expression.";
	text3 = "The imp looks up at you and then glances back down. He has said everything that he will say to you.";
	action = DEP_ON_SDF 14 12 0;

begintalknode 11;
	state = 3;
	personality = 141;
	nextstate = -1;
	condition = ((get_terrain(37,40) == 50) || (get_terrain(40,38) == 51)) && (get_flag(14,12) == 0);
	question = "Who are you?";
	text1 = "_Shhh!_ it says, glancing around to make sure that no one is listening. _Close the doors first. Then we can talk._";

begintalknode 12;
	state = 3;
	personality = 141;
	nextstate = 4;
	condition = (get_terrain(37,40) == 46) && (get_terrain(40,38) == 47) && (get_flag(14,12) == 0);
	question = "Who are you?";
	text1 = "_I am Boarag the Terrible,_ it growls. Somehow, with its high-pitched imp voice, the growl doesn't seem quite as terrible as it does coming from a demon. _I am the king of the imps._";

begintalknode 13;
	state = 4;
	personality = 141;
	nextstate = 5;
	condition = 1;
	question = "King of the imps?";
	text1 = "_Yes._ It glares at you, suspecting that you are mocking it. _My people have been brutally enslaved, and I, their king, have been helpless to stop it._";

begintalknode 14;
	state = 5;
	personality = 141;
	nextstate = 6;
	condition = 1;
	question = "How did this happen?";
	text1 = "_Our history is a tragic one. We dwelt in the greater caves above here in decades past. We lived west of Motrax the dragon in warm and humid caves, a paradise for those of my kind. We were content. Then Grah-Hoth came._";
	text2 = "_When the dark sliths summoned Grah-Hoth into this realm, they brought with him many others, followers of the dark lord. Nolagh-Khar was one, a general of sorts. Grah-Hoth divided these caves among his followers, and he gave Bahssikava to Nolagh-Khar._";
	text3 = "_Once Nolagh-Khar had finished conquering Bahssikava and enslaving the souls of the sliths who lived there, he sought out even more labor for his kingdom. He found it in the form of us._";

begintalknode 15;
	state = 6;
	personality = 141;
	nextstate = 7;
	condition = 1;
	question = "What do you mean?";
	text1 = "_He invaded our cave and took us all hostage. For many, many years, since not long after Grah-Hoth came into this world, we have been slaves to Nolagh-Khar and we have waited for someone who would free us._";
	text2 = "Since Grah-Hoth! That would be almost sixty years now that these imps have been slaves to Nolagh-Khar. They have been waiting a long time indeed.";
	text3 = "_Will you help us?_ Boarag asks. _Choose carefully, because I will not offer again. If you help us, we will aid you in fighting Nolagh-Khar. If you do not, when the battle comes we will have no choice but to fight on the side of our master against you._";

begintalknode 16;
	state = 7;
	personality = 141;
	nextstate = -1;
	condition = 1;
	question = "No, I won't help you imps.";
	text1 = "_Very well._ Boarag turns away, scowling. _It is your funeral._";
	code =
	set_flag(14,12,1);
	end();
break;
	
begintalknode 17;
	state = 7;
	personality = 141;
	nextstate = -1;
	condition = 1;
	question = "Yes, I will help. The enemy of my enemy is my friend.";
	text1 = "Boarag growls fiercely. _Then let us slay the foul monster who has held my people captive for so long! This is what you must do: head west. Cross the river and go northwest. You will find many imps working in a crystal mine, supervised by demons._";
	text2 = "_Kill the captors and release the imps. I will arrive as soon as you do this to tell the imps not to harm you. Then the revolt will begin, and imps that you meet will help you._";
	code =
	set_flag(14,12,2);
	end();
break;

// *** Phaedra identification ***

begintalknode 198;
	state = -1;
	personality = 250;
	nextstate = 99;
	condition = 1;
	question = "Phaedra";
	text1 = "You ask Phaedra if she can identify your items for you. _I sure can,_ she replies, grinning.";

begintalknode 199;
	state = 99;
	personality = 250;
	nextstate = -1;
	condition = 1;
	question = "Please do, then.";
	text1 = "_Sure thing. Only 5 coins per item._ She flashes you another grin,  daring you to ask why she is charging you. You don't.";
	action = ID 5;