// TOWN DIALOGUE SCRIPT
//    Town 8: The Castle

begintalkscript;

variables;

short i,j,k,r1,choice;

begintalknode;
	tag = 1;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "The largest, nastiest soldiers in the Avernite front are sent to the Castle. The Empire has shown, time and again, its ability to launch unexpected, lethal raids deep in your territory. The Castle is prepared.";
	text2 = "The guards have heard of your accomplishments, but they are surprisingly unimpressed by them. They nod as you pass, but they exclude you from conversation. The royal guard is a powerful bunch, but arrogant.";
	text3 = "The guards are an arrogant bunch, but your level of fame and rank is too high for even them to ignore. They nod with respect as you pass.";
	code =
		if (has_spec_item(26) > 0)
			rs(2);
			else rs(3);
	break;
	
	begintalknode;
	tag = 2;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "King Micah, leader of Avernum, has fallen. It doesn't take long for news of this disaster to spread through the Castle and for you to take the blame.";
	text2 = "Alas, the many soldiers outside the Castle soon pour inside and overwhelm you.";
	code =
		erase_char(30000);
	break;
	

// King Micah

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "King Micah";
	text1 = "Micah, revered king of Avernum, stands before you. In the earliest days of Avernum, his calm guidance helped the stunned exiles tame the underworld. Eventually, the Council chose him as the figurehead for your land.";
	text2 = "When you approach, he extends a hand to you. _Greetings, soldier! I am King Micah. I have been waiting for your journey to bring you before us. Your actions in defense of our land benefit us all._";
	text5 = "Micah waits to see what else you have to say. Now that you are getting a longer look, you can see the weariness in his eyes. He is a large man, but the pressure of his responsibilities is crushing him.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(8,11) == 0;
	question = "_It is an honor to meet you, sire. How can I be of assistance?_";
	text1 = "He shakes his head sadly. _Some years ago, a small band came to the defense of Avernum in a time of great trial. Where our armies could not succeed, these heroes did. They are gone now, and nobody knows where they went._";
	text2 = "_Now, once again, we struggle for survival. I am working on plans to defend our ravaged land. And I try to figure out how to defeat our nemesis._";
	action = SET_SDF 8 11 1;

begintalknode;
	state = 1;
	nextstate = 2;
	condition = gf(8,11) >= 1;
	question = "_What brought the Empire's wrath upon Avernum?_";
	text1 = "_Once Erika killed Emperor Hawthorne, curse her, the Empire really had no choice but to attack. I can't blame them. Such a provocation was intolerable._";
	text2 = "_The Empire is bringing more and more troops down here. The process is slow but inexorable. They may well wipe us out. They don't have much land now, but they're building their strength._";
	text3 = "_They have one leader, one powerful scourge who works day and night towards our defeat._";

begintalknode;
	state = 2;
	nextstate = 1;
	condition = gf(8,11) >= 1 && gf(16,11) == 0;
	question = "_Who is our nemesis?_";
	text1 = "_I speak of Garzahd, archmage and leader of the Empire's forces in Avernum. I am looking for a way to have him assassinated. Dishonorable, I know, but we may have no choice. His genius and raw magical power threaten us all._";
	text2 = "_I say this with little fear of contradiction. I believe that, as long as Garzahd lives, we will probably lose this war._";
	action = SET_SDF 8 14 1;
	code =
		toggle_quest(126,1);
	break;
	
begintalknode;
	state = 1;
	nextstate = 4;
	condition = gf(8,14) >= 1 && gf(16,11) == 0;
	question = "_Where is Garzahd, and how can he be assassinated?_";
	text1 = "_Garzahd is in Avernum now, but we know not where he is or how to reach him. Or how to kill him if we could reach him. But perhaps, if we are lucky, someone will figure out how._";
	text2 = "_In the meantime, we do have some knowledge._";

begintalknode;
	state = 4;
	nextstate = 5;
	question = "_Can you share that knowledge with me?_";
	text1 = "_Erika and Solberg knew Garzahd once. They may know how to deal with him. We know also that he was skilled in creating guardian runes. Those will need to be dealt with._";
	text2 = "_Finally, he is a wizard skilled in creating magical shields, and an attacker would need help penetrating his castle's defenses._";
	text3 = "_Every one of these steps must be completed before you will have a chance of defeating our great foe._";
	
begintalknode;
	state = 5;
	nextstate = -1;
	condition = gf(68,11) == 0;
	question = "_Where can I find Solberg?_";
	text1 = "_He is trapped in a tower near Formello. He cannot leave, for fear that Avernum's foes will strike him down. He told me once he had an idea for how to kill Garzahd._";
	code =
		toggle_quest(127,1);
	break;
	
