// TOWN DIALOGUE SCRIPT
//    Town 11: Dharmon

begintalkscript;

variables;

short i,j,k,r1,choice;

begintalknode;
	tag = 1;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = "The general pattern of things is that, the closer you get to Avernum's front against the Empire, the tougher the soldiers you meet become. Dharmon is no exception.";
	text2 = "The warriors of Dharmon are a tough, grim lot, and they immediately recognize you as of a kind with them. They don't have much free time, but they spare it to trade drinks and stories with you.";

// Julie

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Julie";
	text1 = "The woman working at this table is surprisingly young, only in her teens. Her shop features a variety of missile weapons. She is currently salvaging feathers from Empire arrows to place on shafts of her own. She introduces herself.";
	text2 = "She squints at you and nods when you enter. _Julie. Julie the fletcher._";
	text5 = "Julie continues to work on her fletchery. She is an unusual age for an Avernite. Most people in Avernum were banished when they were older. Most children are very young, having been conceived down here.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What are you working on?_";
	text1 = "She grins. _I'm doing what I've done since I was little. Archery. You can purchase my work. It's modest, I admit, but it'll do the job._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_Do you sell razordisks?_";
	text1 = "_Not yet. I have some, and I'm studying them. One day, I will figure out how to craft them. The vahnatai are smart, but they're not completely beyond us._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_That's a long time to devote to one profession._";
	text1 = "_I came with my parents into Avernum when I was six. Since then, I've always been fascinated by archery. The elegant curves the iron-tipped shafts make as they pass through the air, the satisfaction of an arrow sent true._";
	text2 = "_And now, when our people need arms more than anything, I am honored and proud to be able to help._";

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_May I peruse your goods?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Julie the Fletcher","Despite her modesty, Julie's missiles are of extremely high-quality.",81,3,3);
	break;

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_You were banished to Avernum as a child?_";
	text1 = "She sighs. _Usually, children aren't. I should have been left on the surface with a relative. But all of my relatives were already down here. You see, a local noble wanted our family land, so he had us all banished, one by one._";
	text2 = "_So here I am. I'd rather be on the surface, true, but this is my home now. I'll fight for it._";
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_I hope you continue to not need my wares. Safe travels._";
	action = END_TALK;

// Rippel

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 28;
	question = "Rippel";
	text1 = "Even by Avernum standards, the woman behind the counter is pale. Her skin is a pure, unblemished ivory, more reflective than the polished shields on the counter in front of her.";
	text2 = "Though she seems small and delicate, the tools surrounding her tell you that she is no stranger to a forge. _I am Rippel,_ she says. _Welcome to my shop._";
	text5 = "Rippel polishes one of her shields with a rag. _Is there any other way I can be of assistance?_";
	action = INTRO;

begintalknode;
	state = 28;
	nextstate = 29;
	question = "_How is business?_";
	text1 = "_Business is brisk. War is profitable, sadly. You can buy armor, or you can sell me the salvage of the battlefield. Here at the front, we take all of the equipment we can get._";


begintalknode;
	state = 29;
	nextstate = 30;
	question = "_Where is the front right now?_";
	text1 = "_Up north, not far. There's been vicious fighting, back and forth, for months. Nasty fighting. Heavy losses. Our best supplies have come from the fallen foe. Fine metalwork brought down from the surface._";
	text2 = "_I buy all the stuff I can, fix it up, and pass it on to our army. We ain't picky. Sometimes, we can't afford pride._";

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_I've heard it said that pride comes before a fall._";
	text1 = "_It rings true. Of course, we'd rather use our own crafts than blades stolen from the corpses of our foemen, but we can't. We just don't have enough. It's that simple._";

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(11,13) < 2;
	question = "_Anything special you're looking for?_";
	text1 = "_As a matter of fact, we've been making weapons so quickly that we've run low on materials. In particular, fine leather and steel, and focusing crystals to infuse them with power._";
	text2 = "_Every set of the three you can bring me, I will reward you very well._";
	action = SET_SDF 11 13 1;
	code =
		toggle_quest(63,1);
	break;
	
begintalknode;
	state = 28;
	nextstate = -1;
	question = "_I would like to examine your wares._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Rippel's Armory","Rippel has a few pieces of quality Dharmon armor, but most of her stock was scavenged.",82,4,3);
	break;

begintalknode;
	state = 28;
	nextstate = -1;
	condition = 1;
	question = "_I would like to sell something._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;
	
begintalknode;
	state = 28;
	nextstate = -1;
	condition = gf(11,13) == 1 && party_has_item(294) > 0 && party_has_item(295) > 0 && party_has_item(296) > 0;
	question = "_We have some materials for you._ Give fine leather and steel and a focusing crystal.";
	action = REUSABLE;
	code =
	run_hardcode(45);
	break;

