// TOWN DIALOGUE SCRIPT
//    Town 20: Fort Draco

begintalkscript;

variables;

short i,j,k,r1,choice;

begintalknode;
	tag = 1;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "The creation of the barriers has stranded merchants, drovers, and guards in towns and forts all throughout Avernum. Naturally, they have drifted to the inn.";
	text2 = "They sit here, bored. They make plans, trade gossip, and drink. When you approach, they ask if you have learned anything about the barriers. You haven't, so they tell you to go away.";
	text3 = "They are currently engaged in a flurry of negotiating, preparing to leave now that the roads are open. They ignore you.";
	code =
		if (gf(20,0) == 0)
			rs(3);
			else rs(2);
	break;
	
// Boutell

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Boutell";
	text1 = "You are greeted by an enormous, heavily muscled man, stripped to the waist. Somehow, his ruddy glow manages to shine through the paleness caused by his years living in these caves. He grabs your hand and shakes it. _I'm Boutell, master blacksmith of the caves._ ";
	text2 = "_You have the look of a warrior about you, but your weapons are, if you don't mind me saying, lacking. I might be able to help._";
	text5 = "Boutell keeps himself busy keeping the smithy operating while he waits to hear what else you have to say.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What do you do here?_";
	text1 = "_I work steel! One of the few down here who does! If you want a good weapon, you can buy it here. I also do repair work._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_How do you manage to make steel down here?_";
	text1 = "_Fort Draco is one of the few cities in all of Avernum that can make steel! It takes a mighty smelter to make, so it's rare and expensive stuff. But they're the best weapons we have! Draco blades will show the Empire a thing or two!_";
	text2 = "His boasting seems justified. All of the weapons you see here are of extremely high-quality.";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_What kind of repairs can you do?_";
	text1 = "_Well, I don't mean to brag, but the mighty Demonslayer itself was reforged by my hand!_ This seems implausible, but you let it slide. _I can repair any blade you need reworked._";

begintalknode;
	state = 3;
	nextstate = 5;
	question = "_What is this Demonslayer?_";
	text1 = "_A powerful weapon, one of the greatest ever, and we own it. It cuts through demons as if they weren't there. I think it's in the Castle now, for safekeeping. And to think that I repaired it!_";

begintalknode;
	state = 3;
	nextstate = 1;
	question = "_If I need any repairs, we'll be sure to come back here._";
	text1 = "_I appreciate that. I am always looking for a new challenge. I haven't had my skills tested since I repaired Demonslayer._";

begintalknode;
	state = 1;
	nextstate = 4;
	question = "_What sort of weapons do you sell?_";
	text1 = "_Sadly, all of our best steel has to go to the army, to help defend us against the Empire. Fortunately, I have some other blades I can spare for you. Not my best, but they will help you survive._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_I would like to buy some weapons._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Fine Weaponry","Most of Boutell's steel equipment are sold directly to the army, but he has a few expensive pieces available. For high prices.",2,5,1);
	break;

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

begintalknode;
	state = 4;
	nextstate = 1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_All right._";
	action = END_TALK;
	
begintalknode;
	state = 5;
	nextstate = 6;
	question = "_Who discovered the pieces of Demonslayer?_";
	text1 = "_Why, the Great Heroes, of course! The Great Heroes who found Demonslayer and slew the demon Grah-Hoth, who threatened all of Avernum. I met the Great Heroes, honest I did, and it was one of the great honors of my life._";

begintalknode;
	state = 6;
	nextstate = -1;
	question = "_What happened to the Great Heroes?_";
	text1 = "_Why, nobody knows! Nobody has heard of them for years. Some say that they retired and live quiet, anonymous lives. Others think that they escaped to the surface. And some think that they fight on still, waging a secret war against the Empire._";
	text2 = "_They were amazing, though, tall and strong, pale like all Avernites, carrying only the highest quality armor and weapons. Truly, we will never see their like again._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(70,10) == 0;
	question = "_Do you know anything about the magical barriers?_";
	text1 = "_You're not the first soldier to ask me. They have completely cut off this corner of Avernum. Who made them? We have no idea. How can they be brought down? Again, no idea. Perhaps they may have a better idea of what to do about them in Formello._";
	text2 = "_There are mages in Formello, and powerful priests, too. If anyone wanted to do something about the barriers, Formello is the place to begin the search for answers._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(70,10) >= 1;
	question = "_I managed to help bring down the barriers._";
	text1 = "He chuckles. _Now, now. I am sure that you are a very competent adventurer. You have achieved many heroic deeds, I'm sure. I doubt that there's any need to inflate the list artificially._";

// Della

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 28;
	question = "Della";
	text1 = "This tall, thin woman is using a wheelbarrow to haul sacks of ore over to the smelter. The muscles of her arms show like steel cables through her pale skin. She gives you a brief nod. _Welcome, stranger. I'm Della._";
	text5 = "Della sits on her wheelbarrow and looks up at you. She seems to be glad to take a break from work. Sometimes, she pulls her hand across her forehead to wipe off the dust. It is a futile effort.";
	action = INTRO;
	
