// TOWN DIALOGUE SCRIPT
//    Town 6: Almaria

begintalkscript;

variables;

short i,j,k,r1,choice;

begintalknode;
	tag = 1;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "You speak with one of the many soldiers stationed in Almaria. Only a few of them are here permanently. This is a major hub for the army. Soldiers and supplies are constantly traveling through here.";
	text2 = "They are a friendly lot, though many of them are green. Some of them are young and inexperienced enough to never have heard of you. You have a few friendly chats, but most are busily preparing to depart.";
	text3 = "They are a nervous lot. Word of the Empire soldiers hidden in the supply rooms has gotten out. Everyone looks around jumpily, seeing enemy infiltrators in every corner.";
	code =
		if (gf(6,2) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode;
	tag = 3;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "As long as Almaria has existed, it has controlled the only bridge over this river. Tolls exacted from travelers have made this town affluent by Avernite standards.";
	text2 = "This is one of the guards who watches the gate. _Walk up to the gate, soldier. We'll collect your five coins and let you through._";
	text3 = "The guards ignore you. Once you were allowed through the gate, you ceased to be of interest to them.";
	code =
		if (gf(6,25) == 0)
			rs(3);
			else rs(2);
	break;
	
// Rosemary

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Rosemary";
	text1 = "There is a buxom, cheery woman with long, black hair sitting behind the counter. A long row of bottles, filled with brightly colored fluid, is arrayed before her.";
	text2 = "_I'm Rosemary. Like the herb. Welcome to my little apothecary. Potions sold and made, if you have the materials._";
	text5 = "Rosemary watches you attentively. She is polite enough to not continue working while speaking with you.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What's in the bottles?_";
	text1 = "_These are fine potions, carefully crafted from the produce of the underworld, which you may purchase from me. This is a time of great demand._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Why is demand high?_";
	text1 = "_Almaria has become the main supply hub for the whole army. Everything they have comes through here. They're always needing new equipment, and they often come to me. I'll buy all sorts of stuff!_";

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_Can you tell us where you find your potion ingredients?_";
	text1 = "She's still smiling, but you can tell from her eyes that she thinks that was a rude question. _Now, now. A lady never reveals her secrets._";

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_May I purchase some of your wares?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Rosemary's Apothecary","Rosemary's stock is small. The army buys almost everything she has.",67,5,3);
	break;

begintalknode ;
	state = 1;
	nextstate = 5;
	condition = 1;
	question = "_I'd like for you to make a potion for me._";
	text1 = "_Excellent. There are a variety of useful brews I am able to make. Each requires at least two different herbs. Most require energetic herbs, infused with magical power, for extra kick. Let me see your herbs. I'll tell you what I can make._";
	text2 = "_Also, if you give me graymold, I can make graymold salve for you._";
	code =
		toggle_quest(19,1);
	break;
	
begintalknode ;
	state = 5;
	nextstate = -1;
	condition = num_of_item(291) > 0 && num_of_item(289) > 0;
	question = "_I want healing elixir._ (Give energetic and healing herbs.)";
	text1 = "Rosemary takes the herbs, chops them up, and boils them down. She sprinkles in some other ingredients, being careful to make sure you don't see what she is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, she pours a thick fluid into a gourd and seals it with a cork. _There. As good as anything they make on the surface._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_item(289);
		take_item(291);
		reward_give(226);
		play_sound(22);
	break;

begintalknode ;
	state = 5;
	nextstate = -1;
	condition = num_of_item(291) > 0 && num_of_item(289) > 0;
	question = "_I want curing elixir._ (Give energetic and healing herbs.)";
	text1 = "Rosemary takes the herbs, chops them up, and boils them down. She sprinkles in some other ingredients, being careful to make sure you don't see what she is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, she pours a thick fluid into a gourd and seals it with a cork. _There. As good as anything they make on the surface._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_item(289);
		take_item(291);
		reward_give(227);
		play_sound(22);
	break;
	
begintalknode ;
	state = 5;
	nextstate = -1;
	condition = num_of_item(291) > 0 && num_of_item(290) > 0;
	question = "_I want armor elixir._ (Give energetic and spiritual herbs.)";
	text1 = "Rosemary takes the herbs, chops them up, and boils them down. She sprinkles in some other ingredients, being careful to make sure you don't see what she is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, she pours a thick fluid into a gourd and seals it with a cork. _There. As good as anything they make on the surface._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_item(290);
		take_item(291);
		reward_give(230);
		play_sound(22);
	break;

begintalknode ;
	state = 5;
	nextstate = -1;
	condition = num_of_item(292) > 0 && num_of_item(290) > 0 && num_of_item(291) > 0;
	question = "_I want energy elixir._ (Give graymold, energetic and spiritual herbs.)";
	text1 = "Rosemary takes the herbs, chops them up, and boils them down. She sprinkles in some other ingredients, being careful to make sure you don't see what she is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, she pours a thick fluid into a gourd and seals it with a cork. _There. As good as anything they make on the surface._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_item(290);
		take_item(291);
		take_item(292);
		reward_give(229);
		play_sound(22);
	break;

begintalknode ;
	state = 5;
	nextstate = -1;
	condition = num_of_item(291) > 0 && num_of_item(293) > 0;
	question = "_I want a powerful protective potion._ (Give energetic herbs and mandrake root.)";
	text1 = "Rosemary takes the herbs, chops them up, and boils them down. She sprinkles in some other ingredients, being careful to make sure you don't see what she is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, she pours a thick fluid into a gourd and seals it with a cork. _There. As good as anything they make on the surface._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_item(293);
		take_item(291);
		reward_give(237);
		play_sound(22);
	break;

begintalknode ;
	state = 5;
	nextstate = -1;
	condition = num_of_item(292) > 0;
	question = "_I want graymold salve._ (Give graymold.)";
	text1 = "Rosemary takes the herbs, chops them up, and boils them down. She sprinkles in some other ingredients, being careful to make sure you don't see what she is doing.";
	text2 = "It only takes fifteen minutes or so. Eventually, she pours a thick fluid into a gourd and seals it with a cork. _There. As good as anything they make on the surface._";
	action = REUSABLE;
	code = 
		inc_flag(190,7,1);
		take_item(292);
		reward_give(495);
		play_sound(22);
	break;

begintalknode;
	state = 5;
	nextstate = 1;
	condition = 1;
	question = "_I don't need any potions._";
	text1 = "_Pity._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything else._";
	text1 = "_Then I will return to my mincing._ She grins.";
	action = END_TALK;

// Jay

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 28;
	question = "Jay";
	text1 = "There's a tall, skinny guy sitting behind the counter polishing a shield. He's really pale, like all citizens of Avernum, but not as pale as most. He even has a tiny bit of color in his cheeks. _Hi!_ He greets you with a wide smile. _I'm Jay!_";
	text5 = "Jay waits to serve you, smiling at you pleasantly. _I am eager to satisfy any of your armor needs._";
	action = INTRO;

begintalknode;
	state = 28;
	nextstate = 29;
	question = "_What sort of shop is this?_";
	text1 = "_Well, you can buy all sorts of armor here. And then, if you want weapons, you can get them nearby._";

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_Oh, really? Where are weapons sold?_";
	text1 = "_Shannon sells them next door._";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_Do you know Shannon?_";
	text1 = "He grins. _We came down into Avernum together. We were some of the last ones to do so, just before the war started. It was tough, but we're not going to be beaten._";

begintalknode;
	state = 31;
	nextstate = -1;
	question = "_Why were you thrown into Avernum?_";
	text1 = "_My loud mouth. And Shannon's. The Empire can do all of the foolish things they want, but talk about it, and you get in plenty of trouble. Not an unusual story._";

begintalknode;
	state = 28;
	nextstate = -1;
	question = "_I'm interested in buying some of your armor._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Jay's Armor","Jay has high-quality armor, mostly obtained by bartering with passing warriors. It's an odd mix, but well-maintained.",68,5,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 = 1;
	question = "_I don't need anything._";
	text1 = "_All right. Be sure to stop by and see Shannon._";
	action = END_TALK;

// Shannon

begintalknode;
	tag = 50;
	state = -1;
	nextstate = 55;
	question = "Shannon";
	text1 = "This woman has short curly hair, and her skin is pale even by Avernite standards. You would think that she was born here, but she is far too healthy.";
	text2 = "She puts down the iron blade she was sharpening and greets you. _I'm Shannon. Welcome to my shop._";
	text5 = "Shannon runs her stone down the blade of an iron dagger. _Is there anything else I can help you with?_";
	action = INTRO;

begintalknode;
	state = 55;
	nextstate = 56;
	question = "_What do you sell?_";
	text1 = "She waves at the weaponry surrounding her. _You can buy all of this, if you got the cash. It's tough getting good weapons and armor in these times, but we're clever._";

begintalknode;
	state = 56;
	nextstate = 57;
	question = "_You said 'We're.' Who else works with you?_";
	text1 = "_Well, Jay and I only came down to Avernum two years ago, but we were good scroungers on the surface, and we do even better here. Thing about lots of fighting, there's plenty to salvage._";

begintalknode;
	state = 57;
	nextstate = -1;
	question = "_Where do you find your salvage?_";
	text1 = "_Scavengers search the passages around here for battlegrounds. Then they bring the goods to us. It's grisly work, but Avernum needs weapons more than scruples. I do have a few high-quality weapons, pulled off the bodies of dead Empire troops._";

begintalknode;
	state = 55;
	nextstate = -1;
	question = "_Can I take a closer look at your weapons?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Shannon's Weaponry","Shannon has done a great job of repairing the battlefield debris brought to her.",53,5,3);
	break;

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

