
begintalkscript;

variables;

begintalknode 1;
	state = 0;
	nextstate = 1;
	personality = 9;
	question = "Captain Parseval";
	text1 = "Captain Parseval greets you as you enter his office. He's not large, but he looks tough. _It's good to meet you, and I'm glad that you're here._ He says, standing up and shaking hands. ";
	text2 = "_You see, over the last 18 months, we've been finding steadily increasing numbers of cases of skribbane usage in Avernum. You're probably aware of the danger that this addictive drug can pose, and the King wants a stop put to this trend._";
	text3 = "_It seems like that should be easy to do, as all transport of goods between Avernum and the surface must be teleported via Upper Avernum, but we still haven't been able to interrupt the smuggling of skribbane. However, we think we may have a lead._";
	text4 = "_We think that the criminals who habitually hide out in the Honeycomb are at the center of this problem, and so that is where you come in: we need someone to attempt to infiltrate the criminal system and gather hard evidence about what's happening._";
	text5 = "Seeing you come into the office, Captain Parseval quickly asks, _Do you have anything to report? Any progress?_";
	action = INTRO;

begintalknode 2;
	state = 1;
	nextstate = 1;
	condition = (get_flag(1,1) == 0);
	question = "How are we supposed to do that?";
	text1 = "_We think that it may not be hard as it seems. With the outlaw organization working this hard, they probably need more manpower, providing a natural way in for you. _";
	text2 = "_Also, a man is in Mertis at this time whom we believe acts somewhat like a recruiter for the brigands. His name is Scab, and he's staying at the inn right now. _";
	text3 = "_So, what I am asking you to do is speak with this fellow, pretending to be seeking employment among the brigands. _";
	text4 = "_If you can get inside their operation, try to get evidence that will allow us to verify that the bandits are distributing skribbane, and preferably allow us to shut down their activities._";
	action = END_TALK;
	code = 
		set_flag(1,1,1);
		toggle_quest(0,1);
	break;
begintalknode 3;
	state = 1;
	nextstate = 1;
	condition = (get_flag(2,5) == 1 && get_flag(1,3) == 0);
	question = "The brigands have given us a job to do. . . ";
	text1 = "You describe exactly what Gabston ordered you to do, and Captain Parseval looks grim. _I'm afraid that the only way to proceed is to do exactly as you were told. _";
	text2 = "_If you fail to carry out this mission, the criminals will doubt your sincerity, and won't let you any further into their operation. I hate sacrificing Abe's property since he is one of the citizens of Avernum I've sworn to protect._";
	text3 = "_But, if we can't recover his heirloom, the government will compensate him, and this could give us the edge we need to break the skribbane smuggling system, which would benefit all of Avernum._";
	text4 = "_So, on my responsibility, take the candlestick. I'll explain the necessary details to Sergeant Hillas, and he'll see to to it that the guards don't interfere with your work. Good luck._";
	code = 
		set_flag(1,3,1);
	break;
begintalknode 4;
	state = 1;
	nextstate = 1;
	condition = (get_flag(2,5) == 0 || get_flag(1,3) == 1) && (get_flag(3,1) == 0 || get_flag(3,5) == 1) && (get_flag(3,2) == 0 || get_flag(3,6) == 1) && (get_flag(3,3) == 0 || get_flag(3,7) == 1) && (get_flag(3,4) == 0 || get_flag(3,8) == 1) && (get_flag(1,1) == 1);
	question = "Sorry, no progress yet. ";
	text1 = "_Well, please keep working. This mission is of vital importance._";

begintalknode 5;
	state = 1;
	nextstate = 1;
	condition = (get_flag(3,1) == 1 && get_flag(3,5) == 0);
	question = "We found records detailing smuggling transactions!";
	text1 = "You hand over the bundle of records you took from the brigands. Captain Parseval pores over it for several minutes before looking back up at you. His face glows with vindication. ";
	text2 = "_I knew it! The madhouse is the key the whole operation, and thanks to your work, we can now identify and dismantle practically all of it._";
	text3 = "_The only possible thing I could ask for in addition would be an actual sample of skribbane proving that they were beyond any doubt that they were dealing in it. _";
	text4 = "_Thank you for your hard work. This is everything I had hoped for and more. Very good work indeed._";
	code = 
		set_flag(3,5,1);
		change_spec_item(2,-1);
		if(get_flag(3,2)==1){
			remove_string(3);
			toggle_quest(0,1);
		}
		else{
		remove_string(4);
	}
	change_coins(1000);
	award_party_xp(100,40);
	break;
