// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(135,2) == 0;
	question = "special";
	text1 = "You enter the ruins of what was once a small Avernite fortress. Now the crumbling buildings (or, at least, the ones that are still barely standing) have been occupied by squatters. There is a heavy smell of rotting garbage.";
	text2 = "As you enter, you realize that this isn't your usual desperate refugee camp. There are guards, with crude armor and old, dented weapons. They look at you with undisguised loathing.";
	text3 = "And the other people here, the unarmed ones, look thin, exhausted, and close to panic. A lot of them have green smudges around the mouth. You get the impression that being weak and unarmed wouldn't keep them from attacking you.";
	text4 = "This is not a friendly place. The Great Cave must be short on soldiers indeed if they tolerate this pit being here.";
	action = SET_SDF 135 2 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = char_ok(14599) && get_attitude(14599) < 10);
	question = "special";
	text1 = "The moment you step through the door, Chrysander shouts an alarm. _I knew you meant us no good! You won't learn our secrets that easily!_";
	code =
		make_zone_hostile();
		sf(135,3,1);
	break;
	
begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  friendly Outpost";
	text3 = "  Chrysander is In Charge";
	text4 = "  Don't cause trouble For Us and We won't Hurt you";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several armed people on the road. They look like brigands. They wield crude armor and weapons and bear the standard dumb, cruel expression.";
	text2 = "They size you up as you approach. They decide that attacking Avernite soldiers would be, even by their standards, stupidly suicidal. They turn and walk back into the fort ahead.";

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "To be an Avernite soldier in this place is to walk surrounded by a circle of silence. Whenever you get close to any of these people, their quiet, muttered conversations cease. When you move on, the noise resumes.";
	text2 = "None of them wants to be seen talking to you. You leave them alone.";

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to talk to one of the brigands that live in this ruin. Whenever you approach one, he or she snorts and turns away from you.";
	text2 = "It is unusual for someone to treat a soldier of Avernum with such obnoxious insolence. You manage to restrain your temper.";
	
// Korga

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "Most of the guards in this fort are your more normally sized humanoids, humans and nephilim mostly. And yet, one towers over them, bigger, meaner, dumber, and smellier than all the rest.";
	text2 = "The ogre sits on a comically small stone chair and bares her fangs at you. Then she says, _Hrrrr. I Korga, little soldier. This not you place. You be good, or Korga eat you._";
	text5 = "Korga stares at you silently. She occasionally picks bits of rotting meat out from around her fangs with a long, sharp sliver of bone.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Tell me about this camp.";
	text1 = "_Ghrrrr. I not for talking. I for hitting. Talk Chrys ... Chrys ..._ She's having trouble saying the name. _Talk to the boss._";

begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "So. You're an ogre. What's that like?";
	text1 = "_Hrrr. Can't complain._";

begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "What do you do here?";
	text1 = "_I crush. Crush little people who don't pay. Crush adventurers who cause trouble. Crush who boss tells me._";

begintalknode 14;
	state = 10;
	nextstate = -1;
	condition = gf(135,4) < 2;
	question = "I am here to destroy this camp. (Attack.)";
	text1 = "Korga jumps to her feet. She's surprisingly fast and nimble for her size. _Gharrr! Now Korga can earn his pay! Die, little soldier!_";
	action = END_TALK;
	code =
		make_zone_hostile();
		sf(135,3,1);
	break;
	
begintalknode 15;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "There's something I'd like to talk about.";
	text1 = "_Hrrrr? Ogres not for talk. Talk makes Korga's head hurt. Head hurt make Korga want to smash little things. You go away!_ Seems a wise suggestion.";
	action = END_TALK;

//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Chrysander";
	text1 = "At least one room in this miserable fort is kept nice. In fact, it's almost fancy. Art and carpets, salvaged from abandoned homesteads, fill the chamber, giving it a homey feeling.";
	text2 = "A young man, clean and sharply dressed, sits behind the cavewood desk. His friendly smile and cherubic looks would put you at your ease, were it not for the steel broadsword that hangs from his belt.";
	text3 = "He waves a greeting to you, though he doesn't rise. _Ahhh ... The soldier. I'd been told that we've received a visit from the finest of Avernum. I am Chrysander._";
	text4 = "_I am a merchant. I sell certain medicinal herbs. I hope your visit is a peaceful one. If you respect my right to operate my little business here, I'm sure we'll get along fine._";
	text5 = "Chrysander smiles and sips some tea. You note that his gaze is sharp and his mouth lacks any sign of green stains. _Always happy to speak more with the fine warriors of Avernum._";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = gf(135,5) == 0;
	question = "Never mind. I'll just be going.";
	text1 = "Chrysander nods, relieved. _Safe travels to you, then._";
	action = END_TALK;

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = gf(135,5) == 0;
	question = "You sell medicinal herbs?";
	text1 = "_Yes. Extracts of skribbane herb, to be exact. A powerful medicine and aid in battle, one that has received a terrible reputation among the uninformed._";
	text2 = "_Have you tried some? If not, you should. When under its influence, the world around you will seem to move very slowly. Your speed and reflexes will improve dramatically. And the side effects are, I assure you, minimal._";
	text3 = "_Oh, and if you are going to stay here for a time, please stay out of my private chambers._ He looks at the south door. _I really must insist._";
	action = SET_SDF 135 5 1;
	
