// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(146,0) == 0;
	question = "special";
	text1 = "You start to walk around and attempt to get your circulation moving again. It isn't easy. The constant, icy drafts of air from the nearby chasm fill your life with misery, but this was the only chamber with room for you.";
	text2 = "You wish, for the thousandth time, that you were living in one of the warmer barracks upstairs. Alas, you are at the bottom of the ladder at the food depot. A fact that the soldiers upstairs never let you forget.";
	text3 = "Another draft hits you, making you shudder. The caverns of Avernum tend to be either too cold or too hot and choked with sulfurous steam.";
	text4 = "Ah, well. The sooner you get to work, the sooner you can get out of here. You are already wearing your armor. Your blades await to the east.";
	text5 = "(East is down and to the right. You can hold the Tab key down to see the directions, among other things. Walk down the corridor to find some weaponry.)";
	action = SET_SDF 146 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(146,1) == 0;
	question = "special";
	text1 = "Your blades are sitting here where you left them. Crude weapons, dented by years of use, but it could be worse. In the earliest days of Avernum, the prisoners wielded spears tipped with sharpened stone. It's a miracle that anyone survived.";
	text2 = "Time to ready some blades and see what unpleasant job Sergeant Nichol has in store for you. You imagine you can hear his boot tapping impatiently on the stone, waiting for you to emerge.";
	text3 = "(Get and equip at least one of the swords here. Then you will be slightly better prepared for the ordeals ahead.)";
	action = SET_SDF 146 1 1;
	code =
		assert_hint(0);
	break;
	
begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(146,2) == 0;
	question = "special";
	text1 = "Most of Avernum is dimly lit by the green, luminescent fungus that hangs from the ceilings of the caverns. Created by wizards when Avernum was first settled, the stuff makes life in the underworld possible.";
	text2 = "However, very little of it gets down into the low tunnels like these. That's why there are some lamps on the table here. You might want to get one and use it.";
	text3 = "(To use a lamp, open the inventory window and get a lamp. To use an item, like a lamp or a potion, press the sunburst button next to it.)";
	action = SET_SDF 146 2 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(146,5) == 0;
	question = "special";
	text1 = "You enter the main storage hall of the food depot. It's much warmer up here. The searing air from the volcanic vents miles to the east and west is merely balmy by the time it blows out to here. The scent of sulfur is barely noticeable.";
	text2 = "The hall is full of crates of food. Soon, these supplies will be carried by well-guarded caravans to where they are needed most. Though very little food has been arriving lately.";
	text3 = "From here, you can clearly hear the shouting and pleading in the audience hall. This is where Lieutenant Katlyn will be. Now you can go report to her and see if she needs anything.";
	text4 = "(This is a good time, if you haven't already, to save your game.)";
	action = SET_SDF 146 5 1;
	code =
		assert_hint(7);
	break;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(146,6) == 0 && gf(170,0) == 0;
	question = "special";
	text1 = "This is the upper barracks of the food depot, where the more experienced soldiers take turns sleeping in shifts. You immediately envy the warmth, cooking facilities, and lack of a gigantic, yawning chasm.";
	text2 = "The moment you step inside, you feel your fellow Avernites' contempt wash over you. Sergeant Nichol thinks you deserve more respect. News of that hasn't gotten around.";
	action = SET_SDF 146 6 1;

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = get_sdf(146,7) == 0;
	question = "special";
	text1 = "You step through the side entrance into the audience hall. It is, as always, full of desperate Avernites, shouting, and despair.";
	text2 = "When food rationing began and these depots were built, King Starrus declared that each depot would have an audience hall, where the poor and hungry could make a case for an increase in their rations.";
	text3 = "While these petitions might have once worked occasionally, the answer these days is always no. But people still try. The best they can hope for is permission to use the portal to the surface sooner rather than later.";
	text4 = "Lieutenant Katlyn is sitting in her chair, listening to and dismissing petitions with great efficiency. The supplicants are unusually angry today, but guards hold them back. When she sees you enter, she waves for you to approach.";
	action = SET_SDF 146 7 1;

begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "As you reach for the door, you imagine the dressing down you'll get from Sergeant Nichol if you report for duty without having a weapon ready. You turn back.";

begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The weapon, despite its age and poor condition, feels comfortable in your hand. At the very least, you should be able to handle any of the tedious tasks you're likely to be given in the Castle Food Depot.";
	text2 = "There are additional supplies waiting for you in the cabinet by the north wall. You'd probably better collect them before you move on.";
	text3 = "(Click on the wooden cabinet to open it and see what is inside.)";
	text4 = "You hear angry shouting coming from beyond the storeroom door. Sergeant Nichol is probably bellowing for you to come out. The day is off to a perfectly normal start.";
	action = SET_SDF 146 4 1;
	
begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The mages of Patrick's Tower sent the depot three stone servants, to haul around supplies and do odd jobs. Unfortunately, without their creators to guide them, they were clumsy and confused and tended to do more harm than good.";
	text2 = "They are currently being stored down here, where they can't break anything.";
	
begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "For a moment, you see a trace of the old, cranky, demanding Nichol of your training. _Why are you bothering me? I have one cave to search. You have another. Go clear it out!_";
	
begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  CASTLE FOOD DEPOT";
	text3 = "  Petitioners enter and wait to left.";
	text4 = "  Deliveries go straight through.";
	text5 = "  The Castle - North";
	
	
begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You hear the rattling of chains behind you, followed by the sound of a descending portcullis. You try to run back, but it is too late. Someone managed to shut the gate behind you. You hear high-pitched laughter in the shadows.";
	text2 = "You aren't doomed. You saw the gate controls through a window as you were coming in. All you need to do is reach them ...";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = char_ok(15803) && get_attitude(15803) < 10;
	question = "";
	text1 = "As you walk away, Runkle snaps. _No! You're going to get help! You lied to me! Now it happens. You're to blame!_";
	text2 = "He whips his sword out and lunges at you.";
	
begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You use the wheel to open the gate. Then you wedge a rock in the mechanism to prevent anyone from locking you in again.";
	text3 = "This wheel controls the gate outside. It's already open, so there's nothing to do here.";
	code =
		if (gf(146,22) == 0) {
			rs(3);
			sf(146,22,1);
			}
			else rs(1);
	break;
	
begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,21) == 0;
	question = "special";
	text1 = "You enter the Deep Storage caves. You've never been down here, and you don't think you have been missing much. It's very cold. The walls sparkle with countless tiny ice crystals, and every step makes a faint crunch sound.";
	text2 = "A lot of food is kept down here, in sacks and huge casks. The barrels to the south are labeled, _Salted Meat. Surface._ with a date two years previous.";
	text3 = "There is an open gate to the southwest. That must be where you are meant to explore. You can hear faint squeaking, and a few sets of rat tracks are visible in the ice. Sergeant Nichol wasn't imagining things.";
	action = SET_SDF 147 21 1;

begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,22) == 0;
	question = "special";
	text1 = "This large, dim chamber is full of rows of barrels. There are several rats at the far end, gnawing at a pile of frozen sacks of meal.";
	text2 = "But that's not what really draws your attention. In the center of the room, a goblin is smashing in the end of a precious barrel of wheat flour with a hammer.";
	text3 = "Goblins aren't rats, but they have a lot of similarities. They breed quickly. They burrow. They love to steal food. And they get everywhere.";
	text4 = "The goblin hasn't noticed you yet, but he will soon. If goblins are down here looting the supplies, they need to be eliminated, or soon these caves will be picked clean.";
	action = SET_SDF 147 22 1;
	
begintalknode 20;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,23) == 0;
	question = "special";
	text1 = "There are several more goblins here. They are furious that anyone would try to deny them all of this glorious food.";
	text2 = "You can see how they got in here. There is a tiny tunnel to the south, only recently excavated by the dirty little creatures.";
	text3 = "A lone goblin stands in the tunnel, staring at you. He is taller than the others, and covered with jewelry. Gaudy necklaces, costume rings, pretty much every glittery object the creature could find.";
	text4 = "He points a long rapier at you and says, _Lord Trinket claims this food for all goblinkind! Really! I do! Servants, destroy them! And bring the food to me!_";
	text5 = "(These foes look more challenging than the enemies you have met so far. Don't forget that you have healing potions in your pack. To use one, open your inventory and press the Sun button by the potion.)";
	action = SET_SDF 147 23 1;
	