begintalknode;
	state = 28;
	nextstate = -1;
	question = "_How does this smelter work?_";
	text1 = "_Ahhh ... You should ask Kellia. I'm only in training._";

begintalknode;
	state = 28;
	nextstate = 29;
	question = "_May I ask what are you doing?_";
	text1 = "_I help keep the foundry going! While I can._";

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_What's wrong with the foundry?_";
	text1 = "_Those cursed nephilim have cut us off from our fine ore, but we've got plenty stored up, so we'll be making steel for a while!_";

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_Where are these nephilim?_";
	text1 = "_Up north. They took all our mines from us. Hope we get back at 'em soon. Avernum needs Draco's blades._ She grabs another sack of ore and hauls it over to the smelter.";

begintalknode;
	state = 28;
	nextstate = -1;
	condition = gf(70,10) == 0;
	question = "_Can I buy any ore or metal from you?_";
	text1 = "She shakes her head. _Sorry. As long as the barriers outdoors are up, we can't spare an ounce of precious metals or supplies._";

begintalknode;
	state = 28;
	nextstate = -1;
	condition = gf(70,10) >= 1;
	question = "_Can I buy any ore or metal from you?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Draco's Foundry","You can buy some metal and other raw equipment here.",3,2,3);
	break;

begintalknode;
	state = 28;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "She sighs. _Oh. Back to hauling._";
	action = END_TALK;
	
// Kellia

begintalknode;
	tag = 50;
	state = -1;
	nextstate = 55;
	question = "Kellia";
	text1 = "A short, stout woman is taking notes on a sheet of lichen parchment. She is covered with a thick layer of soot, like everything and everyone around here.";
	text2 = "She slaps you firmly on the shoulder in greeting. You feel sprained. _Hi! I'm Kellia. If you want to know anything about the foundry, let me know._";
	text5 = "Kellia watches to make sure the smelter continues to work properly. She quietly waits to see what else you have to say.";
	action = INTRO;

begintalknode;
	state = 55;
	nextstate = 56;
	question = "_What are you up to?_";
	text1 = "_I'm the forewoman here. We can't talk long. We have a load of ingots due in Formello._";

begintalknode;
	state = 56;
	nextstate = 57;
	question = "_Where's Formello?_";
	text1 = "_Biggest city up here. It's some ways to the southeast. Avernum has a large barracks there._ She frowns. _Our next load of steel has to go there anyway, what with the barrier and all._";

begintalknode;
	state = 57;
	nextstate = -1;
	question = "_Barrier?_";
	text1 = "_Yeah, the barrier that just appeared. Blocks the roads and passages. We can't send stuff anywhere far away. It's a bad, bad thing for the rest of Avernum. Lots of fortresses count on us for weapons._";
	text3 = "_Even though the barriers are down, it's taking some time for the roads to be rebuilt. The barrier broke them up. Things will be all right soon, but until then, we're just shipping to Formello._";
	action = DEP_ON_SDF 20 0 0;

begintalknode;
	state = 55;
	nextstate = -1;
	condition = gf(20,0) == 0 && gf(20,22) < 2;
	question = "_Do you need anything? I mean, what with the war and the barrier and all?_";
	text1 = "_The barriers were a disaster. We can't get much ore. That means we can't fill our orders._ She thinks. _You know something? You could help. If you find any iron bars, bring them here. I'll pay well._";
	text2 = "_Avernum needs all the metal it can get. It's precious stuff._";
	code =
		sf(20,22,1);
		toggle_quest(5,1);
	break;
	
begintalknode;
	state = 55;
	nextstate = -1;
	condition = gf(20,22) == 1 && party_has_item(262);
	question = "_I have some iron bars for you._ (Sell your iron bars.)";
	code =
	run_hardcode(3);
	break;
	
begintalknode;
	state = 55;
	nextstate = -1;
	condition = gf(20,0) > 0 && gf(20,22) != 1;
	question = "_Do you need any help right now?_";
	text1 = "_We're fine. Now that the barriers are down, the steel and iron is moving out again. I think you're too busy to want to spend time guarding caravans._";

begintalknode;
	state = 55;
	nextstate = 58;
	question = "_How does this smelter work?_";
	text1 = "She looks down at the pool of bubbling ore. _A very, very good question. Making steel requires incredible heat, which requires a lot of fuel, which we don't have._";

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_OK. So how does this smelter work?_";
	text1 = "_Oh. Um. Magic._";

begintalknode;
	state = 59;
	nextstate = 60;
	question = "_Who created it?_";
	text1 = "_Some mages who came up from the Tower of Magi. They knew we needed their help to make steel, so they used some magic to make this thing. I don't know how to run it. I just watch and make sure nothing goes wrong._";

begintalknode;
	state = 60;
	nextstate = 61;
	question = "_But what do you do if something goes wrong?_";
	text1 = "_I send a message to the Tower of Magi. Then I hope._";
	text2 = "_Of course, since the barriers are still up, the message won't get there. So what I do now is just hope._";
	code =
		if (gf(20,0) > 0)
			rs(2);
		break;
		
begintalknode;
	state = 61;
	nextstate = -1;
	condition = gf(20,27) == 0;
	question = "_That sounds like a terrible system._";
	text1 = "_Don't you know how things work in Avernum? We do the best we can, and then we hope. Want a different system? Then you should have stayed on the surface._";
	action = SET_SDF 20 27 1;
		