begintalknode;
	state = 28;
	nextstate = 32;
	condition = 1;
	question = "_Can you craft something for me?_";
	text1 = "_I can. Word of your deeds has spread even to the front. I would be honored to be able to spend some of my limited time helping you._";
	text2 = "_To take advantage of my skills, you must provide fine steel and focusing crystals. In return, you get the aid of the finest craftsmen in Avernum._";
	code =
		toggle_quest(76,1);
	break;
	
begintalknode;
	state = 32;
	nextstate = -1;
	condition = num_of_item(295) == 0 || num_of_item(296) == 0;
	question = "_Do I have the correct materials?_";
	text1 = "_I'm afraid not. I need at least one piece of fine steel and at least one focusing crystal._";
	
begintalknode;
	state = 32;
	nextstate = -1;
	condition = num_of_item(295) >= 1 && num_of_item(296) >= 1;
	question = "_Can you make a fine broadsword for me?_ (Give one piece of fine steel, one focusing crystal, and 300 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Rippel takes the money and the materials. Then she turns to her forge. _Please go. The craft secrets of Dharmon will stay in Dharmon._";
	text3 = "You return a few hours later and the smith presents you a new broadsword. _You are lucky. This is fine Dharmon work. Bear it proudly._";
	code =	
		cs();
		if (coins_amount() < 300)
			as(1);
			else {
				as(2); as(3);
				inc_flag(190,8,1);
				change_coins(-300);
				take_num_of_item(295,1);
				take_num_of_item(296,1);
				reward_give(85);
				}
	break;
	
begintalknode;
	state = 32;
	nextstate = -1;
	condition = num_of_item(295) >= 2 && num_of_item(296) >= 2;
	question = "_Can you make a breastplate for me?_ (Give two steel, two focusing crystals, and 300 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Rippel takes the money and the materials. Then she turns to her forge. _Please go. The craft secrets of Dharmon will stay in Dharmon._";
	text3 = "You return a few hours later and the smith presents you a new breastplate. _You are lucky. This is fine Dharmon work. Bear it proudly._";
	code =	
		cs();
		if (coins_amount() < 300)
			as(1);
			else {
				as(2); as(3);
				inc_flag(190,8,1);
				change_coins(-300);
				take_num_of_item(295,2);
				take_num_of_item(296,2);
				reward_give(35);
				}
	break;
	
begintalknode;
	state = 32;
	nextstate = -1;
	condition = num_of_item(295) >= 2 && num_of_item(296) >= 3;
	question = "_Can you make a fine pair of greaves for me?_ (Give three steel, two focusing crystals, and 300 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Rippel takes the money and the materials. Then she turns to her forge. _Please go. The craft secrets of Dharmon will stay in Dharmon._";
	text3 = "You return a few hours later and the smith presents you a new pair of greaves. _You are lucky. This is fine Dharmon work. Bear it proudly._";
	code =	
		cs();
		if (coins_amount() < 300)
			as(1);
			else {
				as(2); as(3);
				inc_flag(190,8,1);
				change_coins(-300);
				take_num_of_item(295,2);
				take_num_of_item(296,3);
				reward_give(360);
				}
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	condition = num_of_item(295) >= 4 && num_of_item(296) >= 4;
	question = "_Can you make a powerful shield for me?_ (Give four steel, four focusing crystals, and 300 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Rippel takes the money and the materials. Then she turns to her forge. _Please go. The craft secrets of Dharmon will stay in Dharmon._";
	text3 = "You return a few hours later and the smith presents you a new shield. _You are lucky. This is fine Dharmon work. Bear it proudly._";
	code =	
		cs();
		if (coins_amount() < 300)
			as(1);
			else {
				as(2); as(3);
				inc_flag(190,8,1);
				change_coins(-300);
				take_num_of_item(295,4);
				take_num_of_item(296,4);
				reward_give(129);
				}
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	condition = num_of_item(295) >= 5 && num_of_item(296) >= 5;
	question = "_Can you make a first-rate halberd for me?_ (Give five steel, five focusing crystals, and 300 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Rippel takes the money and the materials. Then she turns to her forge. _Please go. The craft secrets of Dharmon will stay in Dharmon._";
	text3 = "You return a few hours later and the smith presents you a new halberd. _You are lucky. This is fine Dharmon work. Bear it proudly._";
	code =	
		cs();
		if (coins_amount() < 300)
			as(1);
			else {
				as(2); as(3);
				inc_flag(190,8,1);
				change_coins(-300);
				take_num_of_item(295,5);
				take_num_of_item(296,5);
				reward_give(395);
				}
	break;


