// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(149,0) == 0;
	question = "special";
	text1 = "At last, you are on the road out of the Great Cave. Every step carries you farther from the mostly civilized core of Avernum and toward the wild lands of the north.";
	text2 = "The air is growing warmer, and sulfurous drafts constantly blow past you toward the Great Cave. However, your attention is mostly grabbed by the faint static in the air and the shrill buzz detectable just at the edge of perception.";
	text3 = "Thanks to your time at the Portal Keep, you recognize these sensations. They mean you are getting closer to the Great Portal, not far to the southeast. It is your destination, Avernum's main lifeline to the surface.";
	action = SET_SDF 149 0 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You flip through the book. It is very well worn, as if it's been carried a long way. The recipes inside are written in code, so that you can't steal Haskell's alchemical knowledge. The ingredients are, however, plain to read:";
	text2 = "  Healing Elixir - Graymold, Healing Herbs.";
	text3 = "  Curing Elixir - Graymold, Healing Herbs.";
	text4 = "  Energy Elixir - Graymold, Healing Herbs, Energetic Herbs.";
	text5 = "  Armor Elixir - Graymold, Spiritual Herbs, Energetic Herbs.";


begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are a sergeant and several privates patrolling this road. They're trying to keep it clear of brigands and monsters, and they seem to be doing a good job.";
	text2 = "When you approach one of the lower-ranked members of the party, you are referred over to the sergeant.";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  Almaria - West";
	text3 = "  Great Portal - East";
	text4 = "  Tower Colony - East";
	
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

//

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Sergeant Cyrena";
	text1 = "Few roads in Avernum are as secure as the one connecting Almaria to the Great Portal. You are greeted by several soldiers. They look well-fed, and their armor and weapons are all fine steel.";
	text2 = "Their leader greets you. _Welcome, soldier. I'm Sergeant Cyrena. Anything you want to know as you pass through?_";
	text5 = "Sergeant Cyrena nods to you. _Always nice to see a fellow soldier on the road. Any news from the rest of Avernum?_";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Tell me about this road.";
	text1 = "_It is the main route from Almaria to the Great Portal, and it goes to the only route out of the Great Cave to the east. So you can imagine how important it is to keep it clear._";
	text2 = "_It's mostly safe to travel, though it's not so safe to the north and south._";
	text3 = "_We aren't sure how long it will be safe, though. Now that the Great Portal is gone, there's a lot of desperate people on the roads. Dangerously desperate._";
	code =
		if (gf(170,1) < 12)
			rs(3);
	break;

begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Need any help?";
	text1 = "_I appreciate the question, but no. All I have to do is shout, and we get reinforcements aplenty from Almaria. You can continue doing what you were doing._";

begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Can I get any supplies from you?";
	text1 = "She looks uncomfortable. _Ahhh ... We're well-provisioned, it's true, but we're under orders to stay that way. Sharing our supplies would earn us some trouble. Sorry._";

begintalknode 14;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Good day to you.";
	text1 = "_And we wish you the same._ They continue on down the road.";
	text2 = "";
	action = END_TALK;
	
begintalknode 15;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What is to the north?";
	text1 = "_From what I hear, a bunch of skribbane eaters are in the ruins of old Fort Haledon. They keep to themselves, and we leave them alone as long as they stay up there. Not too safe to visit, though._";
	text3 = "_From what I hear, there was a bunch of skribbane eaters in the ruins of old Fort Haledon. Been awful quiet up there, though. Have to send up a scout soon to see what they're up to._";
	action = DEP_ON_SDF 135 1 0;

begintalknode 16;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What is to the south?";
	text1 = "She looks at the wilds to the south and frowns. _Abandoned farms. Wild animals. Blighted fields. Nothing worth us going down there to secure the land._";


//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Taddeo";
	text1 = "This man wears armor so polished it even looks bright in the dim, green light of the great cave. He is weighted down with an enormous variety of weapons. A spear, two swords, three daggers, plus a bow and javelins on his back.";
	text2 = "And yet, he bears the burden with cheer. He greets you as if he were expecting you. _Ahhhh ... I was wondering when another soldier would show up? I've been alone out here for a while. Provisions are running low._";
	text3 = "_Anyway, I'm Taddeo, master trainer. I'm here for the benefit of the troops, so let me know if you want to take advantage of my learning._";
	text5 = "Taddeo is still in high spirits. He pats one of his swords. As he does, all of the other weapons he bears clank together.";
	text6 = "_I'm here to teach you soldiers. Let me know when you need training._";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "The army keeps you here?";
	text1 = "_They do. I'm a skilled teacher, training in all of the martial arts. Sometimes they send soldiers to me, especially agents who are trying to do something tricky._";

begintalknode 32;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "I'm an agent. Trying to do something tricky.";
	text1 = "_Then I'm glad you found me._";

begintalknode 33;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "How did you learn so much?";
	text1 = "He lifts his helm, and you can see his gray hair. And scars. _I was an adventurer once, in the Time of Shades and beyond. I've spitted monsters in all corners of Avernum._";
	text2 = "_And killed a few with my teeth, for what it's worth._";