begintalknode;
	state = 61;
	nextstate = -1;
	condition = gf(20,27) == 0;
	question = "_So you do the best you can and hope._";
	text1 = "_That's how Avernum works!_ She winks.";
	action = SET_SDF 20 27 1;
	
// Cheryl

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 82;
	question = "Cheryl";
	text1 = "There is a small woman with curly hair sitting and poking at her low fire. She watches you silently as you enter. She doesn't seem surprised by your presence.";
	text2 = "You ask her name. _I'm Cheryl,_ she says in a quiet voice.";
	text5 = "Cheryl sits and stares into the peat fire. The smoke is making your eyes water.";
	action = INTRO;

begintalknode;
	state = 82;
	nextstate = 83;
	question = "_What are you doing back here?_";
	text1 = "_Just sitting. In my little house. With my stuff._";
	text2 = "_Maybe with some things you could buy. But things that are perfectly legal to sell! And you can sell me things too, nothing wrong with that. Nothing illegal going on here._ She is nervous.";
	code = 
		sf(20,26,1);
	break;
	
begintalknode;
	state = 83;
	nextstate = 84;
	question = "_So I can't buy anything illegal from you, then?_";
	text1 = "_There's nothing illegal here. Nope!_ She's shaking a little. _And the ore piles back there? They're my property. I can prove it! So stay away._";

begintalknode;
	state = 84;
	nextstate = 82;
	question = "_Can't I just take a peek at your entirely legal pile of ore?_";
	text1 = "The corner of her mouth begins to twitch. _Just stay away from them. Don't go behind my shop. Please? OK?_ Somehow, despite her pleading, she doesn't seem entirely sincere.";
	text3 = "_They're mine. And you know what I hear? Bandits were hiding under them! Bandits so cruel they might harass and shake down innocent ladies trying to make a living. But they're all dead now. What a shame!_ She smiles.";
	action = DEP_ON_SDF 20 2 0;

begintalknode;
	state = 82;
	condition = gf(20,21) == 1;
	question = "_I'm hunting for some bandits. Under Fort Draco, I've heard._";
	text1 = "She shudders. _Don't know anything about it. No idea. No hint of how they sneak out of town. There's nothing interesting behind my house. That is for sure._";

begintalknode;
	state = 82;
	nextstate = -1;
	condition = gf(20,26) > 0;
	question = "_Let me take a look at your wares._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Cheryl's Tools","Cheryl buys and sells various goods in her little home, and she isn't too concerned about where her wares came from.",4,3,3);
	break;

begintalknode;
	state = 82;
	nextstate = -1;
	condition = gf(20,26) > 0;
	question = "_I would like to sell something._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode;
	state = 82;
	nextstate = -1;
	condition = gf(20,26) > 0;
	question = "_I don't need to trade._";
	text1 = "_Oh._ She turns and throws some dried muck onto the fire.";
	action = END_TALK;
	
// Esther

begintalknode;
	tag = 90;
	state = -1;
	nextstate = 109;
	question = "Esther";
	text1 = "A woman with graying hair, pale to the point of translucency, sits behind the counter. _I'm Esther. Welcome to my shop._ She waves at the armor around the room. _Plenty here for a young adventurer._";
	text5 = "Esther keeps herself busy polishing a helmet.";
	action = INTRO;

begintalknode;
	state = 109;
	nextstate = 110;
	question = "_Tell me about your wares._";
	text1 = "_You can buy armor here. Shields, helms, and so on. Mostly scavenged and repaired. It's not the fancy steel stuff, like Boutell makes, but the price won't break you._";
	text2 = "_And, when you're done here, Orson can help you with your weapons._";

begintalknode;
	state = 110;
	nextstate = -1;
	question = "_Who's Orson?_";
	text1 = "_My husband. His weapons shop is just around the corner._ She sighs. _We came down into Avernum together, 10 years ago. We're old timers._";

begintalknode;
	state = 110;
	nextstate = -1;
	question = "_What do you think about Boutell?_";
	text1 = "_His smithy is just down the road. He's a bit full of himself, but let me tell you, he's the finest hammer and anvil man in Avernum. And maybe the surface, too._";

begintalknode;
	state = 109;
	condition = gf(20,21) == 1;
	question = "_I've heard there are bandits under Fort Draco._";
	text1 = "She sighs. _Yes. Bandits is a bit grand. They're thugs, mainly. We always ignored them before, but they've grown arrogant since the barriers came up._";
	text2 = "_There are many ways into the tunnels under the fort. I even hear there is one outside the walls._ She nods toward the wall to the north.";
	
begintalknode;
	state = 109;
	nextstate = -1;
	question = "_Do you do repair work?_";
	text1 = "_Of course. I'm not a burly specimen like Boutell, but I can fire up the forge and do repair work when I need to. Most of my goods are, um, previously owned._";

begintalknode;
	state = 109;
	nextstate = -1;
	question = "_I'd like to do some trading._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Esther's Armors","Esther trades in refurbished armor. It's crude and stained, but the prices are good.",5,2,3);
	break;
	
