// TOWN DIALOGUE SCRIPT
//    Town 1: Lost Bahssikava

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

begintalkscript;

variables;
//int i,j,k,r1,choice;


//*** Skassa ***

begintalknode 1;
	state = -1;
	personality = 11;
	nextstate = 1;
	condition = 1;
	question = "Skassa";
	text1 = "This slith is busy writing in a book. She looks up at you. _Greetings, outsiders,_ she says. _Welcome to the Lost Bahssikava Memorial._";
	text5 = "_How else can I help you?_ she asks.";
	action = INTRO;

begintalknode 2;
	state = 1;
	personality = 11;
	nextstate = -1;
	condition = 1;
	question = "Who are you?";
	text1 = "_My name is Skassa. I am the caretaker of the Memorial. The Prophet himself chose me for this job personally._ She shines with pride.";

begintalknode 3;
	state = 1;
	personality = 11;
	nextstate = 2;
	condition = 1;
	question = "Do you know where Legare is?";
	text1 = "When you say the word, _Legare,_ she looks mildly outraged, but she seems to forgive you. _The Prophet,_ she says, stressing the title, _is in the fort._";

begintalknode 4;
	state = 2;
	personality = 11;
	nextstate = 1;
	condition = 1;
	question = "The fort?";
	text1 = "_The fort,_ she repeats. _It is farther into this tunnel._";

begintalknode 5;
	state = 1;
	personality = 11;
	nextstate = 3;
	condition = 1;
	question = "What is the Lost Bahssikava Memorial?";
	text1 = "_It is for the town that you see around you. This was once a town filled with the most educated and most holy sliths in Avernum. Then the Empire came and slew them all._";
	text2 = "_Rather than cleaning everything up, we left it as it was and built the Memorial so that we would never forget. The Empire has committed crimes against slithkind, but unlike the vahnatai, we have not gone insane with vengeful rage._";

begintalknode 6;
	state = 3;
	personality = 11;
	nextstate = 1;
	condition = 1;
	question = "What did the vahnatai do?";
	text1 = "She sighs. _Let me not dwell on their madness. You may learn the answers to those questions elsewhere. We are here in Lost Bahssikava only to focus on our own atonement._";

begintalknode 7;
	state = 1;
	personality = 11;
	nextstate = 4;
	condition = 1;
	question = "What is this place, this Bahssikava?";
	text1 = "_It is the way home,_ she says reverently. _All three races of this area of Avernum, the sliths, nephils, and humans, are exiles. The nephils and humans are exiles from the surface world._";
	text2 = "_We sliths are exiles from elsewhere._";
	text3 = "_Somewhere beyond the tunnels under Bahssikava lies the slith homeland. It is to the homeland that we wish to go. But we cannot return yet._";

begintalknode 8;
	state = 4;
	personality = 11;
	nextstate = 5;
	condition = 1;
	question = "Why not?";
	text1 = "_We were exiled for worshipping dark gods. This should be familiar to you. The Darklings of Avernum continue in these misguided ways to this day._";
	text2 = "_Powerful priests decreed that we could not return to our homeland until we repented and redeemed ourselves for the evil we had done. The way has been closed to us until now._";

begintalknode 9;
	state = 5;
	personality = 11;
	nextstate = 6;
	condition = 1;
	question = "What happened?";
	text1 = "_Why, the Prophet, of course._ She fairly glows as she speaks about him. _The Goddess revealed to the Prophet the way to redeem ourselves and told him how we could return home._";
	text2 = "_Our punishment, our long exile, is almost over. Soon we will return home. 'To home unknown, unseen, unheard, but not unfelt, unwanted, lov'd....'_ She trails off.";

begintalknode 10;
	state = 6;
	personality = 11;
	nextstate = 1;
	condition = 1;
	question = "What was that?";
	text1 = "_That was part of one of the Prophet's poems._ She sighs rapturously.  _They are beautiful._";
	text2 = "_The Prophet writes such amazing things. The Goddess must show him the most wonderful visions. I can hardly wait for the next time he tells us what she has told him._";