begintalknode 6;
	state = 1;
	nextstate = 1;
	condition = (get_flag(3,2) == 1 && get_flag(3,6) == 0);
	question = "We found actual skribbane in the brigands' store room!";
	text1 = "You hand the pouch of skribbane over to Captain Parseval, who pours out a fraction of the contents onto his desk and examines it minutely. With a look of grim satisfaction he announces, _Yes, this is the real thing._";
	text2 = "_This gives us hard evidence to prove that they are indeed trafficking skribbane and bring the force of the army down on them. _";
	text3 = "_I only wish that we had information about how they smuggle it in and then distribute it; that would allow us to take apart their whole operation. _";
	text4 = "_Thank you for your hard work. This is everything I had hoped for and more. Very good work indeed._";
	code = 
		set_flag(3,6,1);
		change_spec_item(1,-1);
		if(get_flag(3,1)==1){
			remove_string(3);
			toggle_quest(0,1);
		}
		else{
		remove_string(4);
	}
	change_coins(500);
	award_party_xp(50,40);
	break;
begintalknode 7;
	state = 1;
	nextstate = 1;
	condition = (get_flag(3,3) == 1 && get_flag(3,7) == 0);
	question = "We heard one of the brigand slip and mention skribbane. ";
	text1 = "Captain Parseval looks thoughtful and then replies, _Yes, thank helps. It tells us that we're on the right track. But by itself it's just not enough._";
	code = 
		set_flag(3,7,1);
		award_party_xp(10,40);
	break;
begintalknode 8;
	state = 1;
	nextstate = 1;
	condition = (get_flag(3,4) == 1 && get_flag(3,8) == 0);
	question = "We were able to get back Abe's candlestick. ";
	text1 = "Captain Parseval looks greatly relieved. _Thank goodness. I'll have one of the guards take it back to Abe's house, and when he get home I'll explain to him what happened. _";
	text2 = "_It'll be a lot easier to face my own neighbor knowing that I didn't just let bandits make off with one of his family heirlooms. _";
	code = 
		set_flag(3,8,1);
		change_spec_item(0,-1);
		change_coins(25);
		award_party_xp(250,40);
	break;
begintalknode 9;
	state = 1;
	nextstate = 1;
	condition = (get_flag(2,11) == 1 && get_flag(3,9) == 0);
	question = "We killed the brigand leader. ";
	text1 = "You describe Whisper and how you killed him. Captain Parseval raises his eyebrows and says, _Well, that was something I wasn't expecting. Good work though_";
	text2 = "_This I had heard of 'Whisper' before, and his death will break up the brigands significantly. _";
	code = 
		set_flag(3,9,1);
		change_coins(500);
		award_party_xp(50,40);
	break;
begintalknode 10;
	state = 0;
	nextstate = 5;
	personality = 10;
	question = "Scab";
	text1 = "You walk up to the only patron in the inn, a rather rough looking fellow. Somewhat oddly he's eating a large green salad with gusto. ";
	text2 = "He looks quizzically at you as you walk up to him. _And what is it I c'n do fer you lot?_";
	text5 = "Scab is eating again when you arrive. He looks at you boredly. _Yeah? What izzit this time?_";
	action = INTRO;

begintalknode 11;
	state = 5;
	nextstate = 5;
	condition = get_flag(1,2) == 0;
	question = "We're looking for work. We hear you might have. . . connections. ";
	text1 = "_Well, _ he says slowly while leaning back, _I maht at that. What would you be looking for?_";
	text2 = "You spin a lengthy story about how you've come down from Formello looking for opportunities to get ahead, dropping hints that in the past you might have been less than perfect at obeying the law, and wouldn't be averse to doing so again. ";
	text3 = "After hearing you out, Scab says, _Hm, it so happens I know some people looking for a few able bodied workers. If yer interested, you could head into the Honeycomb. If the people I know want to hire you, they'll meet you there. _";
	text4 = "So basically you have a tentative invitation into the legendary Brigands' Madhouse. Now may be the time to check it out. ";
	code = 
		set_flag(1,2,1);
	break;