begintalknode;
	state = 32;
	nextstate = 28;
	condition = 1;
	question = "_I don't need you to make anything for me._";
	text1 = "_Then I should return to my work. Anything else?_";

	
begintalknode;
	state = 28;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_All right. Thank you. Come again!_";
	action = END_TALK;
	
// Largo

begintalknode;
	tag = 50;
	state = -1;
	nextstate = 55;
	question = "Largo";
	text1 = "This man's skin has been permanently mottled by a life working with acidic dyes and chemicals. He self-consciously raises his hand to his blue-speckled cheek. _ Ummm ... Welcome. I ... I am Largo the alchemist. Welcome._";
	text5 = "Largo waits to see what else you want. You notice that his hands are also covered with green and black spots, and these are slowly creeping up his arms. His hands also shake gently.";
	text6 = "Largo notices whenever you notice, and he constantly becomes more self-conscious.";
	action = INTRO;

begintalknode;
	state = 55;
	nextstate = 56;
	question = "_I see you bear the marks of your distinguished profession._";
	text1 = "He nervously raises a hand to his cheek. _Thank you. I guess. I make potions. You can buy them from me. But that is a sideline. I am, at heart, an alchemical researcher._";

begintalknode;
	state = 55;
	nextstate = -1;
	question = "_I am interested in buying some potions._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Largo's Potions","Largo's potions are as high-quality as you would expect from the famed craftsmen of Dharmon.",83,3,3);
	break;

begintalknode;
	state = 56;
	nextstate = 57;
	question = "_You do research then?_";
	text1 = "_Oh, yes indeed! Avernum is an unpleasant place, but an inherently magical one! Every plant down here has been magically shaped in some way in order to enable it to survive! The result is flora of unusual alchemical power._";
	text2 = "_I have been able to do years of meaningful research on mandrake alone!_";

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_What is mandrake?_";
	text1 = "_Rare, wondrous fungus! Hard to find, and unmatched in its power. And, since you seem wise folks, I can use some of my recipes using this plant, if you wish._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_Where might we find some mandrake for ourselves?_";
	text1 = "He frowns. _That is quite rude, I'm afraid. You should never ask an alchemist where he gets his ingredients. That's very private._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_Can you make anything out of mandrake for me?_";
	text1 = "_Not yet, but soon. In the meantime, you should speak with the alchemists of Patrick's Tower._";

begintalknode;
	state = 55;
	nextstate = -1;
	condition = 1;
	question = "_I don't need any potions._";
	text1 = "_Then I ... I ... wish you good day._ He is eager to regain his precious solitude.";
	action = END_TALK;
	
// Sarah

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 82;
	question = "Sarah";
	text1 = "This woman's face is lost in the shadows of her hood. As she moves, a multitude of weapons under her robes leave telltale bumps.";
	text2 = "She looks you over. When she speaks, her voice is soft and cold. _I am Mother Sarah, keeper of the Temple of Crossed Blades._";
	text5 = "You look at Sarah. Inside her hood, all you can see are her eyes. They are calm and cold. She knows not to grow emotionally attached to any warrior who passes through her gate.";
	text6 = "_I am friend to all warriors of Avernum. What else do you wish to know?_";
	action = INTRO;

begintalknode;
	state = 82;
	nextstate = 83;
	question = "_Are you free to speak with me today?_";
	text1 = "Her voice comes from deep within the hood, quiet and sad. _Yes. Earlier, I was away from the temple, to see the soldiers. Now I can attend to the pilgrims._";


begintalknode;
	state = 83;
	nextstate = 84;
	question = "_What soldiers did you visit?_";
	text1 = "_To the north are the front lines. These soldiers are the cork that prevents the Empire from springing from their caves into the Great Cave, and from there into Avernum. I walk among them to watch them. I give them my support, to lend them strength._";

begintalknode;
	state = 84;
	nextstate = 85;
	question = "_How do you do that?_";
	text1 = "_I help by leadership, by prayers, by kind words, and when need be, with magic._";

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_Do you know much magic?_";
	text1 = "_I can cast many powerful spells. What is more, for a donation, I will teach them to those who support us. If you ever wish to purchase my teaching, let me know._";

begintalknode;
	state = 82;
	nextstate = 86;
	question = "_What sort of temple is this?_";
	text1 = "_This is the mightiest temple in Avernum, the Temple of the Crossed Blades._";

begintalknode;
	state = 86;
	nextstate = 87;
	condition = 1;
	question = "_Tell me more._";
	text1 = "_This is a shrine of war. We appeal to the spirits of the dead. We cry out to those who have fallen before us, so that they can help us. Give us strength in the trial we face._";