begintalknode;
	state = 109;
	nextstate = -1;
	condition = 1;
	question = "_I would like to sell something._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;
	
begintalknode;
	state = 109;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_All right. I wish you safe travels._";
	action = END_TALK;
	
// Orson

begintalknode;
	tag = 110;
	state = -1;
	nextstate = 136;
	question = "Orson";
	text1 = "There is an elderly man watching over these tables of goods. He is sharpening an arrowhead when you enter. His skin is like parchment, bleached white. He looks up at you. _Ah! A customer!_ He brushes soot off the counter with his hand. _I am Orson._";
	text5 = "Orson, wrinkled and grumbling, continues to wait on you. He is very pleased to have a customer.";
	action = INTRO;

begintalknode;
	state = 136;
	nextstate = 137;
	question = "_What do you sell here?_";
	text1 = "_I run this fine little weapons shop._ He waves at his stock. _Not a bad lot. The barrier made it difficult to get stock._";

begintalknode;
	state = 137;
	nextstate = -1;
	question = "_What do you know about these barriers?_";
	text1 = "_Not much, I'm afraid. I won't be able to get much new stock with those barriers up, but I still have a lot here. I just hope they get the things down soon._";
	text3 = "_Well, even though the barriers are down, it still is taking a lot of time to get the supply routes up again. You know how it is!_ He smiles, and reclines. _At least his Majesty got the barriers down. Something to be happy for._";
	action = DEP_ON_SDF 20 0 0;

begintalknode;
	state = 137;
	nextstate = -1;
	question = "_Did you make these weapons yourself?_";
	text1 = "_I must tell the truth. No. I don't deal in new, steel Draco weapons. I buy weapons from ... those who find them. Clean and repair. Then sell, with a modest profit for myself._";

begintalknode;
	state = 136;
	nextstate = -1;
	question = "_I'd like to buy a weapon._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Orson's Weapons","Orson sells basically usable refurbished weapons of all sorts. At least they're cheap.",6,1,3);
	break;

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

begintalknode;
	state = 136;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "Orson nods. _All right. I'll be here when you return. I hope._";
	action = END_TALK;


// Boris

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 163;
	question = "Boris";
	text1 = "This burly man is standing in the middle of this training hall, fiercely smacking a dummy. When you get close, he turns and looks you up and down. He is clearly unimpressed. _I'm Boris. You here to train?_ His voice makes the air vibrate.";
	text5 = "Boris waits to see what else you want. He has concluded that you aren't worth dealing with, but he will deign to let you purchase a few moments of his time.";
	action = INTRO;

begintalknode;
	state = 163;
	nextstate = 164;
	question = "_So what can you do for me?_";
	text1 = "_I train people who need it. I have taught many of the soldiers who give their lives defending us. I also expend my precious time assisting adventurers._";

begintalknode;
	state = 164;
	nextstate = -1;
	question = "_What do you teach the soldiers?_";
	text1 = "_Soldiers often get sent to me to learn how to survive in combat. The Empire soldiers are fast and deadly. It's all I can do to give them the skills to avoid being butchered._";

begintalknode;
	state = 164;
	nextstate = -1;
	question = "_You know how to fight?_";
	text1 = "_I know how to do a little of everything. I even know a few of the simpler magical rituals and focusing exercises._";

begintalknode;
	state = 164;
	nextstate = -1;
	question = "_I'm an Avernite soldier. You can teach me?_";
	text1 = "_Yes, but you will have to pay. I would love to share my knowledge for free. Just not enough to do it._";

begintalknode;
	state = 163;
	nextstate = 165;
	question = "_Let's get to work. I'd like to learn._";
	text1 = "_All right. I can teach you both spells and holy rituals. I can't perform the rituals, of course, but I can show you the motions. I can also improve some of your skills, though that is far more expensive._";

begintalknode;
	state = 165;
	nextstate = -1;
	question = "_I want to learn spells._";
	text1 = "You conclude your training.";
	code =
		begin_shop_mode("Boris's Spells","Boris can teach you some of the less involved magical spells.",7,3,3);
	break;

begintalknode;
	state = 165;
	nextstate = -1;
	question = "_I want you to teach me rituals._";
	text1 = "You conclude your training.";
	code =
		begin_shop_mode("Boris's Rituals","Boris can teach you some of the less involved holy rituals.",8,3,3);
	break;

begintalknode;
	state = 165;
	nextstate = -1;
	question = "_I would like to improve my skills._";
	condition = average_level() >= 8;
	text1 = "You conclude your training.";
	code =
		begin_shop_mode("Boris's Skills","Boris can teach you how to improve some of your martial skills. This training is very expensive.",9,4,3);
	break;

begintalknode;
	state = 165;
	nextstate = -1;
	condition = average_level() < 8;
	question = "_I would like to improve my skills._";
	text1 = "He looks you over again and shakes his head. _You aren't ready to comprehend my advanced techniques yet. Return when you have traveled more._";


begintalknode;
	state = 165;
	nextstate = -1;
	question = "_I don't need training._";
	text1 = "_Then leave me. I must perfect my skills._ He returns to smacking the dummy.";
	action = END_TALK;
	
