// TOWN DIALOGUE SCRIPT
//    Town 23: Strange Cave Camp

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

begintalkscript;

variables;
int i,j,k,choice;


//*** Kass ***

begintalknode 1;
	state = -1;
	personality = 230;
	nextstate = 1;
	condition = 1;
	question = "Kass";
	text1 = "Kass walks through the newly-built temple. He appears to be gauging the size and imagining where to put things. When he notices you, he stops to talk.";
	text5 = "_What else should we discuss?_";
	action = INTRO;

begintalknode 2;
	state = 1;
	personality = 230;
	nextstate = 1;
	condition = get_flag(24,1) == 0;
	question = "This isn't much of a temple.";
	text1 = "_It is but the outer shell. The rest is coming later._ He frowns at you angrily. _We must remember that this temple honors the Goddess. It is not well to speak ill of it._";

begintalknode 3;
	state = 1;
	personality = 230;
	nextstate = 1;
	condition = get_flag(24,1) == 1;
	question = "Wow! How did all this stuff get here?";
	text1 = "_By the grace of the Goddess,_ Kass says, smiling. _We sought to honor her, and she gave us the power to do so._ You notice that Talas in the corner overhears this and scowls.";
	text2 = "_By the grace of the Goddess,_ Kass says, smiling. _We sought to honor her, and she gave us the power to do so._";
	code =
	if (char_ok(9))
		remove_string(2);
	else
		remove_string(1);
break;

begintalknode 4;
	state = 1;
	personality = 230;
	nextstate = 1;
	condition = 1;
	question = "What should I do now?";
	text1 = "_We need your help to construct this temple. I read in a Thassakan book that there is an item near here, an item that would show our great faith in the Goddess. It is a gold-threaded tapestry with ancient slith designs on it._";
	text2 = "He continues, _It was once stored in a city south of here, Manikoss, but it was taken in a raid, and it was later found but not recovered. It is in a slime pit to the east. Bring it back to us, so that we may honor the Goddess._";
	text3 = "_We need more help in constructing the temple. In a ruined city to the south, there are two trees that grow with the greenery of surface trees, even here underground. They are the perfect offering to the Goddess. Bring them here._";
	text4 = "He adds, _I have sent Talas ahead of you to open the gates, so you should have no trouble getting in._";
	text5 = "_As we discussed earlier, you should scout south for a new camping place for the expedition. As soon as you find a place along the river where we can stop, return and tell me about it._";
	code =
	clear_strings();
	if (get_flag(23,2) == 0) {
		add_string(1);
		add_string(2);
		toggle_quest(7,1);
		}
	else {
		if (get_flag(23,3) == 0) {
			add_string(3);
			add_string(4);
			toggle_quest(8,1);
			set_flag(23,7,1);
			}
		else {
			add_string(5);
			toggle_quest(9,1);
			set_flag(23,4,1);
			}
		}
break;

//*** Pithoss ***

begintalknode 10;
	state = -1;
	personality = 231;
	nextstate = 5;
	condition = 1;
	question = "Pithoss";
	text1 = "Pithoss stands in his small portable room, pacing back and forth, clearly deep in thought. He greets you as you approach, coming back to reality.";
	text5 = "Pithoss paces back and forth, waiting for your next question.";
	action = INTRO;

begintalknode 11;
	state = 5;
	personality = 231;
	nextstate = 5;
	condition = 1;
	question = "What are you doing?";
	text1 = "_I'm considering some of the mysteries that have yet to be solved. There have been blue crystal pillars in several of the places you have visited. They have the same features as the descriptions that were given by an old group of adventurers._";
	text2 = "He elaborates, _The first adventurers who met the vahnatai found in their lands a bunch of similar pillars that housed vahnatai during their Resting. However, their pillars had machinery that could be activated to wake the sleeping vahnatai._";
	text3 = "He frowns. _The pillars you found did not have that machinery, or it was non-functional. But why?_ He shakes his head. _Perhaps we do not have enough information to know, yet, but I feel that this is important. We must answer it before we finish here._";
	text4 = "_I am thinking about our information on the dark gods of the sliths. Many of them are the same as the gods of the Darklings of Avernum: King Nathaganth, beautiful Hathnazriakh, Rashank the Mighty, and Vorthak the Devourer are all familiar to me._";
	text5 = "His expression darkens. _But others, Anthalak the Twisted and Kelora-Nak the Liar in particular, are unknown to me. Thsss evidently decided that these two, the god of deformity and the god of falsehood, were not useful in his new society._";
	text6 = "He adds, _The prospect that these barbarians may be worse than any Darklings ever were is not comforting._";
	text7 = "_I am... thinking._ He doesn't seem to want to say more than that. When you press, he says, _I am thinking about Kass. And the Goddess. And this temple of his. That's all._";
	code =
	clear_strings();
	if (get_flag(23,3) > 0)
		add_string(7);
	else {
		if (get_flag(23,2) > 0) {
			add_string(4);
			add_string(5);
			add_string(6);
			}
		else {
			add_string(1);
			add_string(2);
			add_string(3);
			}
		}