begintalknode 34;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "What can you teach?";
	text1 = "_Fine technique. Not your ordinary swordwork, but skills to help you kill with true finesse. Artistry!_";

begintalknode 35;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Where are you from originally?";
	text1 = "_Avernum born and bred! I had an ancestor in the First Expedition, before the Empire sent even a single reprobate down here. I have lichen in my blood!_";

begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Do you train for free?";
	text1 = "_I'm afraid not. I have expenses, like anyone else. But I will make my prices very reasonable._";

begintalknode 37;
	state = 30;
	nextstate = 33;
	condition = gf(149,1) == 0;
	question = "Can you train me?";
	text1 = "_Ahhh ... There's a problem. You see, the army is supposed to supply me with meal. And they haven't for some time. Can you spare any mushroom meal?_";

begintalknode 38;
	state = 33;
	nextstate = 30;
	condition = 1;
	question = "I'm afraid not.";
	text1 = "_Unfortunate. And, since the army isn't keeping up its end of the bargain, I can't train you quite yet._.";

begintalknode 39;
	state = 33;
	nextstate = 30;
	condition = party_has_item(191) > 0;
	question = "Here. (Give a bag.)";
	text1 = "He takes the mushroom meal. _You are too kind._";
	code =
		take_item(191);
		sf(149,1,1);
	break;
	
begintalknode 40;
	state = 30;
	nextstate = 34;
	condition = gf(149,1) == 1;
	question = "Can you train me?";
	text1 = "_Ahhh ... There's another problem. You see, the army is supposed to supply me with meat as well. Fresh meat, not that moldy dried stuff. And they haven't for some time. Can you spare any meat?_";

begintalknode 41;
	state = 34;
	nextstate = 30;
	condition = 1;
	question = "I'm afraid not.";
	text1 = "_Unfortunate. And, since the army isn't keeping up its end of the bargain, I can't train you quite yet._.";

begintalknode 42;
	state = 34;
	nextstate = 30;
	condition = party_has_item(253) > 0;
	question = "Here. (Give some meat.)";
	text1 = "He takes the meat, smells it, and nods his approval. _You are too kind._";
	code =
		take_item(253);
		sf(149,1,2);
	break;


begintalknode 43;
	state = 30;
	nextstate = 35;
	condition = gf(149,1) == 2;
	question = "And now can you train me, I asked, expecting the answer no.";
	text1 = "_No. You see, there's another problem. You see, the army is supposed to supply me with wine as well. To help keep my spirits up in my lonely vigil. And they haven't for some time. Can you spare any?_";

begintalknode 44;
	state = 35;
	nextstate = 30;
	condition = 1;
	question = "I'm afraid not.";
	text1 = "_Unfortunate. And, since the army isn't keeping up its end of the bargain, I can't train you quite yet._.";

begintalknode 45;
	state = 35;
	nextstate = 30;
	condition = party_has_item(407) > 0;
	question = "Here. (Offer some wine.)";
	text1 = "He takes the wine, inspects the label, and shudders. _This stuff will rot your insides. I'm no brigand or skribbane eater. I only drink proper wine._";

begintalknode 46;
	state = 35;
	nextstate = 30;
	condition = party_has_item(435) > 0;
	question = "Here. (Offer some Almarian wine.)";
	text1 = "He takes the wine, inspects the label, and nods. _Yes. That is, indeed, the good stuff. I will be able to stand it._";
	code =
		take_item(435);
		sf(149,1,3);
		award_party_xp(200,15);
	break;
	
begintalknode 47;
	state = 30;
	nextstate = 36;
	condition = gf(149,1) == 3;
	question = "Can you train me?";
	text1 = "Taddeo tries to remember anything else he needs. Happily, he's reached the end of his shopping list. _I would be happy to. Prepare to enter the world of fine bladesmanship._";	

begintalknode 48;
	state = 36;
	nextstate = 30;
	condition = 1;
	question = "Let's go.";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Taddeo",
		  "Taddeo wasn't trying to cheat you. He does indeed know a wide variety of advanced fighting techniques. A trainer can only increase a given skill three times.",
		  37,2,0);	
	break;
	
begintalknode 49;
	state = 36;
	nextstate = 30;
	condition = 1;
	question = "I've changed my mind.";
	text1 = "_So sorry to hear it, and after you went to all that trouble._";

//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Haskell";
	text1 = "You enter an alchemical workshop. It looks quite new. The cauldron, grate, and fixtures look like they've been installed recently. And well away from town, so that the Almarians aren't constantly tormented by horrible odors.";
	text2 = "The alchemist in charge walks forward to greet you. _Welcome, traveler. It is good to see a friendly face in dark times. I am Haskell, sage and brewer._";
	text3 = "She is a middle-aged woman, and, while her workshop is new, she has a lot of wear on her. Years of being splattered by boiling, acrid concoctions leaves its mark.";
	text5 = "Haskell fetches a bandage and some ointment from a case and tends to her latest burns. She says, _How else can I help you?_";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "Have you been here long?";
	text1 = "_Oh, no. Only a few months. I was forced from my own home, alas, but the army made sure to set me up here. Only good news I got in a while._";

	