begintalknode;
	state = 5;
	nextstate = -1;
	question = "_Guardian runes?_";
	text1 = "_Powerful magical wards carved into floors and walls. They block all passage, or they incinerate any who brave them._";
	text2 = "_The court wizard, Rone, says he may know a way to break even the strongest guardian rune. Ask him about them._";
	code =
		if (gf(8,7) > 0)
			rs(2);
		sf(8,12,1);
		toggle_quest(130,1);
	break;

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_What sort of defenses can Garzahd create?_";
	text1 = "_We think that his fortress, deep in Empire lands, has a variety of magical defenses. We have contacted the vahnatai regarding Garzahd, and they have said that one of their skilled wizards might be able to help you._";
	text2 = "_Our envoys have learned that their greatest wizard, the mighty Rentar-Ihrno, resides in one of the towers of wizardry. I think she would be eager to help you slay Garzahd._";
	code =
		sf(29,19,1);
		toggle_quest(131,1);
	break;
		
begintalknode;
	state = 1;
	nextstate = 6;
	condition = gf(16,11) == 0 && gf(68,11) > 0 && gf(8,17) < 2;
	question = "_I learned from Solberg that Garzahd has demonic blood in his veins._";
	text1 = "_Fascinating. We know from interrogations that Garzahd has summoned demons to aid in Empire raids on our lands. If he shares a link to infernals, this would explain his ease in commanding them._";
	text3 = "_His fortress, wherever it is, is probably filled with them. To get far past his defenses, one would probably need Demonslayer. If we could spare it._";
	code =
		toggle_quest(128,3);
		toggle_quest(129,1);
	break;
	
begintalknode;
	state = 6;
	nextstate = -1;
	question = "_Is there any chance that I can borrow Demonslayer?_";
	text1 = "__";
	code =
	run_hardcode(129);
	break;

begintalknode;
	state = 5;
	nextstate = 10;
	question = "_Where is Erika?_";
	text1 = "_Her tower is beyond the battle-lines, but maybe someone can figure out how to reach it. She is the cause of many of our problems, and yet she is still our best ally. Her hatred of the Empire is intense, and her powers are great._";
	text2 = "_Just, please. If you go see her, try not to help her do anything too outlandish. Her assassination of Emperor Hawthorne brought this ruin on our heads._";

begintalknode;
	state = 10;
	nextstate = -1;
	question = "_Do you know how I can reach her?_";
	text1 = "_The Tower of Magi has a portal which can teleport people all over Avernum. It would probably be your best bet, if you could figure out how to use it._";
	text2 = "_I believe the wizard Solberg maintains contact with her. Ask him how to reach her._";
	code =
		sf(8,28,1);
		toggle_quest(132,1);
		toggle_quest(133,1); 
	break;
	
	
begintalknode;
	state = 1;
	nextstate = 7;
	condition = gf(16,11) >= 1;
	question = "_I have slain Garzahd. The great enemy of Avernum is no more._";
	text1 = "_I am aware of that. Soon after you performed the deed, our wizards detected the absence of his foul presence. I wish there was something I could do to reward you properly for this act._";
	text2 = "_I think the best reward I can give you is to dedicate all I know and all I am to the defeat of our great enemy. But there is a small token of my regard I can share with you._";

begintalknode;
	state = 7;
	nextstate = -1;
	question = "_Of what enemy do you speak?_";
	text1 = "_I speak of the Empire. It has been dealt several savage blows. And now, thanks to your help, and with courage and skill, we may defeat them. It will be a long road, but we are all eager to travel it._";
	text2 = "_Still, thanks to you, there is hope for Avernum. Truly, you are the equals of the heroes who saved us years ago. I, and Avernum, thank you._";

begintalknode;
	state = 7;
	nextstate = -1;
	question = "_Small token? Sounds good to us._";
	text1 = "_In my chambers, to the south, are several tablets. They contain powerful information, dangerous information. You have proved that you can be trusted with it. You may now read them._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(8,11) >= 1;
	question = "_How fares the war, your Majesty?_";
	text1 = "He sighs. _The less asked of that, the better. It is an ugly affair. I can only say this because we are safely in private, but it is so._";
	text3 = "_Better, now. Without Garzahd, the Empire's troops are confused and ineffective. There are glimmers of hope, at last._";
	action = DEP_ON_SDF 16 11 0;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(8,11) >= 1;
	question = "_You are aware that I contacted the vahnatai people?_";
	text1 = "_How could I not be? I have been trying to contact them, as well. However, they have refused to speak with me until the Crystal Souls are returned. If all three were returned to them, great things might be possible._";
	text3 = "_How could I not be? I am in contact with them, as well. Now that their Crystal Souls are returned, they are dealing with us. A very profitable alliance may be declared soon, and the Empire will be the worse for it._";
	action = DEP_ON_SDF 30 11 0;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I will resume my journey._";
	text1 = "_I am glad to hear it. I am sure you did not ask to become so important to the future of Avernum. However, that has proved to be your fate. Good luck to you._";
	action = END_TALK;

