// TOWN DIALOGUE SCRIPT
//    Town 52: Temple of Sothana

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

begintalkscript;

variables;
int i,j,k,choice;


// *** Zasthen ***

begintalknode 1;
	state = -1;
	personality = 520;
	nextstate = 1;
	condition = 1;
	question = "Zasthen";
	text1 = "This slith, who is slightly built, with deep-set reptilian eyes, stands beside the flames in the ground and whispers chants to himself. He silences as you approach, noting that you wish to speak with him.";
	text5 = "Zasthen clasps his hands together, fingers interlocking, in a position of prayer, as he waits for your next question.";
	action = INTRO;

begintalknode 2;
	state = 1;
	personality = 520;
	nextstate = 1;
	condition = 1;
	question = "Who are you?";
	text1 = "_I am Zasthen, a humble priest of Sothana._";

begintalknode 3;
	state = 1;
	personality = 520;
	nextstate = 2;
	condition = get_flag(52,4) == 0;
	question = "What are you doing?";
	text1 = "_I am preparing for an act of devotion: I will walk across this hot ground, bringing myself through pain for the sake of this goddess._";
	text2 = "As he is speaking, he has an idea. _Have you the faith? I invite you, stranger, to do this as well. Will you show your devotion to the goddess as well, walking across this ground in the name of the Great Wise One?_";

begintalknode 4;
	state = 2;
	personality = 520;
	nextstate = 1;
	condition = 1;
	question = "No, I'd rather not.";
	text1 = "He frowns. _As you wish,_ he says.";

begintalknode 5;
	state = 2;
	personality = 520;
	nextstate = 1;
	condition = 1;
	question = "Yes, I shall.";
	text1 = "_Good!_ he says. _First, wash your hands in the water on this side. Then walk directly across the fire, and when you have crossed, wash your hands there. Once you are done, pray at the altar, and surely the goddess shall show you her blessing._";
	action = SET_SDF 52 4 1;

begintalknode 6;
	state = 1;
	personality = 520;
	nextstate = 1;
	condition = get_flag(52,4) != 0;
	question = "What are you doing?";
	text1 = "_I am preparing for an act of devotion: I will walk across this hot ground, bringing myself through pain for the sake of this goddess._";

begintalknode 7;
	state = 1;
	personality = 520;
	nextstate = 1;
	condition = get_flag(52,4) == 7;
	question = "You said you had a reward for me?";
	text1 = "_Yes,_ he says. _I will teach you a spell to keep you safe from enemies._ He begins explaining a new spell, one that covers your allies with powerful shielding magic. (You learn a level of Protection.)";
	text2 = "_Yes,_ he says. _I will teach you a spell to keep you safe from enemies._ He begins explaining how to cast Protection more efficiently. You listen carefully.";
	code =
	set_flag(52,4,8);
	if (get_flag(293,2) == 0)
		remove_string(2);
	else
		remove_string(1);
	inc_flag(293,2,1);
	set_flag(293,0,1);
break;

// *** Shethoss ***

begintalknode 10;
	state = -1;
	personality = 521;
	nextstate = 5;
	condition = 1;
	question = "Shethoss";
	text1 = "This slith stands with his arms crossed before three colored pools of water. He seems to be contemplating something, or at least he was before you approached. Now he greets you.";
	text5 = "Shethoss waits, arms crossed, for your next question.";
	action = INTRO;

begintalknode 11;
	state = 5;
	personality = 521;
	nextstate = 5;
	condition = 1;
	question = "Who are you?";
	text1 = "_My name is Shethoss, and I am a priest of Sothana. I maintain this room, the room of cleansing._";

begintalknode 12;
	state = 5;
	personality = 521;
	nextstate = 6;
	condition = 1;
	question = "What are you doing?";
	text1 = "_I am readying a simple purification ritual. A festival day is coming soon, and we all must perform simple ablutions before we engage in the festivities._";