begintalknode;
	state = 55;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_Understood. If you need armor, please stop in next door to see Jay._";
	action = END_TALK;

// Julio

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 82;
	question = "Julio";
	text1 = "You meet an aging, dark-skinned man. He moves around the training hall with uncommon grace. He inspects you, nods, and bows deeply to you, from the waist.";
	text2 = "_I am Julio. Once an explorer, now a trainer. My eye tells me you are a warrior of some skill. Yet, I might be able to augment your technique._";
	text5 = "Julio, trainer of Almaria, stands facing you. He holds himself with uncommon confidence and poise.";
	action = INTRO;

begintalknode;
	state = 82;
	nextstate = 83;
	question = "_Can you tell me what you do, exactly?_";
	text1 = "_I train those who would be adventurers and warriors of Avernum. I help those who still have the youth and strength needed to explore._";

begintalknode;
	state = 82;
	nextstate = 86;
	question = "_I could use some training._";
	text1 = "_Gladly. I require only a modest fee for my services._";

begintalknode;
	state = 86;
	nextstate = 82;
	condition = gf(6,15) < 2;
	question = "_What can you teach me?_";
	text1 = "He describes the techniques he can teach you, all commonplace. He gives you a cunning look. _You know, there are certain special techniques I know. Secret tricks. Perhaps, if you performed a service for me, I could share them._";	