begintalknode;
	state = 87;
	nextstate = 88;
	condition = 1;
	question = "_Does the Empire have Temples of Crossed Blades?_";
	text1 = "_Of course. It is one of the oldest and most valued of faiths._";

begintalknode;
	state = 88;
	nextstate = -1;
	condition = 1;
	question = "_How do you know that the spirits won't help them and not us?_";
	text1 = "The thought doesn't seem to have ever occurred to her. _Because we are just and fight for the right, and they do not. Of course._";

begintalknode;
	state = 82;
	nextstate = -1;
	condition = get_prestige() < 28;
	question = "_Can you teach me some of your magic?_";
	text1 = "She thinks. Then she slowly shakes her head. _I know many powerful prayers, but I am sworn to only share them with those who have proven their honor and bravery through many noble deeds._";
	text2 = "_Perhaps, when you have completed more quests for Avernum, I can help you. Not yet._";	
	
begintalknode;
	state = 82;
	nextstate = -1;
	condition = get_prestige() >= 28;
	question = "_Can you teach me some of your magic?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Sarah's Spells","Sarah knows only a few war rituals, but they are all extremely powerful.",84,3,3);
	break;

begintalknode;
	state = 82;
	nextstate = -1;
	condition = 1;
	question = "_I am ready to go._";
	text1 = "_Then you will be in my thoughts. I will ask the spirits of the fallen to watch over and guide you. Good luck, defender._";
	action = END_TALK;


// Gunther

begintalknode;
	tag = 90;
	state = -1;
	nextstate = 109;
	question = "Gunther";
	text1 = "You meet a sleazy, sleazy man. Dirty brown stubble protrudes from his pasty flesh. He looks you over, carefully evaluating your gear and general level of vulnerability.";
	text2 = "He gives you a grin, revealing green-tinted teeth. _So you found your way in, mighty hero of Avernum. I'm Gunther. Welcome to my humble shop. I hope I am worthy of helping someone as lofty as you._";
	text5 = "Gunther watches you carefully. He seems to be trying to calculate, in his mind, how he can use you to his best advantage.";
	action = INTRO;

begintalknode;
	state = 109;
	nextstate = 110;
	question = "_What kind of shop is this?_";
	text1 = "_A small, humble one. I bring useful goods from the Abyss._";

begintalknode;
	state = 110;
	nextstate = -1;
	condition = 1;
	question = "_I'd like to know more about the Abyss._";
	text1 = "_No you don't. Avernites don't care about the Abyss. Why should you? You are all so wise and mighty, and we're just scum._";

begintalknode;
	state = 110;
	nextstate = 109;
	question = "_Why did you leave the Abyss?_";
	text1 = "He shakes his head. _The Empire came. Many died. Bad for business. Very slow. That's why I came here. The Empire has little but pain for the likes of us._";

begintalknode;
	state = 110;
	nextstate = 109;
	question = "_You didn't answer my question._";
	text1 = "_It's a shop. You know! A shop. You Avernum guys think you're smart, right? I sell goods for getting things you want. What other kind? You got cash, I got goods!_";

begintalknode;
	state = 109;
	nextstate = -1;
	question = "_Let me see your wares._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Gunther's 'Goods'","Gunther sells a wide variety of goods. You don't ask any questions about where they came from.",85,3,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 = 111;
	question = "_Why is your shop hidden like this?_";
	text1 = "_Well, see, sometimes, you gotta' be a little discreet, you know. The guards don't like me much. Cause, see, I sometimes hire people to do little jobs fer me._";

begintalknode;
	state = 111;
	nextstate = -1;
	condition = gf(11,15) == 0;
	question = "_I would never work for you._";
	text1 = "_Then I won't waste your time. And you shouldn't waste mine. You should go now._";
	action = END_TALK;

begintalknode;
	state = 111;
	nextstate = -1;
	condition = gf(11,15) <= 1;
	question = "_A job? Like what?_";
	text1 = "_I sometimes trade in rare items from the surface. I found out that, in one of the warehouses in town, there's some precision steel tools. Surface stuff. Real rare and good. I'd pay good for someone who could, discreet-like, get them to me._";
	text2 = "_The warehouses are to the east. Be careful, though. Bet there's some traps._";
	action = SET_SDF 11 15 1;
	code =
		toggle_quest(65,1);
	break;
	
begintalknode;
	state = 109;
	nextstate = -1;
	condition = gf(11,15) == 1 && has_spec_item(32) > 0;
	question = "_I stole the tools for you. Here they are._ (Give him the tools.)";
	code =
	run_hardcode(46);
	break;
	
begintalknode;
	state = 109;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_Then go. I'll be here. I'm always here._";
	action = END_TALK;

// Messner