begintalknode 13;
	state = 6;
	personality = 521;
	nextstate = 5;
	condition = 1;
	question = "What sort of festival is it?";
	text1 = "_It is a small one,_ he replies. _We will celebrate the building of the first temple of Sothana in Khitaloss Province. It happened just before the death of Khalthas, and the temple is reputed to be one of the most beautiful in the empire._";
	text2 = "He sighs regretfully. _I have never seen it, though; the journey is too dangerous, these days. No one has been to Khitaloss in many years._";

begintalknode 14;
	state = 5;
	personality = 521;
	nextstate = 5;
	condition = 1;
	question = "What were you thinking about before we started talking?";
	text1 = "He hesitates. _I... nothing. Just... speak to Sasha. That is all._";
	text3 = "He looks uncomfortable. _Just thinking about how our leader became so infatuated with evil. It is... disquieting._";
	code =
	set_flag(54,6,1);
	if (get_flag(52,3) == 0)
		remove_string(3);
	else
		remove_string(1);
break;

// *** Thena ***

begintalknode 20;
	state = -1;
	personality = 522;
	nextstate = 10;
	condition = 1;
	question = "Thena";
	text1 = "This slith stands at the entrance to the settlement, noting your entrance and smiling broadly to greet you. _Welcome,_ she says, _to the temple of Sothana. I am Thena. We have not had even one visitor for many years, but we welcome news of the outside._";
	text2 = "Despite her cheerful greeting, she glances over her shoulder as she speaks. Something is clearly wrong.";
	text5 = "Thena smiles at you as she waits for your next question.";
	action = INTRO;

begintalknode 21;
	state = 10;
	personality = 522;
	nextstate = 10;
	condition = 1;
	question = "What is this place?";
	text1 = "_This is the Temple of Sothana,_ she replies. _We are the followers of the goddess, living here away from the world in contemplation and meditation. We keep the ancient festivals and rites intact from the wear of time._";
	text2 = "She adds, _We also preserve the ancient knowledge of Sothana with our bards. They recite the poems and histories of old at each festival and holiday, with the greatest performance always being of the Khalthanad, of course._";

begintalknode 22;
	state = 10;
	personality = 522;
	nextstate = 10;
	condition = get_flag(52,13) == 1;
	question = "One of the houses on the west part of town looks funny.";
	text1 = "_It is very old,_ Thena says, _and none of us have ever been able to get the door open. We think that it is best for us simply to leave it alone. I would be interested to know what is in it, were someone to find out, though._";
	text2 = "You tell her what you found in there. She frowns. _That makes no sense to me. I don't know anything about the sliths being servants to anyone in ancient times. The vahnatai lived in small city-states before the coming of Khalthas._";
	text3 = "She frowns deeper. _And a cult of Hathnazriakh, here? That is abhorrent!_ She cuts off abruptly. _It is... not unthinkable, though._ Before you can ask her what she means, she says meaningfully, _Speak with Sasha._";
	text4 = "She frowns deeper. _And a cult of Hathnazriakh, here? That is abhorrent!_ She cuts off abruptly. _It is... not unthinkable, though, as we learned all too well recently. The dark goddess must have some connection with this location._";
	code =
	if (get_flag(52,7) == 0) {
		remove_string(2);
		remove_string(3);
		remove_string(4);
		}
	else {
		remove_string(1);
		if (get_flag(52,3) != 0)
			remove_string(3);
		else
			remove_string(4);
		set_flag(54,6,1);
		set_flag(52,12,1);
		}
break;

begintalknode 23;
	state = 10;
	personality = 522;
	nextstate = 10;
	condition = 1;
	question = "(Tell her your story.)";
	text1 = "She listens intently to all of it. _You have come from the land of the exiles?_ she repeats in surprise when you have finished. _How strange! But the gods work in mysterious ways. Perhaps this foreshadows a great change in the lives of all sliths._";
	text2 = "She shrugs. _We here will continue to live as we always have, though, keeping the ancient ways. We will never change._";