begintalknode;
	state = 86;
	nextstate = -1;
	condition = gf(6,15) > 1;
	question = "_What can you teach me?_";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Julio's training.",
		  "In return for your help, Julio will teach you certain special, secret techniques.",
		  70,4,0);	
	break;

begintalknode;
	state = 86;
	nextstate = 82;
	condition = 1;
	question = "_I don't need training._";
	text1 = "_I understand entirely._";

begintalknode;
	state = 83;
	nextstate = 84;
	question = "_Were you an adventurer once?_";
	text1 = "_I was. I've been down here fifteen years now, most of that time spent wandering, and most of that time was spent looking for an exit to the surface._";

begintalknode;
	state = 84;
	nextstate = 85;
	question = "_I take it that you never found an exit._";
	text1 = "_Sadly, no. Someone else did, in the last place I was going to look! Met them. Can't get to it now. Empire owns that land. Hear they sealed it. A sad waste._";
	text2 = "_Still, another exit will be found one day, though not by me. And when it is, I'll walk there, even if I'm a hundred!_";

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_You met the people who found the exit?_";
	text1 = "_Yes. A group of adventurers, much like yourselves. Amazing fellows. Very competent. They found the exit in the tunnels west of Fort Remote. Can't get to it now._";
	text2 = "_I'd suggest you talk to those adventurers, but they disappeared. They were quite famous down here. Then, one day, they were gone. Maybe they escaped to the surface. Nobody knows for sure._";

begintalknode;
	state = 82;
	nextstate = 87;
	condition = 1;
	question = "_I do my fair share of exploring._";
	text1 = "_Really?_ You tell him of your journey to vahnatai lands. He is impressed. _Truly an accomplishment. You have exceeded me, I am not ashamed to admit._";
	text2 = "_Oh, I long to travel. There is a place I would love to go before I die._";
	text3 = "_And now, thanks to you, it is possible._";
	code = 
		if (gf(6,15) < 2)
			rs(3);
	break;
	
begintalknode;
	state = 87;
	nextstate = -1;
	condition = gf(6,15) <= 1;
	question = "_Where would you love to go?_";
	text1 = "_It's called the Waterfall Warren. It's a maze of rapids west of Fort Dranlon. If you could go through them and tell me a safe route, I would gladly pay you._";
	text2 = "_Should there ever be peace again, I would love one final grand journey._";
	action = SET_SDF 6 15 1;
	code =
		toggle_quest(41,1);
	break;	
	
begintalknode;
	state = 82;
	nextstate = -1;
	condition = gf(148,11) >= 1 && gf(6,15) == 1;
	question = "_I passed through the Waterfall Warren._ (Describe the journey.)";
	code =
	run_hardcode(25);
	break;

// Miranda

begintalknode;
	tag = 90;
	state = -1;
	nextstate = 109;
	question = "Miranda";
	text1 = "A tall, thin woman sits cross-legged in front of a brazier. Incense smoke rises from it. When you approach, she turns a serene gaze up to meet you. _I am Miranda. Welcome._";
	text5 = "Miranda watches you calmly. She seems very peaceful. Strange, considering the tumult of recent times.";
	action = INTRO;

