// TOWN DIALOGUE SCRIPT
//    Town 30: Shrine of Crystals

begintalkscript;

variables;

short i,j,k,r1,choice;

// Lorta-Bok

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Lorta-Bok";
	text1 = "You approach one of the Crystal Souls. You sense the intelligence resting within the stone, and you think that it is paying attention to you. You hear a soothing voice in your mind. _I am Lorta-Bok, aged guide to my people._";
	text5 = "The Crystal Soul Lorta-Bok sits there silently, waiting for you to speak.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What is your purpose here?_";
	text1 = "_I am a historian. Simply observing my people keeps me interested. We vahnatai are a long-lived people. Because of our great spans of life, we tend to forget things._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_How can you be forgetful?_";
	text1 = "_Think of things you did ten, fifteen years ago, things you did when you were but five of your years. Things we did when we were a hundred seem that way to us when we are four hundred._";
	text2 = "_We have much more to remember, but our memories are no better than yours. But my memory is strong. I record what my people have done and where we have been. Tedious to you, priceless to us._";

begintalknode;
	state = 1;
	nextstate = 3;
	question = "_How old are you?_";
	text1 = "_I lived 524 years before I shed my physical form. A cruel accident took me. I served as Bok for 200 years, and should have had 200 more._";
	text2 = "_And think. I came close to destruction. I had fortune._";
	
begintalknode;
	state = 3;
	nextstate = -1;
	question = "_What kind of accident?_";
	text1 = "_Bad mushrooms. I choose not to speak of it._";

begintalknode;
	state = 3;
	nextstate = -1;
	condition = 1;
	question = "_What almost happened to you?_";
	text1 = "_When the Empire attackers came, I did not submit. I fought. The attackers broke down my defenses. They shattered me._";
	text2 = "_Then they seized three others, and they left. From this luck, I lived. It was good fortune, only, that saved me._";

// Wilvron-Bok

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 28;
	question = "Wilvron-Bok";
	text1 = "You approach the crystal. You hear a voice in your mind _Come closer, visitor. You are welcome here. Who are you?_";
	text2 = "It takes a moment to pick your identity out of your brain. _Greetings. I am Wilvron-Bok, a teacher of the vahnatai people._";
	text5 = "The Crystal Soul Wilvron-Bok sits there, waiting for you to speak. Occasionally, you hear a whisper as it trades some information with the other Souls.";
	action = INTRO;

begintalknode;
	state = 28;
	nextstate = 29;
	question = "_What did you teach?_";
	text1 = "_In life I was exceptionally skilled in magic, even for a Bok. In this form, I choose to teach the magic I learned in life._";

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_You mean you still teach magic?_";
	text1 = "_Yes, beings pilgrimage to see me. It is a great honor to them, and to me. In return, if they are worthy, I show them spells._";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_It must be difficult to travel the vahnatai lands these days._";
	text1 = "_The journey is long, and not all are allowed to make it. It is also dangerous, and it honors me that souls would risk the hellhounds and other beasts to obtain my spells._";

begintalknode;
	state = 31;
	nextstate = -1;
	question = "_I also have traveled a long way. I would be honored if you would teach me a spell._";
	text1 = "_You have been given a quest. You have been sent to recover the stolen Crystal Souls. Return them to their platforms, and I will share with you the sacred magic of the vahnatai people._";
	action = SET_SDF 30 18 1;

begintalknode;
	state = 28;
	nextstate = -1;
	condition = gf(30,15) >= 1 && gf(30,18) > 0;
	question = "_I have returned Vyvnas-Bok to its home. Will you teach me a spell?_";
	action = END_TALK;
	code =
	run_hardcode(11);
	break;

begintalknode;
	state = 28;
	nextstate = -1;
	condition = gf(30,16) >= 1 && gf(30,18) > 0;
	question = "_I have returned Jekknol-Bok to its home. Will you teach me a spell?_";
	action = END_TALK;
	code =
	run_hardcode(12);
	break;

begintalknode;
	state = 28;
	nextstate = -1;
	condition = gf(30,17) >= 1 && gf(30,18) > 0;
	question = "_I have returned Caffren-Bok to its home. Will you teach me a spell?_";
	action = END_TALK;
	code =
	run_hardcode(13);
	break;