begintalknode 24;
	state = 10;
	personality = 522;
	nextstate = 10;
	condition = 1;
	question = "Why does everyone here look nervous about something?";
	text1 = "Thena frowns darkly and glances over her shoulder again. Quietly, she replies, _Speak with Sasha. She is in the temple. I can say nothing._";
	text3 = "Thena frowns. _Our leader was seduced by a dark goddess. It will be a long time before we humble followers recover._";
	code =
	set_flag(54,6,1);
	if (get_flag(52,3) == 0)
		remove_string(3);
	else
		remove_string(1);
break;

// *** Iakhthoss ***

begintalknode 30;
	state = -1;
	personality = 523;
	nextstate = 15;
	condition = 1;
	question = "Iakhthoss";
	text1 = "This slith walks around the feast room cheerfully, greeting each slith, carrying a bread knife in one hand and a salt shaker in the other, asking each how the food is.";
	text5 = "Iakhthoss idly eats a small piece of bread as he waits for your next question.";
	action = INTRO;

begintalknode 31;
	state = 15;
	personality = 523;
	nextstate = 15;
	condition = 1;
	question = "Did you cook this food?";
	text1 = "_Yes,_ he replies. _I cook often for everyone. People seem to like it. I prepare greens as well as anyone here._";
	text2 = "Seeing your surprised look, he adds, _You are not accustomed to seeing sliths eat vegetables, are you? We do eat meat, but we have so few animals that we cannot eat it much. We sacrifice on holidays, and we eat only the holy meat produced in sacrifice._";

begintalknode 32;
	state = 15;
	personality = 523;
	nextstate = 15;
	condition = 1;
	question = "Are you a priest of Sothana?";
	text1 = "_I am a humble believer,_ he replies. _I have not gone through the rites to be a true initiate, but I worship the goddess, as does everyone else here._";
	text2 = "He laughs and adds, _We don't have much choice anymore; we could not stop worshipping her, or else we would have to leave, and the river is too dangerous to travel now. But I do believe, and most of the rest of us do, too._";

begintalknode 33;
	state = 15;
	personality = 523;
	nextstate = 15;
	condition = 1;
	question = "What is making everyone so nervous?";
	text1 = "He hushes you sharply. _Shh! Not so loud,_ he says softly. _If you want to know about that, speak to Sasha._";
	text3 = "He replies quietly, _It does not do to speak too loudly of it, but many are concerned about the fate of our leader. He was the most devout among us, yet he was consumed by evil. The dark gods are strong, indeed._";
	code =
	set_flag(54,6,1);
	if (get_flag(52,3) == 0)
		remove_string(3);
	else
		remove_string(1);
break;

// *** Veinor ***

begintalknode 40;
	state = -1;
	personality = 524;
	nextstate = 20;
	condition = 1;
	question = "Veinor";
	text1 = "This slith, head bowed, prays softly at a gravestone. He hears you approach and turns his head to see you. He carries a large sword in his hand, one with intricate designs along the pommel. His muscular arm bears the weight freely.";
	text5 = "Veinor turns his sword in his hand as he waits for your next question.";
	action = INTRO;

begintalknode 41;
	state = 20;
	personality = 524;
	nextstate = 20;
	condition = 1;
	question = "Who are you?";
	text1 = "_My name is Veinor, and I am a warrior. From time to time, this temple faces enemies, barbarians who have journeyed far from the river to find prey, and I lead the defense against them._";
	text2 = "He adds, _We have not, Sothana be praised, faced an invasion in years, but we must always be ready._";

begintalknode 42;
	state = 20;
	personality = 524;
	nextstate = 20;
	condition = 1;
	question = "Whose grave is that?";
	text1 = "It is the grave of my mentor, the great warrior Kanthiloss. He died seven years ago today, and I commend his spirit to the great goddess of battle, Sothana. She must have received him with honor into the afterlife._";
	text2 = "His voice quivers slightly and he falls silent. You can tell that he misses his fallen friend.";