begintalknode 33;
	state = 30;
	nextstate = 31;
	condition = gf(135,5) > 0;
	question = "Tell me more about skribbane herb.";
	text1 = "_It is a powerful, concentrated extract of a plant that grows naturally on the surface. It suppresses feelings of hunger, which makes it very valuable in these current dark times._";
	text2 = "_It also speeds up the mind and the reflexes, which makes it a powerful aid in battle._";

begintalknode 34;
	state = 30;
	nextstate = 33;
	condition = gf(135,5) > 0;
	question = "Tell me about this keep.";
	text1 = "_This was once a small, understaffed, and entirely redundant keep called Fort Haledon. It was shut down quite some years ago and left to crumble._";
	text2 = "Now it is occupied with refugees, looking for a safe place to stay until they can escape Avernum. And, of course, I also operate my small business here. Though the troubles are constant._";

begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = gf(135,5) > 0;
	question = "Sure. I'll buy some skribbane.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Chrysander's Skribbane",
		  "Chrysander sells vials of skribbane so fresh he must be able to grow it himself. The dangerous substance is bright emerald green in its glass vials.",
		  29,3,0);	
	break;
	
begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = gf(135,4) < 2;
	question = "I am going to drive you out of here. Leave or die.";
	text1 = "_What?_ He leaps to his feet. In a moment, his blade is in his hands. _I keep this pitiful rabble out from under the army's feet, and this is how you reward me? By going back on your word._";
	text2 = "_I will not tolerate this! Help! Guards! We're under attack!_";
	action = END_TALK;
	code =
		make_zone_hostile();
		sf(135,3,1);
	break;

begintalknode 38;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Grows on the surface? What about in Avernum? Can you grow it?";
	text1 = "_Ahhhh ..._ In an instant, Chrysander becomes very guarded. _I have heard rumors that skribbane can be grown in the underworld. I know exactly nothing about that._";

begintalknode 39;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "And is it addictive?";
	text1 = "_Pshaw! I assure you that any alleged addictive properties of this marvelous substance are mere rumors spread by those who would control the supply of it for themselves._";
	text2 = "He reaches out and slips a small vial into your hand. _Don't take my word for it. Try it for yourself. I'm sure you will want more._";
	text3 = "You decide not to ask about that stumbling mass of pitiful refugees outside.";
	code =
		if (gf(135,6) == 0) {
			sf(135,6,1);
			reward_give(225);
			}
			else rs(2);
	break;
	
begintalknode 40;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "What does the army think of your selling skribbane?";
	text1 = "_The officers tolerate us being here. Well, most of them do, anyway. They want to be rid of me. But they know that killing me will achieve nothing. In fact, it will make things worse._";

begintalknode 41;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Why?";
	text1 = "He smirks. _Look at the people who stay here in this ruin with me. Would you prefer that they be turned out to wander the Great Cave? They're much safer here, with me. It's better for all concerned._";

begintalknode 42;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "So all those people outside are just harmless refugees?";
	text1 = "_Refugees, yes. As you saw, some of them have weapons. Only to defend themselves against rogues and goons, of course._";
	text2 = "_And, perhaps, I pay some of them to protect me. Which is, I am sure you would agree, reasonable._";

begintalknode 43;
	state = 33;
	nextstate = 34;
	condition = gf(135,4) < 2;
	question = "Tell me about your troubles.";
	text1 = "_I am happy that you asked. It is rare, though not unknown, for soldiers to take interest in my troubles and do small favors for me. And they are well compensated, I assure you. Very well._";
	text2 = "_Does this intrigue you?_";

begintalknode 44;
	state = 34;
	nextstate = 30;
	condition = gf(135,4) == 0;
	question = "Sorry. Not interested.";
	text1 = "Chrysander gives a small shrug. _A loss for us all, I am sure. Do you want anything else?_";

begintalknode 45;
	state = 34;
	nextstate = 35;
	condition = 1;
	question = "I'm interested.";
	text1 = "_I am pleased. So, suppose your travels took you into the dark, wild tunnels west of Fort Remote. There is a band of thieves out there, hiding. Dishonorable louts, who stole something belonging to me._";
	text2 = "_Their leader's name is Tamas. Find them. And, when you do, tell them I know where they are. Then report back to me._";
	code = 
		set_flag(135,4,1);
		toggle_quest(85,1);
	break;

begintalknode 46;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "What did they steal?";
	text1 = "_Something I owned._";