begintalknode;
	tag = 110;
	state = -1;
	nextstate = 136;
	question = "Messner";
	text1 = "The innkeeper of Dharmon is a tired, dour fellow. His depression is only mildly alleviated by your approach. _I'm Messner,_ he says. _How can I help you?_";
	text5 = "Messner sighs. _Is there anything else you need? I suppose I can serve you more if you need it._";
	action = INTRO;

begintalknode;
	state = 136;
	nextstate = 137;
	question = "_What are your services?_";
	text1 = "_I run the Dharmon Arms, and believe me, we got plenty of space. Things've been real slow. But we have the nicest rooms in Avernum, only fifteen coins, and the best ale, decent fungal brew, only 10 coins. Let me know if you want a meal or a room._";

begintalknode;
	state = 137;
	nextstate = -1;
	question = "_Why are things so slow?_";
	text1 = "_It's the war. Nobody wants to stay here when they're afraid the next day the Empire might take the city. A few merchants come, but they drop off their stuff and go. No staying and partying like they always did before._";
	text2 = "_No, these are not good times for the Dharmon Arms._";

begintalknode;
	state = 137;
	nextstate = -1;
	question = "_This looks like a fine inn._";
	text1 = "_The largest, most comfortable inn in Avernum. Dharmon has the best of everything, even in these dark times. My pride and joy. But things have been very, very slow._";

begintalknode;
	state = 136;
	nextstate = -1;
	question = "_I would like a room._ Pay 15 coins.";
	condition = coins_amount() >= 15;
	text1 = "Messner shows you to the filthy merchants' quarters. When you object, he takes you to a nice, comfortable private room. You enjoy a long, peaceful night, your sleep only rarely disturbed by the rumbles from the battlefield to the north.";
	action = END_TALK;
	code =
		revive_party();
		change_coins(-15);
		relocate_char(get_pc_id(0),51,48,FALSE);
		relocate_char(get_pc_id(1),52,48,FALSE);
		relocate_char(get_pc_id(2),52,49,FALSE);
		relocate_char(get_pc_id(3),51,49,FALSE);
		sf(11,26,1);
	break;

begintalknode;
	state = 136;
	nextstate = -1;
	condition = coins_amount() >= 10;
	question = "_Can I get a drink?_ Pay 10 coins.";
	text1 = "As promised, the ale is decent. Bitter and vile, but less so than usual.";
	code =
		change_coins(-10);
		set_char_status(30000,1,25);
	break;

begintalknode;
	state = 136;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_The standard story. Leave me to my despair. it's fine._";
	action = END_TALK;
	
// Malka

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 163;
	question = "Malka";
	text1 = "A small, pregnant woman with black, curly hair sits in the corner. She holds a small boy in her arms. His face is flecked with red, and he looks very ill.";
	text2 = "_I am Malka, and this is Daniel,_ she says, indicating her son. _If you came for work, I can't help you._";
	text5 = "Malka cradles Daniel in her arms. Occasionally, he coughs, and she gives him a worried look.";
	action = INTRO;

begintalknode;
	state = 163;
	nextstate = 165;
	condition = 1;
	question = "_You mentioned my coming for work?_";
	text1 = "_Once, I aided the Scimitar. I gave missions. Secret work against the Empire. It is no longer necessary, so I care for my sick child._";

begintalknode;
	state = 165;
	nextstate = -1;
	condition = 1;
	question = "_Why is your job no longer necessary?_";
	text1 = "_Because the war against the Empire is now in the open, not in the shadows. If you want to fight them, don't come to humble, little me. Go to The Castle._";

begintalknode;
	state = 163;
	nextstate = 164;
	question = "_Is your son all right?_";
	text1 = "_Oh, I'm so worried, I don't mind telling you. My boy, Daniel is very sick. Some cave disease._";

begintalknode;
	state = 164;
	nextstate = 165;
	question = "_Do you know what disease he has?_";
	text1 = "_A rare one. Graymold doesn't work. Sarah's prayers barely helped. There is a package of medicine coming, but, well, I'm not sure we'll get it._";
	text3 = "_Yes. The medicine you brought helped, but it's working very slowly, and caring for Daniel keeps me up all hours. I'm very tired. But I think he'll be OK, and that's what's important._";
	code =
		if (gf(11,8) == 0) {
			sf(11,8,1);
			toggle_quest(77,1);
			}
		if (gf(11,8) < 2)
			rs(3);
			else rs(1);
	break;
	

begintalknode;
	state = 165;
	nextstate = -1;
	question = "_How is he doing?_";
	text1 = "_He's been infected with some sort of cave disease, a weird fungus infection that's eating him up. There was a medicine to treat it being sent here, but the package was lost. It was being brought by boat from Silvar, but we haven't heard anything of it._";
	text2 = "_The boat never made it to Almaria._";
	text3 = "_The medicine helped, and he'll probably get better. Without the medicine, he'd probably be dead by now. But there's still a ways to go before he's all better._ She smiles. _Still, thank you so much for your help!_";
	action = DEP_ON_SDF 11 8 1;