begintalknode 12;
	state = 5;
	nextstate = 5;
	question = "So how's your lunch? ";
	text1 = "_Uh, good. It's good._";

begintalknode 13;
	state = 5;
	nextstate = 5;
	question = "Do you have any advice for us? ";
	text1 = "_Yeah, I guess I do: Always do what yer told, and don't ask too many questions about what's goin' on. Got it?_";

begintalknode 14;
	state = 0;
	nextstate = 6;
	personality = 14;
	question = "Nikko";
	text1 = "Nikko is a relatively young man, in his mid twenties. He greets you energetically, _Good day! Can I interest you in fine items of armor?_";
	text5 = "_Is there anything I can help you with?_ Nikko asks as you approach. ";
	action = INTRO;

begintalknode 15;
	state = 6;
	nextstate = 6;
	question = "May we see what you have for sale?";
	text1 = "You finish looking through the armor. ";
	code = 
		begin_shop_mode("Nikko's Armor","Nikko sells a variety of simple but sturdily made armor.",0,3,-1);
	break;
begintalknode 16;
	state = 6;
	nextstate = 6;
	question = "Where is this armor manufactured?";
	text1 = "_Nearly all of it is my parents' work actually,_ he replies with a grin. _They have a forge down in Almaria these days, but I came back up here because of the volume of trade through Mertis. It's a good place to be selling._";

begintalknode 17;
	state = 0;
	nextstate = 7;
	personality = 15;
	question = "Allison";
	text1 = "Allison is unusually dark skinned for an inhabitant of Avernum, leading you to guess that she probably grew up somewhere on the surface. She looks up brightly as you walk over to her counter. ";
	text2 = "_What can I get for you? I have all types of tools that may come in handy for any expedition._";
	text5 = "_Can I help you find any equipment you need?_ Allison asks.";
	action = INTRO;

begintalknode 18;
	state = 7;
	nextstate = 7;
	question = "We'd like to see what's for sale. ";
	text1 = "You finish browsing through the assorted tools. ";
	code = 
		begin_shop_mode("Allison's Implements","Allison is selling tools to help in almost any situation an adventurer may encounter.",1,3,2);
	break;
begintalknode 19;
	state = 7;
	nextstate = 7;
	question = "If you'll excuse the question, you're not a native Avernite, are you?";
	text1 = "_No_ she says, _I'm not. My family lives in Vantanas, but I moved to Avernum because it sounded so different. I really like it here. Sometimes it's more dangerous than living on the surface, but it's exciting to live in such a unique frontier. _";

begintalknode 20;
	state = 7;
	nextstate = 7;
	question = "Why are you in the equipment business?";
	text1 = "_Well, mostly because it sounded interesting. My father was a tailor so I knew about selling thing anyway, and in this business around here I get to meet so many unusual people. _";
	text2 = "_It was just a couple of months ago that I sold some gear to a bunch of sliths who said they were going on an arduous religious pilgrimage. that's not the kind of thing you get to hear about in the tailoring business._";

begintalknode 21;
	state = 0;
	nextstate = 8;
	personality = 16;
	question = "Roxanne";
	text1 = "Roxanne is a fletcher, and as you head over toward her counter you notice that she is working methodically on finishing more arrows. ";
	text2 = "You greet her, but it takes a moment before she shakes her head slightly and replies, _I'm sorry, I guess I was really engrossed in what I was doing. Do you need some bows or ammunition today?_";
	action = INTRO;

begintalknode 22;
	state = 8;
	nextstate = 8;
	question = "We'd like to look at what's for sale. ";
	text1 = "You decide you have all of the ammunition that you need. ";
	code = 
		begin_shop_mode("Roxanne's Archery Supplies","Roxanne sells the bows and arrows that she makes for fairly typical prices.",2,4,-1);
	break;
begintalknode 23;
	state = 8;
	nextstate = 8;
	question = "Have you heard anything interesting lately?";
	text1 = "_Not much, I guess_, she say, looking thoughtful. _There was some kind of worrisome stuff about skribbane coming down here to Avernum, but I've only heard a few rumors about that. I hope it's really nothing._";