break;

begintalknode 12;
	state = 5;
	personality = 231;
	nextstate = 5;
	condition = 1;
	question = "What do you think of Kass's temple?";
	text1 = "_It is... big._ He seems unwilling to offer more than that.";
	text3 = "_It is impressive, but I am not sure that it is not a waste of time,_ he says cautiously. _Giving the Goddess her due is worthy, but lingering here when we might journey further is dangerously near to distraction._";
	action = DEP_ON_SDF 23 3 0;

begintalknode 13;
	state = 5;
	personality = 231;
	nextstate = 5;
	condition = 1;
	question = "What is Legare doing right now?";
	text1 = "_He is communing with the Goddess,_ Pithoss replies. _He is not to be disturbed._";
	text2 = "_He is still communing with the Goddess, as far as I know,_ replies Pithoss. _He may also be considering our next move. I am not sure. He has been particularly distant lately. He has spoken only with Kass, Ethass, and me._";
	text3 = "He adds, _Machrone also wanted an interview with him, I believe, but the Prophet_ -- he puts a mildly ironic stress on the title -- _felt that he did not have time for a journalist at the moment._ He laughs.";
	text4 = "He voice drifts lower. _In fact, I'm not sure that he has spoken with anyone since you returned from the slime pit. It has been some time that he has been alone. I should go to him. I will do that soon._";
	code =
	clear_strings();
	if (get_flag(23,3) > 0) {
		add_string(2);
		add_string(4);
		}
	else {
		if (get_flag(23,2) > 0) {
			add_string(2);
			add_string(3);
			}
		else
			add_string(1);
		}
break;

//*** Silthokh ***

begintalknode 20;
	state = -1;
	personality = 232;
	nextstate = 10;
	condition = 1;
	question = "Silthokh";
	text1 = "Out here among the strange, miraculous mushrooms, Silthokh is sorting his wares. He seems to have found new things along the journey, somehow. He gives you a muted greeting as you approach.";
	text5 = "Silthokh continues to sort his items, waiting for your next question.";
	action = INTRO;

begintalknode 21;
	state = 10;
	personality = 232;
	nextstate = 10;
	condition = 1;
	question = "So, Phaedra and Machrone, huh?";
	text1 = "Silthokh's eyes flash like the two tines of a slith spear glinting in the light before stabbing their foe. _I was wrong,_ he spits. _I can admit it. But mark my words: I will continue to say what others are not willing to say, and I will be right._";
	text2 = "That seems to be his final word on the matter.";

begintalknode 22;
	state = 10;
	personality = 232;
	nextstate = 10;
	condition = 1;
	question = "Where did you find those things?";
	text1 = "_I looked around._ He grunts. _You didn't think that no one else on this expedition went away from camp to explore, did you? I have to find useful things, so that I can sell them. I've been doing that this whole time._";
	
begintalknode 23;
	state = 10;
	personality = 232;
	nextstate = 10;
	condition = 1;
	question = "Can I buy items from you?";
	text1 = "You finish shopping.";
	code =
	begin_shop_mode("Silthokh's Items","Silthokh has a variety of miscellaneous items at reasonable prices, and he will buy your excess, too.",9,2,2);
break;

begintalknode 24;
	state = 10;
	personality = 232;
	nextstate = 10;
	condition = 1;
	question = "Can I buy mage spells from you?";
	text1 = "You finish shopping.";
	code =
	begin_shop_mode("Silthokh's Spells","Silthokh picked up some spellbooks in Thassaka, and he's willing to let you look at them for a price.",7,3,-1);
break;

begintalknode 25;
	state = 10;
	personality = 232;
	nextstate = 10;
	condition = 1;
	question = "Can I buy priest spells from you?";
	text1 = "You finish shopping.";
	code =
	begin_shop_mode("Silthokh's Spells","Silthokh picked up some spellbooks in Thassaka, and he's willing to let you look at them for a price.",8,3,-1);
break;

begintalknode 26;
	state = 10;
	personality = 232;
	nextstate = 10;
	condition = 1;
	question = "Can you identify my items?";
	text1 = "_Of course, for a small fee. Just to cover my costs, you understand._";
	action = ID 5;
	