begintalknode;
	state = 163;
	nextstate = -1;
	condition = gf(11,8) == 1 && has_spec_item(9) > 0;
	question = "_I have the package of medicine you mentioned._ (Give it to her.)";
	text1 = "__";
	code =
	run_hardcode(139);
	break;

// Starcap

begintalknode;
	tag = 150;
	state = -1;
	nextstate = 190;
	question = "Starcap";
	text1 = "You meet a graying mage. He is surprisingly large and strong for one in his profession. He looks surprised and then irritated that you have intruded on his privacy.";
	text2 = "_You're lucky you're a soldier, or you'd be charred meat by now. I'm Starcap,_ he barks. _What are you doing here?_";
	text5 = "Starcap watches you with irritation. He is annoyed that you have broken into his home, but not so much that he feels a need to deal with you in a violent fashion.";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = 191;
	question = "_I was just having a look around. May I inquire about what you are doing back here?_";
	text1 = "_Trying to protect my privacy._ He watches you carefully, looking for some move which would give him an excuse to blast you.";

begintalknode;
	state = 191;
	nextstate = 192;
	question = "_I see. Sorry that I have disturbed you._";
	text1 = "_Yes. And if you weren't an Avernite soldier, you'd be dead already. Now why have you interrupted my knowledge seeking?_";

begintalknode;
	state = 192;
	nextstate = 193;
	condition = gf(11,27) == 0;
	question = "_I'm curious about your research._";
	text1 = "He starts to get angry at your impertinence, but then calms down. _I might as well say. I'm scrying to find the Onyx Scepter._";

begintalknode;
	state = 192;
	nextstate = -1;
	condition = gf(11,27) > 0;
	question = "_I'm curious about your research._";
	text1 = "_I haven't figured out what to study yet. My old line of inquiry is obsolete, thanks to you._";
	action = END_TALK;

begintalknode;
	state = 193;
	nextstate = 194;
	condition = has_spec_item(23) <= 0;
	question = "_What is this Onyx Scepter?_";
	text1 = "_It's a very powerful artifact, which was lost some years back. It was given to the dragon Sulfras._";

begintalknode;
	state = 194;
	nextstate = 195;
	question = "_Do you know this Sulfras?_";
	text1 = "_Sadly no. She is the mightiest dragon in these caves. She lives in the tunnels to the west of Fort Remote, but our spies say that she has been subdued by the Empire forces._";
	text2 = "_I am trying to tell if the Onyx Scepter is still in her lair or if the Empire has moved it. There. That is what I am trying to find, and I've had no luck. Now leave me in peace, so I can restore my defenses._";

begintalknode;
	state = 195;
	nextstate = -1;
	question = "_You have defenses?_";
	text1 = "_Not yet._ He grins nastily. _Although the next nosy trespassers I get won't survive to reach me._";

begintalknode;
	state = 193;
	nextstate = -1;
	condition = has_spec_item(23) > 0;
	question = "_The Onyx Scepter? You mean this?_ (Show it to him.)";
	text1 = "He looks extremely annoyed. _Well, that's two months of hard research down the midden. Now, if you will excuse me, I'm going to go get very drunk._ He turns away.";
	action = END_TALK;
	code =
		sf(11,27,1);
	break;
	
begintalknode;
	state = 193;
	nextstate = -1;
	question = "_What does the Onyx Scepter do?_";
	text1 = "_We've never been sure, but we have guesses. It seems to involve magical teleporters, which is why we need it._";
	text2 = "_You should talk to Mahdavi, in the Tower of Magi. She might be able to use your skills. And, if you talk to her, you won't be bothering me._";

begintalknode;
	state = 190;
	nextstate = -1;
	condition = gf(11,11) >= 1 && has_spec_item(18) <= 0;
	question = "_We tried to read the book on the pedestal. I couldn't._";
	text1 = "_And I should help you? It's not your book. And, even if it was, you need to get Patrick to give you a ... never mind. I don't want to talk to you. I have work to do._ He starts to ignore you.";
	action = END_TALK;
	
begintalknode;
	state = 190;
	nextstate = -1;
	question = "_Can you teach me any magic?_";
	text1 = "_Why of course! Here is a little spell for eradicating pests._ He casts the spell. You find yourself somewhere else.";
	action = END_TALK;
	code =
		relocate_char(get_pc_id(0),15,11,FALSE);
		relocate_char(get_pc_id(1),16,11,FALSE);
		relocate_char(get_pc_id(2),16,12,FALSE);
		relocate_char(get_pc_id(3),15,12,FALSE);
	break;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything else._";
	text1 = "_Good. Go away._";
	action = END_TALK;