begintalknode 21;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,24) == 0 && gf(170,1) < 2;
	question = "special";
	text1 = "You squeeze your way down the goblin tunnel, feeling very vulnerable and claustrophobic. Fortunately, no ambush awaits you at the far end.";
	text2 = "There is only an entry into another set of tunnels, sealed off by a massive, iron portcullis. It can't be opened from this end. To avenge yourself on Trinket and his goblin horde, you'll have to find a different route to the other side.";
	action = SET_SDF 147 24 1;
	
begintalknode 22;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,25) == 0;
	question = "special";
	text1 = "Not long ago, some magical technicians came from the Castle to create this stone pylon. You asked Sergeant K'Naan what it was for. He told you to shut up and stay away from it.";
	text2 = "Being near it makes your hair stand on end. You feel a powerful compulsion to walk up and touch it.";
	action = SET_SDF 147 25 1;
	
begintalknode 23;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,26) == 0;
	question = "special";
	text1 = "At last, you emerge into the Great Cave, the largest gallery in all of Avernum. It stretches many miles from east to west.";
	text2 = "The Great Cave contains all of Avernum's greatest cities, including Dharmon and Almaria. The reassuring bulk of the Castle looms not far to the north.";
	text3 = "But the luxury and sophistication of Avernum's cities is denied to you. For now, you need to go south, to the mines and the ruins and the goblins. A shallow pair of ruts, left by wagons and sledges, extends to the south.";
	text4 = "You feel a mix of vertigo and excitement. Nobody is shouting orders at you. You have to figure out how to proceed on your own. Follow that road, and your new life of adventuring will begin.";
	text5 = "(If a quest requires you to travel a long distance, your destination will often be marked on the World Map. Hold down the Tab key to see what button will bring up the World Map.)"; 
	action = SET_SDF 147 26 1;
	
begintalknode 24;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,27) == 0;
	question = "special";
	text1 = "Several half-constructed buildings hang off of the east side of the food depot. The depot ran out of materials to make buildings and soldiers to put in them, so the walls were just left to crumble.";
	text2 = "You've heard rumors that unpleasant creatures have settled in the rubble. The sergeants told all of you younger soldiers to stay away. Of course, nobody is here to tell you what to do now.";
	action = SET_SDF 147 27 1;
	
begintalknode 25;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,28) == 0;
	question = "special";
	text1 = "Lieutenant Katlyn had a Job Board placed outside the depot. You can find these boards in every large settlement in Avernum. Adventurers can find all sorts of odd jobs, some of them quite lucrative.";
	text2 = "(Job Board missions are always optional, but they can be a good way to gain loot and experience.)";
	action = SET_SDF 147 28 1;	

	
begintalknode 26;
	state = -1;
	nextstate = -1;
	condition = get_sdf(146,24) == 0;
	question = "special";
	text1 = "The door in the east wall has a crude padlock on it. Perhaps something valuable is on the other side.";
	text2 = "(Sometimes, you will find locked doors and chests. Also, some containers and passages have traps. If you have a character with high enough Tool Use skill, you can pick those locks and disarm those traps.)";
	action = SET_SDF 146 24 1;
	
begintalknode 27;
	state = -1;
	nextstate = -1;
	condition = gf(146,25) == 0;
	question = "special";
	text1 = "Hmmm ... The goblins discarded some javelins on the floor ahead. It's always satisfying to fling a few projectiles ahead before engaging in melee.";
	text2 = "(When you attack an enemy, you will use your Default weapon. This can be a melee weapon, like a sword or a spear, or a missile weapon, like a javelin or a bow.)";
	text3 = "(Get the javelins and equip them. You can switch your default weapon by pressing its button to the lower left, or by typing 's'.)";
	text4 = "(Also, don't forget, you can always skip a character's turn in combat by clicking the character or pressing the Space Bar.)";
	action = SET_SDF 146 25 1;
	code = 
		set_dialogue_pic(196);
	break;	
	
begintalknode 28;
	state = -1;
	nextstate = -1;
	condition = gf(146,26) == 0;
	question = "special";
	text1 = "KEYBOARD SHORTCUTS";
	text2 = "Practically every action in Avernum 6 has a keyboard shortcut. All of these are listed in the instructions, but here are a few common ones.";
	text3 = "To attack or talk to a character, type 'a' and then type the letter above the desired character. To use an object, type 'u' and then type the letter on the object.";
	text4 = "You can move using the keypad or the arrow keys.";
	text5 = "You can see the current shortcuts for all of the buttons by holding down the Tab key. And, if you want to change a shortcut, you can change the keyboard actions in the Options window.";
	action = SET_SDF 146 26 1;

// NICHOL 1

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "Sergeant Nichol is sitting at his desk waiting for you. He is a lifer in the Avernum army, born and raised in the underworld. He is deathly pale and, like everyone who spent a lifetime down here, increasingly sickly in his advancing age.";
	text2 = "He has also been your superior officer and trainer during your year in the army. Almost every order, reprimand, and rare bit of encouragement has come from him. But, today, something is different.";
	text3 = "He slowly rises from his desk. _Ah ... You're finally up. It's good to see you. It is an eventful day, I think._ And then he smiles. No ... It's not a trick of the light. He's actually smiling.";
	text4 = "(You are now in a conversation. Select a response or type the number by it to say something to Sergeant Nichol. Later, to start a conversation with a character, click on it.)";
	code =
		sf(146,10,1);
		toggle_quest(1,3);
	break;
	
begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Oh, God. What did I do wrong?";
	text1 = "He laughs. _Nothing. You have done well, actually. Far better than I expected when you were posted here a year ago. It's been days since you've mucked anything up._";
	text2 = "_No, this will be a good day for you._";

begintalknode 32;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Reporting for orders, sir.";
	text1 = "He nods approvingly. _A bit of professionalism, at last. It took a year, but the lessons finally sunk in._";
	text2 = "_You'll have your orders soon enough. For now, relax. This will be a good day for you._";

begintalknode 33;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "An eventful day?";
	text1 = "_Indeed. You didn't think a full year here would go unnoticed? I've ridden you hard, I know, but I'm not unsentimental. Even in my advanced age._";
	text2 = "_Yes, this will be a good day for you._";

begintalknode 34;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "It's really been a year already?";
	text1 = "_The days turn into a blur here, don't they? Nothing but tedium._ He shakes his head nervously. _But it's better than the alternative. Better than what's happening out there._";

begintalknode 35;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "How is it a good day?";
	text1 = "_First, I want you to know that, although your posting here should be coming to an end, I have asked Lieutenant Katlyn to keep you here indefinitely. You can assist me in running the depot, safe from the chaos outside._";
	text2 = "You feel dizzy. You joined the army to become a hero, to fight for Avernum. And Nichol is making you stay prisoner in this pit, hunting rats and keeping the mob from sacks of moldy meal? If you wanted safety, you wouldn't have signed up.";

begintalknode 36;
	state = 32;
	nextstate = 33;
	condition = 1;
	question = "I appreciate what you did. I suppose.";
	text1 = "Nichol nods, and, for a moment, he looks very sad. He shakes it off quickly and says, _I know this might be a little disappointing. You still have dreams of adventure and all that. When you get older, I think you ..._";
	text2 = "_Ah, I am rambling. I decided to protect you. It doesn't matter. What is done is done, and I have a second bit of news for you._";

begintalknode 37;
	state = 32;
	nextstate = 33;
	condition = 1;
	question = "How could you do that? I want out of here!";
	text1 = "Nichol looks surprised. And then gets a strange look on his face. Not the anger you expected. It's sadness. _Ah, to be young. To still be unable to appreciate the gifts people have given you._";
	text2 = "_Still, you will understand someday. I find you easy to work with, so I decided to protect you. It doesn't matter. What is done is done, and I have a second bit of news for you._";

begintalknode 38;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "You are protecting me?";
	text1 = "_You haven't seen the campaigns I have. How ugly the wars can get down here. Once, I ..._";
	text2 = "He shakes his head. _You have spent much of the last year here. Only a little time on leave. Not much news has reached you. Of the campaigns in the north, of the uprisings, of ..._";
	text3 = "_Things are kept quiet as long as possible, sometimes. Just know that being in this pit, as much as you hate it, is the best option._";