// Rone

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 28;
	question = "Rone";
	text1 = "There is an ancient wizard puttering about this cramped laboratory. He has paper-thin skin and thin, wispy, white hair.";
	text2 = "You recognize this man from tales you have been told. He is Rone, one of the original prisoners of Avernum. He was a very powerful magician. Once.";
	text3 = "Now he is old and feeble. As he wanders past you, he mutters, _More soldiers. More demands. All right. I am Rone. I am here to serve. What do you need?_";
	text5 = "Rone seems to barely acknowledge you're here. His mind is traveling in faraway realms, and it seems unlikely to ever fully return. He mutters, _Rone, wizard, here to serve,_ as if he had only just met you.";
	action = INTRO;

begintalknode;
	state = 28;
	nextstate = -1;
	question = "_I would like to learn more magic._";
	text1 = "He coughs. _There are towers for that. The Castle is not a school._";

begintalknode;
	state = 28;
	nextstate = 29;
	question = "_You are the Royal wizard?_";
	text1 = "He shakes his head, as if to clear it of your interruption. _Yes, yes. Wizard of the Castle. Many honors. Can't you see I'm busy mulling?_";

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_Mulling about what?_";
	text1 = "_I concentrate on bringing aid to Avernum. Magically. It is hard to concentrate, and you do not help._ He turns his back on you.";
	action = END_TALK;

begintalknode;
	state = 28;
	nextstate = 30;
	condition = gf(8,12) >= 1;
	question = "_King Micah said you could tell me about guardian runes._";
	text1 = "He turns to you, his gaze suddenly alert. _Yes, I know of those!_ You see anger in his eyes. _Runes on the ground that sear anyone passing. But we of Avernum had a Blessed Athame, which could break them._";
	text2 = "Fortunately, you have the athame.";
	code =
		if (has_spec_item(22) > 0)
			toggle_quest(130,3);
			else rs(2);
	break;
	
begintalknode;
	state = 30;
	nextstate = 32;
	condition = has_spec_item(22) == 0;
	question = "_What is a Blessed Athame?_";
	text1 = "Rone has a few fortunate moments of lucidity. _A small blade of great power. We hid it in a guarded cave in a maze of waterfalls west of Fort Dranlon. A workshop and storeroom, where the Empire couldn't find it. So we thought. We were going to do many private, special things there._";
	text2 = "_Then they found the cave and took it over for their own uses and perverted the defenses. Bad for us. Now, nobody can get at the Athame, and that suits the Empire fine, curse them._";
	code =
		toggle_quest(130,3);
		toggle_quest(134,1);
	break;
	
begintalknode;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "_Is the Athame still there?_";
	text1 = "_How should I know?_ he snaps. _But if you want it, the Waterfall Warren is the place to begin the search._";
	
begintalknode;
	state = 28;
	nextstate = 31;
	condition = gf(8,13) >= 1;
	question = "_Can you tell me anything about the sword Demonslayer?_";
	text1 = "He gains a small amount of alertness. _You seek Demonslayer? Ah, we have hidden and guarded it well. Hmm. Where was it? Hmm. Oh, yes! Patrick possesses it!_";
	
begintalknode;
	state = 31;
	nextstate = -1;
	question = "_So where would this Patrick fellow be located?_";
	text1 = "_In his tower, to the southwest. I hid it there myself. There is a fountain there with two pots flanking it. Behind each pot is a button. Press both buttons, and the way will be made clear._ He wanders off, lost in thought.";
	action = END_TALK;
	code =
		toggle_quest(129,3);
		toggle_quest(135,1);
		sf(54,11,1);
	break;

begintalknode;
	state = 28;
	nextstate = -1;
	condition = 1;
	question = "_I don't need more help._";
	text1 = "Rone wanders off without another word.";
	action = END_TALK;

// Radner

begintalknode;
	tag = 50;
	state = -1;
	nextstate = 55;
	question = "Gilda";
	text1 = "A happy woman with brown, frizzy hair sits behind the counter, blissfully shuffling forms back and forth. She tallies up numbers, updates lists of names, and engages in enthusiastic bureaucratic such and such.";
	text2 = "She stands to shake your hand. _I am Gilda, head record-keeper. I'm assuming you're here for a higher clearance._";
	text5 = "Gilda watches you happily, wondering what other forms to offer to you to make your lives easier. _I'm the one to come to if you need a higher clearance. Never forget!_";
	action = INTRO;