// *** Machrone ***

begintalknode 11;
	state = -1;
	personality = 12;
	nextstate = 7;
	condition = 1;
	question = "Machrone";
	text1 = "This man finishes writing down a note. He looks up at you, and you get a good look at him for the first time. His skin is not pale like an Avernite's; he is from the surface!";
	text2 = "He is younger than you first thought. He must be in his late teens, if that. His bright eyes dart everywhere, taking in every detail, and he writes down anything that he finds interesting.";
	text3 = "_Adventurers!_ he says again. _Pleased to make your acquaintance. You must tell me all about the places you've been and the things you've done and the items you've acquired that don't belong to you._";
	text4 = "_I've been stuck here long enough that I need to get something out of this, at least._";
	text5 = "He makes a note as something occurs to him. _Yes. Interesting,_ he mutters under his breath.";
	action = INTRO;

begintalknode 12;
	state = 7;
	personality = 12;
	nextstate = 8;
	condition = 1;
	question = "What is it that you do?";
	text1 = "_I am a journalist,_ he said. _I witness important events. I interview the people who took part. Then I write articles about them and send them off to my employer, who sells copies of my articles._";
	text2 = "_It's an unusual profession,_ he adds, _but a rewarding one. I have just begun my work. This is my first solo assignment!_";
	action = SET_SDF 1 23 1;

begintalknode 13;
	state = 8;
	personality = 12;
	nextstate = 9;
	condition = 1;
	question = "Why are you here?";
	text1 = "_I am to report on the phenomenon of the Prophet. You see, I am from the surface. My news organization heard of the events here, and the organization decided that these events were so important that they needed a man on the scene._";
	text2 = "_They looked through the organization, and they decided that only one man would suffice: me! Imagine that! They sent me, their most junior reporter, all the way down here to Avernum to cover a story of this importance!_";
	text3 = "_The trip here was rather long, and Legare has been rather uncooperative, but I'm sure that I'll be making headway in no time. Then I'll have some lovely news to report._";

begintalknode 14;
	state = 9;
	personality = 12;
	nextstate = 10;
	condition = 1;
	question = "What troubles have you run into?";
	text1 = "_Well, getting here was hard. I had to take a ship out to Krizsan in southern Valorim, and from there I rode a horse to Fort Emergence in Upper Avernum. Then I rode across the caves to the Portal Fortress._";
	text2 = "_I waited for my turn to use the portal. When it came, I teleported down to the newly rebuilt Tower of Magi in southeastern Avernum. I walked up to Silvar, and then I took a boat out west and then north up to here._";
	text3 = "_And now that I'm here, I've waited a week just to speak with Legare. Kass tells me that any day now, the Prophet will spare a few moments of his precious time to speak with me._";

begintalknode 15;
	state = 10;
	personality = 12;
	nextstate = 7;
	condition = 1;
	question = "Have you learned anything interesting about the situation here?";
	text1 = "_Why, yes! I have. I have learned that the sliths here are from all possible places of origin. Many are from Gnass. A few grew up in human cities. At least one tribe is from the Honeycomb, and there's even a tribe from the Waterfall Warrens!_";
	text2 = "_There is a kind of stratification of power among them, though. The Gnass sliths occupy many more positions of power than, for example, the Waterfall Warrens sliths. Kass, Legare's second-in-command, is from Gnass._";
	text3 = "_So far, I haven't seen any resentment among the various tribes for this treatment. Legare has managed to unify them under his religion, but the tribal rivalries are underneath the surface, waiting to emerge._";

begintalknode 16;
	state = 7;
	personality = 12;
	nextstate = -1;
	condition = 1;
	question = "I haven't acquired any items that don't belong to me.";
	text1 = "_Sure,_ he says, chuckling. _That's what they all say._";

// *** Phaedra ***

