// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,0) == 0;
	question = "special";
	text1 = "You cross the bridge into the Castle, the capital of Avernum, and its largest building as well.";
	text2 = "Its construction in the Great Cave, aided by magic and opposed by constant raiding parties of nephilim, slithzerikai, and giants, marked the beginning of Avernum as a united nation. It was truly an epic tale.";
	text3 = "And yet, in the recent years of growing size and wealth, it became clear that the Castle was too old, crumbling, and cramped to serve the only nation in the known world besides the Empire. There was talk of building a replacement.";
	text4 = "Of course, in these days of fear and hunger, nobody is talking that way anymore.";
	action = SET_SDF 132 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,1) == 0 && gf(132,10) > 1;
	question = "special";
	text1 = "As you walk out onto the bridge, you begin to feel the beginning of hunger pangs. Operating in the safety of the Food Depot, you never suffered for a good meal. Now that you are stepping out into the world, you will need to feed yourself.";
	text2 = "Fortunately, you still have a while before your hunger gets serious. Of course, as long as you have food on hand, you will be fine ...";
	text3 = "(Every so often, you will eat some of the food in your inventory. If you lack food, you will become hungry. This will result in your being less effective in combat. Using food in your inventory fills you up and heals some damage.)";
	action = SET_SDF 132 1 1;
	code =
		sf(170,3,1);
	break;
	
begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,2) == 0;
	question = "special";
	text1 = "You enter the Castle courtyard. You have never been here before. Frankly, you expected something nicer.";
	text2 = "It is small, shadowy, and packed with practicing soldiers and merchant caravans. Pack lizards snap at passing bureaucrats, and warriors even younger than you fling spears inexpertly at practice dummies.";
	text3 = "You look around, your mouth hanging open, completely unsure where in this chaos you're supposed to go. Finally, a guard takes pity on you. Sighing, he points to the building to the east and says, _Reporting soldiers go there._";
	text4 = "_Find Meryhew. She'll know where you're supposed to go._ That said, the guard stalks off.";
	action = SET_SDF 132 2 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,3) == 0;
	question = "special";
	text1 = "This room is cluttered with junk. Barrels and crates and heaps of it. Someone has been assembling a huge collection of old, dusty items. Many seem valuable. Most of them definitely aren't.";
	text2 = "It's an odd and intriguing collection. You immediately start to wonder why precious space in the Castle is being spent on it.";
	action = SET_SDF 132 3 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,4) == 0;
	question = "special";
	text1 = "This is a small alchemical workshop. The work here seems focused on ways to treat the plague that is afflicting the crops of Avernum.";
	text2 = "This isn't surprising. As soon as the Blight appeared, alchemists began to hunt for a cure. An enormous bounty was offered to the first to succeed. None have.";
	text3 = "The floor here is covered with burn marks and long streaks of slime. Some of the tiny slime bits are still moving.";
	action = SET_SDF 132 4 1;

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,6) == 0;
	question = "special";
	text1 = "You are surprised to find an office in this remote tower. It's cold and dark and dusty. The tapestry on the wall is faded and torn. The desk is worn and old. The blood spots on the floor by the cage are, however, disturbingly fresh.";
	text2 = "There is an old man sitting at the desk staring at you. As he waves you in, you see that his hands are trembling slightly. He seems ancient and harmless. If not senile, at least on the borderline.";
	text3 = "Then, meeting his vacant gaze, you remind yourself where you are and who this is. He seems harmless, but that can easily be an illusion.";
	text4 = "_Yes, yes ..._ he mutters. _You found your way up here. Come in. I think we need to talk._";
	action = SET_SDF 132 6 1;

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,7) == 0;
	question = "special";
	text1 = "This is the Castle ballroom. It was once used to host parties and banquets, so that Avernum could prove that it was a civilized nation. Of course, potentates from the Empire were never impressed.";
	text2 = "Now that the rugs have been rolled up and the paintings have been put in storage, this is where soldiers and visitors to the Castle can come for a quick meal before setting back out into the caves.";
	text3 = "You can always come here for a little bit of food. No more than you need. Not even in the Castle is a single scrap allowed to go to waste.";
	action = SET_SDF 132 7 1;

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,8) == 0;
	question = "special";
	text1 = "You had heard rumors that there was an actual vahnatai living in the Castle. They were actually true! He is standing right before you.";
	text2 = "There are very few members of that ancient and alien race of cave dwellers in Avernum. This one sits here, in surprisingly sparse quarters, surrounded by a few pieces of their alien furniture.";
	text3 = "He looks up at you as you enter. His mouth twists slightly, though you don't know anywhere near enough about the vahnatai to know what that expression means.";
	action = SET_SDF 132 8 1;

begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = get_sdf(132,5) == 0;
	question = "special";
	text1 = "At last, you enter the throne room of the Castle. It is crowded and cluttered now, a place for planning and preparation. You can see King Starrus at the long table in the northwest corner, conferring with his generals.";
	text2 = "King Starrus is almost as old as Levitt, but he wastes no time pretending to be friendly or confused. He asks questions and barks orders with great confidence and clarity.";
	text3 = "And yet, you can see the exhaustion on his face. Once again, he has to guide Avernum through a crisis. For him, this may be one challenge too many.";
	text4 = "A general taps him on the shoulder and points at you. When he sees you, he waves you in. _You there! Don't stand at the door gaping. Time is desperately short! Speak with me. There is much to do._";
	action = SET_SDF 132 5 1;

//


begintalknode 10; // sample locker
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "This locker is full of dried samples of mushrooms, lichen, and moss, taken from all over the lands of Avernum.";
	text2 = "You note with satisfaction that your recent contribution is at the front, waiting to be tested.";
	text3 = "The samples are interesting from an alchemical perspective, but none of them are useful to you. You close the locker.";
	code =
		if (gf(132,11) < 2)
			rs(2);
	break;

begintalknode 11; // treas room box
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This box is covered with mold. When you open it, a cloud of dust flies out. Nobody has looked in here in years and years. You look inside, hoping to find some sort of spectacular treasure.";
	text2 = "Instead, you find a mirror. It's a sheet of polished crystal, six inches across, in a silver frame. You see nothing exceptional about it. However, you doubt anyone will notice its absence for a long time. You keep it.";
	text3 = "The box is empty.";
	code =
		if (gf(132,16) == 0) {
			rs(3);
			sf(132,16,1);
			set_spec_item(20,1);
			}
			else {
				rs(1); rs(2);
				}
	break;

begintalknode 12; // vat
	state = -1;
	nextstate = -1;
	condition = gf(132,15) == 0;
	question = "";
	text1 = "This chamber is designed for magical experimentation and analysis. The thick walls are here to protect the rest of the Castle from the inevitable poisonous or explosive mistakes.";
	text2 = "For example, right now, this room is being used for experiments involving diseased mushrooms and living slimes. The vat by the north wall bubbles and hisses. Eventually, the slimes within will be released and analyzed.";
	text3 = "Or, they might sense prey, find a hole in the vat containing them, slither out and begin to spread chaos. And this is, in fact, what happens.";
	action = SET_SDF 132 15 1;
	code =
		kill_object(23925,0);
		activate_hidden_group(1);
	break;
	
begintalknode 13; // vahn crystal
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "When you get close to this crystal, you see dim, flickering shapes inside. For a moment, you imagine that someone is inside, looking out at you.";
	text2 = "Then a powerful headache explodes inside your skull. The migraine is so fast and intense that it takes a great effort to not vomit. You stagger away.";
	text3 = "After all of his years here, the Castle must be aware that Ghall-Ihrno has this device. It has wards on it to keep you away. You maintain a safe distance.";

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You climb the ladder and attempt to open the trapdoor at the top. Alas, it's securely barred from the other side.";

begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Among the items Lark wants to evacuate to the surface, you find this spellbook. You browse through it, examining the powerful rituals within.";
	text2 = "You are only able to decipher one of them, but it is very valuable. You learn how to create a cloak of energy that will make your spells more powerful. (Your skill with the spell Cloak of the Arcane increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "You browse through the book, but you can't understand any of it. Its contents are old and obscure, and you don't know enough magical lore.";
	code =
		if (gf(132,12) == 0) {
			rs(3);
			if (get_stat_total(13) < 12)
				rs(2);
				else {
					rs(4);
					sf(132,12,1);
					alter_stat(30000,58,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;	
	
begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Among the items Lark wants to evacuate to the surface, you find this spellbook. You browse through it, examining the powerful rituals within.";
	text2 = "You are only able to decipher one of them, but it is very valuable. You learn how to summon powerful allies to aid you in battle. (Your skill with the spell Arcane Summon increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "You browse through the book, but you can't understand any of it. Its contents are old and obscure, and you don't know enough magical lore.";
	code =
		if (gf(132,13) == 0) {
			rs(3);
			if (get_stat_total(13) < 13)
				rs(2);
				else {
					rs(4);
					sf(132,13,1);
					alter_stat(30000,57,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;	

	
begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Among the items Lark wants to evacuate to the surface, you find this spellbook. You browse through it, examining the powerful rituals within.";
	text2 = "You are only able to decipher one of them, but it is very valuable. You learn how to create a deadly torrent of raw magical energy. (Your skill with the spell Arcane Blow increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "You browse through the book, but you can't understand any of it. Its contents are old and obscure, and you don't know enough magical lore.";
	code =
		if (gf(132,14) == 0) {
			rs(3);
			if (get_stat_total(13) < 15)
				rs(2);
				else {
					rs(4);
					sf(132,14,1);
					alter_stat(30000,59,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;	

	
begintalknode 20;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Among the items Lark wants to evacuate to the surface, you find this prayer book. You browse through it, trying to decipher the powerful holy rituals within.";
	text2 = "You are only able to comprehend one of them, but it is very valuable. You learn how to call deadly spectral allies out of the astral plane. (Your skill with the spell Divine Host increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "You browse through the book, but you can't understand any of it. Its contents are old and obscure, and you don't know enough magical lore.";
	code =
		if (gf(131,29) == 0) {
			rs(3);
			if (get_stat_total(13) < 14)
				rs(2);
				else {
					rs(4);
					sf(131,29,1);
					alter_stat(30000,79,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;		

// EXTRAS

begintalknode 21;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are several bureaucrats in this office, shuffling along a small portion of the paperwork that keeps Avernum running. Even in the underworld, on the frontier of human existence, there are records.";
	text2 = "They are surprisingly eager to speak with you, but they know very little about what is going on outside these walls. They never touch any military information.";
	
begintalknode 22;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The dining hall is filled with soldiers, couriers, caravan drivers, and so on, each grabbing a small, precious meal before returning to the roads of Avernum.";
	text2 = "You speak with them for a short time, trading tales and sharing gossip. They give you an idea of how chaotic and dangerous things in Avernum have become. It is interesting, but it doesn't make you feel reassured. Quite the opposite.";
	text3 = "Word of your exploits has begun to spread. The people here are eager to talk to you and hear stories of your adventures. You tell them a tale or two and then politely extricate yourself.";
	code =
		if (gf(170,1) < 16)
			rs(3);
			else rs(2);
	break;
	
begintalknode 23;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The soldiers in the courtyard are hard at work, training constantly for the day (once thought terribly unlikely) that the war comes to the gates of the Castle. You don't bother them.";
	text2 = "Now that the portal has been destroyed, however, you detect an increasing desperation in their exercise. They are exhausted, but they keep practicing.";
	code =
		if (gf(170,1) < 12)
			rs(2);
	break;
	
begintalknode 24;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are a lot of soldiers in the Castle, some here for defense, others waiting to be transferred to a new post.";
	text2 = "Your rank is too low to make you very interesting. You speak with them for a while, but their desire for your departure, so that they can rest or prepare, is all too clear.";
	text3 = "Though they are eager to rest and prepare, your rank gets their immediate attention. You talk with them for a while, and then leave them alone. You don't get anything but barracks gossip.";
	code =
		if (gf(170,0) < 2)
			rs(3);
			else rs(2);
	break;
	
begintalknode 25;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are many guards in the Castle, ready to give their lives should an assassin or spy try to gain entry. King Starrus is an all too tempting target.";
	text2 = "When you try to speak with them, they wave you by. Your rank is far too low for you to be of interest.";
	text3 = "Though they are supposed to be alert, your rank gets their immediate attention. They let you distract them for a while and then ask to return to their vigil. You leave them alone.";
	text4 = "They immediately ask you for identification or transfer orders or some other proof that you should be let in. When you can't present anything, you are turned away. Might as well go back to the food depot for orders.";
	code =
		rs(2); rs(3); rs(4);
		if (gf(170,1) < 4)
			as(4);
			else if (gf(170,0) < 2)
				as(2);
				else as(3);
	break;
	
begintalknode 26;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "This is one of King Starrus's Royal Guard. A serious warrior, one of the best, and completely uninterested in any distraction. Your feeble attempt to start a conversation fizzles out almost instantly.";
	
begintalknode 27;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "While the assembled generals of Avernum are very grateful for your past services, rank and tradition do have their place. They are civil, but they don't want to discuss the war with you. Not yet, anyway.";
	
begintalknode 28;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "A row of pack lizards hisses and snaps at you as you walk by, eager to gnaw on you. The urge to kick one of them is strong, but you resist. In the Castle, it's wise to be on your best behavior.";
	
begintalknode 29;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The Castle kitchen is full of workers, struggling desperately to stretch any scrap of edible material that comes into their hands. They are very impressed by your rank and status, but you don't learn anything useful from them.";
	
//Commander Meryhew

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "You meet a full commander of Avernum's army. She is very different from Sergeant Nichol. Her armor (and skin) bears the marks of recent skirmishes, and she is clearly eager to get out into the field again.";
	text2 = "She is short and stocky, with thick drakeskin armor and a beautiful bow of yew from the surface. She says, _You. The new one. I am Commander Meryhew. You must be looking for me. I always end up with the confused ones._";
	text3 = "This must indeed be the officer you were supposed to report to. She holds out her hand. _Your papers. Transfer orders. Let's see them._";
	text5 = "Commander Meryhew paces back and forth in the hall, inspecting the defenses and shouting orders at anyone passing by. You suspect that she is eager to get back out into the field, but commanders rarely get that privilege.";
	text6 = "You get plenty of chances to admire her bow. The finest surface craftsmanship, rare and valuable down here.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = gf(132,10) == 0;
	question = "Here are my orders. (Hand them over.)";
	text1 = "She takes the papers, flips through them quickly, and jams them into a belt pouch. _Well, you are who I was told to expect. You don't look like much, but I hear you've shown signs of actual initiative. I can use that._";
	text2 = "_There are a lot of messes in the Great Cave that need cleaning, and anyone worth anything has been sent to fight the slithzerikai._";
	text3 = "_I'm going to send you out a lot. Hard, dangerous work, but it needs doing, and there are real rewards for it. I hope you're ready._";
	code =
		sf(132,10,1);
		set_spec_item(1,-1);
		toggle_quest(7,3);
	break;
	
begintalknode 32;
	state = 30;
	nextstate = 32;
	condition = (gf(132,10) == 1 || gf(132,10) == 2) && gf(170,2) == 0;
	question = "What do I need to do first?";
	text1 = "_You are in luck. You are going to be allowed to use the pylon network. No walking around Avernum for you. You can use the pylons to travel from one cave to another in an instant._";
	text2 = "_Go to the Portal Keep and report. They will teach you how to use the pylons. Then walk back here to me. Or teleport._";
	text3 = "_The fortress is just southwest of the castle. Just go outside to the road and follow the signs._";
	text4 = "(In case you get lost, the location of the Portal Fortress is now marked on your World Map.)";
	code = 
		set_flag(132,10,2);
		toggle_quest(14,1);
		sf(170,1,6);
		mark_quest_dest(341,650,0, 14);
	break;	
	
begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = gf(132,10) == 2 && gf(170,2) > 0;
	question = "I am now able to use the pylons.";
	text1 = "She nods. Then she pokes you hard in the chest with her finger. _And still solid. That's a relief. It doesn't always work out that way._";
	text2 = "_Now that you can teleport, you should be sure to attune yourself to the pylon in the Castle. It's in Correlea's lab._ She points to the west.";
	text3 = "_And, at last, I can use you. I have several jobs that need to be done. Quickly. Urgent stuff that's fallen into my lap. I hope you're ready, because your real work is about to begin._";
	code = 
		set_flag(132,10,3);
		sf(170,1,8);
		toggle_quest(14,3);
		award_party_xp(400,4);
	break;	
	
begintalknode 34;
	state = 30;
	nextstate = 33;
	condition = gf(170,1) == 8 && gf(177,13) < 2;
	question = "What are my orders?";
	text1 = "_The Great Cave is slowly slipping into chaos, and I haven't been given the forces I need to calm it. I've only gotten you. I hope you can help me._";
	text2 = "_These missions are to be your primary focus. You can take side jobs to stabilize the Great Cave, but don't let them overly distract you from your real work._";
	text3 = "_Mayor Aznavour of Dharmon is having problems with food hoarders. Something having to do with the Blosk ruins._";
	text4 = "_Gnass is the slithzerikai colony to the northwest. Their leader, Gless-Thsss, has been contacted by a spy from the enemy sliths. Now he claims to need our help._";
	text5 = "_Mad old Archmage Solberg, in Patrick's Tower, is trying to create some sort of new mushroom that will resist the Blight. I don't know why he wants our help, but he does._";
	text6 = "_There. Plenty to do. Pick a task, and dive in._";
	text7 = "(These quests are very important. If you ever feel aimless and unsure what to do, return to Meryhew for more missions.)";
	code =
		toggle_quest(10,1);
		if (gf(177,0) > 1)
			rs(3);
		if (gf(177,1) > 1)
			rs(4);
		if (gf(177,2) > 1)
			rs(5);
	break;
	
begintalknode 35;
	state = 30;
	nextstate = 51;
	condition = gf(170,1) == 10 || (gf(170,1) == 8 && gf(177,13) > 1);
	question = "What do I need to do at the portal?";
	text1 = "_A fair question. But not the sort of thing they tell me. I understand that there is increasing unrest. Too many people trying to push through and overload the thing._";
	text2 = "_Travel east to Almaria and through. Go east to the Great Portal. Follow the signs ... You can't miss it. Report to whoever is in charge there and follow orders. Find out how the thing is functioning._";
	text3 = "_When you are done there, return to me for more orders._";
	text4 = "(Though you have been honored with a new task, any of Meryhew's missions you have not yet done can still be completed. Just go to Gnass, Patrick's Tower, or Dharmon and speak with the mayor or commander.)";
	code =
		toggle_quest(10,3);
		toggle_quest(15,4);
		toggle_quest(16,4);
		toggle_quest(17,4);
		toggle_quest(18,1);
		sf(170,1,10);
		mark_quest_dest(742,730,0,18);
	break;
	
begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = gf(170,1) == 12;
	question = "The Great Portal is gone. What are my new orders?";
	text1 = "You notice that Commander Meryhew is looking very pale. As valiantly as she is trying to cover up her unease at what has happened, she is clearly as terrified as everyone else in Avernum.";
	text2 = "_We already know what happened. Our mages detected the disturbance, the shock wave, right away. It was not difficult for them to ... They figured out what happened._";
	text3 = "_You ... You will need orders. Yes. Now that the portal is ... gone, there is a fair amount of chaos. You will need to operate in a wider area. You will help tamp down the chaos and look for other routes out of Avernum._";
	text4 = "_Oh, yes. One other thing._ She pulls your private's insignia off of your shoulder. She pulls a replacement from her pouch and awkwardly pins it onto your shoulder. _You are now a sergeant. Congratulations._";
	text5 = "_No time to celebrate. We must return to work._";
	code =
		toggle_quest(18,3);
		sf(170,1,14);
		sf(170,0,1);
		award_party_xp(600,10);
	break;

begintalknode 37;
	state = 30;
	nextstate = 37;
	condition = gf(170,1) == 14 && gf(177,14) < 2;
	question = "What are my new orders?";
	text1 = "_I have several new missions. They are to be your primary focus. You will face many distractions, but don't let them take too much focus from your real work._";
	text3 = "_The Tower Colony has had another disaster, no doubt related to what happened to the Great Portal. Not a surprise. But they need your help to recover the records they need to rebuild the portal._";
	text4 = "_Several envoys from the Empire have been kidnapped in Almaria. Friction with the Empire is the last thing we need right now. Someone needs to recover them._";
	text5 = "_Far to the west, beyond Fort Remote, we have been attempting to excavate an old route back to the surface. Work has stopped there, and word has not yet reached us why. Someone needs to go get the digging started again._";
	text6 = "_There is much to do, and we all are balanced on the very edge of disaster. Hurry._";
	text7 = "(These quests are very important. If you ever feel aimless and unsure what to do, return to Meryhew for more missions.)";
	code =
		toggle_quest(11,1);
		if (gf(177,4) > 1)
			rs(3);
		if (gf(177,5) > 1)
			rs(4);
		if (gf(177,6) > 1)
			rs(5);
	break;

begintalknode 38;
	state = 30;
	nextstate = 41;
	condition = gf(170,1) == 14 && gf(177,14) > 1;
	question = "Where am I being sent now?";
	text1 = "She shudders. _You're being sent to ..._ She flicks her eyes up at the ceiling. _You're going to work for Levitt now. He requested you personally._";
	text2 = "_Go upstairs and report to the old man now. I'm done with you. Orders._";
	text3 = "(Though you have been honored with a new task, any of Meryhew's missions you have not yet done can still be completed. Just go to the place that needed help and speak with whoever is in charge.)";
	code =
		toggle_quest(11,3);
		toggle_quest(19,4);
		toggle_quest(20,4);
		toggle_quest(21,4);
		sf(133,16,1);
		sf(133,17,1);
	break;

begintalknode 39;
	state = 30;
	nextstate = -1;
	condition = gf(170,1) > 14 && gf(170,1) < 26;
	question = "Where am I supposed to go now?";
	text1 = "She points upward. _Go upstairs and talk to Levitt. I want to use you but I can't. Crossing Levitt's will is ..._ She shakes her head.";

begintalknode 40;
	state = 30;
	nextstate = -1;
	condition = gf(170,1) >= 26;
	question = "Where am I supposed to go now?";
	text1 = "_I hear you've really moved up in the world. Go to the throne room and see King Starrus._ She smiles. _Rank aside, you're well above my level now._";

//begintalknode 41;
//	state = 30;
//	nextstate = -1;
//	condition = 1;
//	question = "";
//	text1 = ".";
//	text2 = "";

//begintalknode 42;
//	state = 30;
//	nextstate = -1;
//	condition = 1;
//	question = "";
//	text1 = ".";
//	text2 = "";

//begintalknode 43;
//	state = 30;
//	nextstate = -1;
//	condition = gf(132,10) > 0 && has_spec_item(2) && gf(132,21) == 0;
//	question = "I found an odd scroll in a goblin lair. (Show it to her.)";
//	text1 = "She looks at the scroll. _Odd. And interesting. It looks like slith script but ..._";
//	text2 = "_It's probably garbage, but you never know. The best place to get it deciphered is probably Gnass. Plenty of old and learned slithzerikai there._";

//begintalknode 44;
//	state = 30;
//	nextstate = 43;
//	condition = gf(132,10) > 0 && has_spec_item(2) && gf(132,21) == 1;
//	question = "I have gotten the scroll I found deciphered. (Describe it.)";
//	text1 = "She takes the scroll. _Well, this turns out to be valuable information. Bad news, but it's a good thing that we now know it._";
//	text2 = "_It means that Khrez-Yss the Shadow can travel freely in our lands, and we need to do a better job of hunting him. And, unhappily for you, you have attracted his attention. I don't envy you._";

begintalknode 45;
	state = 31;
	nextstate = 30;
	condition = 1;
	question = "At last! I am ready!";
	text1 = "She nods. _Ahhhh ... I see spirit. Or foolhardiness. We'll see which you have soon enough. Your first task will be an easy one._";
	text2 = "(You are now serving under Commander Meryhew. If you are ever unsure what to do or where to go, return to her for direction.)";

begintalknode 46;
	state = 31;
	nextstate = 30;
	condition = 1; 
	question = "Are you sure I'm the right person for this job?";
	text1 = "She laughs. _Of course not! I mean, just look at you! But in these dark times, we use what we can get as well as we can. Happily, your first task will be an easy one._";
	text2 = "(You are now serving under Commander Meryhew. If you are ever unsure what to do or where to go, return to her for direction.)";

begintalknode 47;
	state = 31;
	nextstate = 30;
	condition = 1;
	question = "Ummmm ... Can I go back to the food depot now?";
	text1 = "She snorts. _Back into that pit with Sergeant Nichol? Afraid not. Anyone with skill or potential needs to be out there fighting. And then, with a great deal of skill and luck, some of us might survive._";
	text2 = "_Happily, your first task will be an easy one._";
	text3 = "(You are now serving under Commander Meryhew. If you are ever unsure what to do or where to go, return to her for direction.)";

begintalknode 48;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "What do I need to do when I get to the Portal Fortress?";
	text1 = "_Just go inside. Some wizard or alchemist or similar madman will teach you what to do._";

begintalknode 49;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Do you know how to use the pylons?";
	text1 = "She shudders. _Let some wizard's toy tear me into bits and fling me through the tunnels? I hope not!_";
	text2 = "_You, on the other hand, will need to use them. I need you to be able to travel quickly._";

begintalknode 50;
	state = 33;
	nextstate = 34;
	condition = gf(177,0) < 2;
	question = "I would like to accept the mission in Dharmon.";
	text1 = "She notes its location on your map of Avernum. _Dharmon is a long hike due west of here. A dark and smoky place, full of rough, paranoid people. But they're serious folks. If they say someone is hoarding food, I believe them._";
	text2 = "_We can't tolerate anyone keeping stores of food back. Report to Mayor Aznavour and do what you have to to restore order._";
 	code =
 		sf(177,0,1);
 		toggle_quest(15,1);
		mark_quest_dest(152,634,1,15);
	break;
 	
begintalknode 51;
	state = 34;
	nextstate = -1;
	condition = 1;
	question = "Why is it so bad for someone to hoard food?";
	text1 = "_We need to keep order. If one family is starving and the family next door is sitting on sacks of mushroom meal, it is only a matter of time before the first family attacks the second._";
	text2 = "_In Avernum, we may all go down, but we will all go down together._";
	
begintalknode 52;
	state = 33;
	nextstate = 35;
	condition = gf(177,1) < 2;
	question = "I would like to help Gnass.";
	text1 = "_It is a slith village. Even before most of the slithzerikai joined Avernum, that settlement was there. And yet, the enemy sliths are sending spies to try to infiltrate and turn them._";
	text2 = "She notes its location on your map of Avernum. _We want to keep Gnass happy. Go see Gless-Thsss, their chieftain, and calm him down. Gnass is only a short hike northwest from here._";
 	code =
 		sf(177,1,1);
 		toggle_quest(16,1);
		mark_quest_dest(228,534,0,16);
	break;
 	
begintalknode 53;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "Tell me more about the enemy slithzerikai?";
	text1 = "_What is there to say? There's a lot of them. They have three warlords. They own most of northeast Avernum. They aren't your problem. Focus on the task at hand._";
	
begintalknode 54;
	state = 33;
	nextstate = 36;
	condition = gf(177,2) < 2;
	question = "I would like to travel to Patrick's Tower.";
	text1 = "She notes its location on your map of Avernum. _It's second only to the Tower Colony as a center of magical learning in Avernum. It's run by old Archmage Solberg, but it's still useful. Amazingly enough._";
	text2 = "_He's trying to make a new sort of mushroom that can resist the Blight. And why not? Most of our plants were made by wizards. And he needs help._";
 	code =
 		sf(177,2,1);
 		toggle_quest(17,1);
		mark_quest_dest(289,738,0,17);
	break;
	
begintalknode 55;
	state = 36;
	nextstate = -1;
	condition = 1;
	question = "Who is Archmage Solberg?";
	text1 = "_One of the heroes of Avernum, or so I'm told. Been around since the first days of Avernum, if you can believe that._";
	text2 = "_Completely cracked. Should have retired years ago. And yet, he's still around. Doing whatever it is he does._";
	
begintalknode 56;
	state = 36;
	nextstate = -1;
	condition = 1;
	question = "Why would an archmage need my help?";
	text1 = "_Maybe he wants you to clean bowls. Or hunt pests. Or battle imaginary fairies. Who knows?_";
	text2 = "_Solberg has a lot of pull higher up, so he gets resources when he wants them. Even if he's a little mad._";
	
begintalknode 57;
	state = 30;
	nextstate = -1;
	condition = gf(177,0) == 1 && gf(128,1) > 0 && gf(170,1) == 8;
	question = "I've taken care of the problems in Dharmon. (Give a report.)";
	text1 = "Commander Meryhew listens to your report. Then she pulls a scroll out of her pouch and makes a single check mark on it. _Excellent. One more success to report to the generals._";
	text2 = "_You're doing better than I expected. Now continue to work on the other two tasks. If you're running low on ammo, report to the quartermaster._";
	text3 = "_However, as much as I'd like to let you keep working on these little errands, I've gotten a new dispatch from the Great Portal. I have a new assignment for you._";
	code =
		sf(177,0,2);
		toggle_quest(15,3);
		inc_flag(177,13,1);
		inc_flag(177,17,1);
		if (gf(177,13) == 1)
			rs(3);
			else rs(2);
	break;
	
begintalknode 58;
	state = 30;
	nextstate = -1;
	condition = gf(177,1) == 1 && gf(115,1) > 0 && gf(170,1) == 8;
	question = "I've taken care of the problems in Gnass. (Give a report.)";
	text1 = "Commander Meryhew listens to your report. Then she pulls a scroll out of her pouch and makes a single check mark on it. _Good work. I'll tell the generals about what The Shadow has been doing in our lands._";
	text2 = "_You're doing better than I expected. Now continue to work on the other two tasks. If you're running low on ammo, report to the quartermaster._";
	text3 = "_However, as much as I'd like to let you keep working on these little errands, I've gotten a new dispatch from the Great Portal. I have a new assignment for you._";
	code =
		sf(177,1,2);
		toggle_quest(16,3);
		inc_flag(177,13,1);
		inc_flag(177,17,1);
		if (gf(177,13) == 1)
			rs(3);
			else rs(2);
	break;

begintalknode 59;
	state = 30;
	nextstate = -1;
	condition = gf(177,2) == 1 && gf(158,1) > 0 && gf(170,1) == 8;
	question = "I've helped complete the experiment in Patrick's Tower. (Give a report.)";
	text1 = "Commander Meryhew listens to your report. Then she pulls a scroll out of her pouch and makes a single check mark on it. _Their failure is a disappointment. But not a surprise._";
	text2 = "_You're doing better than I expected. Now continue to work on the other two tasks. If you're running low on ammo, report to the quartermaster._";
	text3 = "_However, as much as I'd like to let you keep working on these little errands, I've gotten a new dispatch from the Great Portal. I have a new assignment for you._";
	code =
		sf(177,2,2);
		toggle_quest(17,3);
		inc_flag(177,13,1);
		inc_flag(177,17,1);
		if (gf(177,13) == 1)
			rs(3);
			else rs(2);
	break;

begintalknode 60;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "Anything I need to know about the Great Portal?";
	text1 = "She looks annoyed. _It's huge. It's a portal. It's the only route to and from the surface with any capacity. It's desperately important._";
	text2 = "_Anything else you need to know you'll learn when you get there. So get going._";

begintalknode 61;
	state = 37;
	nextstate = 38;
	condition = gf(177,4) < 2;
	question = "I want to travel to the Tower Colony.";
	text1 = "_I can almost feel sympathy. The Tower of Magi blew up before I was born. They finally got it rebuilt, and now it has exploded again. And yet, you would think that wizards would learn ..._";
	text2 = "_Anyway, it is a long journey east of here, beyond the Great Portal. They need some help recovering some records._";
	code = 
		set_flag(177,4,1);
		toggle_quest(19,1);
		mark_quest_dest(877,716,0,19);
	break;
	
begintalknode 62;
	state = 38;
	nextstate = -1;
	condition = 1;
	question = "What sort of records?";
	text1 = "_Papers with instructions for reopening the Great Portal, as I understand it._ She smiles wryly. _Nothing important._";

begintalknode 63;
	state = 38;
	nextstate = -1;
	condition = 1;
	question = "What will I have to fight?";
	text1 = "She laughs. _A fair question, as the destruction of the original Tower of Magi was accompanied by a horde of slavering demons._";
	text2 = "_What have they summoned or released or attracted this time? I'm sure it will be very interesting to find out._";

begintalknode 64;
	state = 37;
	nextstate = 39;
	condition = gf(177,5) < 2;
	question = "I would like to accept the mission in Almaria.";
	text1 = "_Well, at least you don't have far to walk. Almaria is only a short journey to the east. You've been there. I can't tell you anything else about the exact circumstances of their carelessness._";
	text2 = "_Go there and report to the mayor. Who, I have no doubt, is an idiot._";
	code = 
		set_flag(177,5,1);
		toggle_quest(20,1);
		mark_quest_dest(544,687,0,20);
	break;

begintalknode 65;
	state = 39;
	nextstate = -1;
	condition = 1;
	question = "What were Empire envoys doing there?";
	text1 = "_Being trapped, the same as the rest of us. Except that they were actual diplomats from Emperor Redmark. Probably negotiating for a big shipment of crystals or precious metal._";
	text2 = "_And now they've been stolen away. Very, very bad, especially since we were hoping to get more supplies and weaponry from the Emperor. Clean up this mess. It is vital. Whatever you do, don't startle the brigands. The envoys must live._";

begintalknode 66;
	state = 37;
	nextstate = 40;
	condition = gf(177,6) < 2;
	question = "I would like to help out at the western excavation.";
	text1 = "_Once, decades ago, some adventurers managed to stumble on a tunnel up to the surface, in the wild tunnels west of the Great Cave. The Empire collapsed it when they invaded. We have been trying to dig it out again._";
	text2 = "_It's an urgent task. Which has, for some reason, stopped. We need you to restart it._";
	code = 
		set_flag(177,6,1);
		toggle_quest(21,1);
		mark_quest_dest(112,737,0,21);
		mark_quest_dest(14,490,0,21);
	break;
	
begintalknode 67;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "Why has the work on it stopped?";
	text1 = "_No idea. The commander has been sending messages back, giving all sorts of information. Rations eaten. Soldiers wounded. Everything we'd want to know except, you know, how much digging has actually occurred._";
	text2 = "_It's worrying the generals. So they're sending you._";

begintalknode 68;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "How do I get there?";
	text1 = "_Go southwest to Fort Remote. Get the commander there to let you through. Once you're in the tunnels beyond go north._";

begintalknode 69;
	state = 30;
	nextstate = -1;
	condition = gf(177,4) == 1 && gf(167,1) > 0 && gf(170,1) == 14;
	question = "I've recovered the records in the Tower Colony. (Give a report.)";
	text1 = "Commander Meryhew listens to your report. Then she pulls a scroll out of her pouch and makes a single check mark on it. _Excellent. That is the first, easiest step to rebuilding the Great Portal. So much more remains to be done._";
	text2 = "_You've done well, but slowly. The situation is eroding by the day. Try to hurry. Now continue to work on the other two tasks. If you're running low on resources, report to the quartermaster._";
	text3 = "_However, as much as we desperately need your help for these tasks ..._ She shakes her head and sighs. _You were actually showing promise, and they're taking you away from me. You have new orders. For transfer._";
	code =
		sf(177,4,2);
		toggle_quest(19,3);
		inc_flag(177,14,1);
		inc_flag(177,17,1);
		if (gf(177,14) == 1)
			rs(3);
			else rs(2);
	break;

begintalknode 70;
	state = 30;
	nextstate = -1;
	condition = gf(177,5) == 1 && gf(102,1) > 0 && gf(170,1) == 14;
	question = "I've completed my mission at Almaria. (Give a report.)";
	text1 = "Commander Meryhew listens to your report. Then she pulls a scroll out of her pouch and makes a single check mark on it. _Excellent. Emperor Redmark will be very pleased to learn how much effort we will expend to help his people._";
	text2 = "Commander Meryhew listens to your report. Then she pulls a scroll out of her pouch and makes a single 'X' on it. _Very unfortunate. Emperor Redmark will be annoyed, but we may be able to convince him that his envoys are at fault._";
	text3 = "_Of course, you will not receive credit for successful completion of this mission. As you were not successful._";
	text4 = "_You are progressing, but slowly. The situation is eroding by the day. Try to hurry. Now continue to work on the other two tasks. If you're running low on resources, report to the quartermaster._";
	text5 = "_However, as much as we desperately need your help for these tasks ..._ She shakes her head and sighs. _You were actually showing promise, and they're taking you away from me. You have new orders. For transfer._";
	code =
		sf(177,5,2);
		if (gf(148,1) == 1) {
			rs(2); rs(3);
			inc_flag(177,14,1);
			inc_flag(177,17,1);
			}
			else rs(1);
		toggle_quest(20,3);
		if (gf(177,14) == 1)
			rs(5);
			else rs(4);
	break;

begintalknode 71;
	state = 30;
	nextstate = -1;
	condition = gf(177,6) == 1 && gf(98,1) > 0 && gf(170,1) == 14;
	question = "I've gotten the work at the western excavation back on track. (Give a report.)";
	text1 = "Commander Meryhew listens to your report. Then she pulls a scroll out of her pouch and makes a single check mark on it. _Excellent. It's not a lot of hope, but at least someone somewhere is doing something._";
	text2 = "_You've done well, but slowly. The situation is eroding by the day. Try to hurry. Now continue to work on the other two tasks. If you're running low on resources, report to the quartermaster._";
	text3 = "_However, as much as we desperately need your help for these tasks ..._ She shakes her head and sighs. _You were actually showing promise, and they're taking you away from me. You have new orders. For transfer._";
	code =
		sf(177,6,2);
		toggle_quest(21,3);
		inc_flag(177,14,1);
		inc_flag(177,17,1);
		if (gf(177,14) == 1)
			rs(3);
			else rs(2);
	break;

	
begintalknode 72;
	state = 41;
	nextstate = -1;
	condition = 1;
	question = "Who is Levitt?";
	text1 = "_The king's spymaster. Since ... Since forever. And it's rarely wise to say more about him than that._ You look in Meryhew's eyes. She is genuinely scared.";
	
begintalknode 73;
	state = 41;
	nextstate = -1;
	condition = 1;
	question = "Tell me about him?";
	text1 = "She says, simply, _He will tell you everything you need to know. It's best not to pry more than that._";
	
begintalknode 74;
	state = 41;
	nextstate = -1;
	condition = 1;
	question = "How do I reach him?";
	text1 = "_Go upstairs. The corridor to his office is reached through the northeast tower._";
	
begintalknode 75;
	state = 39;
	nextstate = -1;
	condition = 1;
	question = "Who should I talk to for more information?";
	text1 = "_The mayor. She claimed for weeks that nothing had gone wrong, so she must know plenty about it. And she'll be eager to share what she knows with you, I think, to spare her neck._";
	
//begintalknode 76;
//	state = 30;
//	nextstate = -1;
//	condition = 1;
//	question = "";
//	text1 = ".";
//	text2 = "";

begintalknode 77;
	state = 30;
	nextstate = 42;
	condition = gf(132,10) > 0;
	question = "Can you tell me more about yourself?";
	text1 = "She seems surprised. And a little annoyed. _I don't make a habit of sharing my life story with my inferiors. The only thing you should be asking me for is more orders._";
	text2 = "_Anyway, it is the standard story. Born here. Never been to surface. Signed up at a time of chaos. Stayed in the army after the chaos passed. Defending my home suits me._";

begintalknode 78;
	state = 30;
	nextstate = -1;
	condition = gf(132,10) > 0 && gf(170,1) < 12;
	question = "What is happening in Avernum?";
	text1 = "_Panic and hunger, barely controlled. Chaos always simmering under the surface. It's ugly, but not violent._";
	text2 = "_Every day, more people leave using the Great Portal. Needed supplies are sent using the same portal. As long as this continues, we can keep order._";

begintalknode 79;
	state = 30;
	nextstate = -1;
	condition = gf(132,10) > 0 && gf(170,1) >= 12;
	question = "What is happening in Avernum now?";
	text1 = "_Every day, people are hungrier and the panic grows. We need a new source of food or a new way back to the surface. Otherwise ..._ She shakes her head.";
	text2 = "She looks even paler than usual. She hasn't been sleeping. She is not immune to the terror that is spreading through all of Avernum.";
	
begintalknode 80;
	state = 30;
	nextstate = -1;
	condition = gf(132,10) > 0;
	question = "I could use more supplies.";
	text1 = "_I will have the northern barracks unlocked for you. There is some equipment back there, and a job board too._";
	text2 = "_If you need more equipment, go see Ssem'Ess, the Castle quartermaster. He knows you are with us, so he'll talk to you._";
	text3 = "_As for magical training, talk to Correlea. Both of them can be found across the courtyard to the west._";
	code =
		if (gf(133,16) == 0)
			sf(133,16,1);
			else rs(1);
	break;
	
begintalknode 81;
	state = 30;
	nextstate = -1;
	condition = gf(132,10) > 0 && has_spec_item(2) && gf(132,21) == 0 && gf(170,6) == 0;
	question = "I found an odd scroll in a goblin lair. (Show the scroll.)";
	text1 = "She takes the scroll and looks it over. _Ahhh ... You found that in the goblin lair? It looks like slith script, but it isn't. Probably nothing, but ..._ She thinks.";
	text2 = "_You might show it around in Gnass. Someone there might recognize the style of writing._";

begintalknode 82;
	state = 30;
	nextstate = 43;
	condition = gf(132,10) > 0 && has_spec_item(2) && gf(132,21) == 1 && gf(170,6) == 0;
	question = "I have gotten the scroll I found deciphered. (Describe it.)";
	text1 = "You describe the contents of the scroll. Meryhew takes it. _You've done well. I'll make sure that word of this gets around. Hmmm. You said in a report that a slith was watching as you fought Lord Trinket._";
	text2 = "_I do not envy you. You have attracted the attention of Khrez-Yss the Shadow._";
	code =
		sf(132,21,2);
	break;
	
begintalknode 83;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "So you're a native of Avernum?";
	text1 = "_It's less common these days. For years, fortune hunters came from the surface as fast as they could fit through the Great Portal, but we can still be found. All four of my grandparents were deemed unfit by the Empire and sent down here._";
	text2 = "Something about her tone of voice suggests that it'd be unwise to ask what got them banished by the Empire.";
	
begintalknode 84;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "What disaster got you to join the army?";
	text1 = "_It was the Time of Shades. A mad vahnatai called Rentar-Ihrno created a host of specters and sea monsters to madden Avernum and tear it apart._";
	text2 = "_A dark time, but all of us, working together, defeated the threat. Some would have you believe that Avernum's problems are only ever solved by rogue adventurers. Don't believe it._";	
	
begintalknode 85;
	state = 43;
	nextstate = -1;
	condition = 1;
	question = "Khrez-Yss the Shadow?";
	text1 = "_One of the three warlords leading the slith clans that invade our lands. A fearsome spy and assassin. Who can, clearly, travel through our lands at will. And you have attracted his attention. Personally._";
	text2 = "_But, fortunately, if he decides you must die, it will happen very quickly. You will feel very little pain at all._";	
	
begintalknode 86;
	state = 30;
	nextstate = -1;
	condition = gf(132,10) > 0 && gf(132,22) == 1 && gf(132,23) == 0;
	question = "Someone named Jasmine is looking for help for Silvar.";
	text1 = "_Bah! She is still here? And she has you wasting my time too? If the mayor hadn't sent her personally, I would have kicked her out myself._";
	text2 = "_Silvar is out of my area. Out of my control. Even if I wanted to send someone there, I couldn't. Don't mention her again._";	
	code =
		sf(132,23,1);
	break;

begintalknode 87;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "How long will I be serving there for?";
	text1 = "_As long as it takes for you to understand if it is working properly or not. Show some initiative. If you are there for a while, it is all right. I understand they need workers._";
	text2 = "_When you know if they need anything, crystals, workers, stronger leadership, or maybe nothing at all, return to me._";
	
// Levitt

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "As your eyes adjust to the light, you see that this dark and musty tower is full of shackles, ropes, and a large iron cage. Avernum faces many threats now. Many enemies who get caught end up here.";
	text2 = "The small, withered man at the desk conceals a thick sheaf of papers as you approach. Even to an experienced warrior like you, there is something deeply worrying about him. An air of disinterest in any sort of human contact.";
	text3 = "_So you have arrived. Be comfortable._ He coughs. _I am Levitt. The intelligence officer. I have requested you. Now you are here. We can begin._";
	text5 = "Levitt sits back in his chair, his chin resting on his chest. As you talk to him, you begin to notice the stubble on his cheeks and the spots on his tunic. He seems old and confused.";
	text6 = "It is only occasionally, when he flicks his gaze up at you when you say something interesting, that you suspect how much of an act that is.";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = 110;
	condition = gf(132,24) == 0;
	question = "I am reporting for duty.";
	text1 = "_Yes. Yes._ He idly scratches his chin. _I am Levitt. I run the intelligence services for Avernum. From here. This humble little tower._";
	text2 = "_Avernum needs order. I bring order. I need agents to bring order. Thus, you. You work for me now. When you need orders, come here._";
	text3 = "He points at the trapdoor in the corner. _You can use the ladder below to reach me more quickly._ You wait for him to say something else. He doesn't. He stares down at the floor.";
	code =
		sf(132,24,1);
	break;
	
begintalknode 92;
	state = 110;
	nextstate = -1;
	condition = 1;
	question = "You bring order? How?";
	text1 = "_The way I have ever since I came here. I find the enemies of Avernum. I ... I bring them around to our way of thinking. So that order is restored._";

begintalknode 93;
	state = 110;
	nextstate = -1;
	condition = 1;
	question = "Where will I be bringing order to?";
	text1 = "_The northeast. The Eastern Gallery. The slith lands. The chaos up there has been tolerated for too long. We ... We ..._ He shakes his head a little, clearing it. _We will bring order._";

begintalknode 94;
	state = 110;
	nextstate = -1;
	condition = 1;
	question = "What is that cage in the corner for?";
	text1 = "He chuckles. _Consider it a tool of order. Time is being wasted. You need orders. I will use your skills properly. For once._";

begintalknode 95;
	state = 90;
	nextstate = -1;
	condition = gf(132,24) > 0 && gf(170,0) < 2;
	question = "What are my orders?";
	text1 = "He seems distracted. You have to ask him again. He reaches into his desk, pulls something out, and slides it across the surface to you. You look closer. It is a lieutenant's insignia.";
	text2 = "_I will not have a mere sergeant working directly for me. Put that on._";
	text3 = "You do so, even though pinning on your own promotion is quite the breach of protocol. _There. Now we can talk properly, lieutenant._";
	code =
		sf(170,0,2);
	break;

begintalknode 96;
	state = 90;
	nextstate = 91;
	condition = gf(170,0) > 1 && gf(170,1) < 16;
	question = "All right. What are my orders?";
	text1 = "He nods. _There is a dragon in Avernum. For the first time in ... Oh, it has been a while. It is in the north. It is not an ally of the Slith Horde. Quite the opposite. It has tried to send an envoy to us._";
	text2 = "_I think this envoy is or was called Breck. He or she or it had a message. You will go to the Abyss and locate the message. Bring it back to me._";
	text3 = "_This will convince me that you are worth remaining in my employ. And, perhaps, be valuable to Avernum._";
	code = 
		set_flag(170,1,16);
		toggle_quest(22,1);
		mark_quest_dest(90,407,0,22);	
		break;


begintalknode 97;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "Tell me about the dragon.";
	text1 = "_It is ... frustrating. I know little. Soldiers of the Empire have contacted it. We have not._";
	text2 = "_I know this. Its name is Melanchion. It was young but is now coming into its true power. It was in the low caverns, but it has emerged into Avernum for its own reasons._";
	text3 = "_I hope you can learn more._";
	
begintalknode 98;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "Tell me about the Abyss.";
	text1 = "_It is to the northwest. You can enter it through Fort Saffron, northwest of Dharmon._";
	text2 = "_It is a chaotic place. It is where those unfit for Avernum live. It is a place full of ... chaotic elements. Though, as long as they stay penned up there, they are allowed to live._";

begintalknode 99;
	state = 91;
	nextstate = 92;
	condition = 1;
	question = "Where should I look in the Abyss?";
	text1 = "_Word of Breck's journey to the Abyss was sent to us by a follower of Melanchion who was already there. The creature's name is Hrramen. A slith. The last message I received from Hrramen came from the Abyss town of Spire._";
	text2 = "_Of course, she might not still be there. If you go to the Abyss and inquire about the Hrramen-Drayssa, you might learn much._";

begintalknode 100;
	state = 92;
	nextstate = -1;
	condition = 1;
	question = "Drayssa?";
	text1 = "_It is slith for 'Dragon Pet.' It is a title followers of Melanchion give themselves. Interesting trivia._";

begintalknode 101;
	state = 90;
	nextstate = 97;
	condition = has_spec_item(3) > 0;
	question = "I have Melanchion's message. It's gibberish. (Give it to Levitt.)";
	text1 = "Levitt takes the scroll and inspects it. Then he turns it to the side. Then upside-down. Then he chuckles. _Yes. Clever._";
	text2 = "_It makes sense. To a dragon's mind. For us, it will be more difficult. You have done well._";
	text3 = "_You have probably lost equipment on this mission. I will have one of the upper storerooms unlocked for you. Use what you find freely. While we react to this message, I will use you to remove ... disorder. Your new orders await._";
	code = 
		set_spec_item(3,-1);
		set_flag(170,1,18);
		sf(133,18,1);
		toggle_quest(22,3);
		toggle_quest(12,1);

		break;


begintalknode 102;
	state = 90;
	nextstate = 93;
	condition = gf(170,1) == 18 && gf(177,15) < 2;
	question = "What are my orders?";
	text1 = "_The Eastern Gallery, the front line of our war against the Slith Horde, is a tangled web of rebellious and chaotic elements. We cannot strike the enemy properly until our side of the line is calm._";
	text2 = "_These missions are to be your primary focus. You must act quickly and without mercy. If the Slith Horde is not defeated, it will break our line and butcher us all._";
	text3 = "_The city of Silvar is on the brink of rebellion. Report to the mayor there. Learn who the chaotic elements are. Remove them, and calm the city._";
	text4 = "_Fort Dranlon is attempting to evacuate, but raiders are slaying any who try to escape. You will go there and help the commander to reduce the fort in an orderly way._";
	text5 = "_The city of Cotra, like so many others, must be reduced. We haven't the population or soldiers to support it. To keep it from being a haven for our foes, it must be destroyed. Report to the commander there to help._";
	text6 = "_I have more information available regarding these tasks._";
	code =
		if (gf(177,7) > 1)
			rs(3);
		if (gf(177,8) > 1)
			rs(4);
		if (gf(177,9) > 1)
			rs(5);
	break;

begintalknode 103;
	state = 93;
	nextstate = 94;
	condition = gf(177,7) < 2;
	question = "I will accept the mission in Silvar.";
	text1 = "_One of Avernum's great cities, the mayor must be horribly weak to allow it to slip so far. It controls a key bridge joining the Eastern Gallery to the rest of Avernum. Order must be restored!_";
	text2 = "_Report to the useless creature. Provide what aid is needed. Eradicate chaotic elements._ Levitt's voice is calmer and louder than it was. His 'doddering old man' disguise is starting to fade.";
 	code =
 		sf(177,7,1);
 		toggle_quest(23,1);
		mark_quest_dest(801,494,0, 23);
	break;
	
begintalknode 104;
	state = 94;
	nextstate = -1;
	condition = 1;
	question = "You want me to kill Avernites?";
	text1 = "_I want you to kill chaotic elements, that threaten stability and would kill us all. Do not weaken. A rebel is as deadly and wretched a creature as a goblin or giant._";

begintalknode 105;
	state = 94;
	nextstate = -1;
	condition = 1;
	question = "Who exactly are the rebels?";
	text1 = "_My intelligence is poor. That is why I am sending you. The mayor there can tell you more._";

begintalknode 106;
	state = 93;
	nextstate = 95;
	condition = gf(177,8) < 2;
	question = "I am ready to travel to Fort Dranlon.";
	text1 = "_That fort is too far into the Eastern Gallery, watching little of importance or value. We are only leaving a small force there to hold it. I hope they are not attacked, or they will have to sacrifice their lives._";
	text2 = "_Anyway, the withdrawal is being slowed by raiders. This is a good chance to eliminate these elements, before they move east and do more harm. That is your task._";
 	code =
 		sf(177,8,1);
 		toggle_quest(24,1);
		mark_quest_dest(472,354,0, 24);
	break;

begintalknode 107;
	state = 95;
	nextstate = -1;
	condition = 1;
	question = "Who are the raiders?";
	text1 = "_We know little, as they have made a habit of leaving no survivors of their attacks._";

begintalknode 108;
	state = 95;
	nextstate = -1;
	condition = 1;
	question = "Why doesn't the fort evacuate in a force too large for the raiders to attack?";
	text1 = "_They have asked for permission. I have refused it. As I said, better to lure the bandits out so they can be dealt with properly._";
	text2 = "_They require death, as an example. All pleas for mercy are unearned and are to be rejected._";

begintalknode 109;
	state = 93;
	nextstate = 96;
	condition = gf(177,9) < 2;
	question = "I would be happy to help destroy Cotra.";
	text1 = "_Yes. Yes. Make it explode, to be exact. More than any other, this job seems well-suited to your unique talents._";
	text2 = "_Of all your tasks, this seems the simplest. The commander asked only for extra security for the final ... What was the word they used? ... Demolition. Yes. That was it._";
 	code =
 		sf(177,9,1);
 		toggle_quest(25,1);
		mark_quest_dest(681,412,0, 25);
	break;

begintalknode 110;
	state = 96;
	nextstate = -1;
	condition = 1;
	question = "Who is in Cotra now?";
	text1 = "_Simply soldiers and alchemists. All the rest were forced to leave. Some struggled mightily, but we cannot allow Cotra to remain._";
	
begintalknode 111;
	state = 96;
	nextstate = -1;
	condition = 1;
	question = "Why is Cotra being destroyed?";
	text1 = "_It is too big and unsettled to be safe. Remember how many Avernites have left for the surface. If a raiding force from the Slith Horde enters it, removing them would be very difficult._";
	text2 = "_An empty city does no good and may do harm. Thus, the ... demolition._";
	
begintalknode 112;
	state = 96;
	nextstate = -1;
	condition = 1;
	question = "How exactly will this city be made to explode?";
	text1 = "_I do not know the details. We are being aided by an alchemist from the Empire who has chosen to help us. It involves a new compound they have created._";
	text2 = "_I will be very interested to hear of the results._";

begintalknode 113;
	state = 90;
	nextstate = -1;
	condition = gf(177,7) == 1 && gf(110,1) > 0 && gf(170,1) == 18;
	question = "I've taken care of the problems in Silvar. (Give a report.)";
	text1 = "Levitt listens to your report. He takes no notes. In the end, he nods. _A fair job, although I doubt that all of the chaotic elements were eliminated. Oh, well. They will not escape justice._";
	text2 = "_You are effective, but not efficient. Work on the other two tasks. If you're running low on supplies, report to the quartermaster._";
	text3 = "_I am going to have you stop working on this set of tasks. I have a new task for you. High risk, but high reward. Receiving this mission will be a great honor for you._";
	code =
		sf(177,7,2);
		toggle_quest(23,3);
		inc_flag(177,15,1);
		inc_flag(177,17,1);
		if (gf(177,15) == 1)
			rs(3);
			else rs(2);
	break;
	
begintalknode 114;
	state = 90;
	nextstate = -1;
	condition = gf(177,8) == 1 && gf(77,1) > 0 && gf(170,1) == 18;
	question = "I've taken care of the raiders near Fort Dranlon. (Give a report.)";
	text1 = "Levitt listens to your report. He takes no notes. In the end, he nods. _A dangerous band of foes. I would like to know more about them. Who they corrupted, who aided them. They should have spent time in my cage. But we can't have everything._";
	text2 = "_You are effective, but not efficient. Work on the other two tasks. If you're running low on supplies, report to the quartermaster._";
	text3 = "_I am going to have you stop working on this set of tasks. I have a new task for you. High risk, but high reward. Receiving this mission will be a great honor for you._";
	code =
		sf(177,8,2);
		toggle_quest(24,3);
		inc_flag(177,15,1);
		inc_flag(177,17,1);
		if (gf(177,15) == 1)
			rs(3);
			else rs(2);
	break;
	
begintalknode 115;
	state = 90;
	nextstate = -1;
	condition = gf(177,9) == 1 && gf(94,1) > 0 && gf(170,1) == 18;
	question = "Cotra has been properly exploded. (Give a report.)";
	text1 = "Levitt listens to your report. He takes no notes. In the end, he nods. _Fascinating. I have already had other agents claim samples of the new compound. We should be able to reproduce it ourselves very soon._";
	text2 = "_You are effective, but not efficient. Work on the other two tasks. If you're running low on supplies, report to the quartermaster._";
	text3 = "_I am going to have you stop working on this set of tasks. I have a new task for you. High risk, but high reward. Receiving this mission will be a great honor for you._";
	code =
		sf(177,9,2);
		toggle_quest(25,3);
		inc_flag(177,15,1);
		inc_flag(177,17,1);
		if (gf(177,15) == 1)
			rs(3);
			else rs(2);
	break;
	
begintalknode 116;
	state = 97;
	nextstate = -1;
	condition = 1;
	question = "What does the message say?";
	text1 = "Levitt meets your gaze, and a shudder runs down your spine. For a moment, all of the shaking and muttering is gone. He looks at you coldly.";
	text2 = "_You will be told what you need to know when you need to know it. Nothing more._";
	text3 = "Then he reclines back in his seat and rests his chin on his chest.";
	
begintalknode 117;
	state = 90;
	nextstate = 98;
	condition = (gf(170,1) == 18 && gf(177,15) > 1) || (gf(170,1) == 20 && gf(170,7) == 0);
	question = "What is my new mission?";
	text1 = "_It took a great deal of time, effort, and blood, but we managed to place scouts in the northern lands controlled by the slithzerikai. They are moving their forces south, preparing for an assault._";
	text2 = "_This means that their primary fortress, in the ruins of Formello, is poorly defended. A small force, striking quickly and with surprise, might be able to slip in and slay their general, Ghavassa-Oss, the Impaler._";
	text3 = "_I have chosen you for this honor. You will get a boat, slip into northern lands, travel east through enemy territory, find a way into Formello, kill Ghavassa-Oss, and, hopefully, escape._";
	code = 
		toggle_quest(12,3);
		toggle_quest(23,4);
		toggle_quest(24,4);
		toggle_quest(25,4);
		set_flag(170,1,20);
		toggle_quest(26,1);
	break;	
	
begintalknode 118;
	state = 98;
	nextstate = -1;
	condition = 1;
	question = "Is this even possible?";
	text1 = "_Only you will be able to answer that question. I think we have a tiny chance of success, but the result, if achieved, would be great. Thus, it is a worthwhile risk of your lives._";
	text2 = "You have a brief feeling of nostalgia for the tunnels under the Food Depot.";
	
begintalknode 119;
	state = 98;
	nextstate = -1;
	condition = 1;
	question = "Where is my boat?";
	text1 = "_The docks are on the river north of Almaria. Go there. You will be allowed in. The officer on duty will direct you along the proper route to enemy-controlled lands._";
	
begintalknode 120;
	state = 98;
	nextstate = -1;
	condition = 1;
	question = "How will I get through enemy lands?";
	text1 = "He chuckles. _I recommend stealth. Avoid the enemy when you can. Ambush if you can't._";
	text2 = "_Keep alert for signs of our spies. There are several of them up there. Perhaps one has found a way for you to enter Formello easily. Oh, and take lots of food. It will be a long journey._";
	
begintalknode 121;
	state = 98;
	nextstate = -1;
	condition = 1;
	question = "What do I do when I reach Formello?";
	text1 = "_Find a way in. The gates will probably be closed, but there are many tunnels in the stone under the city. One of them is sure to still exist. A scout might help you to find it._";
	
begintalknode 122;
	state = 98;
	nextstate = -1;
	condition = 1;
	question = "How will I kill Ghavassa-Oss?";
	text1 = "_Despite the Impaler's dramatic name, I believe him to be quite old. A fragile, aging warlord, looking for final glory. You can kill him using any of the standard methods. A sword, perhaps?_";
	
begintalknode 123;
	state = 98;
	nextstate = -1;
	condition = 1;
	question = "How can I escape?";
	text1 = "_Records indicate that there was a teleportation pylon in the southeast corner of Formello. If it is still intact and you can reach it, you can flee the enemy lands in an instant._";
	text2 = "_If it is no longer intact ... You might have to be versatile._";
	
begintalknode 124;
	state = 90;
	nextstate = -1;
	condition = gf(170,1) == 20 && gf(170,7) > 0;
	question = "I'm back. Ghavassa-Oss is dead. And Khrez-Yss too. (Give full report.)";
	text1 = "For the first time, you see Levitt smile. He seems out of practice, but he manages.";
	text2 = "You notice a small, green smudge on the side of his mouth. He quickly wipes it off.";
	text3 = "_I knew you had succeeded. The disorder in the ranks of the enemy horde was unmistakable. And I take a certain satisfaction in the destruction of my opposite in their ranks._";
	text4 = "_You have done remarkably well. I had thought that I was sending you into certain death, something I only rarely enjoy. You have been a credit to Avernum._";
	text5 = "_I have had the second upstairs storeroom unlocked for a you. A pitiful reward, I know, but all supplies, everywhere, are limited._";
	text6 = "_You deserve a vacation. Perhaps on the surface._ He smiles again. _But it is not to be. The danger continues. You have new orders. We must strike while the enemy is in disarray._";
	code =
		toggle_quest(26,3);
		sf(170,1,22);
		sf(133,19,1);
		award_party_xp(600,30);
	break;
	
begintalknode 125;
	state = 90;
	nextstate = 100;
	condition = gf(170,1) == 22 && gf(170,8) == 0;
	question = "What must I do now?";
	text1 = "_You must return to the Eastern Gallery. You must go to the front, where, even now, the Slith Horde prepares to lash out at us. And they are still lethal, as long as their wizard leads them._";
	text2 = "_Go to Fort Duvno and report to Archmage Solberg. He asked for your personal aid. And we have chosen to give it to him._";
	code =
		toggle_quest(27,1);
		mark_quest_dest(796,328,0, 27);
	break;
	
begintalknode 126;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "Who is this wizard?";
	text1 = "_The final survivor of the trio that led the enemy horde ... Ess-Kalyn the Manburner. Even by slith standards, her mastery of the magical arts is devastatingly powerful._";
	text2 = "_They have been struck a vicious blow in the loss of their tactician and their spy, but the Slith Horde still has raw power. Solberg claims to have a way to erase this final advantage._";	
	
begintalknode 127;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "Archmage Solberg? Him?";
	text1 = "_He is old and doddering and eccentric. I did not choose for you to help him. The order came from above. Some are ... nostalgic. They count on the old wizards to save Avernum yet again._";
	text2 = "_I do not approve. None are indispensable._";
	text3 = "_And yet, Solberg has been effective in the past. Perhaps he can help Avernum in some small way one last time._";
	
begintalknode 128;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "I will follow Solberg's orders?";
	text1 = "He coughs slightly. _Within reason. You are there to help him, if he is sane. And if he is, as some say, mad, I authorize you to act to ... protect Avernum. In any way you see fit._";
	
begintalknode 129;
	state = 90;
	nextstate = 101;
	condition = gf(170,1) == 22 && gf(170,8) > 0;
	question = "Ess-Kalyn the Manburner has been destroyed. Along with Solberg. (Give a full report.)";
	text1 = "Levitt nods. He isn't as animated as he was last time. As time passes, his fatigue is starting to seem more real. There is another green smudge at the side of his mouth. This time, he doesn't wipe it off.";
	text2 = "_I have heard of your victory. The slith forces are aimless, undirected. Soon, we will strike back at them. They will ... They will die. Yes. Die._";
	text3 = "_I have also had word that the pylon by the river where you entered the northern lands is functional. We now have a faster route to that remote region._";
	text4 = "_Now ... Now ..._ His voice trails off. He must have been about to say something about new orders, but he was distracted.";
	code = 
		set_flag(170,1,24);
		toggle_quest(27,3);
		award_party_xp(800,32);
	break;		
	
begintalknode 130;
	state = 101;
	nextstate = -1;
	condition = 1;
	question = "You have something on your mouth. A little stain.";
	text1 = "He looks up and meets your gaze. For a moment, the fatigue fades. He wipes it off with a towel.";
	text2 = "_There was no smudge. Forget about it. If you are wise._";	
	
begintalknode 131;
	state = 101;
	nextstate = -1;
	condition = 1;
	question = "Do I have new orders?";
	text1 = "_You ... Yes, you do._ He shakes his head. _I was distracted. Yes. Orders._";
	
begintalknode 132;
	state = 90;
	nextstate = 103;
	condition = gf(170,1) == 24 && gf(177,16) < 2;
	question = "What are my new orders?";
	text1 = "_Now that our foes in the northern tunnels are in disarray, we can begin operations in that area. Rescue lost soldiers. Recover supplies. And, perhaps, clear a way to Melanchion._";
	text2 = "_These missions are to be your ... your primary focus. Yes. To prepare. For ... What is to come._";
	text3 = "_Fort Monastery, a remote outpost, has managed to hold off the slithzerikai for months. It is a miracle. Now it is time for you to relieve them._";
	text4 = "_Fort Draco was sealed and warded after the Slith Horde invaded, in order to protect the supplies within. You must unseal it. We need that equipment._";
	text5 = "_Our vahnatai here, Ghall-Ihrno, downstairs, he has been contacted by other vahnatai. In the northern caverns. Ghall-Ihrno says something important must happen. Soon. Talk to him._";
	text6 = "_And I ..._ He takes a moment to rally his thoughts. _I have more information available regarding these tasks._";
	code =
		toggle_quest(13,1);
		if (gf(177,10) > 1)
			rs(3);
		if (gf(177,11) > 1)
			rs(4);
		if (gf(177,12) > 1)
			rs(5);
	break;
	
begintalknode 133;
	state = 90;
	nextstate = -1;
	condition = gf(170,1) > 22 && gf(170,0) < 3;
	question = "After all I have done, I'm not being promoted?";
	text1 = "_What? Didn't I ... I ... Of course. It would be appropriate._ He removes captain's insignia from his desk and hands it to you.";
	text2 = "Before you can even pin your new insignia on, Levitt becomes distracted. It's not quite how you imagined your ascent in rank would be.";
	code =
		sf(170,0,3);
	break;
	
begintalknode 134;
	state = 103;
	nextstate = 102;
	condition = gf(177,10) < 2;
	question = "Tell me more about Fort Monastery.";
	text1 = "_One of Avernum's most recent fortifications, and yet it managed to stand against the assault of the horde. Which is still camped directly outside its gates._";
	text2 = "_The force outside the gates needs to be destroyed, though I suggest against a full assault. Find a way into the fort and provide support to their commander._";
 	code =
 		sf(177,10,1);
 		toggle_quest(28,1);
		mark_quest_dest(431,4,0,28);
	break;
	
begintalknode 135;
	state = 102;
	nextstate = -1;
	condition = 1;
	question = "Why can't I just kill the enemy camped outside?";
	text1 = "_You can try. But we would prefer, if you are inclined to suicide, to not engage in it just yet._";

begintalknode 136;
	state = 102;
	nextstate = -1;
	condition = 1;
	question = "How can I enter their fort?";
	text1 = "_The siege force is strong, but not strong enough to block access to Fort Monastery from every possible direction. I am sure you can find a way in._";

	
begintalknode 137;
	state = 103;
	nextstate = 105;
	condition = gf(177,11) < 2;
	question = "What exactly do I need to do in Fort Draco?";
	text1 = "_When the Slith Horde attacked, Fort Draco was sealed. Precious equipment was left inside. Didn't have time to recover it. We need it now._";
	text2 = "He takes a leather satchel out of his desk and hands it to you. You look inside. It contains a spherical crystal five inches in diameter. It's surprisingly light. _That will gain you entry._";
	text3 = "_A highly trained force is waiting nearby to recover the equipment. First, you will enable this force to teleport in and secure the fort. You will let them in._";
 	code =
 		if (has_spec_item(4) == 0)
 			set_spec_item(4,1);
 			else rs(2);
 		sf(177,11,1);
 		toggle_quest(29,1);
		mark_quest_dest(632,87,0, 29);
	break;
	
begintalknode 138;
	state = 105;
	nextstate = -1;
	condition = 1;
	question = "How can I pass the wards and enter the fort?";
	text1 = "_I am unaware of the exact nature of the magic used to seal the gates, but I was told that the sphere you now have will be useful._";
	
begintalknode 139;
	state = 105;
	nextstate = -1;
	condition = 1;
	question = "What do I do once I am inside?";
	text1 = "_Find the teleportation pylon. Use that crystal to activate it. Several soldiers, already attuned to it from when they were stationed in Fort Draco, will emerge._";
	text2 = "_They will proceed to extract certain vital supplies. Escort them and help them to clear Fort Draco of anything that might have managed to infest the fort in our absence._";
	text3 = "_In all probability, the powerful wards placed on Fort Draco when it was abandoned will have kept any nuisances away. That was the plan, anyway. But, the way things have gone so far ..._ He shakes his head.";
	
begintalknode 140;
	state = 105;
	nextstate = -1;
	condition = 1;
	question = "What is likely to be in Fort Draco?";
	text1 = "_It was held by powerful magical bonds. It contains items with powerful latent magical energy. Our mages believe that this sort of power can ... attract ... certain entities._";
	text2 = "_Of course, it is possible that Fort Draco will be empty and the mission will be trivially easy. But I don't think that's going to happen. Do you?_";
	
begintalknode 141;
	state = 103;
	nextstate = 106;
	condition = gf(177,12) < 2;
	question = "Tell me more about the vahnatai.";
	text1 = "_They think these caverns are their rightful home. They are our allies, except for when they're trying to kill us. And, according to Ghall-Ihrno, some of them are in northern Avernum right now._";
	text2 = "_This is an unpredictable factor, something I greatly dislike. I need you to find out where the creatures are and what they want. Speak with Ghall-Ihrno. He will tell you where to go._";
 	code =
 		sf(177,12,1);
 		toggle_quest(30,1);
		mark_quest_dest(645,23,0,30);
	break;
	
begintalknode 142;
	state = 106;
	nextstate = -1;
	condition = 1;
	question = "How did they communicate with Ghall-Ihrno?";
	text1 = "_The creature has his ways. That is why he is in the Castle. The tribes of the vahnatai speak with us through him._";
	
begintalknode 143;
	state = 106;
	nextstate = 107;
	condition = 1;
	question = "What should I do for the vahnatai?";
	text1 = "_Whatever they want, as long as it doesn't hurt the interests of Avernum. Of course, you have to find them first. Ghall-Ihrno should help you with that._";
	
begintalknode 144;
	state = 107;
	nextstate = -1;
	condition = 1;
	question = "And if they do want me to act against Avernum?";
	text1 = "_You will return straight to me. But I suspect that is not the case. They did, after all, ask us for help._";
	
begintalknode 145;
	state = 90;
	nextstate = -1;
	condition = gf(177,10) == 1 && gf(6,1) > 0;
	question = "I've have lifted the siege of Fort Monastery. (Give a report.)";
	text1 = "Levitt listens to your report. He takes no notes. In the end, he nods. _It is good that, sometimes, courage is not rewarded with doom. You have done a good job of saving the valuable troops and materials of the Avernite army._";
	text2 = "_You continue to be effective. Work on the other two tasks. In the meantime, important things are happening. Soon, there might be hope. If you're running low on supplies, report to the quartermaster._";
	text3 = "_I am going to have you stop working on this set of tasks. You are being removed from my command. A remarkable quest awaits you, and I have used you as much as I can._";
	code =
		sf(177,10,2);
		toggle_quest(28,3);
		inc_flag(177,16,1);
		inc_flag(177,17,1);
		if (gf(170,1) > 24) {
			rs(2); rs(3);
			}
			else {
				if (gf(177,16) == 1)
					rs(3);
					else rs(2);
				}
	break;
	
begintalknode 146;
	state = 90;
	nextstate = -1;
	condition = gf(177,11) == 1 && gf(23,12) > 0;
	question = "The gremlins have been cleansed from Fort Draco, and the equipment was recovered. (Give a report.)";
	text1 = "Levitt listens to your report. He takes no notes. In the end, he nods. _Gremlins. Of course. Is there no pest that will not afflict us in these miserable times? But they are gone. You have done well._";
	text2 = "_Also, you managed to preserve a surprising number of the agents sent to the fort. Such efficiency deserves reinforcement._ He gives you a bag of gold coins.";
	text3 = "_It is a pity that you could not have preserved more of the agents sent to the fort. I took a hand in their training myself. Still, I suppose it could not be helped._";
	text4 = "_You continue to be effective. Work on the other two tasks. In the meantime, important things are happening. Soon, there might be hope. If you're running low on supplies, report to the quartermaster._";
	text5 = "_I am going to have you stop working on this set of tasks. You are being removed from my command. A remarkable quest awaits you, and I have used you as much as I can._";
	code =
		if (gf(23,14) < 4) {
			rs(3);
			change_coins(500);
			award_party_xp(400,30);
			}
			else rs(2);
		sf(177,11,2);
		toggle_quest(29,3);
		inc_flag(177,16,1);
		inc_flag(177,17,1);
		if (gf(170,1) > 24) {
			rs(5); rs(4);
			}
			else {
				if (gf(177,16) == 1)
					rs(5);
					else rs(4);
				}
	break;
	
begintalknode 147;
	state = 90;
	nextstate = -1;
	condition = gf(177,12) == 1 && gf(10,5) > 0;
	question = "I found that group of vahnatai and gave them what they wanted. (Give a report.)";
	text1 = "Levitt listens to your report. He takes no notes. _Ahhh ... Rentar-Ihrno. Will we ever be free of fear of that wretch? How many times must we kill her before we are safe? But their clans are happy, and that's what we need._";
	text2 = "_You continue to be effective. Work on the other two tasks. In the meantime, important things are happening. Soon, there might be hope. If you're running low on supplies, report to the quartermaster._";
	text3 = "_I am going to have you stop working on this set of tasks. You are being removed from my command. A remarkable quest awaits you, and I have used you as much as I can._";
	code =
		sf(177,12,2);
		toggle_quest(30,3);
		inc_flag(177,16,1);
		inc_flag(177,17,1);
		if (gf(170,1) > 24) {
			rs(2); rs(3);
			}
			else {
				if (gf(177,16) == 1)
					rs(3);
					else rs(2);
				}
	break;
	
begintalknode 148;
	state = 90;
	nextstate = -1;
	condition = gf(170,1) == 24 && gf(177,16) > 1;
	question = "Who am I going to work for now?";
	text1 = "Levitt is suddenly doubled over with a painful fit of coughing. He lifts his handkerchief to his lips. It comes away flecked with both green and red. He glares at you, defying you to comment.";
	text2 = "_Say nothing. I am still lethal. Don't forget it. But I control you no longer. For this final mission, you report to King Starrus himself._";
	text3 = "_The throne room is open to you. Leave me._ He waves you away, coughing and hacking as he does.";
	action = END_TALK;
	code = 
		toggle_quest(13,3);
		toggle_quest(27,4);
		toggle_quest(28,4);
		toggle_quest(29,4);
		set_flag(170,1,25);
		sf(133,27,1);
		award_party_xp(600,35);
	break;	
	
begintalknode 149;
	state = 90;
	nextstate = -1;
	condition = gf(170,1) > 24;
	question = "Do you have any more orders for me?";
	text1 = "He shakes his head. He seems to be looking paler and weaker by the hour. _No. Go to Starrus. I am busy. So much chaos ... Disorder ... I will not leave my work undone. Do._";
	text2 = "He looks down at the ever-growing pile of reports on his desk, ignoring you.";
	action = END_TALK;
	
begintalknode 150;
	state = 90;
	nextstate = 108;
	condition = gf(132,24) > 0;
	question = "Can you tell me more about intelligence services?";
	text1 = "_You are from the army. You roam the lands, killing foes. Your work is necessary. It has an enviable directness._";
	text2 = "_But a few of us have been tasked by Starrus to serve Avernum in a different way. Collecting information. Making agents of disorder disappear before they grow. This is our task, and we sometimes receive talented assistance. Like you._";
	
begintalknode 151;
	state = 90;
	nextstate = -1;
	condition = gf(132,24) > 0;
	question = "I'd like to know more about you.";
	text1 = "He raises his eyebrows. _Many would._ And that's all he says.";
	
begintalknode 152;
	state = 90;
	nextstate = -1;
	condition = gf(132,24) > 0;
	question = "I need more training and supplies.";
	text1 = "_I believe that Ssem'Ess and Correlea have been made available to you. Nothing additional should be required._";
	
begintalknode 153;
	state = 90;
	nextstate = -1;
	condition = gf(132,24) > 0 && gf(170,1) > 24;
	question = "Are you sure you're feeling all right?";
	text1 = "Levitt responds to your concern with a look of pure loathing. _Time is ... limited ... And you are wasting it. Go to Starrus. Victory ... So close. Go!_ He lifts a report with a shaking hand, reads it, and ignores you.";
	action = END_TALK;
	
begintalknode 154;
	state = 108;
	nextstate = -1;
	condition = 1;
	question = "Agents of disorder?";
	text1 = "_They are everywhere. Spies from the Empire. Rebels against the Empire. Vahnatai splinter groups. Mad mages. Brigands. Demonic infiltration._";
	text2 = "_All threats to this land are removed. Some of them disappear into deep caves. And some ..._ He shrugs, but you think you see his gaze flicker over the cage in the corner.";
	
begintalknode 155;
	state = 108;
	nextstate = -1;
	condition = 1;
	question = "You work for King Starrus?";
	text1 = "_We all do. I am but an agent of the will of the monarch._";
	text2 = "_As, I hope, are you. I would be so disappointed to learn otherwise._";
	
begintalknode 156;
	state = 108;
	nextstate = -1;
	condition = 1;
	question = "Avernum faces many threats?";
	text1 = "_They are constant. Sometimes, as in the Time of Shades, they threaten us all. Other times, they only put huge chunks of our land and people at risk._";
	text2 = "_A few malcontents can simply be sent to the Abyss. Others ... They are dealt with without mercy._";

begintalknode 157;
	state = 90;
	nextstate = -1;
	condition = gf(132,24) > 0 && gf(132,22) == 1 && gf(133,13) == 0;
	question = "There is someone named Jasmine in the courtyard. She wants us to send help to Silvar.";
	text1 = "_Ah, yes. Her. I have investigated her. Overwrought and a source of discord, but not a rebel or traitor. And she has brought a valuable problem to our attention. If she shows some discretion, I will not have to deal with her._";
	text2 = "_Tell her that I have heard her complaints. We will take action. She may depart. I was already going to act, of course, but I think it better that she knows._";
	text3 = "His voice grows even colder. You're surprised that this is possible. _And as for you, please think twice before you occupy my precious time with the complaints of civilians and malcontents._";
	code =
		sf(133,13,1);
	break;
	
begintalknode 158;
	state = 105;
	nextstate = -1;
	condition = 1;
	question = "Anything you can tell me about the warriors that I am to escort?";
	text1 = "_They are some of our army's most competent and highly trained officers, and they will have been instructed which of many items cluttering Fort Draco are important and which are dross._";
	text2 = "_They must be escorted and protected. If too many of them are killed, I will have to consider your mission a failure._";	
	
begintalknode 159;
	state = 90;
	nextstate = -1;
	condition = gf(177,11) == 1 && gf(23,13) > 0;
	question = "We tried to recover the equipment from Fort Draco, but all of the agents you sent were slain. (Give a report.)";
	text1 = "Levitt listens to your report. He takes no notes. In the end, he shakes his head. _Gremlins. Of course. Is there no pest that will not afflict us in these miserable times? But they should still have been manageable._";
	text3 = "_It is a pity that you could not have preserved the agents sent to the fort. I took a hand in their training myself. You have failed me._";
	text4 = "_Perhaps you will have better luck with Fort Monastery and the vahnatai. Otherwise, despite your previous brave acts, you are going to find yourself rapidly demoted._";
	code =
		sf(177,11,2);
		toggle_quest(29,3);
	break;
			
// King Starrus

begintalknode 160;
	state = -1;
	nextstate = 150;
	condition = 1;
	question = "Name";
	text1 = "You are, at last, in the presence of royalty. Before you stands King Starrus, son of the heroic and beloved King Micah, and the second king of Avernum.";
	text2 = "He is a tall, thin man, almost skeletal, well into his fifties. It is as if the pressure of decades of rule have burned most of him away, but what remains is strong enough to handle whatever is asked of him.";
	text3 = "When you approach, he pushes a map aside and looks at you. Though his generals are clearly exhausted and nervous, he is calm. After you kneel, he bids you to rise.";
	text4 = "_I apologize for taking so long to call for the heroes of Formello, but I wanted to wait until I could make proper use of you. That time has come._";
	text5 = "King Starrus gives you some of his attention. While you have become very important to his plans, you can't help but detect a hint of impatience. You are, after all, only one aspect of his plan to save Avernum.";
	action = INTRO;
	
begintalknode 161;
	state = 150;
	nextstate = -1;
	condition = gf(132,25) == 0;
	question = "I am reporting for my new orders.";
	text1 = "All of the generals turn and watch you. Even though they outrank you, you can see the hint of awe in their eyes. You are, after all, the hero of the war against the Slith Horde.";
	text2 = "_And it is an honor. For all of us. And yet, we must ask more of you. Though the war against the horde goes well, we are still trapped in the underworld, and our food supplies grow desperately thin._";
	text3 = "_And yet, we have hope. An unexpected ally has emerged, and we now have a slim chance of avoiding famine and catastrophe. But first, we need an envoy. We need you._";
	action = SET_SDF 132 25 1;
	
begintalknode 162;
	state = 150;
	nextstate = 151;
	condition = gf(132,25) > 0 && (gf(170,1) == 25 || gf(170,1) == 26) && gf(59,1) == 0;
	question = "What do I need to do?";
	text1 = "_We have received messages from the dragon Melanchion. You are familiar with the beast ... You are the one who first established contact with the creature's servants._";
	text2 = "_The dragon's message has indicated that he can help us to repair the damage to the Great Portal. This might have taken us years. Too long, in other words. He can help us now._";
	text3 = "_Go to Melanchion. See if he can give us what we want. Learn his terms and return to me. Do nothing for the dragon until I have approved._";
	text4 = "He reaches under a stack of papers, removes something flat and green, and hands it to you. It is a large, withered scale. _The dragon's courier presented that to us. He said that you would need it._";
	code = 
		set_flag(170,1,26);
		toggle_quest(31,1);
		mark_quest_dest(225,308,0, 31);
		if (has_spec_item(5) == 0)
			set_spec_item(5,1);
			else rs(4);
	break;


begintalknode 163;
	state = 150;
	nextstate = -1;
	condition = gf(170,1) == 26 && gf(59,8) > 0;
	question = "I have met with Melanchion. He will provide us with the crystal we need, but there are conditions. (Describe them.)";
	text1 = "King Starrus listens carefully to the dragon's desires. You are sent out of the throne room while he confers with his generals. And confers. You wait for two hours before you are summoned back in.";
	text2 = "The generals, to a man, look shaken. King Starrus sits in his throne, exhausted. Something very momentous has happened. Whatever it is, they don't say. Starrus rises and looks at you.";
	text3 = "_I ... I think that the fate of Avernum has been decided this day._";
	text4 = "_Return to the dragon. Do what he says. He will provide what he offers. I believe this. Complete your end of the bargain. Retrieve the crystal spire. And then ... And then ..._";
	text5 = "_We will see._";
	code = 
		set_flag(170,1,27);
		toggle_quest(31,3);
		toggle_quest(32,1);
		award_party_xp(600,35);
	break;

begintalknode 164;
	state = 150;
	nextstate = 153;
	condition = gf(170,1) > 26 && gf(170,1) < 30;
	question = "What are my orders now?";
	text1 = "The generals look away. _Go to Melanchion. Do what he wishes. Once he will turn the crystal over, return to me._";
	
begintalknode 165;
	state = 150;
	nextstate = -1;
	condition = gf(170,1) == 30 || gf(170,1) == 31;
	question = "I have completed the work for Melanchion.";
	text1 = "King Starrus chuckles. _We are aware of that. The crystal has already arrived at the Great Portal. Melanchion was transporting it in secret._";
	text2 = "_I suspect that, even if you had not helped him, the devious reptile would have happily turned the spire over to us gratis. So great is his desire to dominate the underworld._";
	text3 = "_You must go complete your final task. Return to the site of the Great Portal. Be present as it is reconstructed. I believe that some force will be required to subdue whatever stray magical elements remain._";
	text4 = "_My hopes, and the hopes of all Avernum, go with you._";
	code =
		toggle_quest(32,3);
		toggle_quest(9,1);
		if (gf(170,1) == 31) {
			rs(1); rs(2);
			}
		sf(170,1,31);
	break;
	
begintalknode 166;
	state = 150;
	nextstate = -1;
	condition = gf(170,1) < 27;
	question = "I would like to know more about what is happening in Avernum.";
	text1 = "_Things are dire. Less so than before, but still desperate. I would discuss it with you. Later. After we have a clearer view of what the dragon desires._";
	
begintalknode 167;
	state = 150;
	nextstate = 155;
	condition = gf(170,1) >= 27;
	question = "I would like to know more about the future of Avernum.";
	text1 = "_It is no mystery. Avernum, as it exists now, must end. The underworld is too small, too perilous, too crowded._";
	text2 = "_We tried to civilize it. We failed. A new future approaches._";	
	
begintalknode 168;
	state = 150;
	nextstate = -1;
	condition = gf(132,25) > 0 && gf(170,1) < 27;
	question = "I want to ask something about Levitt.";
	text1 = "King Starrus shakes his head. _It is unwise to ask too much about that lethal old man. He is a fanatic, like Solberg. Like me. But he is sick, and his strength is overtaxed. He relies on certain ... plants to sustain him._";
	text2 = "_Soon, he will end. Leave him in peace. He might not deserve it, but he has earned it._";	
	
begintalknode 169;
	state = 151;
	nextstate = -1;
	condition = 1;
	question = "Where is Melanchion?";
	text1 = "_Somewhere in the caves west of Fort Draco and east of the Abyss, near the ruins of New Harston. He said that he is in the ruins of the old Empire outpost, though I doubt that helps you._";
	text2 = "_He also said that, when you enter his lands, he will make himself easy to find._";
	
begintalknode 170;
	state = 151;
	nextstate = -1;
	condition = 1;
	question = "Do you really trust the dragon?";
	text1 = "_Dragons have been allies of Avernum in the past. Their hatred of the Empire works well for us. I do not trust the creature, but I believe it can help us. For a price._";
	
begintalknode 171;
	state = 151;
	nextstate = -1;
	condition = 1;
	question = "What if the dragon is secretly working against Avernum?";
	text1 = "_A foe such as that could end us for good. And yet, if that was what the creature wanted, it would have attacked us before now._";
	text2 = "_No, I believe there is hope here. But it is still vital that you tell us what the creature desires before you aid it._";
	
begintalknode 172;
	state = 153;
	nextstate = -1;
	condition = 1;
	question = "This is odd. What is going on here?";
	text1 = "_Is it not clear? If it isn't, it should be. Look around. See what is happening. Avernum, as we knew it, is ending. As it must._";
	text2 = "_There is no treachery against you. Only tasks, and rewards when they are completed. Now go._ You have been dismissed.";
	action = END_TALK;
	
begintalknode 173;
	state = 155;
	nextstate = -1;
	condition = 1;
	question = "What will become of Avernum?";
	text1 = "_It will become a wild place. It will return to being what it was, what it was always meant to be, a place of darkness and courage and savagery. Human, dragon, vahnatai, they will fight over it. Forever._";
	text2 = "_And it is, I think, a good thing. I think the world should always have a place where the young and strong and foolhardy can come to try their fortune._";
	
begintalknode 174;
	state = 155;
	nextstate = -1;
	condition = 1;
	question = "Can nothing be changed?";
	text1 = "_Everything can change. Avernum is in a state of flux, as Melanchion contends with others, including us, for position and power._";
	text2 = "_Who we help, and how, may have a real effect on who dominates Avernum in the future._";
	
begintalknode 175;
	state = 155;
	nextstate = -1;
	condition = 1;
	question = "Where will you go?";
	text1 = "He looks surprised. _Go? I am going nowhere. There are some people who will never leave Avernum, no matter what. They will come here, I will lead them, and our nation will continue._";
	text2 = "_Smaller, perhaps, and more humble. But we will remain._";
	
// another levitt node

begintalknode 178;
	state = 90;
	nextstate = 105;
	condition = gf(177,11) == 0 && gf(170,1) > 24;
	question = "Did you mention that you needed help in Fort Draco?";
	text1 = "_Hmmm ... Yes. We do still need help there. When the Slith Horde attacked, Fort Draco was sealed. Precious equipment was left inside. Didn't have time to recover it. We need it now._";
	text2 = "He takes a leather satchel out of his desk and hands it to you. You look inside. It contains a spherical crystal five inches in diameter. It's surprisingly light. _That will gain you entry._";
	text3 = "_A highly trained force is waiting nearby to recover the equipment. First, you will enable this force to teleport in and secure the fort. You will let them in._";
 	code =
 		if (has_spec_item(4) == 0)
 			set_spec_item(4,1);
 			else rs(2);
 		sf(177,11,1);
 		toggle_quest(29,1);
		mark_quest_dest(632,87,0, 29);
	break;
	
	
// Correlea

begintalknode 180;
	state = -1;
	nextstate = 170;
	condition = 1;
	question = "Name";
	text1 = "One of the sad side-effects of the Castle being so cramped is that the magical facilities, like this small alchemical laboratory, are so close to the dining hall and storage rooms. And yet, the system has worked for decades.";
	text2 = "A middle-aged sage is here, mixing reagents and reducing mixtures. Despite her many years doing this hazardous work, she has escaped serious scarring or burning. Only faint green stains on her fingers mark her occupation.";
	text3 = "When you enter, she turns and smiles. _I am Sage Correlea, alchemist and magical archivist. I was warned of your arrival and told to give you assistance. Such assistance as your rank merits, anyway._";
	text5 = "Correlea wanders around her workshop, chopping herbs, stirring pots of boiling goop, and checking the cell. Occasionally, she checks to see if you need any assistance.";
	action = INTRO;
	
begintalknode 181;
	state = 170;
	nextstate = 171;
	condition = 1;
	question = "What is this workshop for?";
	text1 = "_Research. Samples are brought to me for analysis. Diseased mushrooms. Unusual new monsters. And so on. I examine them for the benefit of my superiors. I also make the odd potion, when someone important needs it quickly._";
	text2 = "_There are better places in Avernum for such work, but King Starrus likes for some things to be done here._";
	
begintalknode 182;
	state = 170;
	nextstate = 173;
	condition = 1;
	question = "How long have you been here?";
	text1 = "_Oh, for so long. Too long._ She blushes a little. _Since Rone brought me here during the Time of Shades. He thought I could help find a way to defeat those creatures. I did. And they haven't let me leave since._";
	text2 = "";
	
begintalknode 183;
	state = 170;
	nextstate = 175;
	condition = 1;
	question = "Can I receive training?";
	text1 = "_Of course. You are authorized. I can make magical learning available to you. Sadly, since supplies are limited, you will need to provide compensation for the materials we will use._";
	text2 = "_Also, should you ever attain the rank of Lieutenant, I can make a new class of rituals available to you._";
	text3 = "_Also, since you have attained the rank of Lieutenant, I can make a new class of rituals available to you._";
	code =
		if (gf(170,0) < 2)
			rs(3);
			else rs(2);
	break;
			
begintalknode 184;
	state = 170;
	nextstate = -1;
	condition = 1;
	question = "Can I purchase any potions?";
	text1 = "_Oh. No. I would get into trouble. Ssem'Ess, next door, insists that all such 'assets,' as he calls them, go through him._";
	
begintalknode 185;
	state = 171;
	nextstate = 172;
	condition = 1;
	question = "Where else does magical research take place?";
	text1 = "_Mostly in Patrick's Tower, to the southwest, and the Tower Colony, to the east. Anything large or explosive or dangerous is done there, far from the Castle._";
	text2 = "_You will find lots of quality wizards there, many from the surface._";
	
begintalknode 186;
	state = 172;
	nextstate = -1;
	condition = 1;
	question = "Why do wizards come down from the surface?";
	text1 = "_Empire law is desperately strict about who can do magic and how much they can do. Any ambitious wizard who wants to do something exciting? They come to us. It's a great asset. Unless they're insane._";
	
begintalknode 187;
	state = 171;
	nextstate = -1;
	condition = 1;
	question = "Why does King Starrus have research done here?";
	text1 = "_He and ..._ She leans close and whispers. _Levitt. His spymaster._ She talks in a normal voice again. _There are some things they want to see themselves or to have examined under their direct supervision._";
	text2 = "_I'm not saying they don't trust the Tower Colony. But ..._ She shrugs.";	
	
begintalknode 188;
	state = 173;
	nextstate = -1;
	condition = 1;
	question = "Rone?";
	text1 = "She sighs. _A great wizard. One of the first, a hero of Avernum. You know, when a wizard reaches a certain level of power, they tend not to die until they decide that it's their time._";
	text2 = "_Five years ago, Rone ... He decided._ She turns and discreetly wipes her eyes with her sleeve.";	
	
begintalknode 189;
	state = 173;
	nextstate = -1;
	condition = 1;
	question = "The Time of Shades?";
	text1 = "Her voice takes on the practiced tone of one who has told this story many times. _When the mad vahnatai Rentar-Ihrno attempted to take her vengeance upon Avernum._";
	text2 = "_She created three powerful shades, with the ability to madden anyone near them, and inflicted them upon our cities. Working with several adventurers, I found a weakness in those creatures which lead to their destruction._";
	text3 = "_For that, I was honored, et cetera. It's a long tale, and I don't think it's a good time to wallow in tales of Avernum's sorrow._";
	
begintalknode 190;
	state = 175;
	nextstate = -1;
	condition = 1;
	question = "Can you teach holy rituals?";
	text1 = "_I'm afraid I can't, but Asta can. She is upstairs. She would like, I am sure, a distraction from her other work._";
	
begintalknode 191;
	state = 175;
	nextstate = -1;
	condition = 1;
	question = "I would like to learn magic.";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Correlea's Spells",
		  "Correlea describes a range of simpler magical incantations that might be of value to you.",
		  2,3,0);	
	break;
	
begintalknode 192;
	state = 175;
	nextstate = -1;
	condition = gf(170,0) >= 2;
	question = "I would like to learn advanced magic.";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Correlea's Spells",
		  "Correlea describes a range of more powerful magical incantations that might be of value to you.",
		  3,4,0);	
	break;
	
begintalknode 193;
	state = 175;
	nextstate = 170;
	condition = 1;
	question = "I don't need to learn anything else.";
	text1 = "_All right._";
	
// Ghall-Ihrno

begintalknode 200;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = "You get a closer look at the vahnatai, who has made the Castle his home for over twenty years. He sits on a stone chair, staring deeply into the crystal before him. For the vahnatai, crystals are the heart of both magic and religion.";
	text2 = "He is wrapped in a thin, translucent cloak, their traditional garb. The fabric shimmers slowly in the dim light, changing color every moment.";
	text3 = "Then he ends his meditation and looks up at you. _A visitor. Not a surprise. I am Ghall-Ihrno. It is nice to have those to talk to at the end._";
	text5 = "Ghall-Ihrno stares up at you calmly. _You would speak with me? More calm conversation and reflection before the end of things? I would not object._";
	action = INTRO;
	
begintalknode 201;
	state = 190;
	nextstate = 191;
	condition = 1;
	question = "What is your purpose in the Castle?";
	text1 = "_I am a ... Diplomat is not the right word. I can talk to vahnatai. Of different ... Clans? Groups. Tribes. I carry messages from them to the Castle and back, so the humans can keep from overly enraging their kind._";
	
begintalknode 202;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "You said something about the end?";
	text1 = "_Avernum has faced many crises, but this one ... We vahnatai have lived through this story before. We know how it ends._";
	text2 = "_But such talk, I have found, causes aggravation among your kind. I will not speak farther. Except to say this. Everything ends._";
	
begintalknode 203;
	state = 190;
	nextstate = -1;
	condition = gf(177,12) == 0;
	question = "There is something else I would like to know.";
	text1 = "_About me? Or my people? Well ..._ He looks at the insignia on your shoulder.";
	text2 = "_The humans here can grow irritable if I spend too much time speaking with the lower classes. Perhaps you should go. I will return to my meditation. Pardon. Good day._";
	action = END_TALK;
	
begintalknode 204;
	state = 190;
	nextstate = 195;
	condition = (gf(177,12) == 1 || gf(170,1) > 24) && gf(10,5) == 0;
	question = "Levitt told me to come and speak with you.";
	text1 = "_So you will be aiding us? I am glad. There is a new group of vahnatai in the northern parts of Avernum, northwest of Formello. I did not expect them. And, somehow, they found a crystal they could use to contact me._";
	text2 = "_They have a task, and they need the help of humans. They have not told me what it is. It is hard to communicate with them. However, at this stage, I think your kind could use the goodwill of the vahnatai._";
	text3 = "He rises, walks to his cabinet, and fetches a thin sheet of mica, marked with odd scratches. He gives it to you. _This will mark you as being from me. I ask you to find my fellow vahnatai and aid them._";
	text4 = "_Helping them will have rewards. For you, and for your nation._";
	code =
		if (has_spec_item(6) == 0)
			set_spec_item(6,1);
			else rs(3);
	break;
	
begintalknode 205;
	state = 190;
	nextstate = -1;
	condition = gf(10,5) > 0;
	question = "What are your plans now?";
	text1 = "_Soon, I will return to my people. I see the end coming, closer and closer. There is no need for me to stay here, but my kind can use me in the tumult ahead._";
	text2 = "_I thank you for your aid. My departure will be soon._";
	
begintalknode 206;
	state = 191;
	nextstate = -1;
	condition = 1;
	question = "How did you come to be here?";
	text1 = "_I came during the ... You call it the Time of Shades. A time of violence between my people and yours. Very sad. Once here, I saw I should stay._";
	
begintalknode 207;
	state = 191;
	nextstate = -1;
	condition = 1;
	question = "How do you communicate with them? Do you travel?";
	text1 = "_No. I communicate from here. We have ... many ways._ He doesn't elaborate.";
	
begintalknode 208;
	state = 191;
	nextstate = 192;
	condition = 1;
	question = "The humans enrage the vahnatai?";
	text1 = "_When you infringe upon our lands. When our presence exhausts the caves, we vahnatai hibernate and let them regenerate. A talent your kind lacks, alas._";
	text2 = "_But, when you move into our lands while we sleep, we can be irked upon awakening. Such a thing recently happened in the low caverns to the north._";	
	text3 = "_But that was settled happily and peacefully._";
	
begintalknode 209;
	state = 192;
	nextstate = -1;
	condition = 1;
	question = "How?";
	text1 = "_The Blight. The attack of the slithzerikai. The human invaders fled for their lives, and the vahnatai seized their land._";
	text2 = "_Ahhh ... You might not find that to be a happy conclusion. Ah, well._";
	
begintalknode 210;
	state = 195;
	nextstate = -1;
	condition = 1;
	question = "The vahnatai found a way to communicate with you?";
	text1 = "_There are isolated pieces of vahnatai magic in Avernum. This small band stumbled upon a piece of it. When you find them, I am sure that you will learn more._";
	
begintalknode 211;
	state = 195;
	nextstate = -1;
	condition = 1;
	question = "How can I locate them?";
	text1 = "_As I said, go to Formello. The vahnatai seem to be northwest of there and northeast of Fort Draco. More than that, I don't know. Some searching might be required._";
	
begintalknode 212;
	state = 195;
	nextstate = -1;
	condition = 1;
	question = "They said nothing about what they want?";
	text1 = "_No. Although, since they asked you for help, I doubt it will be harmful to your kind._";
	text2 = "_However, these are not traditionally vahnatai lands. They came a very long way to get here and ask for your help. Whatever they wish, they take it very seriously._";
	
// Lark

begintalknode 215;
	state = -1;
	nextstate = 210;
	condition = 1;
	question = "Name";
	text1 = "There is a mage in this storeroom, walking around with a scroll in one hand and a pen in the other, cataloging the piles of junk here. She sometimes grabs an item and moves it to a different shelf or throws it in the trash barrel.";
	text2 = "She isn't as pale and thin as the other Avernites in town. She has been in Avernum for a long time, but you doubt that she was born here. She seems very distracted. Which, considering all the junk, is understandable.";
	text3 = "_She looks up at you. Welcome ..._ She looks at the insignia on your shoulder. _Soldier. I am Lark, hedge-wizard and archivist._ She looks over your equipment. _Hmmm. Nothing of historical import there. Carry on._";
	text5 = "Lark continues to sort through the items, dusting them off, taking notes on them, and occasionally discarding them. _Sorry. It is so easy to get distracted. Can I help you with something else?_";
	action = INTRO;
	
begintalknode 216;
	state = 210;
	nextstate = 211;
	condition = 1;
	question = "Where are you from?";
	text1 = "_Ahhhh ..._ She looks up at the ceiling, lost in memory. _I was on the surface once. Sunlight. Wind. Food. Then I came down here. And I kept staying down here. Until now._";
	
begintalknode 217;
	state = 210;
	nextstate = -1;
	condition = 1;
	question = "Can you teach me any magic?";
	text1 = "_Oh, no. That has never been my specialty. Talk to Correlea or Asta. They can help you._";
	
begintalknode 218;
	state = 210;
	nextstate = 213;
	condition = 1;
	question = "What is all this stuff for?";
	text1 = "_This ... stuff, as you call it, is a collection of fine historical and magical artifacts from all throughout the history of Avernum. I was brought here after the Blight struck to gather and catalog them._";
	
begintalknode 219;
	state = 210;
	nextstate = 215;
	condition = gf(132,29) < 2;
	question = "Are you buying any equipment?";
	text1 = "_I am, in fact. But nothing mundane. I'm so glad you asked!_ She giggles. _Special things. And I don't pay with money, but with artifacts of only moderate power. And knowledge!_";
	text2 = "_For example, I want to recover the blessed athame. It is an item of some historical interest to scholars of Avernum. Plus, it can put scratches in just about anything, if that's the sort of thing you like to do._";
	text3 = "_If someone recovered it for me, so it could be taken to safety, I would pay very well._";
	code = 
		set_flag(132,29,1);
		toggle_quest(37,1);
	break;	
	
begintalknode 220;
	state = 211;
	nextstate = -1;
	condition = 1;
	question = "Why did you come down here?";
	text1 = "_You know, I'm not sure. Low rations must be fuzzing my memory. Probably for the same reason most magicians come down here ... To do research and zap things without the Empire bothering us._";
	
begintalknode 221;
	state = 211;
	nextstate = 212;
	condition = 1;
	question = "Why did you stay?";
	text1 = "_Well, it's all so interesting down here. I'm only so good at magic, but I turned out to have a knack for getting things and finding things. Deciphering old dragon scrolls. Gathering bits of odd monsters._";
	text2 = "_Papers on my discoveries have been read in the finest academies on the surface. I'm just naturally good at getting things._";
	
begintalknode 222;
	state = 212;
	nextstate = -1;
	condition = 1;
	question = "And you get the things yourself?";
	text1 = "_Oh, I have been known to hire the occasional adventurer. But I tell them where to go. That part is very important!_";
	
begintalknode 223;
	state = 213;
	nextstate = -1;
	condition = 1;
	question = "Historical and magical artifacts?";
	text1 = "_Items of great fame and interest, and items of power. Things we do not want lost. I find them and keep them safe. By the order of King Starrus himself._";
	
begintalknode 224;
	state = 213;
	nextstate = 214;
	condition = 1;
	question = "And what happens to the stuff?";
	text1 = "_Well, if it's not interesting or powerful, I discard it. If it is interesting but not very powerful, I barter it._";
	text2 = "_And if it is an item of great fame or strength, it will be saved._";
	
begintalknode 225;
	state = 214;
	nextstate = -1;
	condition = 1;
	question = "Saved?";
	text1 = "_Taken to the surface, where it will be held safe until Avernum is secure._";
	text3 = "_Taken to the surface. Or, at least, it will be when the portal is rebuilt. Which will happen soon. I hope._";
	action = DEP_ON_SDF 170 1 10;
	
begintalknode 226;
	state = 215;
	nextstate = -1;
	condition = 1;
	question = "What is an athame?";
	text1 = "_A small ceremonial dagger. This one is most highly and effectively blessed and used for the etching of magical glyphs. Once stored safely in the Tower of Magi, it has since had a long and interesting tale._";
	
begintalknode 227;
	state = 215;
	nextstate = -1;
	condition = 1;
	question = "And where is this athame?";
	text1 = "She makes a small, happy hopping motion. _Somehow, I knew you would ask. It was being used to etch protective symbols in the northern forts, first Fort Emerald, and then Fort Saffron._";
	text2 = "_It was lost only recently. In tracing its path, the last I heard, it was taken to Fort Saffron a few months ago. Perhaps the commander there can help you to learn its fate._";	
	
begintalknode 228;
	state = 210;
	nextstate = -1;
	condition = gf(132,29) == 1 && has_spec_item(7);
	question = "I have your blessed athame. (Give it to her.)";
	text1 = "She eagerly takes it, confirms that it is undamaged, and deposits it in a leather satchel. _Excellent. I will get it to the surface as quickly as possible, before some other careless person takes it away and then dies._";
	text2 = "She walks to the west wall and unlocks a box. _Help yourself to what is in there. A worthwhile reward for a brave adven ... Soldier. I meant soldier._";	
	text3 = "_I recognize greatness in you, the sort of enthusiasm and skill that could lead you to be a great gatherer of things. If you are interested in pursuing your new calling, let me know._";
	code = 
		set_spec_item(7,-1);
		set_flag(132,29,2);
		toggle_quest(37,3);
		award_party_xp(500,12);
		sf(133,14,1);
	break;		
	
begintalknode 229;
	state = 210;
	nextstate = 216;
	condition = gf(132,29) == 2 || gf(132,29) == 3;
	question = "I would like to help you gather more stuff.";
	text1 = "_I am so very happy to hear it! I have been needing a part-time gatherer person very badly. And there is something else I seek._";
	text2 = "_I am referring to the famed onyx scepter. A finely carved artifact with the ability to stabilize magical portals, its possession would be of obvious value._";
	text3 = "_Return it to me, and an even more glorious reward than the last awaits you._";
	code = 
		set_flag(132,29,3);
		toggle_quest(38,1);
	break;	

begintalknode 230;
	state = 216;
	nextstate = -1;
	condition = 1;
	question = "It stabilizes portals?";
	text1 = "_Its mere presence has a calming effect on magic, evening out surges and calming enraged flows. In most cases, unhelpful. For the creation of portals, invaluable._";
	text2 = "_If the Great Portal is to be recreated, having the onyx scepter would be, while not necessary, very helpful._";
	code = 	
		if (gf(170,1) < 12)
			rs(2);
	break;
	
begintalknode 231;
	state = 216;
	nextstate = -1;
	condition = 1;
	question = "And where is the scepter?";
	text1 = "_After the Blight arrived, it was taken to the ruins of Fort Avernum, in the hope that the old portal there could be reopened. It would have been very handy for bringing supplies from the surface._";
	text2 = "_Then the slithzerikai attacked, and the trail was lost._";
	text3 = "_The ruins of Fort Avernum are east of Silvar._";
	
begintalknode 232;
	state = 210;
	nextstate = -1;
	condition = gf(132,29) == 3 && has_spec_item(8);
	question = "I have your onyx scepter. (Give it to her.)";
	text1 = "She takes it with great reverence. _You may have done Avernum a truly great service today. I will make sure that the appropriate wizards get this immediately._";
	text2 = "She walks out to the hall to unlock a storeroom. _Help yourself to what is in there: An artifact valuable enough to save but not to take to the surface. Even if we could._";	
	text3 = "_You are very adept at this sort of thing. If you wish to continue your new calling, let me know._";
	code = 
		set_spec_item(8,-1);
		set_flag(132,29,4);
		toggle_quest(38,3);
		award_party_xp(500,18);
		sf(133,24,1);
	break;		
	
begintalknode 233;
	state = 210;
	nextstate = 217;
	condition = gf(132,29) == 4 || gf(132,29) == 5;
	question = "I would like to help you gather even more stuff.";
	text1 = "_Good! Your timing is excellent. An artifact of exceptional value and historical significance has been lost. It must be recovered._";
	text2 = "_I speak, of course, of the Orb of Thralni, the glorious sphere that has granted the gift of flight to many an adventurer._";
	text3 = "_And then some soldiers took it for a mission, only a few weeks previous, and lost it. And, I suppose, their own lives as well. It must be recovered!_";
	code = 
		set_flag(132,29,5);
		toggle_quest(39,1);
	break;	
	
begintalknode 234;
	state = 217;
	nextstate = -1;
	condition = 1;
	question = "It can help me fly?";
	text1 = "_It can! It works on single individuals or small groups. Once, it was thought that it could even work on six individuals. More recent research revealed, oddly, that the limit was actually four._";
	text2 = "_Whichever. Its uses for missions of stealth were limitless. As long, of course, as it was not lost._";
	
begintalknode 235;
	state = 217;
	nextstate = -1;
	condition = 1;
	question = "And where is the orb?";
	text1 = "_It was carried by a small group of raiders on a mission to assassinate some slith warlord. They left from Almaria and used the orb to fly upriver._";
	text2 = "_What madness. Four warriors against the whole slith army? Certain death! And such a waste of our precious and unique orb!_";
	text3 = "_Perhaps, if you ever went up the river north from Almaria, you can find traces of their passage and discover where their remains landed._";
	
begintalknode 236;
	state = 210;
	nextstate = -1;
	condition = gf(132,29) == 5 && has_spec_item(9);
	question = "I have your Orb of Thralni. Well, what is left of it. (Give the shards to her.)";
	text1 = "Lark lets out a cry of limitless woe as she takes the shards. _Ahhhhhhhh!_ she cries. _Noooooo!_ With your help, she manages to console herself.";
	text2 = "_What a waste. But, perhaps, some of the residual magic remains in the shards. Perhaps the artifact can be reformed._";
	text3 = "She unlocks the northeast door. _Help yourself to what is in there._ She blushes slightly. _It is my bedroom, but I've had to use it for artifact overflow._";	
	text4 = "_If you wish to hunt for something else, something that is probably already broken anyway, let me know._";
	code = 
		set_spec_item(9,-1);
		set_flag(132,29,6);
		toggle_quest(39,3);
		award_party_xp(500,24);
		sf(133,29,1);
	break;		
	
begintalknode 237;
	state = 210;
	nextstate = 218;
	condition = gf(132,29) == 6 || gf(132,29) == 7;
	question = "I would like to help you find something else.";
	text1 = "_I've heard rumors that you have been going north. Far north. If so, I would like something of huge historical significance._";
	text2 = "_In the Time of Shades, Avernum was in part saved because the vahnatai were able to contact a group of adventurers. They did so using crystals hidden in caverns north of Formello and Fort Draco._";
	text3 = "_Perhaps, somewhere in those caverns, you might find one of those original communication crystals. Bring me knowledge of its location and, if it has already been shattered, a fragment of it._";
	code = 
		set_flag(132,29,7);
		toggle_quest(40,1);
	break;	
	
begintalknode 238;
	state = 218;
	nextstate = -1;
	condition = 1;
	question = "The Time of Shades?";
	text1 = "_A strange time, one that many despised. A time when the vahnatai were of great use to us when they weren't trying to, you know, kill us._";
	text2 = "_Those times are gone forever, but the debris remains. Lovely, lovely debris._";
	
begintalknode 239;
	state = 218;
	nextstate = -1;
	condition = 1;
	question = "Where should I hunt for these crystals?";
	text1 = "_The adventurers who found the crystals were most neglectful of their responsibility to history. All they said when they reported to the Castle was that the stones were north of Formello and Fort Draco._";
	text2 = "_However, if, in your travels, you find signs of vahnatai activity, that would be a natural place to explore._";
	
begintalknode 240;
	state = 210;
	nextstate = -1;
	condition = gf(132,29) == 7 && has_spec_item(10);
	question = "Look. Shards. Here. (Give them to her.)";
	text1 = "Lark takes the shards and inspects them. She can't hide her disappointment. _Well. Seldom has an item of such priceless historical interest been so cracked and dusty._";
	text2 = "She walks out to the hall to unlock a storeroom. _Help yourself to what is in there: An artifact valuable enough to save but not to take to the surface. Even if we could._";	
	text4 = "_I have one more artifact on my current collection list. One of great fame and utility, that all Avernites have heard of._";
	code = 
		set_spec_item(10,-1);
		set_flag(132,29,8);
		toggle_quest(40,3);
		award_party_xp(500,28);
		sf(133,25,1);
	break;		
	
begintalknode 241;
	state = 210;
	nextstate = 219;
	condition = gf(132,29) == 8 || gf(132,29) == 9;
	question = "What is the final artifact?";
	text1 = "_It is the blade Demonslayer, lost and found, broken and reforged, held in awe by some, thought to be gruesomely overrated by others._";
	text2 = "_It was taken from me recently and not returned. I know exactly where it is. My collection will be ever incomplete without it._";
	code = 
		set_flag(132,29,9);
		toggle_quest(41,1);
	break;	
	
begintalknode 242;
	state = 219;
	nextstate = -1;
	condition = 1;
	question = "What is Demonslayer?";
	text1 = "_A mighty greatsword, with the unmatched ability to slay demons. Of which, of course, there is rarely a shortage down here._";
	
begintalknode 243;
	state = 219;
	nextstate = -1;
	condition = 1;
	question = "Where is Demonslayer?";
	text1 = "_It was taken to the Tower Colony to aid in sealing the magical rent in reality on the second floor. One of our better warriors carried Demonslayer to fend off the infernals the tear attracted._";
	text2 = "_Didn't work. He died, and the blade now lies at the feet of one particularly large haakai. At least, that is what the one scout that survived reported._";
	
begintalknode 244;
	state = 219;
	nextstate = -1;
	condition = 1;
	question = "How can I get the blade?";
	text1 = "_Without aid, trying to recover it would be suicide. Perhaps if you consulted with the mages at the colony, one of them might have some good advice._";
	
begintalknode 245;
	state = 210;
	nextstate = -1;
	condition = gf(132,29) == 9 && (party_has_item(304) || party_has_item(305));
	question = "I have obtained Demonslayer. (Give it to her.)";
	text1 = "Lark takes the blade, inspects it, and sighs. _Cracked. Of course. And now it must be reforged. Again._ She can't hide her disappointment. _But at least it is home._";
	text2 = "She walks out to the hall to unlock a storeroom. _Help yourself to what is in there ... the last and greatest of the rewards I can offer you._";	
	text4 = "_You have done marvelously. You are easily one of the best collectors I have ever met. If the Great Portal can be reformed before we all die, your names will be said in awe by archivists everywhere._";
	code = 
		take_item(304);
		take_item(305);
		set_flag(132,29,10);
		toggle_quest(41,3);
		award_party_xp(800,34);
		sf(133,26,1);
	break;		
	
begintalknode 246;
	state = 210;
	nextstate = -1;
	condition = gf(132,29) == 10;
	question = "Is there nothing else to obtain?";
	text1 = "_Not yet. Once I can transport the massive pile of stuff I already have to safety, I can begin to collect again. Until then, I watch my trove and prepare to defend the castle._";
	text2 = "_The only thing I seek now is food._ She shakes her head. _But don't we all?_";	
	
// Ssem'Ess

begintalknode 250;
	state = -1;
	nextstate = 250;
	condition = 1;
	question = "Name";
	text1 = "By approaching this counter, you become part of a tradition stretching back to the earliest days of the Castle: trying to pry desperately needed supplies out of the hands of an unsympathetic quartermaster.";
	text2 = "The armed slithzerikai behind the counter says, _Ahsssss ... Isss you. News had come of new transfersss. Ssem'Ess was told of your face. And here you are._";
	text3 = "_Ssem'Ess can trade. Can give more supplies. Can give ... Isss called a per diem. But no more. Little to trade here. Suppliesss are short._";
	text5 = "Ssem'Ess says, _You want more? Soldiersss ... Always wanting. What do you want now?_";
	action = INTRO;

begintalknode 251;
	state = 250;
	nextstate = 251;
	condition = 1;
	question = "I would like to trade with you.";
	text1 = "_Yessss ... Good. You barter. Give what you found, get what you need. Restock our suppliesss. Isss good. Will buy, will sell. What you want?_";
	
begintalknode 252;
	state = 251;
	nextstate = -1;
	condition = 1;
	question = "Let me see what I can trade for.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Ssem'Ess",
		  "You are shocked at how depleted the Castle's supply room has become. Still, there are some useful items you can trade for.",
		  4,2,0);	
	break;
	
begintalknode 253;
	state = 251;
	nextstate = -1;
	condition = 1;
	question = "I have something I want to sell.";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;
	
begintalknode 254;
	state = 251;
	nextstate = 250;
	condition = 1;
	question = "I want to talk about something else.";
	text1 = "_Yesss? What isss it?_";
	
begintalknode 255;
	state = 250;
	nextstate = -1;
	condition = gf(131,25) < gf(177,17) + 2;
	question = "Can I have my per diem?";
	text1 = "_Yesss ... Money for expenses. Can't give every day, but can give as time passesss._ Ssem'Ess counts out a small pile of silver coins for you.";
	code =
		change_coins(20 * (gf(177,17) + 2 - gf(131,25)));
		sf(131,25,gf(177,17) + 2);
	break;
	
begintalknode 256;
	state = 250;
	nextstate = -1;
	condition = gf(131,25) >= gf(177,17) + 2;
	question = "Can I have my per diem?";
	text1 = "_Not yet. Not enough time is past. Should be giving every day, but not enough money to give every day._";
	
begintalknode 257;
	state = 250;
	nextstate = -1;
	condition = (gf(131,26) == 0 && gf(177,17) < 1) || (gf(131,26) > 0 && gf(131,27) == 0 && gf(177,17) < 3) || (gf(131,27) > 0 && gf(131,28) == 0 && gf(177,17) < 6);
	question = "Can I have more supplies?";
	text1 = "_Sssss ... No. No word comesss of you doing enough. Do more, and you get more._";
	
begintalknode 258;
	state = 250;
	nextstate = -1;
	condition = gf(131,26) == 0 && gf(177,17) >= 1;
	question = "Can I have more supplies?";
	text1 = "_Yesss. Word comesss. I give precious suppliess to you._ He unlocks one of the boxes in the supply room.";
	code =
		sf(131,26,1);
	break;
	
begintalknode 259;
	state = 250;
	nextstate = -1;
	condition = gf(131,26) > 0 && gf(131,27) == 0 && gf(177,17) >= 3;
	question = "Can I have more supplies?";
	text1 = "_Yesss. Word comesss. I give precious suppliess to you. Very preciousss. Hurtsss to lose._ He unlocks one of the boxes in the supply room.";
	code =
		sf(131,27,1);
	break;
	
begintalknode 260;
	state = 250;
	nextstate = -1;
	condition = gf(131,27) > 0 && gf(131,28) == 0 && gf(177,17) >= 6;
	question = "Can I have more supplies?";
	text1 = "_Yesss. Word comesss. I give precious suppliess to you. Very preciousss. Bessst of what we have left. Very painful. Hope you do not waste._ He unlocks the last sealed box in the supply room.";
	code =
		sf(131,28,1);
	break;
	
begintalknode 261;
	state = 250;
	nextstate = -1;
	condition = gf(131,28) > 0;
	question = "Can I have more supplies?";
	text1 = "_What supplies? You take all we have. So little time left. So little to use. Isss not good._";

	
// Sage Asta

begintalknode 270;
	state = -1;
	nextstate = 270;
	condition = 1;
	question = "Name";
	text1 = "This woman is wearing long, flowing robes, and an ankh hangs around her neck. She would fit in much better in a shrine or temple, if it weren't for the slime stains that cover (or have burned through) her garments.";
	text2 = "When you approach, she is trying to get a small cave slime back into a jar. She pokes at it with a stick and shouts a lot. Eventually, it is confined, sealed inside with a thick cork.";
	text3 = "Then she turns, sees you, and gives a little bow. _Good day to you, traveler. I am known here as Sage Asta. I would love to give you succor and wisdom and teaching, though my calling lately has led me to a much different path._";
	text4 = "A lump of slime on the floor next to her begins to slither away. She stomps on it.";
	text5 = "Sage Asta says, _What else do you wish to know? In all honesty, a rest from my labors in this lab is very welcome. What would you speak of? Or be taught?_";
	action = INTRO;

begintalknode 271;
	state = 270;
	nextstate = 271;
	condition = 1;
	question = "How did you come to be here?";
	text1 = "_I am a traveler in the Path of All Life. Our sect travels through the lands, welcomed by all, spreading healing and the joy of communion with nature. I let the nature spirits call me into Avernum. Which might not be working out._";
	text2 = "_When I came to the Castle, offering my healing arts, Correlea suggested I put my knowledge of life to use. And so I remained here. As far as this work is from my main purpose._";
	
begintalknode 272;
	state = 270;
	nextstate = 273;
	condition = 1;
	question = "What do you teach?";
	text1 = "_I teach focusing rituals that can be used, by the trained mind, to heal and focus oneself. I could teach you, if you are willing. It would be enjoyable for me. Though I would be forced to ask for funds to continue my work._";

begintalknode 273;
	state = 270;
	nextstate = 274;
	condition = 1;
	question = "Tell me about your research.";
	text1 = "_I breed slimes. I split them up into smaller slimes. I collect mushrooms with different sorts of blight. I feed this mushroom to that slime and see if I can find ..._ She shakes her head. _It sounds mad to say it out loud._";
	
begintalknode 274;
	state = 271;
	nextstate = -1;
	condition = 1;
	question = "Why did you stay here?";
	text1 = "_Because people are hungry, and a disease afflicts their food. I respect the balance of life, but not to the point of allowing famine._";
	text2 = "_Correlea was drawn to me immediately. She thought my knowledge could help to find a cure. And so I stay._";
	
begintalknode 275;
	state = 271;
	nextstate = -1;
	condition = 1;
	question = "What exactly are you trying to do?";
	text1 = "_I am looking for a way to destroy the blight. Something that might remove it from the afflicted crops, leaving the healthy mushrooms behind._";
	text2 = "_I have found that certain slimes are attracted to the blight. I am trying to breed a sort that is too small to harm humans and large enough to consume the diseased mushrooms._";
	
begintalknode 276;
	state = 271;
	nextstate = 272;
	condition = 1;
	question = "You seem to be having some problems.";
	text1 = "_I have nothing but problems. Correlea urges me to stay on and bring my ideas to life, but the slimes are so ... so ... I am sworn to love all living things. Had I not, I would hate slimes. I really, really would._";
	text2 = "_Were it not for Correlea's support, I would have given up long ago._";
	
begintalknode 277;
	state = 272;
	nextstate = -1;
	condition = 1;
	question = "Tell me more about Correlea.";
	text1 = "_She is downstairs._ Asta doesn't elaborate.";
	
begintalknode 278;
	state = 273;
	nextstate = 270;
	condition = 1;
	question = "Please train me.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Sage Asta",
		  "Sage Asta's holy rituals are not very powerful, but they are undeniably handy.",
		  5,2,0);	
	break;
	
begintalknode 279;
	state = 273;
	nextstate = 270;
	condition = gf(132,11) > 1;
	question = "Please train me in your advanced rituals.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Sage Asta",
		  "Sage Asta knows a few very powerful rituals, which she will teach you in return for your past services.",
		  6,4,0);	
	break;
	
begintalknode 280;
	state = 273;
	nextstate = 270;
	condition = 1;
	question = "I don't need training.";
	text1 = "_I am disappointed, but I understand._";
	
begintalknode 281;
	state = 274;
	nextstate = -1;
	condition = 1;
	question = "Do you really think that will work?";
	text1 = "_No. But every possible sane thing we could try has failed. Now we must be creative._";
	
begintalknode 282;
	state = 274;
	nextstate = -1;
	condition = gf(132,11) < 2;
	question = "Do you need any help?";
	text1 = "She seems surprised. _Help? Actual help? Actually, I could use some assistance._";
	text2 = "_The work here requires mushrooms afflicted with every sort of Blight. I could use four samples, one mushroom from each region. From the Great Cave, the Eastern Gallery, the Abyss, and the northern regions. Then I could compare them._";
	text3 = "_When exploring, watch for mushrooms that show signs of corruption and bring them to me. You would be doing me a great service. And, if you could bring me those samples, there are things I could do for you in return._";
	code = 
		set_flag(132,11,1);
		toggle_quest(42,1);
	break;
	
begintalknode 283;
	state = 274;
	nextstate = 275;
	condition = 1;
	question = "Where do you think the Blight came from?";
	text1 = "_There are many theories. Some of them are ... They strike me as paranoid._";
	text2 = "_But I have wandered much. I know that new blights and diseases sometimes appear. Nobody knows how or why, but it always happens. The only question is how prepared you are to react._";
	
begintalknode 284;
	state = 275;
	nextstate = -1;
	condition = 1;
	question = "And how prepared was Avernum?";
	text1 = "_I will let you decide that for yourself._";
	
begintalknode 285;
	state = 270;
	nextstate = -1;
	condition = gf(132,11) == 1 && gf(132,17) == 0 && party_has_item(491);
	question = "I found a diseased mushroom in the Great Cave.";
	text1 = "Sage Asta fetches a pair of tongs, takes the sample, inspects it, and seals it in a ceramic jar. _Similar to what I have already, but not entirely useless. I will pay you as promised._";
	text2 = "She gives you a small pouch of coins and a flask containing a thick, green goo. _I don't need any more of this variety, but please watch for samples in the other locations I mentioned. That would be helpful._";
	text3 = "_The more we know about the Blight, the better we can combat it._";
	code =
		sf(132,17,1);
		inc_flag(132,27,1);	
		take_all_of_item(491);
		change_coins(50);
		reward_give(220);
		reward_give(220);
		award_party_xp(200,10);
	break;
	
begintalknode 286;
	state = 270;
	nextstate = -1;
	condition = gf(132,11) == 1 && gf(132,18) == 0 && party_has_item(492);
	question = "I found a diseased mushroom in the Abyss.";
	text1 = "Sage Asta fetches a pair of tongs, takes the sample, inspects it, and seals it in a ceramic jar. _Nicely done. Very close to the one sample I already have, which is still useful knowledge. I will pay you as promised._";
	text2 = "She gives you a pouch of coins and a flask containing a watery, yellow goo. _I don't need any more of this variety, but please watch for samples in the other locations I mentioned. That would be helpful._";
	text3 = "_The more we know about the Blight, the better we can combat it._";
	code =
		sf(132,18,1);
		inc_flag(132,27,1);	
		take_all_of_item(492);
		change_coins(100);
		reward_give(223);
		reward_give(223);
		award_party_xp(200,20);
	break;
	
begintalknode 287;
	state = 270;
	nextstate = -1;
	condition = gf(132,11) == 1 && gf(132,19) == 0 && party_has_item(493);
	question = "I found a diseased mushroom in the Eastern Gallery.";
	text1 = "Sage Asta fetches a pair of tongs, takes the sample, inspects it, and seals it in a ceramic jar. _Entirely different from the sample I have already, and thus quite valuable. I will pay you well for this._";
	text2 = "She gives you a pouch of coins and a flask containing a sticky purple goo. _I don't need any more of this variety, but please watch for samples in the other locations I mentioned. That would be helpful._";
	text3 = "_The more we know about the Blight, the better we can combat it._";
	code =
		sf(132,19,1);
		inc_flag(132,27,1);	
		take_all_of_item(493);
		change_coins(200);
		reward_give(226);
		reward_give(226);
		award_party_xp(200,30);
	break;
	
begintalknode 288;
	state = 270;
	nextstate = -1;
	condition = gf(132,11) == 1 && gf(132,20) == 0 && party_has_item(494);
	question = "I found a diseased mushroom in the northern regions.";
	text1 = "Sage Asta fetches a pair of tongs, takes the sample, inspects it, and seals it in a ceramic jar. _My first sample from that region. Very, very handy. I eagerly anticipate the slimes' reaction to it. I will pay you well for this._";
	text2 = "She gives you a small pouch of coins and a flask containing a gelatinous clear goo. _I don't need any more of this variety, but please watch for samples in the other locations I mentioned. That would be helpful._";
	text3 = "_The more we know about the Blight, the better we can combat it._";
	code =
		sf(132,20,1);
		inc_flag(132,27,1);	
		take_all_of_item(494);
		change_coins(300);
		reward_give(229);
		reward_give(229);
		award_party_xp(200,40);
	break;
	
begintalknode 289;
	state = 270;
	nextstate = -1;
	condition = gf(132,11) == 1 && gf(132,27) > 3;
	question = "I think I've collected all the samples you needed.";
	text1 = "_And so you have. For such an effort, you deserve a better reward than I can give you._ She hands you a small pouch of crystals. _Those stones are precious. I've used them many times in my travels. When I traveled._";
	text2 = "_In addition, there are certain magical rituals we only teach to those who have done great favors for our sect. You can learn them now, if you wish._";
	code = 
		set_flag(132,11,2);
		toggle_quest(42,3);
		award_party_xp(500,35);
		reward_give(243);
		reward_give(243);
		reward_give(244);
		reward_give(244);
	break;			
	
begintalknode 290;
	state = 270;
	nextstate = -1;
	condition = gf(132,27) > 0;
	question = "Have the samples I brought helped you?";
	text1 = "_Not yet. But I have hope. In these ever darker times, that and the company of others are all that sustains me._";
	
// Kanox

begintalknode 295;
	state = -1;
	nextstate = 290;
	condition = 1;
	question = "Name";
	text1 = "These days in Avernum, having a job handing out food can be very dangerous. That is probably why the head chef of the Castle is a huge, muscular man with a large, vicious cleaver hanging from his belt.";
	text2 = "When he sees you, he waves you over and checks the insignia on your shoulder.";
	text3 = "_New soldier here, eh? Well, you'd better get to know me. I'm Kanox. Come get rations from me before you head out. But, I warn you ..._ He pats the cleaver. _Don't get greedy._";
	text5 = "Kanox is carrying a tray of food around the hall, parceling it out to soldiers and caravan drivers. Roast lizard haunch, dried fish, mushroom meal rolls, he hands the bounty out in measured amounts.";
	action = INTRO;

begintalknode 296;
	state = 290;
	nextstate = 291;
	condition = 1;
	question = "You are in charge of the rations here?";
	text1 = "He nods. _Ssem'Ess, the quartermaster, he handles the blades and the armor and the wands and what-not. But if it's food, it goes through me. And I am fair. That's why I have the honor._";
	
begintalknode 297;
	state = 290;
	nextstate = -1;
	condition = 1;
	question = "How are the food supplies holding out?";
	text1 = "He shakes his head. _Sorry. You have to be a higher rank before you can get that information. It's not something we talk about._";

begintalknode 298;
	state = 290;
	nextstate = -1;
	condition = gf(132,28) == 0;
	question = "Can I have some food?";
	text1 = "Kanox nods. _You're due._ He gives you a roll made of mushroom meal. Avernite bread is dry, bitter stuff, but it maintains life.";
	text2 = "_Make it last. That's it for you today._";
	code =
		sf(132,28,1);
		reward_give(256);
	break;
	
begintalknode 299;
	state = 290;
	nextstate = -1;
	condition = gf(132,28) > 0;
	question = "Can I have more food?";
	text1 = "Kanox shakes his head. _You want to eat more? That means someone else doesn't get their share. Not on my watch. Move on, and see you tomorrow._ He walks off.";
	action = END_TALK;
	
begintalknode 300;
	state = 290;
	nextstate = -1;
	condition = 1;
	question = "That is all I need.";
	text1 = "He seems relieved. _You have enough? Don't hear that often. Good day to you._";
	action = END_TALK;
	
begintalknode 301;
	state = 291;
	nextstate = -1;
	condition = 1;
	question = "What do you serve?";
	text1 = "_Because of the Blight, we have very few mushrooms. And, since that's where most of our food came from, either eaten by us or the lizards we eat, that's a real problem._";
	text2 = "_I have fish, what little mushroom meal we have left, some stringy lizard meat, and what little comes down to us through the Great Portal. It should last, but it will be close._";
	text3 = "_I have fish, what little mushroom meal we have left, some stringy lizard meat, and what little is left that came down to us through the Great Portal. Now that the Portal is gone, though ..._ He shakes his head.";
	code =
		if (gf(170,1) < 12)
			rs(3);
			else rs(2);
	break;
	
begintalknode 302;
	state = 291;
	nextstate = -1;
	condition = 1;
	question = "I can get food here?";
	text1 = "_All soldiers based here can. Not enough to make you happy, but enough so you can fight. And don't ask for more. Don't waste your strength._";
	
begintalknode 303;
	state = 291;
	nextstate = 292;
	condition = 1;
	question = "You are fair?";
	text1 = "_I am. Everyone wants more. Commanders. Generals. Mages. They all have a reason why they're so important that I should let them get fat. And I always say no._";
	text2 = "_King or commoner, in my kitchen, you eat the same. Starrus wants it to be that way everywhere. He's a wise man._";
	
begintalknode 304;
	state = 292;
	nextstate = -1;
	condition = 1;
	question = "How does that make him wise?";
	text1 = "_We are all Avernites. We're a family. We rise or sink together. And we can't stay together if everyone resents how much their neighbor is eating._";
	text2 = "_King Starrus is a wise man._";
	text3 = "_But, with the Great Portal gone, I don't think he'll keep order for much longer. And then I might have to start using this to keep order._ He pats the cleaver on his belt. _Hope it doesn't come to that._";
	code =
		if (gf(170,1) < 12)
			rs(3);
	break;
	

// Jasmine

begintalknode 310;
	state = -1;
	nextstate = 300;
	condition = 1;
	question = "Name";
	text1 = "There is a young Avernite woman pacing around in the courtyard. Her clothes are torn and dirty. It looks like she traveled a very long way to get here.";
	text2 = "You notice that the guards and soldiers are trying very hard to ignore her. When you meet her gaze she immediately takes the opportunity to speak with you.";
	text3 = "_Greetings to you, bold warrior of Avernum. I am Jasmine, envoy from Silvar. Official envoy. Can I trouble you for a moment of your time? Nobody else will speak with me._";
	text5 = "Jasmine is still unhappily pacing the courtyard. She seems to grow more exhausted by the hour, and yet she refuses to give up. Such mad determination in the face of futility is very Avernite.";
	action = INTRO;

begintalknode 311;
	state = 300;
	nextstate = 301;
	condition = 1;
	question = "You are from Silvar?";
	text1 = "_I am. Sent by Mayor Augustus personally. An official envoy. So you have to let me stay._";
	
begintalknode 312;
	state = 300;
	nextstate = 302;
	condition = 1;
	question = "How did you come to be here?";
	text1 = "_First, I walked. Then I traveled with a caravan. Then I walked more. Then I got through Almaria, even though they tried to make me, an official envoy, pay a toll! That took some shouting._";
	text2 = "_And then more walking. It was quite a tale. And dangerous. But I am here now._";

begintalknode 313;
	state = 301;
	nextstate = -1;
	condition = 1;
	question = "Tell me about Silvar.";
	text1 = "_A beautiful city, fallen on harder and harder times. In need of help. Not that anyone here will bother to send it._";
	
begintalknode 314;
	state = 301;
	nextstate = -1;
	condition = 1;
	question = "How long have you been here?";
	text1 = "_Weeks. And I will stay weeks more._ Her voice grows conspicuously louder. _I will not go until we have received the help we demand and deserve._";
	
begintalknode 315;
	state = 301;
	nextstate = -1;
	condition = 1;
	question = "Have to let you stay?";
	text1 = "_I'm an official envoy, like I said. With the papers and everything. And it's part of the compact between the crown and the cities. I am entitled to room, board, and a hearing in the Castle._";
	text2 = "_Until we get our aid, I am not going._";
	
begintalknode 316;
	state = 302;
	nextstate = -1;
	condition = 1;
	question = "Almaria?";
	text1 = "_The city on the river to the east. Grown fat and rich over the last century from bridge tolls. But they didn't get a coin from me!_";
	
begintalknode 317;
	state = 302;
	nextstate = -1;
	condition = 1;
	question = "Were you ever attacked?";
	text1 = "_Of course. Zombies near Mertis. Bandits south of the Honeycomb. A giant spider on the road to the east. I almost died getting here, and I will be heard._";
	
begintalknode 318;
	state = 300;
	nextstate = 303;
	condition = gf(132,22) < 2;
	question = "You want my help?";
	text1 = "_I do. My city, Silvar, is collapsing. Mayor Augustus can't keep control anymore. There are too many ... malcontents. They want to flee to the south. Give up the war and collapse the bridge!_";
	text2 = "_We need someone to come and restore order. If you find anyone in authority, can you get help for us? Please? If we don't get aid, something terrible might happen._";
	code = 
		set_flag(132,22,1);
		toggle_quest(60,1);
	break;	
	
begintalknode 319;
	state = 303;
	nextstate = -1;
	condition = 1;
	question = "Why can't the city guard help?";
	text1 = "_They do what they can, but we don't have enough soldiers and the traitors are too many. Only a handful of soldiers could tip the balance, and we don't even get that!_";
	
begintalknode 320;
	state = 303;
	nextstate = -1;
	condition = 1;
	question = "Collapse the bridge?";
	text1 = "_Silvar guards the lone bridge separating the invaded lands to the north from the rest of Avernum. If it was destroyed, yes, it would stop the Slith Horde's advance. For a while._";
	text2 = "_But it would only be a temporary reprieve, and it would mean abandoning all of northern Avernum. It is too soon for that!_";
	
begintalknode 321;
	state = 300;
	nextstate = -1;
	condition = gf(132,23) == 1;
	question = "Meryhew refuses to send help.";
	text1 = "_Of course. She is the one who turned me away before. There has to be someone of a higher rank that I could reach. Please help me._";
	action = SET_SDF 132 23 2;
	
begintalknode 322;
	state = 300;
	nextstate = -1;
	condition = gf(133,13) == 1;
	question = "I spoke to Levitt, the spymaster. He assures me that something will be done.";
	text1 = "_Levitt ... Levitt is going to help us?_ She shudders. _Now I am afraid. Perhaps the cure will be worse than the disease._";
	text2 = "_Still, you have helped us. For that, I am grateful. Soon, I will return to Silvar with the news. Should you ever be there, speak with Mayor Augustus. I am sure he will want to reward you for your efforts._";
	text3 = "_Now please excuse me. It will be a long, hard journey back. I will have to be prepared._";
	action = END_TALK;
	code = 
		sf(132,22,1);
		set_flag(133,13,2);
		toggle_quest(60,3);
		award_party_xp(400,12);
	break;		

	
////

begintalknode 349;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Unfortunately, the Castle was a poor place to begin your life of crime. Most of the soldiers have had to travel northeast to fight the slithzerikai, but enough remain down here to hunt you down.";
	text2 = "You are jailed in Fort Remote. By the time you are able to get free, the multiple disasters that afflict Avernum have doomed you and all around you.";
	code =
		erase_char(30000);
	break;