begintalknode;
	state = 109;
	nextstate = 110;
	question = "_Were you meditating?_";
	text1 = "_I seek a way for peace and tranquility, when all that is around is death._";

begintalknode;
	state = 110;
	nextstate = -1;
	question = "_Is peace even possible?_";
	text1 = "_A dream perhaps unattainable, perhaps naive, but look around. Truly, what other dream is there worth having, besides being able to seek one's life path in peace?_";

begintalknode;
	state = 110;
	nextstate = -1;
	question = "_The Empire is death to us all._";
	text1 = "_Perhaps. All people do is try to find ways to kill one another. I see it in them, I see it in you, I saw it on the surface. All I can do is heal them when they fall, in the hope that they gain some wisdom in their recuperation._";
	text2 = "She sighs, and a half-smile flits across her face. _Heavens, I sound naive. Oh well._";

begintalknode;
	state = 109;
	nextstate = 111;
	question = "_You are the healer here?_";
	text1 = "_There are several. I am one who can heal with magic. I tend to the most severe cases._";

begintalknode;
	state = 111;
	nextstate = -1;
	condition = 1;
	question = "_Can you teach me any of your rituals?_";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Miranda the Healer",
		  "Miranda is hazy and distracted, but she is able to teach you a few useful rituals.",
		  50,3,0);	
	break;


begintalknode;
	state = 111;
	nextstate = -1;
	condition = 1;
	question = "_I don't need any training._";
	text1 = "_What? Oh. All right. I ... Goodbye._ She returns to her incense and meditation.";
	action = END_TALK;

// Duckworth

begintalknode;
	tag = 110;
	state = -1;
	nextstate = 136;
	question = "Duckworth";
	text1 = "The secretary for city hall snoozes gently behind the desk, almost totally obscured by the huge stacks of papers before him. The etched plate on his desk says, _Duckworth._";
	text5 = "You wait patiently for Duckworth to pay attention to you. He doesn't. He snoozes gently.";
	action = INTRO;

begintalknode;
	state = 136;
	nextstate = 137;
	question = "_Ummm. Excuse me? Can you help me?_";
	text1 = "When you ask, he grumbles and shifts slightly in his chair.";

begintalknode;
	state = 137;
	nextstate = -1;
	question = "_Hey, wake up._ Shake him.";
	text1 = "He grunts, shifts in his chair, mutters _Go away,_ and starts to snore gently. Whether he's exhausted from overwork, lazy, or narcoleptic, it's clear that you won't get any help here.";
	action = END_TALK;

begintalknode;
	state = 137;
	nextstate = -1;
	question = "Leave him alone.";
	text1 = "You leave this beleaguered fellow Avernite to his gentle slumber. It's your good deed for the day.";
	action = END_TALK;

// Bevan

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 163;
	question = "Bevan";
	text1 = "A huge, bearded bear of a man sits at the end of a table, unhappily reading a scroll. He would seem quite out of place in these lovely surroundings, were it not for his mayor's sash.";
	text2 = "He looks up at you. _Ah. The honored soldier, envoy to the vahnatai. The officials of Avernum have discussed your accomplishments at length._";
	text3 = "_I'm Bevan, mayor of Almaria. You are welcome here._";
	text5 = "Bevan reclines back and watches you. You are a welcome distraction from the endless paperwork. He still seems out of place. The furnishings here are unusually opulent for Avernum.";
	action = INTRO;

begintalknode;
	state = 163;
	nextstate = 164;
	question = "_How are you keeping yourself occupied, your honor?_";
	text1 = "He puts down his scroll, picks up another one, and sighs. _Keeping things running. Staying out of the way of the military. That's mainly it._";

begintalknode;
	state = 164;
	nextstate = -1;
	condition = 1;
	question = "_What are those scrolls?_";
	text1 = "_Communication. Now that the barriers are down, the cities of Avernum are in a frenzy trying to make contact and coordinate our actions once again._";
	text2 = "_Only if we all work together can the Empire invaders be destroyed._";

begintalknode;
	state = 164;
	nextstate = 165;
	question = "_Are there lots of soldiers here?_";
	text1 = "_Almaria is the safest town in Avernum, and the most central. Thus, we have been commandeered to be the core supply depot for the whole army!_ He waves at the ocean of paper before him. _It's a nightmare of paperwork, but at least we aren't under attack._";
	text2 = "He looks across the table at you. _You're free to wander, aren't  you? A wandering agent? Hmm. You're probably looking for a mission._";
	code =
		if (gf(6,13) > 1)
			rs(2);
	break;
	