// Kev

begintalknode;
	tag = 150;
	state = -1;
	nextstate = 190;
	question = "Kev";
	text1 = "You find a very young man, just starting to get fuzz on his upper lip. He's rearranging the thick piles of dirt on the floor with a large broom. Huge piles of ore dwarf him to either side.";
	text2 = "He seems excited to meet adventurers. _Hi! I'm Kev!_";
	text5 = "Kev continues to rearrange the piles of soot with his broom. _I never get to meet adventurers in here. It is exciting!_";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = 191;
	question = "_What are you doing in here?_";
	text1 = "_Sweeping up the warehouse._";

begintalknode;
	state = 191;
	nextstate = 192;
	question = "_Must be a bit tedious._";
	text1 = "_Yeah. It's nice to see someone. Especially an adventurer. This warehouse makes me nervous. I keep hearing noises._";

begintalknode;
	state = 192;
	nextstate = 193;
	question = "_What sort of noises? Where are they coming from?_";
	text1 = "_From the storeroom with the barrels. I hear scraping in there all the time. I try not to go back there. It sure don't sound like rats!_";
	text3 = "_From the rats. It used to be bandits, until you found and killed them all! They were stealing the ore. I'm glad they never bothered with me!_";
	action = DEP_ON_SDF 20 2 0;

begintalknode;
	state = 193;
	nextstate = -1;
	question = "_Have you seen any rats around?_";
	text1 = "_Have I! Big as me! And sometimes they blow this foul, nasty gas at you! I run when I see 'em. You should do the same!_";

begintalknode;
	state = 190;
	nextstate = -1;
	question = "_You think I am an adventurer?_";
	text1 = "_You're a soldier, but you're allowed to wander freely, right? Righting wrongs and fighting injustice? That's basically an adventurer, right?_";

// Crisper

begintalknode;
	tag = 170;
	state = -1;
	nextstate = 217;
	question = "Crisper";
	text1 = "The bar is tended by a handsome man with a somewhat deranged demeanor. He fights a constant and futile battle to keep the counter free of soot.";
	text2 = "He's pleased to have a customer who isn't a stranded merchant. _Welcome to my inn! My name is Crisper._";
	text5 = "Crisper continues his futile battle against the soot. It's a struggle to keep a surface clean for even a moment. _Have an order?_";
	action = INTRO;
	
begintalknode;
	state = 217;
	nextstate = 219;
	question = "_So what makes cleaning here so tough?_";
	text1 = "He twitches. _Let me tell you about all the ashes! I never knew when I bought this place there would be so many ashes! A ton a day, piles and piles of them, all over. And smoke too! And it isn't just that ..._";
	text2 = "He twitches alarmingly. _It's the spiders! I have to clear away their webs! The noises they make! All of them!_";

begintalknode;
	state = 219;
	nextstate = 220;
	question = "_What's so difficult about a bunch of spiders?_";
	text1 = "He twitches. _They're what did this to me! It was the happy spiders! I can't get them out of my brain! I hear them speaking to me sometimes! A whole bunch of them live in a cave to the west._";
	text2 = "_Some of them came around not that long ago, looking for someone to help them. I've always hated spiders! And having them like me only makes it worse!_ He's ranting. You get nervous.";

begintalknode;
	state = 220;
	nextstate = 217;
	condition = 1;
	question = "_Maybe I can help them._";
	text1 = "_You're welcome to try. I'm never going out there. Spiders are terrifying. Even friendly ones._";

begintalknode;
	state = 220;
	nextstate = 217;
	condition = 1;
	question = "_Spiders? Yuck._";
	text1 = "_I know, right? I don't care how friendly they are. I'm never going out there._";

begintalknode;
	state = 217;
	nextstate = -1;
	condition = gf(20,0) == 0;
	question = "_So barkeep, heard anything about the magic barriers outdoors?_";
	text1 = "_Only that they're a disaster, completely cutting us off from all of Avernum. If you want real information, talk to Commander Anford. You can find him near the docks._";

begintalknode;
	state = 217;
	nextstate = -1;
	condition = gf(20,21) == 1;
	question = "_Know anything about the brigands under the fort?_";
	text1 = "_We tolerated them for too long. They were useful for a time, but we should have rid ourselves of them long ago._";
	text2 = "He leans close. _If you look around in the basement of this inn, watch the walls for buttons. You might find something useful._";

begintalknode;
	state = 217;
	nextstate = 218;
	question = "_What's on the menu today?_";
	text1 = "_All drinks are three coins. It don't matter what you order because it all tastes the same. The soot, you know. You can sleep in the common room for five coins. And you can even buy rations! Feel free to stay and rest for a while. Just never mind me._";
	text2 = "_It takes all my time keeping this place clean._";

begintalknode;
	state = 218;
	nextstate = -1;
	question = "_I'll buy some rations._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Crisper's Inn","The inn has mushroom ale, mushroom stew, mushroom bread, all the standard simple Avernum fare.",10,4,3);
	break;