begintalknode;
	state = 55;
	nextstate = 56;
	question = "_What sorts of records are kept here?_";
	text1 = "_Oh, you wouldn't find most of it very interesting. Someone has to keep all the information straight. Of course, I do have to deal with soldiers. Mercenaries. Adventurers._";

begintalknode;
	state = 56;
	nextstate = 60;
	question = "_You're in luck. I am a soldier._";
	text1 = "_Yes. Well, I'm generally in charge of evaluating and awarding security clearance. If you ever feel you've earned a new clearance, come see me._";

begintalknode;
	state = 60;
	nextstate = -1;
	condition = 1;
	question = "_What are the clearances for?_";
	text1 = "_Gaining access to the more important research facilities and officials of Avernum._";

begintalknode;
	state = 60;
	nextstate = -1;
	condition = 1;
	question = "_How do I qualify for a higher clearance?_";
	text1 = "_Being useful. Doing missions. Gaining the favor of the mayors and commanders of our glorious nation._";

begintalknode;
	state = 60;
	nextstate = -1;
	condition = 1;
	question = "_What are the clearances?_";
	text1 = "_Soldier. That's for soldiers. Magi. That's for access to areas of magical power. And Crown. That's the best one._";

begintalknode;
	state = 55;
	nextstate = 57;
	question = "_Can I be issued higher clearance yet?_";
	text1 = "_Well, that depends. What is your name?_";

begintalknode;
	state = 57;
	nextstate = 58;
	question = "Tell her your name.";
	text1 = "She checks her papers. _I see. And do you formally request a higher security clearance?_";

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_I formally request a higher security clearance._";
	text1 = "She hands you some papers. _Fill out these forms please, and then I'll check your records._";

begintalknode;
	state = 59;
	nextstate = -1;
	question = "Fill out the forms. See what happens.";
	code =
	run_hardcode(127);
	break;

begintalknode;
	state = 55;
	nextstate = -1;
	question = "_There's lots of information here. How can you keep track of it all?_";
	text1 = "_It's easy! In fact, we could use more. If you're on a daring raid in some Empire fortress and you stumble across some of their records, bring them here. I'll pay you, and it'll be a big help in my work._";
	action = SET_SDF 8 16 1;
	code =
		toggle_quest(50,1);
	break;
	
begintalknode;
	state = 55;
	nextstate = -1;
	condition = party_has_item(219) > 0 && gf(8,16) >= 1;
	question = "_I have some Empire records._ Give them to her.";
	code =
	run_hardcode(32);
	break;

begintalknode;
	state = 55;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything else._";
	text1 = "_I am sorry. I wish I could help you more._";
	action = END_TALK;
	
// Prince Chevyn

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 82;
	question = "Prince Chevyn";
	text1 = "You meet an awkward, vacant young man wearing ill-fitting, ratty robes. He wears a silver circlet. You've heard of this person. This must be the Prince Chevyn, son of the king.";
	text2 = "Your guess was correct. He blurts out, _I'm Chevyn! Prince Chevyn! I'm royal!_";
	text5 = "Chevyn stands imposingly, trying to create an image of regal equipoise. It isn't working out quite as well as it might, but at least he's making a good effort.";
	action = INTRO;

begintalknode;
	state = 82;
	nextstate = 83;
	question = "_Greetings, your Highness._";
	text1 = "He stands up proudly. _I'm royalty. I'm the prince. You know what that means._";

begintalknode;
	state = 83;
	nextstate = -1;
	question = "_That you're royalty?_";
	text1 = "_King Micah is the king. He's my father! I'm preparing to take his place and stuff! That means I'm helping the military._";

begintalknode;
	state = 83;
	nextstate = 84;
	question = "_Sorry... what does it mean?_";
	text1 = "_That means I'll be king and wise powerful ruler over Avernum, me and my lizard Fred. That'll be really neat! But first, I'm supposed to be helping the war._";

begintalknode;
	state = 84;
	nextstate = -1;
	question = "_Your lizard is named Fred?_";
	text1 = "_My loyal friend and guardian! If you see him, pet him for me!_ He thinks. Hard. _Or her. It's a lizard. You know how it is._";

begintalknode;
	state = 84;
	nextstate = -1;
	question = "_Oh, really? Helping how, exactly?_";
	text1 = "_I was thinking of a whole new war fighting strategy plan thing when you came along, for wiping out the Empire, and maybe the vahnatai, and maybe even destroying Silvar too, for good measure!_ He thinks.";
	text2 = "_Or maybe Silvar shouldn't be destroyed. I'm still working this all out._";