begintalknode;
	state = 163;
	nextstate = 166;
	condition = gf(6,13) <= 1;
	question = "_I am looking for a mission._";
	text1 = "Mayor Bevan looks somber. _One of our more unstable mages, who went by the name 'Sixus', suddenly started to believe we wanted him dead. He disappeared. I'd like you to find him and make sure that he does nothing to aid the Empire. Do whatever it takes._";
	action = SET_SDF 6 13 1;
	code =
		toggle_quest(40,1);
	break;
	
begintalknode;
	state = 166;
	nextstate = -1;
	condition = 1;
	question = "_What do I do when I find Sixus?_";
	text1 = "_We need you to do what it takes to make sure he doesn't go rogue and aid the Empire. If you have to kill him, it's unfortunate, but necessary. I suggest speaking with Abby. I think she knows something about his whereabouts._";
	
begintalknode;
	state = 166;
	nextstate = -1;
	condition = 1;
	question = "_Where is Sixus?_";
	text1 = "_We don't know, but we have guesses. I suggest speaking with Abby. I think she knows something about his whereabouts._";
	
begintalknode;
	state = 163;
	nextstate = -1;
	condition = gf(6,13) == 1;
	question = "_Tell us more about Sixus._";
	text1 = "_He left, and he took lots of vital records with him. If the Empire caught him, it would be a disaster. Not to mention the harm he could do in his paranoia. We don't know why he went mad, but, well, it happens to Avernites often enough._";
	text2 = "_We need you to either convince him to return or, failing that, kill him. Do this, and you will be rewarded. If you accept, go ask Abby about Sixus. She knew him. She's somewhere around the supply bins._";

begintalknode;
	state = 163;
	nextstate = -1;
	condition = gf(6,13) >= 2;
	question = "_You have another mission for me?_";
	text1 = "He thinks. _Actually, now that I come to think of it, no. Your labors would best be put to the service of other areas of Avernum._";

begintalknode;
	state = 163;
	nextstate = -1;
	condition = gf(45,11) >= 1 && gf(6,13) == 1;
	question = "_I've taken care of the Sixus problem. The situation is safe._";
	code =
	run_hardcode(121);
	break;

begintalknode;
	state = 163;
	nextstate = -1;
	condition = gf(6,1) >= 1 && gf(6,14) == 0;
	question = "_I found some invisible Empire troops in the warehouse._";
	text1 = "_Well, I heard, of course. I find out about all of these things after they happen. We think that they were based somewhere in town. If you can find where they were hiding, let me know._";

begintalknode;
	state = 163;
	nextstate = -1;
	condition = gf(6,14) >= 1 && gf(6,26) == 0;
	question = "_We found a hidden safehouse. I think Empire soldiers were hiding there. They are gone._";
	text1 = "_Good. If my soldiers aren't competent enough to deal with the situation and scare out the rats, I'm glad that you can help us._";
	code =
		sf(6,26,1);
		award_party_xp(200,15);
	break;
	
// Abby

begintalknode;
	tag = 150;
	state = -1;
	nextstate = 190;
	question = "Abby";
	text1 = "There is a very small woman sitting at the table, blissfully reading. She seems oblivious to your presence.";
	text2 = "You clear your throat.";
	text3 = "You do it again.";
	text4 = "She regretfully looks up at you. _Ah. A soldier. Hello. I'm Abby._ She returns to her reading.";
	text5 = "Abby stares intently at the words on the page in front of her, trying to indifferently continue the conversation and study at the same time.";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = 191;
	question = "_Can you help me?_";
	text1 = "She looks up at you, somewhat irritated. _I'm really quite busy. I'm sorry._ She looks back at her book.";

begintalknode;
	state = 191;
	nextstate = -1;
	condition = 1;
	question = "_I want to learn magic._";
	text1 = "_So do I. It is difficult. So many interruptions._";

begintalknode;
	state = 191;
	nextstate = 192;
	condition = gf(6,13) == 1;
	question = "_It's about Sixus. I need information about him._";
	text1 = "Her head pops up. _Oh! You're going to try to find poor Sixus? Unfortunate fellow. Good mage. Not quite right in the head. Thinks we want him dead, so he packs up and runs and takes lots of secret stuff with!_";
	text2 = "_Odd fellow. I hope you don't have to kill him. He's very bright. And secretive._";

begintalknode;
	state = 192;
	nextstate = -1;
	condition = 1;
	question = "_You think I will have to kill him?_";
	text1 = "_I think he will force you to, in self-defense. If you want to save the fellow, you will have to approach him very carefully._";

begintalknode;
	state = 192;
	nextstate = -1;
	condition = 1;
	question = "_Did he leave alone?_";
	text1 = "_No. He took all of his apprentices with him. A real blow. Try to avoid them. If you meet them, they will probably attack you to protect their master. A waste._";