// Captain Ebbeth

begintalknode;
	tag = 170;
	state = -1;
	nextstate = 217;
	question = "Captain Ebbeth";
	text1 = "The captain of this garrison takes a moment out from his incessant reviewing of reports and marching orders to speak with you. _I am Captain Ebbeth. State your business quickly, soldier. Being near the front takes all we have._";
	text5 = "Captain Ebbeth sighs. _I suppose you need more of my time. You are an important person._ You detect a trace of sarcasm, but just a trace. _What else do you want?_";
	action = INTRO;

begintalknode;
	state = 217;
	nextstate = 218;
	question = "_What responsibilities fall on your shoulders?_";
	text1 = "_Well, my job is pretty much everything. I handle the prisoners. I send troops to the front and Fort Remote. I hold people's hands. I never sleep. I deal with confused adventurers. I do everything._";

begintalknode;
	state = 218;
	nextstate = -1;
	question = "_Surely you don't actually hold anyone's hand._";
	text1 = "He looks annoyed. _Yes, yes. Very clever. Do you have a reason to waste my time?_";

begintalknode;
	state = 218;
	nextstate = -1;
	question = "_Do you have any prisoners now?_";
	text1 = "_Yeah, we got a talkative prisoner in one of the cells. Try not to pester her. She's in for a long day of questioning tomorrow._";

begintalknode;
	state = 218;
	nextstate = -1;
	question = "_Can you tell me about Fort Remote?_";
	text1 = "_Avernum's westernmost fort. It's a ways to the southwest. Bunch of Empire forts and stuff beyond there. We send them troops and supplies. It got destroyed a few years back, but it's rebuilt now, and strong._";

begintalknode;
	state = 217;
	nextstate = 219;
	question = "_Tell me about the front?_";
	text1 = "_Where have you been? It's the main front lines, between us and the Empire, up to the north. All the troops and supplies that head up there pass through here, and let me tell you, that's a lot of work!_";

begintalknode;
	state = 219;
	nextstate = -1;
	condition = 1;
	question = "_How long have we held them there?_";
	text1 = "_Almost a year now. Hard to imagine it's been that long. We never thought we could stop them. It's only their limited numbers that gave us any hope._";

begintalknode;
	state = 219;
	nextstate = -1;
	condition = 1;
	question = "_How long can we hold them?_";
	text1 = "_Nobody knows. Maybe a day. Maybe forever. Maybe the front already fell. If it falls, the Great Cave will burn._";

// Mayor Genevieve

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 244;
	question = "Mayor Genevieve";
	text1 = "The mayor of Dharmon is sitting behind her desk, fingering her sash of office. She is not much older than you and has a calm, organized demeanor. There are very few papers on the top of her desk.";
	text2 = "Your interruption irritates her, until she sees who you are. _Ahhh ... I heard that you arrived in Dharmon. I am Mayor Genevieve. What can I do for you, soldier?_";
	text5 = "Mayor Genevieve smiles. _Anything else you need to know?_ Her air of tranquility is strongly at odds with the chaos of Dharmon.";
	action = INTRO;

begintalknode;
	state = 244;
	nextstate = 245;
	question = "_Are you working right now?_";
	text1 = "_At this moment? No. I'm enjoying a few minutes of peace. And thinking about a few of our problems._";

begintalknode;
	state = 245;
	nextstate = -1;
	question = "_I suppose your job is not often peaceful._";
	text1 = "She indicates the lack of papers on her desk. _One contingent of troops just headed out. The new one hasn't arrived yet. Things are, for the moment, calm. In this business, you learn to stop and take a breath when you can._";

begintalknode;
	state = 244;
	nextstate = 247;
	condition = gf(11,12) < 2;
	question = "_I'm looking for work._";
	text1 = "_Hoping for a promotion, eh? You came to the right place. I could use some help._";
	text2 = "_Of course, we have a lot of problems. The standard problems. Lately, we've gotten a new one. An unusual threat._";
	
begintalknode;
	state = 247;
	nextstate = 246;
	question = "_What is this new danger?_";
	text1 = "_Some of our patrols, to the south, have been attacked by bands of giants. Not normal giants, but mutated giants, misshapen, stronger, and deadly. We think that the Empire is creating them. That is why I am looking for some adventurers to undertake a mission for me._";
	text3 = "";
	action = DEP_ON_SDF 11 12 1;

begintalknode;
	state = 244;
	nextstate = -1;
	condition = gf(11,12) >= 2;
	question = "_I'm still looking for work._";
	text1 = "_I admire your ambition, but I don't need your help right now._";