begintalknode 27;
	state = 10;
	personality = 232;
	nextstate = 10;
	condition = 1;
	question = "Can you teach me anything?";
	text1 = "You finish shopping.";
	code =
	begin_shop_mode("Silthokh's Recipes","Silthokh, from years of digging up alchemical ingredients, knows how to make a variety of potions. He'll teach you for a small price.",14,2,-1);
break;
	
//*** Ithik ***

begintalknode 30;
	state = -1;
	personality = 233;
	nextstate = 15;
	condition = 1;
	question = "Ithik";
	text1 = "Ithik stands among these brightly colored mushrooms, slowly paging through a book. He greets you mildly as you approach.";
	text5 = "Ithik reads another line from his book, waiting for your next question.";
	action = INTRO;

begintalknode 31;
	state = 15;
	personality = 233;
	nextstate = 16;
	condition = 1;
	question = "What are you reading?";
	text1 = "_It's called 'Hess Theiforoom,'_ he replies. _That is, 'The Story of the Gods.' It tells about the origins of the gods of the sliths. I'd only heard vague half-remembered stories from my parents; this is the real thing._";

begintalknode 32;
	state = 16;
	personality = 233;
	nextstate = 15;
	condition = 1;
	question = "Oh. Neat.";
	text1 = "_Yes,_ Ithik says, and you can tell that he means it.";

begintalknode 33;
	state = 16;
	personality = 233;
	nextstate = 15;
	condition = 1;
	question = "Care to tell me some of the story?";
	text1 = "_Of course!_ His face lights up. _There were many gods of the Empire of Khalthas, ranging from the great and powerful king god Seithoss, the Serpent God, to Possanathoss, the God of Light. All were revered and had their own cults._";
	text2 = "He continues, _But this book is a poem that talks about when and how Seithoss came into being, and how Soothaana, Goddess of Wisdom, came to him, and birthed several children: Rhaasinoss, God of War; Thaanoss, God of Death; and others._";
	text3 = "He cradles the book lovingly. _Kaanini loothaemeth Seithon koot Possanathon te,_ he recites, gently gliding over the hexameter, and the translation comes to your mind: _In song let us praise Seithoss and Possanathoss._ He murmurs, _So beautiful._";

begintalknode 34;
	state = 15;
	personality = 233;
	nextstate = 15;
	condition = 1;
	question = "What do you think of the temple?";
	text1 = "_Kass's temple,_ he says, _is weird. Why is he putting so much effort into creating a portable shrine to the Goddess? We should be putting that effort into getting to Danatha, the nearest city in Khitaloss Province._";
	text2 = "He frowns. _I don't approve of it._";
	
//*** Talas ***

begintalknode 40;
	state = -1;
	personality = 234;
	nextstate = 20;
	condition = 1;
	question = "Talas";
	text1 = "Talas surveys the construction in the temple, and you can see him doing mental calculations and fitting additional things into the space. He nods to you as you approach.";
	text5 = "Talas stands in the corner, waiting for your next question.";
	action = INTRO;

begintalknode 41;
	state = 20;
	personality = 234;
	nextstate = 21;
	condition = get_flag(23,3) == 0;
	question = "Nice temple.";
	text1 = "_Thanks,_ he says. _I'm not sure that it's even worth it, but Kass ordered me to build it, so I'm going to build it.";

begintalknode 42;
	state = 21;
	personality = 234;
	nextstate = 22;
	condition = 1;
	question = "You're not sure that it's worth it?";
	text1 = "_No, not at all._ He looks to make sure that Kass isn't listening. _I haven't seen any real sign of the Goddess on this entire expedition,_ he says in a low tone. _Kass talks about how the Goddess has gotten us this far, but I think he's forgotten us._";
	text2 = "He points at you. _After all, it's been you, not divine intervention, who have scouted out the paths and told us the safe ways to go. I've been the one who has opened the tricky doors. Silthokh has found our supplies. And so on._";
	text3 = "He nods confidently. _Yes sir, it's been the work of mortals that has gotten us this far, as far as I've seen._";

begintalknode 43;
	state = 22;
	personality = 234;
	nextstate = 23;
	condition = 1;
	question = "What about the steel doors? The parting of the river? The mushrooms?";
	text1 = "_Bah! Magic tricks and good fortune,_ he replies without hesitation. _Did you actually push on those doors in Bahssikava Deeps before you called us?_ You admit that you didn't. _Then how do you know that they were locked in the first place?_";
	text2 = "He continues, _Oh, sure, they were locked once upon a time, or else the Bahssikavans would've gotten back through, but how do you know that they were still locked when you got there? Spells expire sometime, you know._";
	text3 = "He adds, _And the river! That showed power, great magical power, but not divine. A great mage could've done it. Erika, Patrick, X, any of them, if they were all still alive, I mean. And the other thing... what was it... oh yes!_";
	text4 = "He snaps his fingers. _The mushrooms here. They are organic, are they not? Do you see a god sitting around giving them life? No! They've got dirt and nutrients, and they grow naturally. We were just lucky to find them. No invisible goddess required._";