begintalknode;
	state = 192;
	nextstate = 193;
	question = "_Bright and secretive in what ways?_";
	text1 = "_Secretive, in that he wanted to build a hidden tower way out in the middle of nowhere, with no help from anyone. Bright, in that he did it. Magically. He's probably in that tower now._";

begintalknode;
	state = 193;
	nextstate = -1;
	question = "_Do you know where his tower is?_";
	text1 = "_He never told anyone where it was, not even me and Bevan, his only friends!_ She thinks. _Actually, he did say something. When he built his tower, he said that, to get there, he had to take a boat north from Almaria._";
	text2 = "_After sailing out of the Great Cave to the north, he would follow the coast around to the east, landing at some tunnel. He also said it was south of a chasm, in a really isolated place. Hope that helps._ She returns to her reading.";
	action = END_TALK;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = gf(6,16) <= 1;
	question = "_What are you researching?_";
	text1 = "She shows you the book she is trying to read. It's from the surface. It's on Empire military protocols. _The Empire maintains checkpoints all over Avernum. It uses a pass system to determine who can enter what areas. I know of red, blue, and gray passes._";
	text2 = "_I am trying to determine what the blue passes are like, so that we could create a forgery. If someone could show me one of the blue passes, it would be a huge help._";
	action = SET_SDF 6 16 1;
	code =
		toggle_quest(42,1);
	break;
	
begintalknode;
	state = 190;
	nextstate = -1;
	condition = gf(6,16) == 1 && has_spec_item(4) > 0;
	question = "_I have a blue pass._ (Show it to her.)";
	code =
	run_hardcode(26);
	break;


begintalknode;
	state = 190;
	nextstate = -1;
	condition = gf(6,16) == 2 && has_spec_item(5) == 0;
	question = "_Remind me what pass you are looking for?_";
	text1 = "_A gray Empire pass, it would be a great aid to us. Sadly, it is the rarest sort. If it helps, a fellow passed through town a month back, heading up to Mertis. Name was Caelen. He said that he'd heard a rumor that someone up there had one._";
	
begintalknode;
	state = 190;
	nextstate = -1;
	condition = gf(6,16) == 2 && has_spec_item(5) > 0;
	question = "_I also have a gray pass._ (Show it to her.)";
	code =
	run_hardcode(27);
	break;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = gf(6,16) >= 1 && gf(6,16) <= 2;
	question = "_Any guess how I could find these Empire passes?_";
	text1 = "_Apart from the obvious technique of breaking into Empire outposts, killing everyone, and searching, I have no idea._";

begintalknode;
	state = 190;
	nextstate = -1;
	condition = gf(6,16) == 1 && has_spec_item(3);
	question = "_I have a red pass._ (Show it to her.)";
	text1 = "She shrugs. _That is the most common variety. We gained the ability to forge those before the barriers appeared._";

// Captain Dirk

begintalknode;
	tag = 170;
	state = -1;
	nextstate = 217;
	question = "Captain Dirk";
	text1 = "There is a scarred, balding, and richly odored man sitting at the desk. He greets you as you enter, relieved to be able to ignore his papers for a while. _Greetings. Call me Captain Dirk._";
	text5 = "As you continue to speak with the captain, you can't help but feel that he hasn't availed himself of a bath for some time.";
	action = INTRO;

begintalknode;
	state = 217;
	nextstate = 218;
	question = "_Are you part of the army?_";
	text1 = "_Uh, I'm quartermaster here. I look after the supplies and boats and stuff._";

begintalknode;
	state = 218;
	nextstate = -1;
	question = "_What's a quartermaster?_";
	text1 = "_I keep track of what all we got here, and send it where they need it._";

begintalknode;
	state = 217;
	nextstate = 219;
	condition = gf(6,1) >= 1;
	question = "_I was just attacked by Empire troops! In one of your storerooms!_";
	text1 = "_I know. Terrible, isn't it? We don't know where they came from. We think they must have been staying somewhere in town. Or that that's where they were based._";
	text3 = "_I know. Terrible, isn't it? We don't know where they came from. We think they must have been staying somewhere in town._ You tell him about the hidden base you found. _Ah. Well, there you are then. Thanks for taking care of it for us._";
	action = DEP_ON_SDF 6 14 0;

begintalknode;
	state = 219;
	nextstate = -1;
	condition = gf(6,14) == 0;
	question = "_Any guess of where that might be?_";
	text1 = "_I don't know, and I'm too busy to go look for it. The base wouldn't be in the north part of town, though. Too well defended._";

begintalknode;
	state = 217;
	nextstate = 220;
	condition = 1;
	question = "_Can I get some supplies?_";
	text1 = "Dirk snorts. _I am no small town quartermaster. I deal with supplies by the tons, shipping them to the front lines._";