begintalknode 39;
	state = 33;
	nextstate = 34;
	condition = 1;
	question = "What is the next bit of news?";
	text1 = "_That I think you can be trusted with a little bit of independence. Do things on your own. Show a little initiative!_";
	text2 = "This doesn't sound good.";

begintalknode 40;
	state = 34;
	nextstate = 35;
	condition = 1;
	question = "Go on.";
	text1 = "_Well, for the last year, I've been holding your hand. Fighting with you. Telling you when to use magic. Helping you disperse the mobs. Now, at last, I think you can stand on your own. And not a moment too soon!_";

begintalknode 41;
	state = 35;
	nextstate = 36;
	condition = 1;
	question = "I need to do something?";
	text1 = "_Nothing spectacular. More rats._ He points to the south. _I found fresh spoor just an hour ago. Heard the beggars too. Probably came up from the chasm._";
	text2 = "_There's no food in those caves now, so they'll be hungry. That'll make it easy for you to lure them out. Once they smell you ..._ He chuckles.";

begintalknode 42;
	state = 36;
	nextstate = -1;
	condition = 1;
	question = "Can I get more supplies?";
	text1 = "He snorts. Very quickly, the sarcastic, critical Nichol returns to you. _For rats? What would you like? A potion of invulnerability? A wand of death? Or three? Perhaps I should find Demonslayer for you. Is that what you need?_";
	text2 = "You tell him that, no, that probably won't be necessary.";

begintalknode 43;
	state = 36;
	nextstate = -1;
	condition = 1;
	question = "You won't be coming with me?";
	text1 = "_Of course not. It's time for you to stand on your own two feet. And your tail, I suppose._";
	text2 = "_Of course not. It's time for you to stand on your own two feet._";
	code =
		if ((species_in_party(2)) || (species_in_party(3)))
			rs(2);
			else rs(1);
	break;
	
begintalknode 44;
	state = 36;
	nextstate = -1;
	condition = 1;
	question = "All right. I'll hunt down those rats.";
	text1 = "He nods. _And I'll catch up on my requisition forms. Come back when they're dead._ He points to the south.";
	text2 = "(You have just received a quest, the first of many. The goal for your quest is marked with a star on the map. Go hunt some rats. The mark will be removed when the quest is completed and you've received your reward.)";
	action = END_TALK;
	code =
		toggle_quest(2,1);
		mark_quest_dest(433,695,1,2);
	break;

begintalknode 46;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Sergeant Nichol says, _So, are all of those ..._ He stops and listens. He sniffs the air. Then he shakes his head.";
	text2 = "_The rats are still down there. Get hunting!_";	
	
begintalknode 47;
	state = -1;
	nextstate = -1;
	condition = gf(146,14) == 0;
	question = "";
	text1 = "You thread your way among empty boxes and shelves, which once stored food and supplies. Not anymore. The people of Avernum are eating the food far faster than it is being brought from the surface. And you know how that story will end.";
	text2 = "Sergeant Nichol was right. There are rats down here. You see the droppings and the fresh tracks in the light layer of mold on the stone.";
	text3 = "It doesn't take too long to find the rats. Nichol was right about another thing. The moment they smell fresh meat, the vicious, furry beasts pour out of their hiding places.";
	text4 = "(You are about to enter combat mode. In combat mode, your characters will act one at a time. To attack an enemy, click on it. Once the rats are dead, you will learn how to end combat.)";
	code =
		sf(146,14,1);
		spawn_creature(15769);
		spawn_creature(15770);
		spawn_creature(15771);
		spawn_creature(15772);
	break;
	
begintalknode 48;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Another rat climbs out of the chasm. It is far larger than the others, a huge, hideous beast. Its skin is covered with patches of fungus, and white froth dots the corners of its mouth. Its eyes show traces of feral intelligence.";
	text2 = "You doubt Sergeant Nichol knew anything like this beast was down here. If you live, he might want to be informed.";	
	
begintalknode 49;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Sergeant Nichol will be pleased. The rats are all dead, and your wounds will heal eventually.";
	text2 = "(Return to the sergeant and click on him to speak with him.)";
	
// NICHOL 2

begintalknode 51;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "Sergeant Nichol notes the fresh scratches on your armor with approval. _Well, you seem a bit more worn down than I would have expected, for just a handful of rats, but you did get the job done._";
	text2 = "He gets some bandages out of his desk and tends to your wounds. _Good old field medicine. First picked it up in the Za-Khazi campaign. Ugly days._";
	text3 = "_I suppose I should get a report about the fight. See if there's any pointers I can give you._";
	code =
		toggle_quest(2,3);
		award_party_xp(500,4);
		revive_party();
		sf(146,10,2);
		sf(146,12,1);
	break;
	
begintalknode 52;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "It was easy. Not a problem.";
	text1 = "Sergeant Nichol nods. Then he looks at the scratches on your armor again. _I see. I think that I may investigate myself, just in case. This looks like a larger infestation than normal._";
	text2 = "_It looks like our instincts were correct. You are capable of acting on your own. For short times, doing easy tasks, anyway. Now I have something else for you to do._";
	
begintalknode 53;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "These weren't your ordinary rats. (Describe them.)";
	text1 = "Sergeant Nichol listens with concern. He seems skeptical, until he looks at the scratches on your armor again. _Hmmm. I think I will look around myself. This looks like a larger infestation than normal. Might mean ... Well, I'll look._";
	text2 = "_As for you, it looks like our instincts were correct. You are capable of acting on your own. For short times, doing easy tasks, anyway. Now I have something else for you to do._";
	code =
		award_party_xp(100,2);
	break;
	
begintalknode 54;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "What do you want me to do?";
	text1 = "He walks to the west gate, raps on it with a mailed hand, and shouts to the guards upstairs. It starts to open slowly. Then he points to the stairway beyond.";
	text2 = "_Go upstairs and report to Lieutenant Katlyn. She's in the audience hall right now, telling hungry people why they can't have more food. Make sure everything is under control up there._";
	text3 = "_Then, if she doesn't need you, report back to me._";
	code =
		toggle_quest(3,1);
		mark_quest_dest(406,654,0,3);
	break;
	
begintalknode 55;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "What do you think she will want me to do?";
	text1 = "_Probably nothing. But you might want to mention the rats to her._";
	
begintalknode 56;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "I have to come back down here?";
	text1 = "_Ahhhh ... You're going to try to go outside again? On some adventure? Not wise. The people of Avernum are not getting calmer, and if they find out you work in the food depot ..._ He shakes his head.";
	text2 = "_You're a good kid. I'm trying to keep you safe. Don't make it harder._";
	
begintalknode 57;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "All right. I'm going.";
	text1 = "He nods. _Oh, and one more thing. I think you can be allowed to have this._ He removes a key from a pouch and hands it to you.";
	text2 = "_This is the key to the upstairs food bins. In case Katlyn sends you to get food for someone. As unlikely as that is. Having that key is a privilege. Don't misuse it._";
	text3 = "_Go see Katlyn. I have work to do._ He casts an uneasy glance at the shadowy corridor to the south.";
	action = END_TALK;
	code =
		set_spec_item(50,1);
	break;
	
begintalknode 60;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You try to talk to the sergeant. He seems annoyed. _Quit wasting time. You have your orders. Go upstairs and talk to the lieutenant._";
	text2 = "(Click on the stairway to the west to climb up it.)";

// FOOD BIN

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "This is one of the food lockers, normally kept full of sacks of high-quality mushroom meal. Before Sergeant Nichol gave it to you, you never had the key that unlocks it. That key is a valuable resource.";
	text2 = "You don't have any reason to open the locker, though. It could get you in considerable trouble. You leave it alone.";
	text3 = "The locker is still unlocked.";
	text4 = "The locker is still unlocked. You peek inside and note without surprise that two large sacks of meal are missing. Fortunately, in all of the chaos, it's unlikely that the theft will be traced back to you.";
	code =
		clear_strings();
		as(1);
		if (gf(146,17) == 0)
			as(2);
			else if ((gf(146,17) == 1) && (gf(146,18) > 0))
				as(3);
				else if (gf(146,17) == 2)
					as(4);
	break;
	
begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = gf(146,17) == 1 && gf(146,18) == 0;
	question = "Unlock the bin.";
	text1 = "You use the key to unlock the locker. You can't resist peeking inside. The locker is piled high with sacks of meal, just like you expected.";
	action = END_TALK;
	code =
		sf(146,18,1);
	break;

begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Leave the bin alone.";
	text1 = "You do your duty and keep the valuable food inside safely stored.";
	action = END_TALK;

begintalknode 75;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "This is one of the food lockers, normally kept full of sacks of high-quality mushroom meal. Before Sergeant Nichol gave it to you, you never had the key that unlocks it. That key is a valuable resource.";
	text2 = "Much to your surprise, the door is slightly ajar. Looking inside, you find that the locker is empty. This is quite a surprise. The depot's supplies seem to be far scarcer than anyone has let on.";
	action = END_TALK;	

// Sergeant K'Naan

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "Avernum has come far since the early days. Once, the nephilim waged ceaseless war against the human intruders. Now that they have (mostly) been integrated into Avernite society, their arrogance expresses itself in other ways.";
	text2 = "For example, this nephil, Sergeant K'Naan, has spent months working out his frustrations by ordering you around and belittling your every effort.";
	text3 = "_Hmrrrr,_ he says. _It is a kit, up from your icy little hole. Why you bother K'Naan? Why you need my time?_";
	text5 = "Sergeant K'Naan sits at his table and works on a bone with his sharp teeth. The bone lacks even the slightest scrap of meat, but it is apparently better than nothing. The nephil silently flicks his gaze up at you.";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = gf(170,0) == 0;
	question = "What are you doing?";
	text1 = "_Hrmmm? Waiting. For orders. Or to go deal with rabble. Not to talk to you. Move on, kit._";

begintalknode 92;
	state = 90;
	nextstate = -1;
	condition = gf(146,17) == 1 && char_ok(15803);
	question = "Someone named Runkle snuck past the audience chamber.";
	text1 = "_Mrrrr? And you tell me? Why you not kick this Runkle out?_ K'Naan lets out a little hiss. _Stay. I solve your problem._";
	text2 = "He rises and walks out of the barracks. A minute later, he returns. _No sneaking. No hiding. No Runkle. He flees. If he existed._ K'Naan sits down and gets back to work on his bone.";
	text3 = "_Go. You bother again, you get a kick. Or worse._ As the other soldiers snicker, K'Naan waves you away.";
	action = END_TALK;
	code =
		erase_char(15803);
		sf(146,17,3);
		award_party_xp(100,2);
	break;
	
begintalknode 93;
	state = 90;
	nextstate = -1;
	condition = gf(170,0) == 0;
	question = "There is something I'd like to know.";
	text1 = "Sergeant K'Naan's tail twitches with amusement. _Is not my job to teach. That happens with Nichol, down in your cold hole. Leave us, before I give you a kick._ As the other soldiers snicker, K'Naan waves you away.";
	action = END_TALK;

begintalknode 94;
	state = 90;
	nextstate = -1;
	condition = gf(170,0) == 1;
	question = "You don't outrank me anymore, K'Naan.";
	text1 = "The nephil flicks his gaze over the insignia on your shoulder. _What? You find that lying on ground? Or maybe promoted by mistake? And what of it? You want hug? You want bone to gnaw?_";
	text2 = "_Go away. I am busy._ He gnaws on his bone.";
	action = END_TALK;

begintalknode 95;
	state = 90;
	nextstate = -1;
	condition = gf(170,0) > 1;
	question = "I outrank you, K'Naan. You have something to say to me?";
	text1 = "K'Naan looks at the insignia on your shoulder. He shudders, but he has no choice. Slowly, as if he is covered in lead weights, he rises. He gives you a little salute and says, very quietly, _Sir._";
	text2 = "Then he slumps into his chair and returns to gnawing his bone. The other soldiers look away. You thought that this moment would be very satisfying. And you know something? It really really is.";
	action = END_TALK;

// 110 Lieutenant Katlyn

begintalknode 110;
	state = -1;
	nextstate = 110;
	condition = 1;
	question = "Lieutenant Katlyn";
	text1 = "Lieutenant Katlyn is young for her rank, barely twenty-five. Since the troubles started, the army has received a flood of recruits. Like, for example, you.";
	text2 = "Fortunately, Katlyn is extremely intelligent and has risen through the ranks quickly, though denying food to so many people is taking a harsh toll on her. Her porcelain face has lines on it that weren't there a month ago.";
	text3 = "She efficiently dismisses a couple who was petitioning for another bag of mushroom meal. They move toward the east wall, and Katlyn turns to you. _Ahhh ... Nichol sent you up? To see if I need help?_";
	text5 = "You wait for Lieutenant Katlyn to dismiss another petitioner. Then she turns to you. _Yes? Anything else?_";
	action = INTRO;

begintalknode 111;
	state = 110;
	nextstate = -1;
	condition = 1;
	question = "I'd like to ask something.";
	text1 = "She shoots a nervous glance at the crowd of hungry people inside and outside the audience hall gates. _This might not be a good time for idle conversation._ Since you don't outrank her, you don't argue.";
	text3 = "She looks at your insignia. _I'm sorry, sir, but I need to deal with this audience. Please let me speak with you later?_";
	action = DEP_ON_SDF 170 0 2;
	
begintalknode 112;
	state = 110;
	nextstate = -1;
	condition = gf(146,10) == 2;
	question = "Yes. Anything I can do up here?";
	text1 = "Lieutenant Katlyn starts to answer. As she begins to speak, a disheveled man shouts, _Talk to us first! It's my turn! My turn!_ He runs forward. The other waiting people, seeing someone leap forward, surge after him.";
	text2 = "There is a brief melee. You help the guards calm the petitioners. Some noses are bloodied, but nobody is hurt. Hurt seriously, anyway.";
	text3 = "You return to Katlyn, who is wincing. _Perhaps you should go help Sergeant Nichol downstairs. We are fine up here. We just need to get this lot cleared out._ She waves you off.";
	action = END_TALK;
	code =
		sf(146,10,3);
		toggle_quest(3,3);
		toggle_quest(4,1);
		erase_char(15798);
		erase_char(15799);
		spawn_creature(15801);
		spawn_creature(15802);
		spawn_creature(15803);
		
		set_name(15801,"Belyna");
		set_name(15802,"Penn");
		set_name(15803,"Runkle");
		
		set_level(15803,3);
		change_max_health(15803,40);
	break;
	
begintalknode 113;
	state = 110;
	nextstate = -1;
	condition = gf(146,10) == 3 || gf(146,10) == 4 || gf(146,10) == 5;
	question = "Are you sure I can't do anything for you?";
	text1 = "_What? Are you trying to cause a riot? Back downstairs with you. Let me do my job._";
	action = END_TALK;
	
begintalknode 114;
	state = 110;
	nextstate = 111;
	condition = gf(146,10) == 6 || (gf(146,10) == 7 && gf(160,0) == 0);
	question = "I need to report to you about the goblins downstairs.";
	text1 = "This gets Katlyn's full attention. She turns away from the supplicants and listens as you describe to her what happened downstairs. She looks worried, then furious.";
	text2 = "_Thank you for reporting this to me. This situation is growing urgent. Now I must send someone to deal with it._";
	text3 = "_Has anything changed since the last time you spoke with me?_ You shake your head. _Then your orders are unchanged._";
	text4 = "_We have known for some time about the colony of goblins to the south, led by this Trinket. But, until now, they had never caused real trouble. Now they must be dealt with. Nichol says that you are capable. Let's test this._";
	text5 = "_I will instruct the soldiers to let you out of the keep. Go south. The goblins reside in an abandoned mine. Find Trinket. Kill him. Do this for me, and you may have a promising career ahead of you._";
	code =
		if (gf(146,10) == 6) {
			toggle_quest(5,3);
			rs(3);
			}
			else {
				rs(1); rs(2);
				}
		sf(146,10,7);
		sf(146,15,1);
		mark_quest_dest(419,738,0,6);
		toggle_quest(6,1);
		sf(170,1,2);
	break;
	