begintalknode;
	state = 82;
	nextstate = 86;
	question = "_You will be king one day?_";
	text1 = "_My father says yes. If the Council chooses me. So I have to impress them. And I think I will!_";

begintalknode;
	state = 86;
	nextstate = -1;
	condition = 1;
	question = "_Who is the Council?_";
	text1 = "He concentrates, trying to recall the answer. _The king and the mayors of all the biggest cities. That's right, isn't it? I think that's right. Anyway, they choose the kings. I don't get it until they decide I'm a great leader._";

begintalknode;
	state = 82;
	nextstate = -1;
	condition = 1;
	question = "_Do you have any missions for me?_";
	text1 = "_No. My father says I can't give out missions. It didn't work out well when I did it before. Too many adventurers died._";

// Lorraine orb = 492

begintalknode;
	tag = 90;
	state = -1;
	nextstate = 109;
	question = "Lorraine";
	text1 = "A tall, thin woman paces about this courtyard. She carries several large, parchment maps. Occasionally, she stops and spreads one out on the floor to inspect it.";
	text2 = "When you approach behind her, she squeaks in alarm and rolls up the map. Then she sees who you are. _Oh. I suppose you know things already. You have clearance to be here, yes? My name is Lorraine. Welcome._";
	text5 = "Lorraine chats about the war with you, occasionally interrupting the conversation to show you some fascinating detail on one of her maps. Geography and geology truly interest her, and she discusses that to the exclusion of anything that would help you in your quests.";
	action = INTRO;

begintalknode;
	state = 109;
	nextstate = 110;
	question = "_What are the maps for?_";
	text1 = "_I'm working on a bit of research. That's what I'm here for._";

begintalknode;
	state = 110;
	nextstate = 111;
	question = "_Can you tell me what you're researching?_";
	text1 = "_Not magic. Tunnels. I am going through all of the surveys of tunnels in Avernum, even the oldest ones, to try to find useful tunnels. The right passage can help us to launch surprise attacks on the Empire._";
	text2 = "_Also, I'm working on something else, to take a break from all of that. I'm trying to figure out where the Orb of Thralni ended up._";
	code =
		if (gf(8,29) > 0)
			rs(2);
	break;

begintalknode;
	state = 111;
	nextstate = -1;
	condition = gf(8,29) == 0 && party_has_item(492);
	question = "_The Orb of Thralni? You mean this thing?_ Show it to her.";
	text1 = "She delicately cradles it in her hands. _It is! You recovered it! I will be sure to let my superiors know that it is safely back in Avernite hands. They will be pleased._ She hands it back to you.";
	code =
		change_reputation(1);
		award_party_xp(200,20);
		sf(8,29,1);
	break;
	
begintalknode;
	state = 111;
	nextstate = 112;
	condition = gf(8,29) == 0;
	question = "_What is this Orb of Thralni?_";
	text1 = "_It's an artifact! It enables its bearer to fly! We had it here, but it was stolen. But I think I know who the thieves were._";
	text3 = "_It's an artifact! It enables its bearer to fly! I heard that it was recovered by some bold adventurers. Thank goodness!_";
	action = DEP_ON_SDF 8 9 0;
	code =
		if (gf(8,9) == 0)
			toggle_quest(136,1);
		toggle_quest(137,3);
	break;

begintalknode;
	state = 112;
	nextstate = -1;
	question = "_Stolen? Out of the Castle? How is that possible?_";
	text1 = "_A very good question. A complete mystery. Probably magic. What doesn't get done by magic these days?_";
	
begintalknode;
	state = 112;
	nextstate = 114;
	question = "_Where do you think it is?_";
	text1 = "She shows you the maps. They are of the caves west of Fort Remote, an outpost southwest of here. _There is a huge nest of Empire mages in there, doing research. After the orb was stolen, troops in Fort Remote thought they saw some people fly over them._";
	text2 = "_The mage fort is southwest of Fort Remote. I would bet that's where the Sphere ended up. Now if only someone would get it._";

begintalknode;
	state = 114;
	nextstate = -1;
	condition = 1;
	question = "_Do you know anything else about this fort?_";
	text1 = "_Very little. It's a dangerous place, full of magic and wrapped in secrets. We do know its name, obtained from messages carried by captured Empire couriers. The place is called 'Kothtar.'_";

begintalknode;
	state = 109;
	nextstate = 113;
	question = "_You seem to be very interested in maps._";
	text1 = "_Oh, it's a terrible job! With the barriers and the cavequakes and the new settlements springing up everywhere. How am I supposed to keep track of everything? I'm so behind, and there's so much I need to know._";