begintalknode 44;
	state = 23;
	personality = 234;
	nextstate = 20;
	condition = 1;
	question = "So you don't believe in the Goddess at all?";
	text1 = "_Well, don't tell anybody, but no. I've spent my entire life learning about things that you can see and touch. Even magic can be controlled and used in a standard, repeatable way. But this Goddess is completely invisible and unknowable._";
	text2 = "He shakes his head. _It's just against my nature to believe in something without any kind of evidence at all._";

begintalknode 45;
	state = 20;
	personality = 234;
	nextstate = 20;
	condition = get_flag(23,3) != 0;
	question = "Impressive work on the temple.";
	text1 = "Talas just snorts. _Thank you, I guess,_ he says, _but I think that it's wasted effort._ He shakes his head and refuses to say more on the subject.";
	
//*** Phaedra ***

begintalknode 50;
	state = -1;
	personality = 235;
	nextstate = 30;
	condition = 1;
	question = "Phaedra";
	text1 = "Phaedra sits in her chair with her baby on her lap! She carries it gently in her arms, rocking it back and forth slowly, supporting the head with her hand. _Hi, there,_ she says to you as you approach.";
	text5 = "Phaedra sits and rocks her baby gently as she waits for your next question.";
	action = INTRO;

begintalknode 51;
	state = 30;
	personality = 235;
	nextstate = 30;
	condition = 1;
	question = "Your baby's born!";
	text1 = "_Yup!_ she says, grinning broadly. _It wasn't too hard, either. She just came right out._ She laughs. _Sort of. It took a few hours, but I've heard women tell stories of much worse._";
	text2 = "She tickles the baby playfully, and the baby giggles. Mother and daughter both definitely share a cheerful demeanor. _Her name is Arcadia,_ Phaedra says, _and I hope that she'll bring good luck to the expedition._";

begintalknode 52;
	state = 30;
	personality = 235;
	nextstate = 30;
	condition = 1;
	question = "How do you feel?";
	text1 = "_Good,_ she says. _I'm still a little shaky from the process, but I should be better in a few days. Pithoss already stopped by to ask me how soon I thought I'd be able to get back to scouting._";
	text2 = "She laughs. _Well, I think he just wanted to play with the baby. But that's why he said he'd come, anyway._";

begintalknode 53;
	state = 30;
	personality = 235;
	nextstate = 30;
	condition = 1;
	question = "Machrone, huh?";
	text1 = "Phaedra blushes a bright red. _He was very sweet to me in Bahssikava. What can I say? He's met all sorts of people and been all sorts of places. He has fascinating stories for an adventuring girl like me. And he's always kind and gentle._";
	text2 = "She smiles. _I know he's kind of a joke around here, but... I can't help thinking that somehow he knows more about life than a lot of the other members of the expedition. He seems mature and grounded, at least when he's alone. I can't explain it._";
	text3 = "She concludes, bashfully, _But I am sure that he is a good man, and he is good for me._";
	
//*** Ethass ***

begintalknode 60;
	state = -1;
	personality = 236;
	nextstate = 35;
	condition = 1;
	question = "Ethass";
	text1 = "Ethass stands across from Phaedra. She smiles at the baby, and you think for a moment that you see something deeper in her eyes, a more complicated thought than simply happiness for a happy friend. You can't quite place it, though.";
	text5 = "Ethass stands, awaiting your next question.";
	action = INTRO;

begintalknode 61;
	state = 35;
	personality = 236;
	nextstate = 35;
	condition = 1;
	question = "What are you doing?";
	text1 = "_Right now, I'm taking care of Phaedra,_ she replies. _She just gave birth. She's in great shape, but she's going to need to rest for a little while yet._";

begintalknode 62;
	state = 35;
	personality = 236;
	nextstate = 35;
	condition = 1;
	question = "How do you feel about Phaedra, Machrone, and their baby?";
	text1 = "_Happy,_ she says, and you can see that deeper reflection in her eyes again. _It must be wonderful for them, not to have to sneak around anymore, not to have to keep things secret, to be able to be together in public and share their love openly._";
	text2 = "She adds slowly, _Yes. Wonderful._";