begintalknode 115;
	state = 110;
	nextstate = 112;
	condition = gf(146,10) == 7 && gf(160,0) > 0;
	question = "The goblin Trinket has been slain.";
	text1 = "You report the details of your victory to Katlyn. She is both pleased and surprised. _Well, I am annoyed at Sergeant Nichol. He has been hiding a treasure in the lower level._";
	text2 = "_I could make good use of you, but, sadly, it is not to be. I'd been worried that I was about to lose some of my experienced soldiers, trained in our ways. But I don't have to._";
	
begintalknode 116;
	state = 110;
	nextstate = -1;
	condition = char_ok(15801) && gf(146,16) == 2;
	question = "I talked to two petitioners. Penn and Belyna. Is it possible to get more food for them?";
	text1 = "The lieutenant turns to her secretary and gets confirmation that she dismissed their claims already. When she turns back to you, she is angry.";
	text2 = "_Are you serious? Reconsider? After a denial? And get every applicant running back? That would cause a riot! And those two were hungry, but they weren't starving._";
	text3 = "_No, their hope is to use the portal. Get out of this miserable land. And you ... Waste my time with this sort of business again and I'll have you fighting sliths in the Eastern Gallery inside of a week._ She waves you away.";
	action = END_TALK;
	code =
		sf(146,16,3);
	break;
	
begintalknode 117;
	state = 110;
	nextstate = -1;
	condition = gf(146,10) > 7;
	question = "Is there anything else I can do for you?";
	text1 = "_You're in the army. Orders are important. So is chain of command. You aren't my responsibility (or problem) anymore. Your next orders come from the Castle. Move on, and good luck._";
	text3 = "She notes the insignia on your shoulder. _You seem to be doing well for yourself. I don't think that you need to concern yourself with our business anymore. Your future is at the Castle. I hope it's a bright one._";
	action = END_TALK;
	code = 
		if (gf(170,0) < 2)
			rs(3);
			else rs(1);
	break;
	
begintalknode 118;
	state = 111;
	nextstate = -1;
	condition = 1;
	question = "Tell me more about Trinket.";
	text1 = "_The dirty little beast calls itself Lord Trinket, but I will not flatter such a pest. We know his name because he actually sent a goblin to demand tribute from us. That envoy's skull sits outside our gate._";
	text2 = "_Apparently, the creature has somehow obtained some magical items. That makes it more dangerous than usual, but it is still a goblin. You should be able to deal with him._";
	
begintalknode 119;
	state = 111;
	nextstate = -1;
	condition = 1;
	question = "Trinket is in an abandoned mine?";
	text1 = "_Yes. A promising crystal mine to the south. Then half of the miners won the right to return to the surface in the lottery. The rest dispersed, leaving their remaining prizes behind._";
	text2 = "_Now it is simply a gathering place for vermin._";
	
begintalknode 120;
	state = 111;
	nextstate = -1;
	condition = 1;
	question = "I have to kill him?";
	text1 = "_Of course. Maybe, in a gentler time, we can try to forge peace with goblinkind. This is not such an age. We need to protect our remaining food supplies._";
	
begintalknode 121;
	state = 111;
	nextstate = -1;
	condition = gf(146,19) == 0;
	question = "Can I have some supplies?";
	text1 = "_That seems reasonable. There is a box of equipment in the barracks. I will have it unlocked for you._";
	text2 = "_Also, be sure to collect some rations before you depart. Within reason. Remember, every bite you take comes out of someone else's mouth._";
	action = SET_SDF 146 19 1;
	
begintalknode 122;
	state = 111;
	nextstate = -1;
	condition = gf(160,1) == 0;
	question = "Can I get any assistance?";
	text1 = "She thinks. _I think I heard reports of a bounty hunter collecting goblin ears down there. The name was Vanderin. Travel along the road and watch for him. He might help out. For his own reasons, of course._";
	
begintalknode 123;
	state = 112;
	nextstate = 113;
	condition = 1;
	question = "I don't understand.";
	text1 = "She sighs. _The Castle. They need someone to run errands. They demanded some of my soldiers, as if I have any to spare._ She has her secretary write out some orders and give them to her. She gives them to you, with a pouch.";
	text2 = "_The pouch contains gold. The orders send you to Commander Meryhew, in the Castle. It's quite an honor for you. It's the Castle, after all._";
	text3 = "_And that's all. Thank you for your service here._ She starts to turn back to the audience hall.";
	code = 
		set_flag(146,10,8);
		toggle_quest(6,3);
		toggle_quest(7,1);
		mark_quest_dest(428,594,0,7);
		award_party_xp(600,4);
		change_coins(300);
		set_spec_item(1,1);
		sf(170,1,4);
	break;
	
begintalknode 124;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "But that's it? How do I find Commander Meryhew?";
	text1 = "She smiles. _You go to the Castle. Enormous building? Just to the north? Surrounded by a moat? You can't miss it. The entrance is at the north end. I'm sure someone there can tell you where to find Meryhew._";
	text2 = "Angry muttering from the mob draws Katlyn's attention. _And now I need to get back to work. Enjoy your life of adventure. Goodbye._ She turns and starts to listen to an application for ten pounds of dried lizard meat.";
	action = END_TALK;
	
begintalknode 125;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "All right, then. Goodbye.";
	text1 = "_Goodbye. Remember, Castle. Enormous building, just to the north. Surrounded by a moat. You can't miss it._";
	text2 = "Angry muttering from the mob draws Katlyn's attention. _And now I need to get back to work. Enjoy your life of adventure. Goodbye._ She turns and starts to listen to an application for ten pounds of dried lizard meat.";
	action = END_TALK;

// 130 Belyna

begintalknode 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = "You find an Avernite couple waiting for you in the hallway outside the audience hall. They aren't supposed to be back here ... It's soldiers only. They must have snuck back here during the brief melee.";
	text2 = "You recognize them. They are Penn and Belyna. They were being denied extra food when you first talked to Lieutenant Katlyn. The woman walks up to you, nervously twisting the front of her tunic with her hands.";
	text3 = "_Gr ... Gree ... Greetings to you. I am Belyna. This is my husband, Penn. I ... I wanted to ask for your help. You seem brave and kind. Can you help?_";
	text5 = "Belyna is waiting here nervously. She's right to be nervous. The moment the other soldiers see her, she will be thrown out. And not gently.";
	action = INTRO;

begintalknode 131;
	state = 130;
	nextstate = -1;
	condition = gf(146,16) == 0;
	question = "Didn't the lieutenant already deal with you?";
	text1 = "Belyna nods. _She did. She told us to wait and use the portal out. But we don't know how long it will be before our number comes up in the lottery. And ... We're losing strength._";
	text2 = "You look them over. The standard rations have left them thin and pale, even by Avernum standards, but they're in no danger of death. Just a fair amount of discomfort.";
	
begintalknode 132;
	state = 130;
	nextstate = -1;
	condition = gf(146,16) == 0;
	question = "You have to get out of here. Go! (Push them out.)";
	text1 = "It's hard, but it's necessary. Everyone wants more food these days. They don't put up any resistance. They don't cry or complain. They just shuffle out.";
	text2 = "There. Another job done. Time to return to Sergeant Nichol.";
	action = END_TALK;
	code =
		award_party_xp(100,3);
		sf(146,16,1);
		erase_char(15801);
		erase_char(15802);
	break;
	
begintalknode 133;
	state = 130;
	nextstate = -1;
	condition = gf(146,16) == 0;
	question = "I can speak with the lieutenant for you. Maybe she can help.";
	text1 = "_Can you?_ She grabs your hand. _Oh ... Anything you can get for us would help. Even just a few crusts. It's getting hard for us to work, and ..._";
	text2 = "Suddenly embarrassed, she releases your hand and looks down at the floor. _Thank you for your help._";
	action = END_TALK;
	code =
		sf(146,16,2);
	break;
	
begintalknode 134;
	state = 130;
	nextstate = -1;
	condition = gf(146,16) == 2;
	question = "I haven't spoken with the lieutenant yet.";
	text1 = "_Oh, please hurry. Someone is sure to throw us out soon._";
	action = END_TALK;
	
begintalknode 135;
	state = 130;
	nextstate = -1;
	condition = gf(146,16) == 3;
	question = "I have spoken with the lieutenant. You have to go. Now.";
	text1 = "It's hard, but it's necessary. Everyone wants more food these days. These don't put up any resistance. They don't cry or complain. They just shuffle out.";
	text2 = "As they go, Belyna mutters, _Back to the lottery. Maybe this time ... Maybe ..._ They wander back into the audience hall.";
	action = END_TALK;
	code =
		award_party_xp(100,3);
		sf(146,16,3);
		erase_char(15801);
		erase_char(15802);
	break;
	