begintalknode 17;
	state = -1;
	personality = 13;
	nextstate = 11;
	condition = 1;
	question = "Phaedra";
	text1 = "Before you stands a confident woman, probably somewhere in her late twenties. She is human!";
	text2 = "She also radiates power. For someone so young, she has achieved great magical strength. She is an impressive physical specimen, too. Somehow she has managed to combine weapons skills with magical and priestly ability.";
	text3 = "_Hello,_ she says. _I am Phaedra._";
	text5 = "Phaedra waits for your next question.";
	action = INTRO;
	code =
	set_flag(1,22,1);
break;

begintalknode 18;
	state = 11;
	personality = 13;
	nextstate = 12;
	condition = get_flag(250,0) != 4;
	question = "What are you doing here? You're a human!";
	text1 = "_I am not the only non-slith here,_ she says, with a nod to your party. _Other than us, a human named Machrone is also here. Bahssikava holds secrets of interest not only to sliths, but to all races.";

begintalknode 19;
	state = 11;
	personality = 13;
	nextstate = 12;
	condition = get_flag(250,0) == 4;
	question = "What are you doing here? You're a human!";
	text1 = "_I am not the only non-slith here,_ she says, noticing that your party does not consist of non-sliths. _A human named Machrone is also here. Bahssikava holds secrets of interest not only to sliths, but to all races.";

begintalknode 20;
	state = 12;
	personality = 13;
	nextstate = 11;
	condition = 1;
	question = "What sort of secrets?";
	text1 = "_Secrets of the past,_ she says. _I read an account written by a member of the party that assassinated Emperor Hawthorne twenty years ago. That party, before the assassination, came here. They went into the tunnels below._";
	text2 = "_They found ancient ruins below Lost Bahssikava, ruins clearly built by sliths, but ruins of buildings that were skillfully constructed. The sliths of Avernum are not natural architects; the few who can build learned the skill from humans._";
	text3 = "_But these sliths who came through Lost Bahssikava already had the skill. It is my belief that the sliths of the homeland are tremendously advanced, perhaps even beyond the vahnatai in magical skill. They would know much useful to learn._";
	action = SET_SDF 1 19 1;

begintalknode 21;
	state = 11;
	personality = 13;
	nextstate = 13;
	condition = 1;
	question = "What do you do for a living?";
	text1 = "_I am an adventurer, just like you._ She thinks and adds, _I've been around and seen many strange things. I can identify your items for you, if you want._";

begintalknode 22;
	state = 13;
	personality = 13;
	nextstate = 11;
	condition = get_flag(250,1) > 1;
	question = "But where's your party?";
	text1 = "_I adventure by myself._ She smiles. _I suppose I prefer not to rely on anyone else for aid. I can wield magic and use a sword; what else do I need?_";
	text2 = "_Fighting by myself has allowed me to gain great power over a short period of time._ Looking at her, you can't argue.";

begintalknode 23;
	state = 13;
	personality = 13;
	nextstate = 11;
	condition = get_flag(250,1) == 1;
	question = "I see you adventure alone, like I do.";
	text1 = "_Yes._ She smiles. _I suppose I prefer not to rely on anyone else for aid. I can wield magic and use a sword; what else do I need?_";
	text2 = "_Fighting by myself has allowed me to gain great power over a short period of time. But I'm sure you understand as well as I do the advantages of working alone._";

begintalknode 24;
	state = 11;
	personality = 13;
	nextstate = 14;
	condition = get_flag(0,17) == 1;
	question = "Are you the daughter of Justin and Rita?";
	text1 = "_Why, yes!_ she says, beaming. _How did you know?_";

begintalknode 25;
	state = 14;
	personality = 13;
	nextstate = 11;
	condition = 1;
	question = "The librarian in the Temple of the Goddess told me.";
	text1 = "_Oh! Ethass. I have known her for a long time. My father and mother used to let me play with her when I was little and we visited Gnass. She even taught me a little of the slith tongue._";
	text2 = "_Yes, my dear father and mother were Justin and Rita. They passed away recently, but I try to honor their memory by living as they would have had me live: learning as much as I can about the world and making a difference while I'm doing it._";
	action = SET_SDF 1 6 1;