begintalknode;
	state = 218;
	nextstate = -1;
	condition = coins_amount() >= 5;
	question = "_I'd like to go sleep in the common room._ Pay 5 coins.";
	text1 = "_Right this way._ He takes you to the common room. You manage to find a place to sleep among the filthy miners and merchants. With difficulty, you manage to get a few hours of restless sleep. The room smells bad.";
	action = END_TALK;
	code =
		revive_party();
		change_coins(-5);
		relocate_char(get_pc_id(0),40,48,FALSE);
		relocate_char(get_pc_id(1),41,48,FALSE);
		relocate_char(get_pc_id(2),42,48,FALSE);
		relocate_char(get_pc_id(3),42,49,FALSE);
	break;
	
begintalknode;
	state = 218;
	nextstate = -1;
	condition = coins_amount() >= 3;
	question = "_Can I get a drink?_ Pay 3 coins.";
	text1 = "_Here's some of what would be our finest ale if it weren't for all the darn soot._ He serves up several mugs of mushroom ale, with little flecks of soot floating on top. It's strong stuff, and not entirely repulsive.";
	code =
		change_coins(-3);
		set_char_status(30000,1,25);
	break;

begintalknode;
	state = 218;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "He nods. _I'll get back to the paying customers, then._";
	action = END_TALK;

// Harg

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 244;
	question = "Harg";
	text1 = "There is a large, filthy, dirty man sitting at the bar, swilling down mushroom ale. You sit by him and ask his name. _Harg,_ he grunts.";
	text5 = "Harg continues to drink himself into a stupor.";
	action = INTRO;