begintalknode 140;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You try to speak with Penn, Belyna's husband. He is at least a decade older than her, with thinning hair and sunken cheeks. He seems exhausted. He mutters something you don't understand. You'd be better off talking to his wife.";

// 150 Runkle

begintalknode 150;
	state = -1;
	nextstate = 150;
	condition = 1;
	question = "Runkle";
	text1 = "As you round the corner, you find another man who slipped into the back hall. He is nowhere near as docile and Belyna and Penn. You recognize him as the shouting man who started the near-riot.";
	text2 = "You get a closer look at him. He is thin, twitching, and there are faint green stains around his mouth. He looks wild, almost deranged. And there is a sword in his belt. If he had it in the audience hall, it wasn't visible.";
	text3 = "He walks close to you, without a scrap of fear. You can smell sweat and a faint, medicinal odor. He points at the door to the east. _You. I need meal. Two bags of it. I'll pay you. Fifty coins. Open the bin for me. Now._";
	text5 = "Runkle is staring at you. He wipes off his mouth with his sleeve, but the faint green stains remain. _Meal. I need the meal. Now._";
	action = INTRO;

begintalknode 151;
	state = 150;
	nextstate = -1;
	condition = 1;
	question = "Why do you want it?";
	text1 = "_None ... None of your business. I'll pay you. All you need to know._";
	text2 = "_Get it for me. I need it. Fast._";
	
begintalknode 152;
	state = 150;
	nextstate = -1;
	condition = 1;
	question = "What are those stains?";
	text1 = "_You've never heard of skribbane? Don't matter. Who are you to judge me?_";

begintalknode 153;
	state = 150;
	nextstate = -1;
	condition = gf(146,17) < 2;
	question = "You shouldn't be here. Get out of here.";
	text1 = "_Have to ... Have to have it. Need the money. Need to buy ... Yes. You have a key, don't you? Can get the key. Grab the meal. Run. Nobody will ..._ His eyes grow wilder as he speaks.";
	text2 = "And then he snaps. He whips his sword out. _Sorry. Nothing personal. Need the money. Now ..._ He lunges at you.";
	action = END_TALK;
	code =
		set_attitude(15803,10);
	break;
	
begintalknode 154;
	state = 150;
	nextstate = -1;
	condition = gf(146,17) < 2 && gf(146,18) == 0;
	question = "I'll unlock the bin for you. Just a moment.";
	text1 = "_Yes. Yes. You do, I pay. Good bags of meal. Need them, now._ He waves points at the door. _Do it now._";
	action = END_TALK;
	code =
		sf(146,17,1);
	break;	
	
begintalknode 155;
	state = 150;
	nextstate = -1;
	condition = gf(146,17) == 1 && gf(146,18) > 0;
	question = "I opened the bin for you.";
	text1 = "_Yes. Yes. Two bags. All I can carry. Two hundred coins, at least. Can buy ... I need ..._ He pulls a grimy leather pouch from his belt and hands it to you. _There's your coins._";
	text2 = "Runkle slips into the storeroom. A minute later, he comes out again, two large bulges clearly visible under his cloak. Without a word or a glance, he is gone. The odd, medicinal stink of him remains well after he is gone.";
	action = END_TALK;
	code =
		sf(146,17,2);
		erase_char(15803);
		change_coins(50);
		award_party_xp(100,2);
	break;
	
begintalknode 156;
	state = 150;
	nextstate = -1;
	condition = gf(146,17) == 0;
	question = "Uh ... Just wait here. I'll be back to help you in a moment.";
	text1 = "_No! You go to get guards! I know it! Have to have it. Need the money. Need to buy ... Yes. You have a key, don't you? Can get the key. Grab the meal. This is your fault._ His eyes grow wilder as he speaks.";
	text2 = "And then he snaps. He whips his sword out. _Sorry. Nothing personal. Need the money. Now ..._ He lunges at you.";
	action = END_TALK;
	code =
		set_attitude(15803,10);
	break;

// 170

begintalknode 170;
	state = -1;
	nextstate = 170;
	condition = 1;
	question = "Name";
	text1 = "You return to Sergeant Nichol, who is pacing nervously in the basement. After spending a year trying to build himself a refuge from the chaos outside, the recent intrusion into the cellar has left him unnerved.";
	text2 = "_Ah, you're back,_ he says. _I am glad. I don't think those rats you fought were the end of the problem. They were the beginnings. There is something in Deep Storage. I heard it!_";
	text3 = "He looks at your new insignia. That you now outrank him makes him both proud and envious.";
	code =
		if ((gf(146,10) > 4) || (gf(146,8) > 0))
			rs(2);
		if (gf(170,0) < 2)
			rs(3);
	break;
	
begintalknode 171;
	state = 170;
	nextstate = -1;
	condition = gf(146,10) == 3;
	question = "Lieutenant Katlyn didn't need assistance.";
	text1 = "_Not surprising, but we needed to check. We have worse problems now. And they're our responsibility._";
	
begintalknode 172;
	state = 170;
	nextstate = 171;
	condition = gf(146,10) == 3 || (gf(146,10) == 4 && gf(146,8) == 0);
	question = "There's something in Deep Storage?";
	text1 = "_Yes. I'm certain of it. I went and looked at the bodies of the rats you killed. On the way back, I looked through the bars to Deep Storage. I saw shadows and I clearly heard ... something._";


begintalknode 173;
	state = 170;
	nextstate = 172;
	condition = gf(146,10) == 3 || (gf(146,10) == 4 && gf(146,8) == 0);
	question = "What are my orders now?";
	text1 = "_If vermin have infested Deep Storage, they must be driven out. The supplies down there might one day be the last bulwark between the Great Cave and starvation._";
	text2 = "_Prepare yourself, but do it quickly. We must make haste._";
	code =
		toggle_quest(4,3);
	break;
	
begintalknode 174;
	state = 171;
	nextstate = -1;
	condition = 1;
	question = "Why didn't you investigate?";
	text1 = "_Heh. So young and foolhardy. Learn from my caution._";
	text2 = "_I'm not mad enough to explore by myself. I waited for you to return. Never, ever go out alone._";
	
begintalknode 175;
	state = 171;
	nextstate = -1;
	condition = 1;
	question = "What is Deep Storage?";
	text1 = "_It is the cold, low caverns, where the bulk of our emergency supplies are kept, highly secure and under lock and key. Mark my words. When we're getting the supplies out of Deep Storage, things have truly gotten bad._";
	
begintalknode 176;
	state = 172;
	nextstate = -1;
	condition = 1;
	question = "What is our plan?";
	text1 = "_I will unlock the gate. We will rush in before the vermin has time to flee. You will go southwest and slay anything interfering with the supply bins. I will go north and secure the algae chamber._";
	text2 = "He anticipates your question. _The algae chamber has pools of mold in it, kept fresh for the wizards of Patrick's Tower. I don't know what it's for. Smells like old socks._";
	
begintalknode 177;
	state = 172;
	nextstate = -1;
	condition = 1;
	question = "What do you think is back there?";
	text1 = "_Probably just more rats. That would be bad enough, but ... I have other suspicions. Just keep a blade handy and be ready for anything._";
	
begintalknode 178;
	state = 172;
	nextstate = -1;
	condition = 1;
	question = "Shouldn't we get help from upstairs?";
	text1 = "Nichol sighs. He would clearly like nothing more. _They have enough to worry about. And if we ask their help just to deal with some rats ... No. We'll get their help when we need it. Not sooner._";
	
begintalknode 179;
	state = 172;
	nextstate = 173;
	condition = 1;
	question = "I'm ready to go.";
	text1 = "_Are you sure? I don't want to rush ahead alone and end up with my pants down._";
	
begintalknode 180;
	state = 173;
	nextstate = -1;
	condition = 1;
	question = "Maybe I need a little bit more time.";
	text1 = "He seems relieved by the delay. _Be prepared. That's what I always say. Do what you need to do, but hurry._";
	action = END_TALK;
	