begintalknode 26;
	state = 11;
	personality = 13;
	nextstate = 15;
	condition = 1;
	question = "Have you met Legare?";
	text1 = "_Ah, yes, the Prophet._ She allows herself a sly smile. _He is an interesting fellow._";

begintalknode 27;
	state = 15;
	personality = 13;
	nextstate = 16;
	condition = get_flag(1,6) == 1;
	question = "How so?";
	text1 = "_He is the most intense slithzerikai I have ever met. My parents brought me with them on all of their travels. I have met all sorts of beings._";
	text2 = "_I spoke with Empress Prazac, the dragons Motrax and Sulfras, the incantrix Erika, King Micah, and many other powers._";
	text3 = "_But Legare reminds me of no one quite so much as Rentar-Ihrno._";

begintalknode 28;
	state = 15;
	personality = 13;
	nextstate = 11;
	condition = get_flag(1,6) == 0;
	question = "How so?";
	text1 = "_Oh, just that he is complicated,_ she says evasively.";
	text2 = "She is probably right not to say anything more to someone whom she doesn't know very well. If you got to know her better, though, she might have some interesting information for you.";

begintalknode 29;
	state = 16;
	personality = 13;
	nextstate = 17;
	condition = 1;
	question = "Rentar-Ihrno?";
	text1 = "_Yes. The mighty vahnatai archmage. I met her once before she disappeared. And her passion, her awesome power and her willingness to use that power in any way necessary to achieve her goals, and her raw charisma were much the same as this Legare._";
	text2 = "_I realize the seriousness of what I am saying, and you should, too. You are supposed to meet with him, correct?_";

begintalknode 30;
	state = 17;
	personality = 13;
	nextstate = 11;
	condition = 1;
	question = "Yes.";
	text1 = "_Listen carefully, then. Legare is obsessed with finding the way back to the slith homeland. He will stop at nothing, I think. I have found no sign that he is dangerous yet, but the moment that I do, I am under orders to report back to Fort Dranlon._";
	text2 = "_If you should at some point notice that I am gone without warning, it means that I have gone to seek reinforcements. It would be best for you to get well away from here before then, because I will return with an army, and we will subdue these sliths._";
	text3 = "Something about the way she says the word _subdue_ leaves no doubt as to what she means. Legare had better not give Phaedra any reason to believe that he is dangerous.";
	action = SET_SDF 1 7 1;

// *** Kass 1 ***

begintalknode 31;
	state = -1;
	personality = 14;
	nextstate = 18;
	condition = 1;
	question = "Kass";
	text1 = "_Welcome to Bahssikava,_ Kass says. _I am sure you have many questions for me, and I have much that I must tell you, too._";

begintalknode 32;
	state = 18;
	personality = 14;
	nextstate = 19;
	condition = 1;
	question = "This place is a disaster area!";
	text1 = "_It is rather devastated,_ Kass agrees. _However, it is a historical landmark. The sliths who lived here were the first Darklings to repent._";

begintalknode 33;
	state = 18;
	personality = 14;
	nextstate = 18;
	condition = 1;
	question = "Aren't you supposed to be back at the Temple of the Goddess?";
	text1 = "He chuckles. _I was only there to greet you. Once I had done that, I returned here, where I carry out the Prophet's orders with the greatest efficiency I can._";
	text2 = "He adds, _I know a few secret passages of which I make use regularly. You took the long way here._";

begintalknode 34;
	state = 19;
	personality = 14;
	nextstate = 18;
	condition = 1;
	question = "What are Darklings?";
	text1 = "_Darklings are the sliths of Avernum who persist in the evil ways that got them exiled to Avernum in the first place._";
	text2 = "_It is time for you to learn a little of our history._";
	action = SET_SDF 1 9 1;