begintalknode;
	state = 28;
	nextstate = -1;
	question = "_Why is there a 'Bok' at the end of your name?_";
	text1 = "_It is a great and powerful vahnatai honorific, only given to the wisest of our kind, and to Crystal Souls._";

// Eos-Bok

begintalknode;
	tag = 50;
	state = -1;
	nextstate = 55;
	question = "Eos-Bok";
	text1 = "You approach the Crystal Soul. It inspects you. You sense that it is magically reading your mind. You can only hope it finds nothing objectionable.";
	text2 = "Finally, it says _Greetings, humans. I mean you no harm if you mean me no harm. I am Eos-Bok._";
	text5 = "The Crystal Soul Eos-Bok sits there, waiting patiently for you to speak. You occasionally feel a ticklish sensation in your mind, as if the being is still reading the stray thought or two.";
	action = INTRO;

begintalknode;
	state = 55;
	nextstate = 56;
	question = "_Why did you read my thoughts?_";
	text1 = "_I must protect myself, as I have great importance to my people._";

begintalknode;
	state = 56;
	nextstate = -1;
	question = "_Protect yourself from Avernites?_";
	text1 = "_From all outsiders. All of us Crystal Souls had great powers in life, and those powers have increased since. Humans took us by surprise once. It will not happen again._";

begintalknode;
	state = 55;
	nextstate = 59;
	question = "_What is your purpose here?_";
	text1 = "_It is my purpose. I dispense justice._";

begintalknode;
	state = 59;
	nextstate = 57;
	question = "_So you are a judge?_";
	text1 = "_Not entirely. When a problem is too thorny for living Boks to deal with, they turn to me for impartial judgment. This only happens rarely, though. What happens more often is that a criminal comes to me to confess and receive my punishment._";

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_What sort of punishments do you give?_";
	text1 = "_When one wants to confess privately, they may be punished by me. If the living then learn of the crime, the criminal has atoned. I have thieves return goods, slanderers return the truth, and murderers spend their lives trying to undo their harm._";
	text2 = "_When one truly wants to atone, I help them do it in the best possible way. It has only failed once._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_What happened that one time?_";
	text1 = "_Just before the last Resting, centuries past, a thief told me he stole a ring, felt guilty, hid it behind a stalagmite outside, and came in for atonement. I told him to return it to the owner and confess to her. He couldn't face the shame of doing so._";
	text2 = "_He left the shrine, the caves, and the tribe. He never returned. Sad. He was young. He didn't deserve the results of his weakness._";

// Aichael-Bok

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 82;
	question = "Aichael-Bok";
	text1 = "There is a Crystal Soul here. When you get close, you hear, in your mind, _Approach, and kneel._";
	text2 = "Before you can think about it, you find yourself kneeling. _I am called Aichael-Bok. Welcome. You may rise._ Unnerved, you do so.";
	text5 = "The Crystal Soul Aichael-Bok sits there, waiting patiently for you to speak. It hums quietly, a soft, musical chiming sound. When you are close to it, you concentrate on keeping the thing from controlling you.";
	action = INTRO;

begintalknode;
	state = 82;
	nextstate = 83;
	question = "_What do you do for the vahnatai?_";
	text1 = "_I continue to ponder what I pondered for two centuries before the Resting. I think on the nature of our beings._ Its voice sounds like music. The words chime like pure notes.";

begintalknode;
	state = 83;
	nextstate = -1;
	question = "_Do you also rest during the 'Resting'?_";
	text1 = "_We partake of the Resting too, but differently. Our minds slow down._";

begintalknode;
	state = 83;
	nextstate = 84;
	question = "_Have you come to any conclusions?_";
	text1 = "_We are not crystals with souls inside them. Our spirits, when they return from the beyond, create crystal around us from nothingness. It is strange, though. It would seem possible to create a flawed crystal._";