begintalknode 52;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "The army built this workshop for you?";
	text1 = "_What can I say? They need good alchemists. Can't let one go to waste. I lost most of what I needed to make potions when I fled south._";
	text2 = "_Cauldrons are cheap. A good alchemist ... That's rare._";
	
begintalknode 53;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "Where are you from?";
	text1 = "_Exodus. It was a town. A mining town, in the Northern Frontier. You haven't heard of it._";
	
begintalknode 54;
	state = 52;
	nextstate = 53;
	condition = 1;
	question = "What happened to Exodus?";
	text1 = "_When the Slith Horde came, they cut off the frontier. Everyone who could get out did. I saw what was happening faster than most and escaped. The others ..._ She shakes her head.";
	
begintalknode 55;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "Were they killed?";
	text1 = "_Nobody knows. Some may still live. There are some wizards out there, and the Anama had some war priests, and some of the positions would be easy to defend._";
	text2 = "_So I'm sure the Horde hasn't taken the whole frontier. But if they aren't relieved soon, there won't be much hope for them._";
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "I want to buy a potion.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Haskell's Potions",
		  "Haskell has a few quality potions in stock, available for sale only to Avernite soldiers.",
		  38,3,0);	
	break;

	
begintalknode 57;
	state = 50;
	nextstate = 54;
	condition = 1;
	question = "Can you make a potion for me?";
	text1 = "_Of course, if you provide the ingredients. I can make some rather effective brews for you, with quality components._";
	text2 = "_Look in the book by the west wall if you want to see what I can make._";
	
begintalknode 58;
	state = 54;
	nextstate = -1;
	condition = party_has_item(289) && party_has_item(292);
	question = "Can you make Healing Elixir for me? (Give graymold and healing herbs.)";
	text1 = "Haskell smiles. _Hardly a challenge._";
	text2 = "She takes the herbs and, in an instant, becomes a whirlwind of chopping, boiling, and straining. She works quickly, efficiently, and almost safely.";
	text3 = "This effort results in quick success. She presents a clay jug to you, stoppered with wax. _Healing Elixir! I hope it has the desired effect._";
	action = REUSABLE;
	code = 
		take_num_of_item(289,1);
		take_num_of_item(292,1);
		reward_give(226);
	break;

begintalknode 59;
	state = 54;
	nextstate = -1;
	condition = party_has_item(289) && party_has_item(292);
	question = "Can you make Curing Elixir for me? (Give graymold and healing herbs.)";
	text1 = "Haskell smiles. _Hardly a challenge._";
	text2 = "She takes the herbs and, in an instant, becomes a whirlwind of chopping, boiling, and straining. She works quickly, efficiently, and almost safely.";
	text3 = "This effort results in quick success. She presents a clay jug to you, stoppered with wax. _Curing Elixir! I hope it has the desired effect._";
	action = REUSABLE;
	code = 
		take_num_of_item(289,1);
		take_num_of_item(292,1);
		reward_give(227);
	break;	
	
begintalknode 60;
	state = 54;
	nextstate = -1;
	condition = party_has_item(289) && party_has_item(291) && party_has_item(292);
	question = "Can you make Energy Elixir for me? (Give graymold, healing herbs, and energetic herbs.)";
	text1 = "She takes the herbs and, in an instant, becomes a whirlwind of chopping, boiling, and straining. She works quickly, efficiently, and almost safely.";
	text2 = "This effort, however, results in success. She presents a clay jug to you, stoppered with wax. _Energy Elixir! I hope it has the desired effect._";
	action = REUSABLE;
	code = 
		take_num_of_item(289,1);
		take_num_of_item(291,1);
		take_num_of_item(292,1);
		reward_give(229);
	break;

begintalknode 61;
	state = 54;
	nextstate = -1;
	condition = party_has_item(290) && party_has_item(291) && party_has_item(292);
	question = "Can you make Armor Elixir for me? (Give graymold, spiritual herbs, and energetic herbs.)";
	text1 = "She takes the herbs and, in an instant, becomes a whirlwind of chopping, boiling, and straining. She works quickly, efficiently, and almost safely.";
	text2 = "This effort, however, results in success. She presents a clay jug to you, stoppered with wax. _Armor Elixir! I hope it has the desired effect._";
	action = REUSABLE;
	code = 
		take_num_of_item(290,1);
		take_num_of_item(291,1);
		take_num_of_item(292,1);
		reward_give(230);
	break;

begintalknode 62;
	state = 54;
	nextstate = 50;
	condition = 1;
	question = "I don't need any potions.";
	text1 = "_All right._";

begintalknode 63;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "I don't need anything else.";
	text1 = "_Then I'd better return to work. I have to get ten healing elixirs to Fort Duvno inside of a week._";
	action = END_TALK;
	

////

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