begintalknode;
	state = 220;
	nextstate = -1;
	condition = 1;
	question = "_So that's a 'no'?_";
	text1 = "_Leave my supplies alone. There are others who need them more than you._";

// Laura

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 244;
	question = "Laura";
	text1 = "You meet a short, round woman clad in the rough robes of a traveling mage. She's an extroverted sort, eager to meet another traveler. _I'm Laura. Well met, friend._";
	text2 = "_You are like me, yes? Another traveler._";
	text5 = "Laura smiles and sips from a small cup of Almarian wine. _Care to speak of anything else, soldier?_";
	action = INTRO;

begintalknode;
	state = 244;
	nextstate = 245;
	question = "_Where are you traveling?_";
	text1 = "_My familiar and I are heading back to the Tower of Magi. I want to learn more about the vahnatai, and there seems the best place._";

begintalknode;
	state = 245;
	nextstate = -1;
	question = "_What is a familiar?_";
	text1 = "_My magical animal companion, Dagger. If you see her, you can say hi. Don't expect politeness. She's not a happy animal._";

begintalknode;
	state = 245;
	nextstate = 246;
	question = "_We have met the vahnatai. They are a strange people._";
	text1 = "_Oh, yes! Everyone's talking about them, but especially mages! A whole new people to learn about, to learn skills from. Pity so many of them hate us. Still, they're on everyone's mind._";
	text2 = "_A soldier at Fort Emerald, he even claims some of them were nearby!_";

begintalknode;
	state = 246;
	nextstate = -1;
	question = "_You don't happen to remember the soldier's name?_";
	text1 = "_A soldier named Brian. Ask him about the vahnatai if you want. He claims some were nearby, near an Empire outpost, although that's impossible. He must have been hallucinating. Why would the vahnatai be consorting with Empire troops?_";

begintalknode;
	state = 244;
	nextstate = -1;
	condition = 1;
	question = "_Can you teach me any magic?_";
	text1 = "_Alas, no. It is not a skill I have. You should go where I am going, the Tower of Magi. It's the best place to learn spells. Patrick's Tower, to the west, is another prime destination._";

// Rosemary

begintalknode;
	tag = 210;
	state = -1;
	nextstate = 271;
	question = "Rosemary";
	text1 = "An immaculately groomed nephar stands proudly behind an immaculately clean bar. He bows to you. _I am Hmurr. Welcome to my inn._ His speech is unusually clear for a nephil.";
	text5 = "Hmurr waits on you. He looks nervous, as if he expects you to hate him. His kind is not usually welcome in human settlements.";
	action = INTRO;

begintalknode;
	state = 271;
	nextstate = 272;
	question = "_Is this your inn?_";
	text1 = "_I own this inn. How I came to have it is an odd tale. But it is mine, and I run it with pride. You may buy my fine rations, or get a room for a mere five coins. And we are one of the few that sells the fine Almarian wine._";

begintalknode;
	state = 272;
	nextstate = -1;
	question = "_I'd like to hear the tale._";
	text1 = "_Rhiannon, a kind lady, ran this inn before me. She took me in when I was but a kit, during the wars 'tween your people and mine. She raised me, and when she died, may she find rest, the inn was left to me._";
	text2 = "_People feared me at first, but they got used to me quickly enough. And now I own this inn!_ He waves proudly at the common room.";

begintalknode;
	state = 271;
	nextstate = -1;
	question = "_May I purchase some of your goods?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Hmurr's Rations","Hmurr sells food for the road, as well as the best wine in Avernum.",71,3,3);
	break;

begintalknode;
	state = 271;
	nextstate = -1;
	condition = coins_amount() >= 5;
	question = "_I need a room for the night._ Pay 5 coins.";
	text1 = "Hmurr counts out your coins and proudly shows you to a beautifully clean room. Not a spot of dust or mold. You spend a pleasant and restful night.";
	action = END_TALK;
	code =
		revive_party();
		change_coins(-5);
		relocate_char(get_pc_id(0),50,47,FALSE);
		relocate_char(get_pc_id(1),51,47,FALSE);
		relocate_char(get_pc_id(2),51,48,FALSE);
		relocate_char(get_pc_id(3),50,48,FALSE);
	break;

begintalknode;
	state = 271;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_Hmrrr. Safe travels to you, then._";
	action = END_TALK;
	
// Gypsy

begintalknode;
	tag = 230;
	state = -1;
	nextstate = 298;
	question = "Gypsy";
	text1 = "This woman has traveled from one end of Avernum to the other, several times. She is perched on top of a stool, tuning her guitar. Instruments like this are extremely rare in Avernum. _Hello, traveler,_ she says. _I'm Gypsy!_";
	text5 = "Gypsy stops the conversation a moment to tune one of the strings on the instrument. It was brought down from the surface years ago and been forced to survive in rough conditions ever since.";
	action = INTRO;