begintalknode;
	state = 84;
	nextstate = 85;
	question = "_Are many flawed?_";
	text1 = "_Our spirits return from the beyond with the help of the living vahnatai, who call us with long, elaborate rituals. However, two of the Crystal Souls brought back were flawed._";
	text2 = "_Poor Dahris-Bok, and poor Delrin-Bok. If only they could be healed._";

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_What are the elaborate rituals like?_";
	text1 = "_I will not tell you of them, for they are secretly performed on the island in the middle of this dome._";

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_What went wrong with Dahris-Bok?_";
	text1 = "_He could not stand our presence and demanded to be moved to a crypt in the lake region. He would give advice to the living in return for tribute, but if he did not get tribute, he would become angry and hostile._";
	text2 = "_Sad and ungraceful. But at least he helped his people, unlike Delrin._";

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_What happened to Delrin-Bok?_";
	text1 = "_Delrin-Bok formed with a flaw. He blamed the living for it, claiming that it scattered his thinking. It was nobody's fault, though. It just happened. Still, it did scatter his thinking. He went mad, and had to be removed for all our sakes._";
	text2 = "_The poor soul lives to the west, in the spore caverns. Avoid him. He is very deranged and very dangerous._";

begintalknode;
	state = 82;
	nextstate = 86;
	condition = 1;
	question = "_How did you control me?_";
	text1 = "_I did not,_ it says, in its musical voice. _I only gave you a good suggestion, and you wisely accepted it._";

begintalknode;
	state = 86;
	nextstate = 82;
	condition = 1;
	question = "_That is reasonable._";
	text1 = "_Of course. I am nothing but reasonable._";

begintalknode;
	state = 86;
	nextstate = 82;
	condition = 1;
	question = "_Do not do it again._";
	text1 = "You start to speak, but then you decide not to.";

// Vyvnas-Bok

begintalknode;
	tag = 90;
	state = -1;
	nextstate = 109;
	question = "Vyvnas-Bok";
	text1 = "You stand in the presence of a Crystal Soul you returned. _Welcome, humans! I am glad at your presence. I am Vyvnas-Bok._ Its voice is very friendly. It soothes you.";
	text5 = "The Crystal Soul Vyvnas-Bok sits there, waiting patiently for you to speak. You feel the warmth of its gratitude. Being near it is comforting. So much so, that you don't want to leave.";
	action = INTRO;

begintalknode;
	state = 109;
	nextstate = 110;
	question = "_I hope you are doing well._";
	text1 = "_Yes. Many thanks to you. Right now, I prepare for battle._";

begintalknode;
	state = 110;
	nextstate = 111;
	question = "_Preparing for battle?_";
	text1 = "_Some of us spend all our centuries in this form in the shrine, gathering and dispensing knowledge. Some of us, on the other hand, become more active._";

begintalknode;
	state = 111;
	nextstate = 112;
	question = "_How active are you about to be?_";
	text1 = "_Some of us are carried into battle. We cast our spells to fight our enemies. There are legendary tales of battles between Crystal Souls, in the name of their tribes. At this point, it does not fall to me to gather information._";

begintalknode;
	state = 112;
	nextstate = -1;
	question = "_Why won't you gather information?_";
	text1 = "_I do not disparage such pursuits. They are as valuable in times of strife, sometimes more so. However, there must always be those who go out to actually fight. Soon, this is what I will do._";

begintalknode;
	state = 109;
	nextstate = -1;
	question = "_Are you recovering well from your imprisonment?_";
	text1 = "_I suffered no damage to recover from. Fortunately, my captors were not able to affect my stability. I was fortunate._";

begintalknode;
	state = 109;
	nextstate = -1;
	condition = 1;
	question = "_Being near you feels ... pleasant._";
	text1 = "_Yes. Bask in my energy. Let me touch you. Then go forth. You must fight our common enemies._";

// Jekknol-Bok

begintalknode;
	tag = 110;
	state = -1;
	nextstate = 136;
	question = "Jekknol-Bok";
	text1 = "As you approach Jekknol-Bok, disembodied flickers of words pass through your head like ghosts. Finally, it says _No._ The word drags slowly through your mind. It hurts.";
	text5 = "As you stand near Jekknol-Bok, it feels like someone is playing soft, discordant music inside your mind. A low, scraping sound. It's a very uncomfortable sensation.";
	action = INTRO;

begintalknode;
	state = 136;
	nextstate = 137;
	question = "_Will you speak to me?_";
	text1 = "_I will not listen._ The voice gives you a headache. You feel very nervous talking to Jekknol-Bok. It feels like it could harm your mind easily if it grew upset.";

begintalknode;
	state = 137;
	nextstate = 138;
	question = "_You don't have to listen. Just talk to me._";
	text1 = "_I saw them die. I saw all my people die. Die slow. All the vahnatai died. The humans could not keep me from seeing. Or maybe they helped. I don't know. You are alien._";