begintalknode 181;
	state = 173;
	nextstate = -1;
	condition = 1;
	question = "Let's go.";
	text1 = "The old soldier stands, shakes his limbs, does a little stretching, and readies his blade. _All right. I'll lead. You follow. When we're in Deep Storage, I'll go north and you go southwest. Let's go spit some rats._";
	text2 = "With a final shudder, he leaves to the south.";
	action = END_TALK;
	code =
		toggle_quest(8,1);
		sf(146,10,4);
		sf(146,13,1);
		mark_quest_dest(405,678,1,8);
	break;
	
begintalknode 182;
	state = 170;
	nextstate = 174;
	condition = gf(146,10) == 4 && gf(146,8) > 0;
	question = "There were goblins back there. One of them called itself 'Lord Trinket'. I killed most of them.";
	text1 = "You describe the battle to Sergeant Nichol. He isn't surprised. _I had my suspicions. I'm surprised we kept those vermin out as long as we did._ He thinks about what to do next. He soon comes to a conclusion. He doesn't like it.";
	text2 = "_I don't like this, but we have no choice._ He looks at you sadly. _I tried ... I did ... I'm sorry._";
	
begintalknode 183;
	state = 174;
	nextstate = 175;
	condition = 1;
	question = "What? What happens now?";
	text1 = "_Go upstairs. Talk to Lieutenant Katlyn. Tell her what is happening. She will select someone to help with the problem. I hope ... I'm sorry._";
	code =
		sf(146,10,6);
		toggle_quest(8,3);
		toggle_quest(5,1);
		award_party_xp(500,4);
	break;
	
begintalknode 184;
	state = 175;
	nextstate = -1;
	condition = 1;
	question = "All right! I might finally get some action!";
	text1 = "_Yes. The courage of youth. I hope you live long enough to see that for what it is._ He claps you on the shoulder. _Good luck. I hope to see you back down here, where it's safer, soon enough._";
	text2 = "He turns away, freeing you to go back to the lieutenant.";
	action = END_TALK;
	
begintalknode 185;
	state = 175;
	nextstate = -1;
	condition = 1;
	question = "What's wrong? Why do you keep apologizing?";
	text1 = "_I tried to make a secure place down here, safe from ... I've seen what can happen out there. How ugly things can get. I ... I'm sorry. Getting sentimental in my old age._";
	text2 = "_The lieutenant needs to know what is happening. Go talk to her._ he turns away.";
	action = END_TALK;
	
begintalknode 186;
	state = 170;
	nextstate = 176;
	condition = gf(146,10) < 6;
	question = "I encountered someone named Runkle upstairs.";
	text1 = "You describe your meeting with Runkle. Nichol nods.";
	text2 = "You describe your meeting with Runkle, leaving out any ugly details about the theft of food. Nichol nods.";
	text3 = "_Green stains, eh? Sounds like a skribbane addict. Hungry and dangerous. We're well rid of him._";
	code =
		if (gf(146,17) == 2)
			rs(1);
			else rs(2);
	break;
	
begintalknode 187;
	state = 176;
	nextstate = -1;
	condition = 1;
	question = "Skribbane?";
	text1 = "_A gift from the Empire. Once, it could only be grown on the surface. Makes you strong and fearless and immune to pain for a time. At first. Then it stops helping, but you find that you can't live without it._";
	text2 = "_Some advice for you, kid. Stay away from the stuff._";	
	
begintalknode 188;
	state = 170;
	nextstate = -1;
	condition = gf(146,10) == 7;
	question = "I have an actual mission! I was sent to hunt Trinket.";
	text1 = "_I'm not surprised. Our army tends to look for those with initiative and potential and exploit it as quickly and totally as possible._.";
	text2 = "_Still, congratulations. I hope you come back alive._";	
	text3 = "You tell Sergeant Nichol of your victory over the goblin tribe. He seems guardedly pleased. _I had heard that you were sent out. I confess I was worried._";
	text4 = "_Now that you are back safe, with any luck, you will be transferred to a nice quiet post. I wish you luck_";
	action = DEP_ON_SDF 160 0 0;
	
begintalknode 189;
	state = 170;
	nextstate = -1;
	condition = 1;
	question = "I could use some medical attention.";
	text1 = "_Of course, of course._ Sergeant Nichol takes some time to bandage your wounds.";
	code =
		revive_party();	
	break;

begintalknode 190;
	state = 170;
	nextstate = -1;
	condition = gf(146,10) > 7 && gf(170,0) == 0;
	question = "I am being transferred to the Castle.";
	text1 = "_The lieutenant was courteous enough to let me know. I know I rode you pretty hard, but it was good having you down here._";
	text2 = "_Now I have to replace you. It won't be hard. And I hope the new kids know enough to keep their heads down and stay safe._";
	text3 = "_Go. You're bigger than this cellar now._ He waves you away.";
	action = END_TALK;
	
begintalknode 191;
	state = 170;
	nextstate = -1;
	condition = gf(170,0) > 0;
	question = "I was passing by and thought I'd stop in.";
	text1 = "You sit and share a drink with old Sergeant Nichol. He is interested to hear first-hand of your exploits. When you leave, he claps you on the shoulder.";
	text2 = "_You've done well for yourself, kid._";
	text3 = "He smiles. _I mean, sir._";
	text4 = "_Remember what I taught you. Keep your head down. Don't volunteer for anything. And good luck._ He returns to work.";
	action = END_TALK;
	
// 190 Dominica

begintalknode 194;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Dominica";
	text1 = "There is a caravan master in the courtyard, hovering protectively near her two wagons. They are loaded with sacks of dried mushroom meal, due to be delivered to somewhere in the Great Cave.";
	text2 = "When she sees you, she gives you a little bow. _Greetings, soldier. I am Dominica. I do not need any aid. I am only waiting for my escort, and then my little caravan will depart._";
	text5 = "Dominica is checking her wagons before departure. You notice that her forearms are covered with faint scars. In Avernum, that is a sure sign of someone who frequently works with giant lizards.";
	action = INTRO;

begintalknode 195;
	state = 190;
	nextstate = 191;
	condition = 1;
	question = "Where are you going?";
	text1 = "_I am on the Dharmon run. I carry food there when it is needed, and I bring back the surplus when they have it, or when they manage to grow something._";
	text2 = "_It is a simple run. Only a day's journey, and usually not threatening._";
	
begintalknode 196;
	state = 190;
	nextstate = 192;
	condition = 1;
	question = "Will you have an escort?";
	text1 = "_Of course. Food caravans always have escorts. Way things are out there, it's necessary. And getting more so every day._";
	
begintalknode 197;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "Can you tell me about the Great Cave?";
	text1 = "_The largest cavern in Avernum. There are still two major cities left, Dharmon to the west and Almaria to the east. And, of course, the Castle just to the north._";
	text2 = "_It is still the safest place to be in all of Avernum. Though not by as wide a margin as it used to be._";
	
begintalknode 198;
	state = 191;
	nextstate = -1;
	condition = 1;
	question = "Where is Dharmon?";
	text1 = "_About a day's travel to the west, and the roads are decent. It is one of the few cities in Avernum that is still mostly at full strength._";
	text2 = "_The rest of them are slowly emptying out. Going back to the surface, you know._";
	
begintalknode 199;
	state = 191;
	nextstate = -1;
	condition = 1;
	question = "What do you need to do before you go?";
	text1 = "_Wait for my guards to finish their drinks. And then fetch the lizards, hitch them to the wagons, and bandage all the wounds we got hitching them up._ She laughs bitterly.";
	
begintalknode 200;
	state = 191;
	nextstate = -1;
	condition = 1;
	question = "Do you meet many monsters along the way?";
	text1 = "_A few, though they tend to have the good sense to stay away from the road. The Great Cave is nowhere near as safe as it used to be. When so many soldiers went northeast to fight the sliths, well ..._ She shakes her head.";
	
begintalknode 201;
	state = 192;
	nextstate = -1;
	condition = 1;
	question = "Is there a real risk of attack?";
	text1 = "She looks at the wagons. _Those bags of meal are worth a fair amount of money, which draws brigands. And some people feel entitled to more than their fair rations, and some of those people are armed._";
	text2 = "_I haven't been attacked yet. But some have._";
	