begintalknode 47;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "Do you want me to recover what was stolen?";
	text1 = "_Oh, I'm sure it is long gone by now._";

begintalknode 48;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "That's all? Say you found them?";
	text1 = "_That is all I require. Yes. Simple work. Something you can do while simply walking by._";

begintalknode 49;
	state = 30;
	nextstate = -1;
	condition = gf(135,4) == 1 && gf(126,1) > 0;
	question = "I met Tamas. I had to destroy him.";
	text1 = "_Oh. I am so very sorry to hear it. He always was a jumpy sort. And eager to believe certain rumors about my reputation. Oh well. I apologize for the extra trouble. I will pay to compensate you._";
	text2 = "He gives you a generous pouch of coins and a beautiful pair of greaves. _You see? Those greaves are too bulky for me, so I give them to you._";
	text3 = "_I pay well those who aid me. Help me again, and the reward will be even better. Oh, and let me throw in some skribbane._ He does.";
	code = 
		set_flag(135,4,2);
		toggle_quest(85,3);
		award_party_xp(400,16);
		change_coins(500);
		reward_give(354);
		reward_give(225);
		reward_give(225);
	break;		

begintalknode 50;
	state = 30;
	nextstate = 36;
	condition = (gf(135,4) == 2 || gf(135,4) == 3) && gf(135,9) == 0;
	question = "You want me to do something else?";
	text1 = "_Yes. Something very simple. A delivery. Travel up to northern Avernum is very difficult these days. I need a small package taken to Silvar. To a woman named Xylia._";

begintalknode 51;
	state = 36;
	nextstate = -1;
	condition = gf(135,4) == 2;
	question = "A delivery? I don't think so.";
	text1 = "_Unfortunate. Well, if you will excuse me, much work to do. Good day._";
	action = END_TALK;

begintalknode 52;
	state = 36;
	nextstate = -1;
	condition = 1;
	question = "What is in the package?";
	text1 = "_I prefer those in my employ to not ask too many questions._";

begintalknode 53;
	state = 36;
	nextstate = 37;
	condition = 1;
	question = "I can do it.";
	text1 = "He leaves through the southern door. A few minutes later, he returns with a small package, about five pounds, wrapped in papyrus. He hands it to you.";
	text2 = "_Take what I have given you. Do not open it. Do not lose it. Go to Silvar, find Xylia, and hand it to her._";
	code =
		set_flag(135,4,3);
		toggle_quest(86,1);
		if (gf(135,7) == 0) {
			sf(135,7,1);
			set_spec_item(26,1);
			}
			else rs(2);
	break;
	
begintalknode 54;
	state = 37;
	nextstate = -1;
	condition = 1;
	question = "Anything else?";
	text1 = "_I am quite serious when I say you should not lose it. If you do, I will be annoyed. That includes letting other members of the army get their hands on it somehow._";

begintalknode 55;
	state = 30;
	nextstate = -1;
	condition = gf(135,4) == 3 && gf(135,9) > 0;
	question = "I delivered the package to Xylia.";
	text1 = "He claps his hands, pleased. _Excellent! I have been trying to get a package up there with no luck for months._";
	text2 = "He gives you a pouch of gold coins and a shield made of some sort of chitin. _I got that shield in trade. Very nice, but it doesn't lend itself to my talents. And let me toss in some skribbane._ He does.";
	text3 = "_I am most grateful for your help._";
	code = 
		set_flag(135,4,4);
		toggle_quest(86,3);
		award_party_xp(400,20);
		change_coins(1000);
		reward_give(135);
		reward_give(225);
		reward_give(225);
		reward_give(225);
		reward_give(225);
	break;		

begintalknode 56;
	state = 30;
	nextstate = -1;
	condition = gf(135,7) > 0 && gf(135,9) == 0 && has_spec_item(26) == 0;
	question = "I lost the package you gave me.";
	text1 = "He shakes his head. _I see. Most unfortunate. Especially for you. I have a reputation to uphold, you see. I can't let anyone think I would tolerate someone stealing from me._";
	text2 = "He leaps to his feet. In an instant, his blade is in his hands. _Nothing personal._";
	action = END_TALK;
	code =
		make_zone_hostile();
		sf(135,3,1);
	break;

begintalknode 57;
	state = 30;
	nextstate = -1;
	condition = gf(135,4) == 4;
	question = "Anything else I can do for you?";
	text1 = "_Hmmm. Not at this point. I don't like to use any one agent more than I have to, especially one with such high ... visibility as you._";
	text2 = "_Perhaps we should part ways for a time. Don't cause trouble for me, and I will not cause trouble for you._";

begintalknode 60;
	state = 30;
	nextstate = -1;
	condition = gf(135,5) > 0;
	question = "I'll just be going now.";
	text1 = "Chrysander nods, relieved. _I am always happy to meet someone who respects our right to live as we choose._";
	action = END_TALK;
	
//



////

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