begintalknode;
	state = 298;
	nextstate = 299;
	question = "_Nice instrument._";
	text1 = "_My thanks, strangers. I spent a year making it, on the surface. When I was thrown down here, they were merciful enough to let me take it down here with me._";
	text2 = "_Traveling and playing is my life now. I just came over from Dharmon._";
	
begintalknode;
	state = 299;
	nextstate = -1;
	condition = 1;
	question = "_Why were you sent to Avernum?_";
	text1 = "_It was for singing a bawdy ballad mocking the stiffs in power._";

begintalknode;
	state = 299;
	nextstate = 300;
	question = "_Dharmon? Where is that?_";
	text1 = "_Never been there? Big city, under a hill, well to the west. Probably the busiest place in Avernum._";

begintalknode;
	state = 300;
	nextstate = -1;
	question = "_Why is it so busy?_";
	text1 = "_Never seen people move faster in all of Avernum than there, now. You see, the big front between us and the Empire is just north of there. Lots of action, lots of fighting. I'm staying away from there for a while. Want to live to keep playing._ ";
	text2 = "With that, she plays a rousing song on her guitar. You stand entranced. It's been a long time since you've heard surface world music. You spend a peaceful hour listening to her play before you move on.";
	action = END_TALK;

// Monty

begintalknode;
	tag = 250;
	state = -1;
	nextstate = 325;
	question = "Monty";
	text1 = "You meet a wiry caravan guard, a variety of weaponry hanging from his belt and shoulder straps. He eyes your gear and approves of what he sees.";
	text2 = "He grants you a broad smile. _Greetings, traveler! I'm Monty._";
	text5 = "Monty takes a deep swig of cheap ale. _What else do you wanna' know? I'm not short on time._";
	action = INTRO;

begintalknode;
	state = 325;
	nextstate = 326;
	question = "_Hi! Are you just passing through?_";
	text1 = "_I'm heading on over to Blosk. You know, about a hundred miles west? They have a need for good guards there._";

begintalknode;
	state = 326;
	nextstate = 327;
	question = "_What's going on in Blosk?_";
	text1 = "_The Empire's started attacking around there a lot since the barriers came down. They're starting to learn their way around the caves. Good place for a mercenary to be._ He thinks. _Just between you and me, though, if you go there keep your eyes open._";
	text2 = "_Word is, there's some spying going on._";

begintalknode;
	state = 327;
	nextstate = -1;
	question = "_They say that the Empire has spies in Blosk?_";
	text1 = "_That's just the rumor, that Blosk has a lot of trouble with that. Means they need good men all the more._";
	text3 = "_That's just the rumor, that Blosk has a lot of trouble with that. Means they need good men all the more._ You don't mention that you exposed a spy in Blosk. For all you know, there are other spies there.";
	action = DEP_ON_SDF 10 12 0;

begintalknode;
	state = 325;
	nextstate = -1;
	condition = 1;
	question = "Talk to Monty.";
	text1 = "You join Monty at the bar and spend some time trading tales. A woman named Gypsy plays music and sings. Other patrons join you, including a mage named Laura. You receive several hours of actual peace and relaxation. It is a rare pleasure.";
	action = END_TALK;

begintalknode;
	state = 325;
	nextstate = -1;
	condition = 1;
	question = "_I need to go._";
	text1 = "_All right. I don't want to keep you._";
	action = END_TALK;

// Dagger

begintalknode;
	tag = 270;
	state = -1;
	nextstate = 352;
	question = "Dagger";
	text1 = "You reach down to pet a cat. To your surprise, it jumps away, saying, _Knock it off!_ You step back, surprised. It looks up at you. _Yeah. I'm a talking cat. Name's Dagger. Like you care._";
	text5 = "Dagger nervously paces pack and forth, pausing occasionally to clean itself.";
	action = INTRO;

begintalknode;
	state = 352;
	nextstate = 353;
	question = "_What are you?_";
	text1 = "It spits. _I'm a familiar, OK? What's it to you?_";

begintalknode;
	state = 353;
	nextstate = 354;
	question = "_What's a familiar?_";
	text1 = "It stares up at you boldly. _It means I got no dignity. I follow Laura around, and protect her, and I don't get any kinda' say in the matter._";

begintalknode;
	state = 354;
	nextstate = -1;
	question = "_Who is Laura?_";
	text1 = "_My mistress. She's around here somewhere. Now, don't get me wrong. I like her a lot. She's as good a mistress as there is. But hey, any job that ends me up talkin' to knuckleknobs like you, that's a job I can do without!_";
	text2 = "It walks off. Hmm. It doesn't seem to like you.";
	action = END_TALK;