// *** Sasha ***

begintalknode 50;
	state = -1;
	personality = 525;
	nextstate = 25;
	condition = 1;
	question = "Sasha";
	text1 = "This slith is washing her hands in the basin in front of her. She wears an expression of placid calm, and she watches you approach. She wears a small ankh on a chain around her neck.";
	text5 = "Sasha dries her hands as she waits for your next question.";
	action = INTRO;

begintalknode 51;
	state = 25;
	personality = 525;
	nextstate = 25;
	condition = 1;
	question = "Who are you?";
	text1 = "_My name is Sasha,_ she replies. _I am the Assistant Chief Priestess of this temple, Guardian of the Mysteries, and Preserver of the Traditions._";

begintalknode 52;
	state = 25;
	personality = 525;
	nextstate = 25;
	condition = 1;
	question = "What is this room?";
	text1 = "_This is the largest room of worship in the temple. Here we gather on some feast-days for guided prayer and discussion of community matters. All issues are discussed here, with the blessing of the goddess of wisdom._";

begintalknode 53;
	state = 25;
	personality = 525;
	nextstate = 25;
	condition = (get_flag(54,6) == 1) && (get_flag(52,3) == 0);
	question = "I've been wondering why everyone is so uncomfortable, and I was told to talk to you.";
	text1 = "She frowns. _Yes, you have come to the right person. Our leader, Zektoth, the Chief Priest of this temple, has vanished. Rumors have been going around that he has been seduced by a dark god, perhaps Vorthak the Devourer or Hathnazriakh the Temptress._";
	text2 = "She continues, _In any case, no one has been sure what to say or do. Please help us. If he truly has been lost to evil, slay him. Discover also how it happened; we must know. If he has not been lost, at least tell us where he is and why he has gone._";
	text3 = "She reaches into her pocket. _His room is the one in the northwest, and I think that it is the best place to start looking. Here is the key to it._ She hands you a small, bronze key.";
	text4 = "She adds, _I would seek him myself, but I am not a fighter. If he is evil, I have not the strength to defeat him._";
	code =
	if (get_flag(54,8) == 1)
		remove_string(3);
	else
		change_spec_item(8,1);
	toggle_quest(16,1);
	set_flag(54,8,1);
break;

begintalknode 54;
	state = 25;
	personality = 525;
	nextstate = 25;
	condition = get_flag(52,3) == 1;
	question = "I killed Zektoth. (Tell her what happened.)";
	text1 = "She looks horrified as you describe your encounter with Zektoth. _Did you find out what drove him to such evil?_ she asks. You tell her about what you read in his records, and she gasps.";
	text2 = "_He was seduced by Hathnazriakh?_ she exclaims. _How foul! How vile!_ She shakes her head. _Sothana grant us patience and wisdom, patience to await the truth, and wisdom to know it once we see it._";
	text3 = "She opens a secret compartment in the wall before her, and she pulls out a large chestplate. She gives it to you. _You have done us good service in dark times, for which we can give you this reward. Let the protection of Sothana be with you always._";
	text5 = "_Yes,_ she says. _You did a good deed for us. Let the protection of Sothana be with you always._";
	text7 = "She looks horrified as you describe your encounter with Zektoth. _Did you find out what drove him to such evil?_ she asks. When you admit that you didn't, she frowns. _There must be an answer down there. I cannot rest until I know what it is._";
	code =
	clear_strings();
	if (get_flag(53,3) == 0)
		add_string(7);
	else {
		if (get_flag(52,10) == 0) {
			add_string(1);
			add_string(2);
			add_string(3);
			toggle_quest(16,0);
			award_party_xp(90,100);
			set_flag(52,10,reward_give(481));
			}
		else
			add_string(5);
		}
break;