begintalknode;
	state = 244;
	nextstate = -1;
	condition = gf(11,12) >= 2;
	question = "_Did you learn anything from the papers I brought you?_";
	text1 = "_The plans you have given us were highly informative. We are now looking for ways to deal with the horrible monstrosities the Empire is creating. It is a difficult problem, but a solvable one._";

begintalknode;
	state = 246;
	nextstate = -1;
	condition = gf(11,12) <= 1;
	question = "_Please tell me more about this mission._";
	text1 = "_In the caves west of Fort Remote is the fortress Kothtar. There, the Empire carries out bizarre, magical experiments, we believe involving giants. Go there, sneak in, find records explaining what they were doing, and bring them here. I will reward you._";
	action = SET_SDF 11 12 1;
	code =
		toggle_quest(64,1);
	break;
	
begintalknode;
	state = 244;
	nextstate = -1;
	condition = gf(11,12) == 1 && has_spec_item(21) > 0;
	question = "_It was difficult, but I recovered the plans from Kothtar. Here they are._ Give them to her.";
	code =
	run_hardcode(140);
	break;

// Keith

begintalknode;
	tag = 210;
	state = -1;
	nextstate = 271;
	question = "Keith";
	text1 = "A beggar approaches you. He holds a begging bowl out in front of him. _I'm Keith, mighty soldier. Spare a coin?_";
	text5 = "Keith continues to wander the streets of Dharmon, optimistically holding the bowl out to passers-by. _Spare a coin, wealthy warrior?_";
	action = INTRO;

begintalknode;
	state = 271;
	nextstate = 272;
	question = "_Why are you begging on the streets?_";
	text1 = "_Not all of us have had the fortune to be able to head for safer lands, m'lord. So if you would give me a coin, I would much appreciate it._";

begintalknode;
	state = 272;
	nextstate = 271;
	question = "_I take it that many have left here?_";
	text1 = "_All the richer folks has been heading east for safer places. Only the soldiers is around here now. And some shopkeepers, and me._ He holds out the bowl, hoping for a coin.";

begintalknode;
	state = 272;
	nextstate = -1;
	condition = coins_amount() > 0;
	question = "_Here. Have a coin._ Give him a coin.";
	text1 = "He accepts the coin gratefully. _Thank you, m'lord! Thank you, thank you, thank you. You are very kind._ He hobbles off.";
	action = END_TALK;
	code =
		change_coins(-1);
	break;
	
begintalknode;
	state = 272;
	nextstate = -1;
	condition = coins_amount() > 100;
	question = "_You poor creature. Let me help you!_ Give him 100 coins.";
	text1 = "He accepts the coins in stunned silence. _Thank you, m'lord! I am overwhelmed by your generosity. I'm going to the inn to buy things!_ He hobbles off.";
	action = END_TALK;
	code =
		change_coins(-100);
	break;

begintalknode;
	state = 272;
	nextstate = -1;
	question = "_I can't spare anything._";
	text1 = "_Oh. Yes. I can see how poor you are. I wish you good fortune._ He hobbles off.";
	action = END_TALK;

// Agate

begintalknode;
	tag = 230;
	state = -1;
	nextstate = 325;
	question = "Agate";
	text1 = "You meet a very young and muscular woman in rough prisoner's garb. She sits on her crude bedding. The remnants of healthy skin tone mark her as a recent arrival from the surface world.";
	text2 = "_Another interrogator? I am Lieutenant Agate, of the army of the Empire. Do your worst._";
	text5 = "As you talk to Agate, her courage slowly fades. She watches you nervously, wondering what is going to happen to her.";
	action = INTRO;

begintalknode;
	state = 325;
	nextstate = 326;
	question = "_I want to ask you a few questions._";
	text1 = "She looks you over. _You aren't my usual questioners. I was telling them about the southwest quadrant. That's where you got me._";

begintalknode;
	state = 326;
	nextstate = 327;
	question = "_What about the southwest quadrant?_";
	text1 = "She thinks for a moment. She tries to remain calm, hoping that you don't hurt her. _It's west of your Fort Remote. We have three forts there. Three mighty forts. Better than anything you have, that's for sure._";

begintalknode;
	state = 327;
	nextstate = -1;
	question = "_What are they?_";
	text1 = "_Well, I've already told, so I can tell you. There's Kothtar, Angierach, and the lair of Sulfras. I'll tell more, but only to my captors. Not you. Sorry._";

begintalknode;
	state = 327;
	nextstate = -1;
	question = "_How can we get into one of those forts?_";
	text1 = "She keeps silent, watching you with a half smile. There's not much you can do. She's not your prisoner, and she knows it.";
	action = END_TALK;