begintalknode;
	state = 113;
	nextstate = -1;
	condition = gf(8,15) <= 1;
	question = "_Like what? Maybe I could help?_";
	text1 = "_Well, there is actually a way you could help me. There's supposedly a new town to the north, near Empire lands. It's called Harston. However, we have no idea where it is. If you could tell me where it's located and what it's like, it'd be a huge help._";
	text2 = "_If you tell me, I'll put in a good word for you with Gilda. May help you get a higher security clearance._";
	action = SET_SDF 8 15 1;
	code =
			toggle_quest(51,1);
	break;

begintalknode;
	state = 109;
	nextstate = -1;
	condition = gf(8,15) == 1 && gf(51,11) >= 1;
	question = "_I've been to Harston._ (Describe it to her.)";
	code =
	run_hardcode(31);
	break;
	
begintalknode;
	state = 109;
	nextstate = -1;
	condition = gf(8,15) > 1;
	question = "_Any other way I can help?_";
	text1 = "_Besides recovering the Orb of Thralni? Probably not._";
	text3 = "_Now that you have found the Orb of Thralni? Not that I can think of, but I appreciate the consideration._";
	action = DEP_ON_SDF 8 29 0;
	
// Lithgow

begintalknode;
	tag = 110;
	state = -1;
	nextstate = 136;
	question = "Lithgow";
	text1 = "A tall, balding man is perched on a stool behind the counter. He wears as fine robes as any you have ever seen in Avernum. A long, slender blade hangs from his belt.";
	text2 = "When you enter, he is counting an impressive pile of gold coins. He nods to you, but he doesn't seem pleased to have a visitor. Especially not a lowly soldier. _Welcome ... warrior. I am called Lithgow. Royal treasurer._";
	text5 = "Lithgow watches you warily. The royal treasurer is worried that, at any moment, you may try to take away some of his nice, pretty money.";
	action = INTRO;

begintalknode;
	state = 136;
	nextstate = 137;
	question = "_That's quite a bit of gold._";
	text1 = "_It is supposed to be. I am the treasurer of the kingdom._ He pats his blade. _It's a job that keeps me active._";

begintalknode;
	state = 137;
	nextstate = -1;
	question = "_Exactly what does a royal treasurer do?_";
	text1 = "_It's a tough job, keeping track of all the crown's wealth. It's spread all over Avernum now, in the form of blades and armor and enchanted items, all valuable metal or magic. But I keep track._";

begintalknode;
	state = 137;
	nextstate = -1;
	question = "_Active how?_";
	text1 = "_Everyone wants some cash for this or metal for that. Metal is too rare to give out lightly! But, everyone with Crown Clearance is entitled to an occasional stipend for expenses._ He seems to really wish that he didn't have to tell you that.";
	code = 
		sf(8,19,1);
	break;

begintalknode;
	state = 136;
	nextstate = 138;
	question = "_How goes the war?_";
	text1 = "_Even one of your clearance can't get an answer to that. All I will say is this._";

begintalknode;
	state = 138;
	nextstate = -1;
	condition = 1;
	question = "_Yes?_";
	text1 = "_Few in Avernum will take a risk unless they are given coin. Coin is not infinite. I wish all would happily give their lives against the Empire for free, but that is not the way of things._";
	
begintalknode;
	state = 136;
	nextstate = -1;
	condition = gf(8,19) > 0;
	question = "_I have Crown Clearance. Can I have my stipend?_";
	text1 = "__";
	code =
	run_hardcode(128);
	break;

begintalknode;
	state = 136;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything else._";
	text1 = "_I am relieved to hear it. Good day._";
	action = END_TALK;

// Curtin

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 163;
	question = "Curtin";
	text1 = "You find a mage with long, dark hair and severe features. She sits cross-legged on a carpet, staring into the brazier before her.";
	text2 = "When you approach, she smiles and motions for you to sit with her. You ask her name. _I am called Curtin._";
	text5 = "Curtin stares into the brazier intently and indicates that you should do the same. The incense is starting to make your eyes water.";
	action = INTRO;

begintalknode;
	state = 163;
	nextstate = 164;
	question = "_What are you doing?_";
	text1 = "_This is where I come to rest and ponder. The rest of the time, I perform research on teleportation._";

begintalknode;
	state = 164;
	nextstate = 165;
	question = "_Learn anything interesting?_";
	text1 = "_Teleportation is a difficult but powerful field. Some of my work is on the shelves in the banquet hall. What's more,_ (and she beams with pride as she says it) _I helped work on the portal._";

begintalknode;
	state = 165;
	nextstate = 166;
	question = "_Which portal?_";
	text1 = "_The portal in the Tower of Magi. It enables one to flash to anywhere in Avernum, if they but know the right coordinates._";