begintalknode 24;
	state = 6;
	nextstate = 6;
	question = "Does no one here sell weapons?";
	text1 = "_Yeah, I guess you're here a bit too early,_ he says with a laugh. _My younger brother Ben is planning to move up here with me and sell weapons. He's reserved that empty booth over there. _ He nods toward the unoccupied corner of the bazaar. ";
	text2 = "_Unfortunately, he won't get here with his stock for another few months. Sorry I can't help you any more with that._";

begintalknode 25;
	state = 0;
	nextstate = 9;
	personality = 16;
	question = "Cronan";
	text1 = "The innkeeper is an older man, who is currently pacing back and forth at the counter, muttering quietly to himself. When he sees you coming towards him, he straightens up and displays a smile.";
	text2 = "_Welcome guests!_ he announces _I am Cronan, owner of this establishment. What can I get for you today?_";
	text5 = "Cronan puts down the mug he was polishing and greets you again. _Anything I can get you?_ he asks.";
	action = INTRO;

begintalknode 26;
	state = 9;
	nextstate = 9;
	question = "What services do you offer?";
	text1 = "_Like any proper inn, you can get a filling meal or a room to stay in. A meal is only 3 coins, staying in the common room is 5 coins, and the private room costs 15 coins. _";

begintalknode 27;
	state = 9;
	nextstate = 9;
	question = "We'd like a meal. ";
	text1 = "You hand Cronan your money, and he brings out your food. It's not the best you've ever had, but it is indeed filling. ";
	text3 = "Unfortunately, it turns out you can't afford a meal. Cronan says apologetically, _Sorry, but i can't give away food for free._";
	action = PAY 0 0 0 3;
	code = 
		revive_party();
	break;
begintalknode 28;
	state = 9;
	nextstate = 9;
	question = "We'd like to stay in the common room. ";
	text1 = "You pay a few coins and go lay down in the common room. the bed bugs are terrible, and it's really not all that restful. You suppose it was better than nothing. ";
	action = INN 5 25 17;

begintalknode 29;
	state = 9;
	nextstate = 9;
	question = "We'd like to stay in the private room. ";
	text1 = "You hand Cronan a few coins and go into the private room. It's nice and quiet, and you get a good bit of rest. ";
	text3 = "You ask Cronan the price, but it turns out you can't afford it. It's too bad, because you would have liked some nice quiet rest. Oh well. ";
	action = INN 15 33 17;

begintalknode 30;
	state = 0;
	nextstate = 10;
	personality = 17;
	question = "Rhoads";
	text1 = "Inside the chapel you meet a rather atypical priest. He's in his sixties you guess, but clearly works to stay in good shape. He also carries a sizeable mace. ";
	text2 = "_Greetings travelers, _ he says. _I am Rhoads, and I welcome you to the Temple of Elgar._";
	text5 = "Rhoads nods politely to you as you re-enter the temple. He's slapping his mace into his palm as though considering crushing something. ";
	action = INTRO;

begintalknode 31;
	state = 10;
	nextstate = 11;
	question = "Who is Elgar?";
	text1 = "_Elgar is the mightiest of deities, a great warrior!_ Rhoads intones with a fanatical gleam in his eye. _Elgar governs all forms of just and righteous violence._";
	text2 = "_Elgar also blesses his followers with the skills needed to be as efficient as possible at vanquishing their enemies; great magic to crush your foes. For a nominal donation I could instruct you in this art. _";

begintalknode 32;
	state = 11;
	nextstate = 10;
	question = "Ok, we want to learn about the way of Elgar. ";
	text1 = "You finish training in the wisdom of Elgar. It seems like it could come in pretty handy. ";
	code = 
		begin_shop_mode("Rhoads, Priest of Elgar","Rhoads can teach you the magical knowledge of Elgar, which is to say, how best to strike at your enemies' weak spots.",3,5,-1);
	break;
begintalknode 33;
	state = 11;
	nextstate = 10;
	question = "Maybe we'll learn the teachings of Elgar a bit later. ";
	text1 = "_You should consider it well, _ Rhoads says, _The power that Elgar grants is a boon to any true warrior. _";

begintalknode 34;
	state = 10;
	nextstate = 10;
	question = "Do you perform healing?";
	text1 = "_Certainly not!_ Rhoads exclaims. _Elgar is a god of great fighters, not finicky healers. I devote myself to the true way of Elgar: breaking enemies apart!_";