begintalknode;
	state = 244;
	nextstate = 246;
	question = "_Might I ask your profession?_";
	text1 = "_I'm a caravan drover._";
	text2 = "_Not much work now. Not as long as the barriers are up._";
	text3 = "_Not much work now. Trade is still starting up, even though the barriers have been down for a while._";
	code =
		if (gf(20,0) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode;
	state = 246;
	nextstate = -1;
	question = "_What do you know about the barriers?_";
	text1 = "_They block all the roads. That's all I know. What else should I know? I look like a wizard to you?_";
	
begintalknode;
	state = 244;
	nextstate = 245;
	question = "_May I talk with you?_";
	text1 = "_Let a man drink in peace._";

begintalknode;
	state = 245;
	nextstate = -1;
	question = "_Just trying to make conversation._";
	text1 = "_You heard me. I'm drinkin' here. Go away._ He turns away.";
	action = END_TALK;

begintalknode;
	state = 244;
	nextstate = 247;
	condition = gf(20,24) <= 1;
	question = "_You seem to be in a very bad mood._";
	text1 = "He belches bitterly. _You would be too. I am thwarted in love. The picture of all feminine beauty? Her name is Rose. She lives in Formello. I wish I had the nerve to propose to her. But I don't. So I drink, to minimize my sorrow._ He takes another swig.";
	
begintalknode;
	state = 247;
	nextstate = -1;
	condition = gf(20,24) == 0;
	question = "_Um, that's too bad._";
	text1 = "_Right. Now let a man drink in peace._";
	action = END_TALK;
	
begintalknode;
	state = 247;
	nextstate = -1;
	condition = 1;
	question = "_Maybe I can propose to her for you._";
	text1 = "_If you did that, I would be your enemy for life. You should butt out._";
	text2 = "That's what he says, but you detect a glimmer in his eye. He would probably really appreciate it.";
	action = END_TALK;
	code =
		sf(20,24,1);
		toggle_quest(6,1);
	break;
	
begintalknode;
	state = 244;
	nextstate = -1;
	condition = gf(20,24) == 1 && gf(1,21) >= 1;
	question = "_Good news! We proposed to Rose for you! She said that she could never love you. You can stop worrying now._";
	code =
	run_hardcode(4);
	break;

begintalknode;
	state = 244;
	nextstate = -1;
	condition = gf(20,24) >= 2;
	question = "_How are you holding up under your grief? Feel like talking about it?_";
	text1 = "Without a word, he pays for his drinks and storms out of the bar. You have made someone rather angry with you.";
	action = END_TALK;
	code =
		erase_char(2008);
	break;

// Boutell

begintalknode;
	tag = 210;
	state = -1;
	nextstate = 271;
	question = "";
	text1 = "You meet an energetic, long-haired woman. Her belt is laden with tools of various sorts. She holds a ruler and a scroll, and her jerkin is covered with a light layer of sawdust. _I'm Tess, the shipwright of Fort Draco. Pleased ta meetcha!_";
	text5 = "Tess keeps busy planing a long board of porous, fungal wood. She waits to see what else you have to say.";
	action = INTRO;

begintalknode;
	state = 271;
	nextstate = 272;
	question = "_What are you making?_";
	text1 = "_Whaddaya think? I make boats. Wanna purchase one? Only 300 coins. Highest quality!_";

begintalknode;
	state = 272;
	nextstate = -1;
	question = "_Do they ever sink?_";
	text1 = "_Not when I make 'em, as long as you're careful. So be careful. If a boat sinks in an Avernum river, everyone usually dies._";

begintalknode;
	state = 271;
	nextstate = 273;
	question = "_How do you make a boat?_";
	text1 = "_I carve 'em outta the cavewood myself! By hand! They're small, but they'll get you south just fine. Safest way to travel!_";

begintalknode;
	state = 273;
	nextstate = -1;
	question = "_Why is water travel safer than travel by land?_";
	text1 = "_The Empire don't got many boats down here! Don't have the know-how. It's the one thing we got over 'em - people like me!_";

begintalknode;
	state = 273;
	nextstate = 274;
	question = "_Tell me about cavewood._";
	text1 = "_Well, it's not wood. I'll tell ya that for nothin'. It's lumpy and soft and weird and hard ta work. I can do it. Empire soldiers sure can't._";

begintalknode;
	state = 274;
	nextstate = -1;
	question = "_How did you learn to work it?_";
	text1 = "_I just did it. Sat down, grabbed a tool, and started carvin'. Made somethin' lousy. Burned it. Tried it again._";
	text2 = "_Ten years later, I could make boats!_";

begintalknode;
	state = 271;
	nextstate = -1;
	question = "_I would like to purchase one of your fine boats._ (Give her 300 coins.)";
	text1 = "She collects and counts the coins. _Fair enough. The boats are out at the docks. One of them is yours now. Helps yerself._";
	text3 = "_You don't have the coinage, buddy. Sorry!_";
	text5 = "There are no ships left.";
	code =
		clear_strings();
		if (coins_amount() >=300) {
			if (set_boat_range_property(2,4)) {
				add_string(1);
				change_coins(-1 * 300);
				}
				else add_string(5);
			}
			else add_string(3);
	break;

begintalknode;
	state = 271;
	nextstate = -1;
	condition = 1;
	question = "_I don't need a boat._";
	text1 = "_All right. Enjoy your walking!_ She returns to work.";
	action = END_TALK;

// Anford

begintalknode;
	tag = 230;
	state = -1;
	nextstate = 298;
	question = "Anford";
	text1 = "A middle-aged man is reclining against one of the statues, looking out over the water.  He wears the robes of a mere apprentice mage, but the commander's insignia he wears on his shoulder communicates much greater authority.";
	text2 = "He greets you with a confident nod. _Welcome, fellow soldiers. I'm Anford. Commander of Fort Draco. My gate guards told me of your arrival. I'm glad you came to see me._";
	text5 = "The commander stares out over the river, lost in his planning. The green light from the fungus above shines eerily on the river.";
	action = INTRO;
	code =
		sf(20,25,1);
	break;

begintalknode;
	state = 298;
	nextstate = 304;
	condition = gf(71,20) == 1;
	question = "_Captain Vidican said I might be able to help you._";
	text1 = "Commander Anford nods. _I think she mentioned you in her last letter. Working in construction. Kept a clear head during the recent raid, yes? Showing potential. She sent you out to look for a more useful post._";
	text2 = "_I'm glad you came here. I do think I have a way to use you._";
	code =
		sf(71,20,2);
		toggle_quest(101,3);
	break;

begintalknode;
	state = 304;
	nextstate = -1;
	condition = 1;
	question = "_I need to look for a post?_";
	text1 = "_Afraid so. Normally, we'd send you to Silvar or the Castle for an official evaluation and station. However, the barriers kept that from being an option._";
	text2 = "_Since you showed initiative, the good captain trusted you to find the best place to fight for Avernum._";

begintalknode;
	state = 304;
	nextstate = 298;
	condition = 1;
	question = "_Can I be stationed here?_";
	text1 = "_Perhaps. First, I need to see if your skills can be best applied here. If you can help me with something, I can give you advice in return._";

begintalknode;
	state = 304;
	nextstate = 298;
	condition = 1;
	question = "_I will continue to look for a good place to serve._";
	text1 = "_Well, I may be able to help you find a good way to use your skills. If you can help me with something, I can give you advice in return._";
	
begintalknode;
	state = 298;
	nextstate = 299;
	question = "_Are you an apprentice mage?_";
	text1 = "_Yes and no. I am the commander of Fort Draco. I'm also a mage, but that isn't as important. My duty is to this fort, first and foremost._";

begintalknode;
	state = 299;
	nextstate = 301;
	question = "_Which came first, your apprenticeship or your command?_";
	text1 = "_I've been an apprentice mage for five years. In the slith wars, I got assigned to this fort, and they found I had a knack for tactics. I never returned to the Tower of Magi._";

begintalknode;
	state = 301;
	nextstate = -1;
	question = "_Do you wish to?_";
	text1 = "_Of course. Our lives in Avernum are humble and dangerous, but they are ours. All of us wish for the day when this war ends, the Empire is gone, and we can return to our dark, damp homes._";

begintalknode;
	state = 298;
	nextstate = 300;
	question = "_Why are you standing out here?_";
	text1 = "_This is where I do my thinking about the fort. My office, so to speak. Normally, I'd be planning tactics. Scouting, defenses, that sort of thing. But not lately. We fought off a bunch of Empire assaults, and they've left us alone lately, so that's not on my mind._";
	text2 = "_We have a different threat now. I'm mainly thinking about the barrier._";

begintalknode;
	state = 300;
	nextstate = 302;
	question = "_What do you know about the barrier?_";
	text1 = "_The barriers appeared a few weeks ago. Impenetrable fields of magic, outdoors, huge, of a sort we've never seen before, cutting off this area from the rest of Avernum. We can't break them down, we can't touch them. It's a disaster! They have cut Avernum into pieces._";
	text3 = "_Well, the barriers are down now, thank heavens. But I'm trying to think of a way to deal with this situation should it arise again. It is terrifying that anyone could assault us so easily._";
	action = DEP_ON_SDF 20 0 0;

begintalknode;
	state = 302;
	nextstate = 303;
	condition = gf(20,0) == 0;
	question = "_Who do you think created them?_";
	text1 = "He sighs. _The Empire is the most common guess. They have invaded us, and this may just be their newest weapon. However, I don't believe it._";

begintalknode;
	state = 303;
	nextstate = -1;
	condition = gf(20,0) == 0;
	question = "_Why?_";
	text1 = "_I am no expert on magic, but this is like no spell I have ever heard of. I think this is something new, something different. I would tell The Castle, but, of course, I have no way to send a message to them._";

begintalknode;
	state = 298;
	nextstate = -1;
	condition = gf(71,20) == 0 && gf(20,21) <= 1;
	question = "_Is there a job I can do for you?_";
	text1 = "_I don't know you. You should return to Fort Ganrick and speak with the captain there. I'm sure she can provide you with direction. Perhaps involving the nephilim that are attacking._";

begintalknode;
	state = 298;
	nextstate = 305;
	condition = gf(71,20) > 1 && gf(20,21) <= 1;
	question = "_You mentioned that I can do a job for you?_";
	text1 = "_I'm glad you asked. There have been some brigands ambushing caravans near the fort. Very near. I think they're based very close to the fort. Directly underneath us, in fact._";
	text2 = "_Convince their leader to take them away. Failing that, kill them. In return, I will strive to find a way to return the favor._";
	action = SET_SDF 20 21 1;
	code =
		toggle_quest(4,1);
	break;
	
begintalknode;
	state = 305;
	nextstate = -1;
	condition = 1;
	question = "_Wait. There are bandits underneath the fort?_";
	text1 = "_I am not proud of it, but yes. They were tolerated for some time, but now we need to be rid of them. I was going to send some of my own soldiers, but you have shown an aptitude for tunnel combat._";
	text2 = "_I can think of no better way to evaluate you._";

begintalknode;
	state = 305;
	nextstate = -1;
	condition = 1;
	question = "_How can I get down there?_";
	text1 = "_There are several trapdoors to the low tunnels in Fort Draco. The trick, of course, will be finding one that is not excessively trapped._";

begintalknode;
	state = 305;
	nextstate = 306;
	condition = 1;
	question = "_How did the bandits get down there to begin with?_";
	text1 = "Anford sighs. _My predecessor was a practical man. He didn't mind housing a few brigands. They were allowed to capture the occasional caravan. In return, they paid their keep by watching the tunnels, wiping out goblins, and so on._";

begintalknode;
	state = 306;
	nextstate = -1;
	condition = 1;
	question = "_What happened to your predecessor?_";
	text1 = "_He took a force out of the fort, heading west. Empire forces cut them off and killed every one of them._";
	text2 = "_This was before the barriers appeared._";

begintalknode;
	state = 306;
	nextstate = -1;
	condition = 1;
	question = "_Why do you need to be rid of them now?_";
	text1 = "_Because they have grown arrogant and strangely erratic. They make demands. They are bullies. In addition, I hate bandits._";

begintalknode;
	state = 298;
	nextstate = -1;
	condition = gf(20,21) == 1 && gf(20,2) >= 1;
	question = "_We found and killed the brigands. They refused to go peacefully._";
	code =
	run_hardcode(2);
	break;
	
begintalknode;
	state = 298;
	nextstate = -1;
	condition = gf(20,21) >= 2 && gf(20,3) < 2 && gf(20,0) == 0;
	question = "_What is your advice for me?_";
	text1 = "_You show a lot of potential, too much to be wasted out here. As long as the barrier is up, Fort Draco has little to do._";
	text2 = "_I think you should go to Formello. It's the largest city the barriers allow us to reach. It's a several days' journey to the southeast._";
	text3 = "_Go there, find Mayor Amtar, and say that I sent you. If there is a way for you to make a difference, I assure you he will find it._";
	code =
		set_flag(20,3,1);
		toggle_quest(102,1);
	break;
		
begintalknode;
	state = 298;
	nextstate = -1;
	condition = gf(20,21) >= 2 && gf(20,3) > 0;
	question = "_Anything else I can do for you? Quests and the like?_";
	text1 = "_Apart from eliminate the entire Empire army?_ He chuckles. _Not really._";


begintalknode;
	state = 298;
	nextstate = -1;
	condition = gf(70,7) == 1;
	question = "_I have a message from Gridley, quartermaster of Fort Ganrick. They need more javelins._";
	text1 = "Commander Anford actually laughs. _From us? We are already scavenging the javelins we use from the battlefield. Every one we have, we've already recovered and repaired at least three times._";
	text2 = "_You are free to convey my sympathies. That is all I have to send._";
	code =
		sf(70,7,2);
	break;