begintalknode;
	state = 166;
	nextstate = 167;
	question = "_How does the coordinate system work?_";
	text1 = "_Before entering the portal, you say three short words, which tell the portal where to send you. They are difficult to find but very useful. I have found two interesting sets of them, for the Castle and Erika's tower!_";

begintalknode;
	state = 167;
	nextstate = 168;
	question = "_Would you mind telling them to me?_";
	text1 = "_The coordinates for the Castle are etched on a pylon. Determining them was a week of work. Finding the way to Erika's tower was an accident. We were trying to find a route to near Solberg's tower. The coordinates are on a pylon near there._";
	text2 = "_Be careful not to tell people these coordinates. The portal would be dangerous in the wrong hands!_";

begintalknode;
	state = 167;
	nextstate = -1;
	condition = 1;
	question = "_Where is the pylon?_";
	text1 = "_It is in the training courtyard, to the west._";

begintalknode;
	state = 168;
	nextstate = -1;
	question = "_You don't remember what the Erika coordinates were?_";
	text1 = "_They've slipped my mind sadly, but Solberg's tower is not far from Formello. It really is near there. You'll need a boat to get there, though._";

begintalknode;
	state = 163;
	nextstate = 169;
	condition = 1;
	question = "_Can you teach me any magic?_";
	text1 = "_I only know about teleportation, and I do not teach it unless my student has years to spend. One mistake can leave you forever entombed in stone._";

begintalknode;
	state = 169;
	nextstate = -1;
	condition = 1;
	question = "_Where can I learn magic?_";
	text1 = "_Patrick's Tower is a wise choice. Also, the Tower of Magi, of course. Does 'X' still have his secret office in the southeast corner? Nag him. He might share some secrets with you._";

// Kristen

begintalknode;
	tag = 150;
	state = -1;
	nextstate = 190;
	question = "Kristen";
	text1 = "You meet a small, delicately featured woman with a sweet smile. Her robes are snowy white, and she radiates a constant power and confidence. A gold ankh hangs from her neck. _My name is Kristen. Welcome._";
	text5 = "Kristen smiles at you. You bask in the constant warmth of peace and good feelings. You notice that her skin isn't very pale. She hasn't been down in the underworld for that long.";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = 191;
	question = "_Who are you?_";
	text1 = "_I am an Avernite. The last Avernite. I came here on my own after the Empire stopped sending people down. I realized that you were on the side of justice._";

begintalknode;
	state = 191;
	nextstate = 192;
	question = "_Why did you feel so passionate about seeing justice done for Avernum?_";
	text1 = "_I fought for the Empire once. It shames me to admit it. I even sent those like you down here. But redemption is always possible, and is never as hard as it seems. My mission is to atone._";
	text2 = "_So, just before the last Avernum portal was shut down, I snuck through._";

begintalknode;
	state = 192;
	nextstate = -1;
	question = "_How can you atone?_";
	text1 = "_I provide healing for your warriors. I can also teach you spells which the Empire doesn't want you to have._";
	text2 = "_Alas, I must ask a fee for my help. Worry not. The tithe will go to the needy and to the good fight._";

begintalknode;
	state = 190;
	nextstate = -1;
	question = "_Can I buy some spells?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Kristen's Spells","Kristen is an exile from the surface world. She has come to share powerful rituals with the Avernites, for a modest donation.",72,3,3);
	break;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = dread_curse(0) > 0;
	question = "_I have a terrible curse. Can you lift it?_";
	text1 = "She inspects you closely. _Sadly, no. That's a nasty one. But try the Tower of Magi. There is a very skilled priestess there who, I've heard tell, is experienced in dealing with all sorts of curses._";

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "_I don't need any more help._";
	text1 = "_Then go forth. Fight for justice._";
	action = END_TALK;

// Levitt

begintalknode;
	tag = 170;
	state = -1;
	nextstate = 217;
	question = "Levitt";
	text1 = "A thin, pale man stands rigid in the corner. A blue field engulfs him from the neck down. It doesn't take long to figure out that the field is holding him paralyzed. The man whimpers and stares at you in terror. _I am Levitt! Levitt! I'll tell you all!_";
	text5 = "Levitt stares up at you, pitiful and whimpering. The smell tells you that he's been here for a while. He has the healthy skin tone of someone who just came from the surface, but terror and lack of food have left him pale and weak.";
	action = INTRO;

begintalknode;
	state = 217;
	nextstate = 218;
	question = "_Why have you been restrained?_";
	text1 = "He turns his head around weakly to look at you. The rest of his body is held utterly still. His voice is a terrified shriek. _Please! Please! I've told you everything I know!_";