begintalknode 35;
	state = 18;
	personality = 14;
	nextstate = -1;
	condition = get_flag(1,9) == 1 && get_flag(1,11) == 0;
	question = "Tell me about the history of the sliths.";
	text1 = "_Come and sit in these chairs, and I will tell you the story._ You do.";
	code =
	set_flag(1,11,1);
	end();
break;

// *** Kass 2 ***

begintalknode 36;
	state = -1;
	personality = 14;
	nextstate = 20;
	condition = 1;
	question = "Kass";
	text1 = "Kass stands in front of the door, watching you.";

begintalknode 37;
	state = 20;
	personality = 14;
	nextstate = -1;
	condition = 1;
	question = "What was my mission again?";
	text1 = "_In the tunnels below are two huge steel doors. The Prophet needs to get to them so that he can open them, and so that we can go through them._";
	text2 = "_The way is blocked by monsters. He needs you to clear it._";
	text3 = "_If at any point you cannot continue, come back here for further instructions._";

begintalknode 38;
	state = 20;
	personality = 14;
	nextstate = -1;
	condition = 1;
	question = "Where are these tunnels with the monsters?";
	text1 = "_There is a secret passage in the southeast corner of this room. Go through there. Be warned: the lizards will attack you almost as soon as you step through._";
	text2 = "_No one has been down in those tunnels in twenty years -- the Prophet took an alternate route out -- and the paths were in questionable condition even two decades ago._";
	action = SET_SDF 1 10 1;

begintalknode 39;
	state = 20;
	personality = 14;
	nextstate = -1;
	condition = 1;
	question = "So where is Legare? Can I speak to him?";
	text1 = "_The Prophet's health is precarious at times. He has fallen ill at the moment and cannot speak to any visitors._ He adds under his breath, _Certainly not that fool Machrone._";
	text2 = "Louder, he says, _The Prophet has authorized me to give you this mission in his stead._";
	action = SET_SDF 1 24 1;

begintalknode 40;
	state = -1;
	personality = 15;
	nextstate = 21;
	condition = 1;
	question = "Gatekeeper";
	text1 = "A slith stands here watching the gate. He looks at you carefully, and he seems to recognize you.";

begintalknode 41;
	state = 21;
	personality = 15;
	nextstate = -1;
	condition = get_flag(250,1) == 1;
	question = "Do you know who I am?";
	text1 = "_Sss. Yesss. You are the one the Prophet said was coming._";

begintalknode 42;
	state = 21;
	personality = 15;
	nextstate = -1;
	condition = get_flag(250,1) > 1;
	question = "Do you know who we are?";
	text1 = "_Sss. Yesss. You are the ones the Prophet said were coming._";

begintalknode 43;
	state = 21;
	personality = 15;
	nextstate = -1;
	condition = get_terrain(2,8) == 65;
	question = "Will you open the gates?";
	text1 = "_You may pass._";
	code =
	flip_terrain(2,8);
	flip_terrain(2,9);
	play_sound(99); 
break;

// More Machrone

begintalknode 44;
	state = 7;
	personality = 12;
	nextstate = 7;
	condition = get_flag(1,24) == 1;
	question = "I don't think you're going to get to talk to Legare.";
	text1 = "_Why not?_ he asks, curious. You explain that Kass said that he would certainly not let _that fool_ Machrone talk to Legare.";
	text2 = "When you are done, Machrone smiles. _Well, I came all this way to get a story. I can't just go back empty-handed. Even if I don't get to speak to Legare personally, there is still the fact that this is an expedition of tremendous historical importance._";
	text3 = "He looks not the least bit dismayed.";
	
// More Phaedra

begintalknode 45;
	state = 11;
	personality = 94;
	nextstate = 11;
	condition = 1;
	question = "Can you identify my items?";
	text1 = "_Sure thing. Only 5 coins per item._.";
	action = ID 5;