begintalknode 202;
	state = 192;
	nextstate = -1;
	condition = 1;
	question = "How bad are things out there?";
	text1 = "_Not so bad. King Starrus has done well with the rationing. Everyone is uncomfortable, but nobody is starving._";
	text2 = "_It will be close, but I think we will send enough people through the portal to prevent any great suffering among those who remain._";
	text3 = "_But now, with the portal gone ..._ She shakes her head. _We stand at the edge of disaster._";
	code =
		if (gf(170,1) <= 10)
			rs(3);
			else rs(2);
	break;

begintalknode 203;
	state = 190;
	nextstate = 0;
	condition = gf(159,0) == 1;
	question = "I found your lizard. I'm afraid I had to kill it.";
	text1 = "She is, understandably, displeased. _Ahh. Very unfortunate. Those creatures are most difficult to train. Well, at least it won't attack some innocent. Thank you for letting me know._";
	code = 
		sf(159,0,2);
	break;
	
// 210 Or'Vysss

begintalknode 210;
	state = -1;
	nextstate = 210;
	condition = 1;
	question = "Or'Vysss";
	text1 = "You stop by to see Or'Vysss. In happier times, she was a traveling tinker. Now that the Great Cave has become so dangerous, she spends most of her time here, trading and bantering with the soldiers and petitioners.";
	text2 = "When you get close, she waves you over. _Ahssss ... Yesss. Or'Vysss has good new thingsss for you. You go out, yesss? On mission, yesss? Good armor isss difference between life and ..._ She shakes her head. _The other thing._";
	text3 = "(You can buy supplies from merchants. You can also sell equipment you have no use for.)";
	text5 = "Or'Vysss constantly wipes off and rearranges the goods scattered on the thin blankets around her. _Ah ... You come to trade, yesss? Good. Good. Or'Vysss makesss special deal for Avernum soldier._";
	action = INTRO;

begintalknode 211;
	state = 210;
	nextstate = -1;
	condition = 1;
	question = "Let me see what you have for sale.";
		text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Or'Vysss",
		  "Or'Vysss's supplies are of low quality, especially when compared to what you can get from the fine metalsmiths of Dharmon. But she does give a good deal to the soldiers stationed here.",
		  1,2,0);	
	break;
	
begintalknode 212;
	state = 210;
	nextstate = -1;
	condition = 1;
	question = "I would like to sell something.";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode 213;
	state = 210;
	nextstate = 211;
	condition = 1;
	question = "How is business?";
	text1 = "_Isss good. Much bartering. Many good dealsss. Many in Avernum willing to trade useless trinketsss for food and weaponsss. Are hard timesss, and Or'Vysss helps them through._";
	
begintalknode 214;
	state = 211;
	nextstate = -1;
	condition = 1;
	question = "Where do you get the food?";
	text1 = "_Trade for it from those with enough, those who catch fish and hunt lizardsss. Only crops fail. Is still meat._";
	
begintalknode 215;
	state = 211;
	nextstate = -1;
	condition = 1;
	question = "So you take the possessions of desperate people and give them food in return.";
	text1 = "_And weaponsss. Do not make it sound like Or'Vysss is cruel. I take from them thingsss they don't need and give them thingsss they need. They are thankful Or'Vysss is there. Much worse if Or'Vysss is not._";
	
begintalknode 216;
	state = 210;
	nextstate = 212;
	condition = 1;
	question = "I am going out on a mission. Can you help me?";
	text1 = "_Of course. Or'Vysss always gives discountsss to brave warrior of Avernum. And they let Or'Vysss stay here. Or'Vysss but wants to help._";
	
begintalknode 217;
	state = 212;
	nextstate = 210;
	condition = 1;
	question = "Actually, could you give me something? A potion or weapon, perhaps?";
	text1 = "Or'Vysss does something she doesn't do often. She blinks. _Or'Vysss gives good price to you. Do not ask for more. Or'Vysss must live too. And wise lieutenant approves._";
	
begintalknode 218;
	state = 212;
	nextstate = 210;
	condition = 1;
	question = "And we appreciate it.";
	text1 = "Or'Vysss gives you a toothy smile. _See what I have to sell now?_";
	
begintalknode 219;
	state = 210;
	nextstate = -1;
	condition = 1;
	question = "Do you know anything about the savage slithzerikai?";
	text1 = "She lets out an angry hiss. _Do not ask me of them. Murderersss, seizing the cities, killing good soldiersss, trying to take all Eastern Gallery. They are horrorsss._";
	text2 = "_I hope Avernum destroysss them all. If not, when they come here, they kill me as sure as you._";
	
begintalknode 220;
	state = 210;
	nextstate = -1;
	condition = 1;
	question = "That is all I need.";
	text1 = "Or'Vysss thanks you and wishes you safe travels.";
	action = END_TALK;
	
//// MIXED

begintalknode 270;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are three privates in these barracks. While they technically don't outrank you, they've been here for a lot longer, and it gives them a superior attitude.";
	text2 = "The soldier snorts, _What are you looking at? Don't you have some work to do? Downstairs?_ He goes back to reading a well-worn scroll.";
	text3 = "The soldier concentrates on sharpening his blade and ignores you.";
	text4 = "The soldier says, _Don't be getting all hopeful. The beds up here are full up. Three of us share each one. You're not getting out of the cellar. Don't even try!_";
	text5 = "The soldier snorts. _Why don't you go back to Sergeant Nichol. We're with K'Naan. He has a future in this army._";
	text6 = "There are three privates in these barracks. Now that you outrank them, they don't have anything snide to say to you. It's very satisfying.";
	code =
		clear_strings();
		if (gf(170,0) == 0) {
			as(1);
			as(2 + get_ran(1,0,3));
			}
			else as(6);
	break;
	
begintalknode 271;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are several guards here, keeping a stern watch on the many desperate applicants for aid. They all have truncheons in their hand and more dangerous weapons close nearby.";
	text2 = "You try to speak with one of them, but you don't get anywhere. They won't let their concentration waver for a moment.";

begintalknode 272;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are a lot of Avernite citizens here, thin but not starving, each waiting their turn to explain why they should get more rations or earlier use of the portal to the surface. Upon seeing an Avernite soldier, the supplicant says ...";
	text2 = "_Can you help me? I've had bad luck in the lottery, but I have to get out of here. I have to._";
	text3 = "_I need more bread. My children ... They're losing weight. They're sickly. Can you put in a good word for me? Please?_";
	text4 = "_I owned three mines around Formello before it was lost. I've met King Starrus himself. It's an outrage I have to wait like this!_";
	text5 = "_Why is it taking so long? I need to return to my farm. Is there any way to speak with the lieutenant faster?_";
	text6 = "_Ah, a soldier. You look well fed. It's easy for you lot to boss us around. We're all weak and you're at full strength._";
	text7 = "Sergeant Nichol told you what to do in these cases ... Nod and move on. It's harsh, but you're not supposed to get personally involved.";
	code =
		clear_strings();
		as(1); as(7);
			as(2 + get_ran(1,0,4));
	break;
	
begintalknode 273;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Lieutenant Katlyn has a secretary, who records the details and results of every request. Even though the answer is always no. He then puts his records on the shelves behind him.";
	text2 = "It's a tedious job, but it's far better than fighting off the savage sliths in the Eastern Gallery.";

begintalknode 274;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There is a married couple petitioning for food right now. Named Penn and Belyna, from what you can tell. You don't interrupt them. Based on the look on Katlyn's face, it isn't going well for them.";

begintalknode 275;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There is a nephil guard here, petitioning for rations to help sustain his merchant caravan. It looks like she might actually have some success in her plea. You don't interfere.";
	
begintalknode 276;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are two caravan guards here, trading a bottle of mushroom ale back and forth before leaving on their next run. The looks on their faces tell you just how foul the beverage is.";
	text2 = "Soldiers and private guards generally don't get along well. You nod cordially to each other, but that's it.";		
	
begintalknode 277;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are two huge lizards chained up in this pen. They have thick leather collars around their necks. They must be caravan lizards. They are waiting to be taken out and hitched up to wagons.";
	text2 = "Their claws and teeth have been filed down slightly to make them less dangerous to their masters. They are still dangerous and foul-tempered creatures. You maintain a safe distance.";		
		
		
begintalknode 299;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Unfortunately, the Great Cave 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;		