begintalknode;
	state = 138;
	nextstate = 139;
	question = "_Yes, I am an alien, but I saved you._";
	text1 = "_Humans help me. Humans hurt me. None of this is real. My people are dead._";

begintalknode;
	state = 139;
	nextstate = -1;
	question = "_Your people are alive. They are rebuilding their society after the Resting._";
	text1 = "_This is all a lie, all this is simply a lie, a human trick. I have my dignity. I will not let myself believe this is real. I have beaten you. Now leave me. I have no more to say._";

begintalknode;
	state = 136;
	nextstate = 140;
	question = "_Could you be more careful? Your voice is hurting me._";
	text1 = "_Alien! You are alien!_ You back away, wincing. _You must not command me! No more!_";

begintalknode;
	state = 140;
	nextstate = -1;
	question = "_I apologize. I'll stop._ (Back away.)";
	text1 = "Jekknol-Bok starts to screech. It's not a sound. It's a wave of mental energy, intense and powerful. Fortunately, you get out of range, so it just causes agonizing pain.";
	text2 = "The shrine fills with soothing sounds, as the other Crystal Souls attempt to soothe Jekknol-Bok. You get away safely.";
	action = END_TALK;

begintalknode;
	state = 140;
	nextstate = -1;
	question = "_I rescued you. You should stop hurting me._";
	action = END_TALK;
	code =
	run_hardcode(14);
	break;

// Caffren-Bok

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 163;
	question = "Caffren-Bok";
	text1 = "Caffren-Bok's crystal still glows with a vital energy. _I am Caffren-Bok, friends. I am glad that you have returned. You have risked so much to save me._";
	text5 = "Caffren-Bok waits silently for you to speak.";
	action = INTRO;

begintalknode;
	state = 163;
	nextstate = 168;
	condition = 1;
	question = "_Tell me about your imprisonment._";
	text1 = "_It was tedious. The Empire mages came to me and demanded things. The Empire leader Garzahd came to me and demanded things. I refused. I was silent. I was angry._";

begintalknode;
	state = 168;
	nextstate = -1;
	condition = 1;
	question = "_Did they harm you?_";
	text1 = "_Not yet. They were working up to it, trying to find a way to torment me. Then you came. It was fortunate._";

begintalknode;
	state = 163;
	nextstate = 164;
	question = "_What are you engaged in now?_";
	text1 = "_I contemplate Garzahd, leader of the Empire enemy in Avernum._";

begintalknode;
	state = 164;
	nextstate = 165;
	condition = gf(16,11) == 0;
	question = "_How to kill him, I hope._";
	text1 = "_He may have been able to do the impossible. He tried to compel me to use my powers at the front of the Empire army, to fight for them. He must die. I have been working with Rentar-Ihrno towards this aim._";

begintalknode;
	state = 165;
	nextstate = 166;
	question = "_What have you and Rentar-Ihrno decided?_";
	text1 = "_She and I are trying to figure out how one of his power may be slain. We are at a loss._";

begintalknode;
	state = 166;
	nextstate = 167;
	question = "_Perhaps I can help discover a way to slay him._";
	text1 = "_Perhaps you humans may find a way to deal with a human magician. Should you do so, go see Rentar-Ihrno and ask about attacking him. We will give you all the help we can._ (You take note of this.)";
	action = SET_SDF 29 19 1;

begintalknode;
	state = 167;
	nextstate = -1;
	question = "_Where can Rentar-Ihrno be found?_";
	text1 = "_She is hard to reach. She is in the city of Egli. Find her. She may be invaluable in your quest to slay Garzahd._";

begintalknode;
	state = 164;
	nextstate = -1;
	condition = gf(16,11) >= 1;
	question = "_I have slain Garzahd. He is dead._";
	text1 = "Caffren-Bok says nothing. However, you can sense a feeling of great contentment.";

// Ruis

begintalknode;
	tag = 150;
	state = -1;
	nextstate = 190;
	question = "Ruis";
	text1 = "A vahnatai child sits by the fire, looking forlorn and alone. Strangely, she doesn't seem threatened by your presence. She stands and bows. _I am Ruis._ She looks at you with great interest.";
	text5 = "Ruis stands politely at attention. She looks at you with interest. She finds aliens to be very interesting.";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = 191;
	question = "_What are you doing here alone?_";
	text1 = "_I am a pilgrim. I come to see the Crystal Souls._";