begintalknode;
	state = 218;
	nextstate = 219;
	question = "_Refresh my memory?_";
	text1 = "He whimpers. _I was just a foot soldier. It was join them or they'd kill me! They blasted the Abyss. I didn't wanna' die. They have lots of troops, but they never told me anything. I only know their mission._";

begintalknode;
	state = 219;
	nextstate = -1;
	question = "_Go on._";
	text1 = "Tears slide down his face. It's a pathetic sight. _They're going to do to Avernum what they did to the Abyss. Giants, sliths, nephil, humans, everyone. They're going to kill you all. Nothing more, nothing less._";
	text2 = "_Now release me. Please, let me go._ Even if you wanted to, you don't know how.";

begintalknode;
	state = 217;
	nextstate = 220;
	question = "_Tell me about Empire outposts, or I'll do something terrible to you._";
	text1 = "_Oh, I... I... I don't know! No, wait! East of here! East of Almaria and west of the Magi Tower and near a lot of lava. There's a secret outpost. Hidden past the lava. Lots of our best raiders._";

begintalknode;
	state = 220;
	nextstate = -1;
	condition = 1;
	question = "_Why should I care?_";
	text1 = "_I heard the commander there has a gray pass. That's the best there is! But it was just a rumor. Don't hurt me if it's not true!_";

begintalknode;
	state = 217;
	nextstate = -1;
	condition = 1;
	question = "Try to free him.";
	text1 = "The moment you touch the field holding him, your entire arm goes numb. You doubt you could break through the barrier without killing its prisoner.";
	
begintalknode;
	state = 217;
	nextstate = -1;
	condition = 1;
	question = "Leave.";
	text1 = "You walk away. Levitt whimpers as you go.";
	action = END_TALK;
	
// Ackroyd

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 244;
	question = "Ackroyd";
	text1 = "This burly, grizzled old veteran is wearing heavy, pitted chainmail. One of his arms is made of wood. The other arm has a barrel balanced on his shoulder.";
	text2 = "He nods when he sees you staring at him. _I'm Ackroyd._";
	text5 = "Ackroyd grins toothily at you, not letting the barrel down from his shoulder. Muscles bulge in his neck and remaining arm.";
	action = INTRO;

begintalknode;
	state = 244;
	nextstate = 245;
	question = "_Hi. Need any help?_";
	text1 = "_Nah. I'm quartermaster for the Castle, ya' know? I look after storerooms and stuff? Cause, ya' see, I was wounded, and they needed somewheres to stick me._";

begintalknode;
	state = 245;
	nextstate = -1;
	question = "_You have much stuff to look after?_";
	text1 = "_Yeah, sometimes. Not now, y'know. And I don't have any to share with you. But there's an empty small barracks around here somewhere, not used for nothin'. You could rest there and leave your stuff if you wanted._";

begintalknode;
	state = 245;
	nextstate = -1;
	question = "_How'd you get wounded?_";
	text1 = "_The Empire? Heard of it? One of their assassins nailed me in the arm. It got infected and poisoned and stuff, and it had to come off. I'm bitter, but hey, I got stuff to keep busy with, ya' know? Oh well._";
	text2 = "He puts the barrel down and easily picks up another. His remaining arm is frighteningly well muscled.";
	
begintalknode;
	state = 244;
	nextstate = 246;
	condition = 1;
	question = "_I'd like to trade with you._";
	text1 = "_Have to disappoint you. We just don't have the goods here. They're all at the front. I can buy, but I can't sell._";

begintalknode;
	state = 246;
	nextstate = -1;
	condition = 1;
	question = "_I would like to sell something._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode;
	state = 246;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_Then I'll get back to work. Too much to do._ He walks off to move a big mound of flour sacks.";
	action = END_TALK;
	
// _Fred

begintalknode;
	tag = 210;
	state = -1;
	nextstate = 271;
	question = "_Fred";
	text1 = "There is a large, torpid, pudgy iguana prowling the halls. You cannot help but notice it has a big, blue ribbon around its neck. Under the ribbon is a nametag. The lizard's name is _Fred._";
	text5 = "Fred looks up at you, dreaming futile dreams of the day when it grows large enough to devour you.";
	action = INTRO;

begintalknode;
	state = 271;
	nextstate = -1;
	question = "Try to catch it.";
	text1 = "It hisses and attempts to bite you on the foot. You jump back, and it runs away.";
	action = END_TALK;

begintalknode;
	state = 271;
	nextstate = -1;
	question = "Try to pet it.";
	text1 = "_Hiss!_ It tries to get the ribbon off, to no avail. Then it bites you on the thumb. You pull your hand back, and it runs away.";
	action = END_TALK;