begintalknode;
	state = 191;
	nextstate = 192;
	question = "_Why do you need to talk to one of the Crystal Souls?_";
	text1 = "_They give us advice. I'm trying to find out what I should be. Some think I should be a mage, and some a Ponder._";

begintalknode;
	state = 192;
	nextstate = 193;
	question = "_Which would you prefer?_";
	text1 = "She smiles broadly. _They say I'm smart! Some want me to be a mage, and some think I could be wise and think stuff! I don't know, though. That's why I'm here, so the elders can help me._";
	text2 = "_I've been here a week, and still no luck. But I have high hopes! Now I have much to do._";

begintalknode;
	state = 193;
	nextstate = -1;
	condition = 1;
	question = "_Like what?_";
	text1 = "_Like think. The Crystal Souls say they would prefer it if I find the answer for myself._ You leave her alone to her contemplation.";
	action = END_TALK;
	
// Crysa-Te

begintalknode;
	tag = 170;
	state = -1;
	nextstate = 217;
	question = "Crysa-Te";
	text1 = "This vahnatai warrior whips out his waveblade the moment he sees you approach. He doesn't attack, though. You ask who he is. _I am Crysa-Te, vahnatai blademaster, and I am sure to make you die with me!_";
	text5 = "Crysa-Te circles nervously, ready to attack you at the slightest provocation. The vahnatai warrior has not been convinced to trust Avernites.";
	action = INTRO;

begintalknode;
	state = 217;
	nextstate = 218;
	question = "_Hold on there, blademaster. We come in peace._";
	text1 = "_I'm here to see the Crystal Souls! They say that we are protected from Avernites. I am willing to test that statement, if you force me!_";

begintalknode;
	state = 218;
	nextstate = -1;
	question = "_How are the Crystal Souls protected?_";
	text1 = "_They say there are spells for if humans attack someone here again. I believe them, but I don't trust it._";

begintalknode;
	state = 218;
	nextstate = -1;
	question = "_Most Avernites, including us, are peaceful._";
	text1 = "_They say you're not all bad. It's not my place to say. Just stay away!_ He backs away.";
	action = END_TALK;

begintalknode;
	state = 217;
	nextstate = -1;
	question = "_You'd better put that sword away, or you might hurt yourself._";
	text1 = "_My honor now commands that I answer your slight!_";
	action = END_TALK;
	code =
		set_attitude(3008,10);
	break;

// Mentos

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 244;
	question = "Mentos";
	text1 = "You meet a young vahnatai male. He is sitting by his fire reading a scroll. He stands when you approach. _Welcome, humans. Sit by my fire a bit. I am Mentos._ His friendliness, rare among the vahnatai, is refreshing.";
	text5 = "You sit with Mentos, staring into the fire. The peacefulness is refreshing.";
	action = INTRO;

begintalknode;
	state = 244;
	nextstate = 245;
	question = "_Why are you here?_";
	text1 = "_I am a mage in training. I'm here to study with Wilvron-Bok._";

begintalknode;
	state = 245;
	nextstate = 246;
	question = "_What does Wilvron-Bok teach?_";
	text1 = "_He teaches spells to those lucky enough to be sent to him. I am a pilgrim. I came all the way from Mancuso._";

begintalknode;
	state = 246;
	nextstate = 247;
	question = "_Where's Mancuso?_";
	text1 = "_'Twas a long journey. Mancuso is a small village, far to the east. I hope they're doing well without me. I'm their only mage._";
	text2 = "_One day, I'll not be called Mentos, but Mentos-Te. It is my hope._ He proffers several small pieces of vahnatai candy to you.";

begintalknode;
	state = 247;
	nextstate = -1;
	question = "Take a piece of the candy.";
	text1 = " You try one. It's pretty good. It makes your mouth tingle pleasantly. You stare into the fire for a while, relaxing.";
	action = END_TALK;

begintalknode;
	state = 247;
	nextstate = -1;
	question = "Refuse the candy.";
	text1 = "Mentos makes a shrugging motion. You stare into the fire for a while before taking your leave.";
	action = END_TALK;

