// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(113,0) == 0;
	question = "special";
	text1 = "There are several rows of mushrooms hidden in this cave, growing happily, free of the Blight. Not many, just enough to sustain a small farm.";
	action = SET_SDF 113 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(113,1) == 0;
	question = "special";
	text1 = "When you enter this tunnel, you are hit with a powerful, medicinal smell. Someone is growing herbs down here. Small pots of leafy green plants. The leaves are then trimmed, chopped, and put into the stone vats.";
	text2 = "That explains the violent reception you received. Skribbane growers are a notoriously touchy and violent lot. Or, at least, they are when they eat their own product.";
	action = SET_SDF 113 1 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(113,2) == 0;
	question = "special";
	text1 = "You enter the remains of an old brewery. Many a barrel of Avernum's trademark vile mushroom ale has emerged from this abandoned building.";
	text2 = "Or maybe it's not abandoned. You hear the faint echoes of shrill, high-pitched cackling coming from the stairway.";
	action = SET_SDF 113 2 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Vanessa has an old book of rituals stored back here. Very old. The leather cover is cracked and faded, and many of the pages have begun to crumble, unable to indefinitely hold the power stored within.";
	text2 = "You learn, from one of the more intact sections, a powerful chant. It can be used to regenerate and revive all nearby wounded allies. (Your skill with the spell Mass Healing increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "You browse through the book, but you can't understand any of it. You don't know enough magical lore. (Improve your Arcane Lore skill to understand books like these.)";
	code =
		if (gf(113,4) == 0) {
			rs(3);
			if (get_stat_total(13) < 6)
				rs(2);
				else {
					rs(4);
					sf(113,4,1);
					alter_stat(30000,70,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Surprisingly, there are a few goblins working at this shop. They sweep, carry stuff around, and watch for intruders. They are all armed.";
	text2 = "When you try to speak with them, they mutter something unintelligible, bow their heads, and shuffle past. Tame, but still dumb.";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several farmers here, tending to their fruit trees and trying to salvage some of their twisted, blighted crops. It's a pitiful sight.";
	text2 = "You talk to them a short time. They tell you to watch out for bandits, but they don't have anything else useful to say.";
	text3 = "You talk to them a short time. They thank you profusely for killing the nephilim bandits.";
	code =
		if (gf(127,1) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are three armed people sitting quietly around this fire. They look very thin. You notice that one of them is constantly wiping his mouth with his sleeve.";
	text2 = "You try to talk to them, but they ignore you. They completely ignore you, as if you weren't there. Odd. Eventually, you leave.";

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

	
begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  Dharmon, The Castle - Southeast";
	text3 = "  Fort Saffron - North";
	text4 = "  Patrick's Tower - Southeast";
	text5 = "  Fort Remote - South";	

// vanessa

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "This old, crumbling shop looks like it dates back to the earliest days of Avernum. And most of the wares being sold here are of a comparable age. There is a lot of dust. The sneezing begins almost immediately.";
	text2 = "The mold and decay don't seem to bother the shopkeeper. She is a young, cheery woman with two wands hanging from her belt. You don't have to wonder how she defends herself out here.";
	text3 = "_Ahhh ... Welcome, soldier! Welcome to Shaynee's Retreat, oldest continuously functioning trading post in all of Avernum. At least, I think it is. Whatever your adventuring needs, I have something that can help you._";
	text5 = "Vanessa smiles and wipes a smudge of grime off her cheek with her sleeve. (This only makes the smudge larger.) _How else can I help you, brave warrior of Avernum?_";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Tell me about Shaynee's Retreat.";
	text1 = "_As I said, it is an old, proud institution, oldest continuously operating trading post in all of Avernum. Founded by Shaynee, in ... well, a long time ago._";
	text2 = "_We have had a lot of tourist trade here. Visitors staying in the Fissure Post often stop by to pick up a souvenir of old Avernum. A lot less of that now, of course._";

begintalknode 12;
	state = 10;
	nextstate = 13;
	condition = 1;
	question = "Isn't it dangerous out here?";
	text1 = "_Oh, yes! It would be worse if I had a lot of food. But, as you can see, I don't._ She is, indeed, very thin. _But there are brigands and skribbane eaters and folks who are simply desperate._";
	text2 = "_Fortunately, I can defend myself._";
	
begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Let me see your wares.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Shaynee's Retreat",
		  "Shaynee's Retreat has an amazing collection of junk for sale. And yet, surprisingly, some of it looks useful.",
		  30,3,0);	
	break;
begintalknode 14;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Can I sell something to you?";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode 15;
	state = 10;
	nextstate = 15;
	condition = gf(113,11) == 0;
	question = "Anything unusual for sale? For, say, the distinguished adventurer?";
	text1 = "_Well, I could let you into my private showroom. There's an old spellbook in there. You could flip through it. I generally charge five hundred coins for access to it. And nobody has ever felt robbed._";
	text2 = "_Let me know if you are interested._";

begintalknode 16;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Who was Shaynee?";
	text1 = "_My grandmother, rest her soul. One of the pioneers of old Avernum. Wise old woman, and sharp at business. I try to take after her._";

begintalknode 17;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What would someone from the Empire want here?";
	text1 = "_History! A piece of history! Take a dagger, say it was used in the Empire War to stab someone or other, and the surfacers will give fifty coins for it!_";
	text2 = "_Not that I would do such a thing to a fellow Avernite, of course._ Of course.";

begintalknode 18;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "Where do you get your wares?";
	text1 = "_From everyone who stops by with something to sell. Adventurers. Refugees. Miners._";

begintalknode 19;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Bandits?";
	text1 = "She looks annoyed. _I do my best not to fence stolen goods. I am an honest woman. But, of course, I can't tell where everything in the world came from, can I?_";
	
begintalknode 20;
	state = 12;
	nextstate = 10;
	condition = 1;
	question = "I'd like to know something else.";
	text1 = "_But of course!_";

begintalknode 21;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "What do you know about the skribbane trade?";
	text1 = "_Little. It's dangerous to know too much about it. It took root in the Great Cave during the chaos after the Slith Horde came. It will be desperately hard to get rid of the stuff, I think._";
	text2 = "_Beware that foul herb. It has benefits, true, but it exacts a vicious price for them._";

begintalknode 22;
	state = 13;
	nextstate = 14;
	condition = 1;
	question = "How do you defend yourself?";
	text1 = "_Well, I have these ..._ She pats the wands on her belt. _Fully charged. And I have my goblin guards. The bandits know that it wouldn't be worth the risk to fight me._";

begintalknode 23;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "You have goblins here?";
	text1 = "_Oh, yes. They work for me. They respond well to a strong, firm leader. I feed them and treat them kindly, and they're loyal enough. Not that I don't lock the door when I sleep, of course._";

begintalknode 24;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "That is all I need.";
	text1 = "_That is unfortunate. It was nice to have civilized conversation. The goblins ... Not good talkers, I'm afraid. Hope to see you again._";
	action = END_TALK;
	
begintalknode 25;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "What is in the spellbook?";
	text1 = "_I have no idea. I can't read magicese._";	
	
begintalknode 26;
	state = 15;
	nextstate = 10;
	condition = coins_amount() >= 500;
	question = "All right. I'm in. (Pay 500 coins.)";
	text1 = "You count out the coins. Vanessa unlocks the northern door. _Thank you. Enjoy! Oh, and stay away from the case. It's got a little trap on it._";	
	action = SET_SDF 113 11 1;
	code =
		change_coins(-500);
	break;
	
begintalknode 27;
	state = 15;
	nextstate = 10;
	condition = 1;
	question = "No, thank you.";
	text1 = "_Pity. It's a really nice spell book. It's bound in leather and everything!_";	

	
// Dragan

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "Though this man is an old farmer, you can immediately tell that he was once something else. Blades hang from his walls, and he is still very strong and light on his feet. He once fought for a living.";
	text2 = "He is standing by the fire, trying to keep warm. In the flickering light, you easily see the gray streaks in his hair. He looks up at you with annoyance. _Ah, the soldiers. Always coming in without knocking._";
	text3 = "_Can't complain too much, I suppose. I was the same way. I'm Dragan, and I like my privacy. Ask what you have to, and move on._";
	text5 = "Dragan only seems more irritated the longer you stay around. _Sorry, warrior. I mean no disrespect, but it's about time for you to move on. Say your piece._";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Tell me about your farm.";
	text1 = "_My farm? A miserable ruin. Nothing left here. All the money I saved to buy this plot, wasted. Now I just wait._";

begintalknode 32;
	state = 30;
	nextstate = 32;
	condition = 1;
	question = "Were you a warrior once?";
	text1 = "He nods. _Aye._ He doesn't elaborate.";

begintalknode 33;
	state = 31;
	nextstate = -1;
	condition = gf(113,0) > 0;
	question = "I saw the mushrooms you have downstairs.";
	text1 = "_What? You were snooping around down there? Well, you saw that there's only enough down there to feed a few people around here. I'm not a hoarder._";
	text2 = "_Now get out of my home._ He turns away.";
	action = END_TALK;

begintalknode 34;
	state = 30;
	nextstate = 33;
	condition = gf(127,1) == 0 && get_quest_status(166) == 2;
	question = "I'm hunting for the bandit nephilim.";
	text1 = "That gets his attention. He looks up at you, surprised. _You are, eh? About time Dharmon noticed our plight. Aznavour talks about how law and order he is, but ..._ He shakes his head. _Never mind._";
	text2 = "_Yeah, there are nephilim. A bunch of them. I've fended them off so far, but they'll only be scared of my bluffs for so long._";

begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = gf(127,1) > 0;
	question = "The nephilim bandits are dead.";
	text1 = "You tell Dragan the tale. He nods, impressed. _I couldn't have done better in my prime. Thanks, soldier. You should go back to Dharmon. Sure they have a bounty waiting for you._";
	text2 = "_I'd pay you myself, but these are hard days for me. Sorry._";

begintalknode 36;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "What are you waiting for?";
	text1 = "He shrugs. _A change. I'd go out and fight myself, but those days are past for me._";

begintalknode 37;
	state = 31;
	nextstate = -1;
	condition = party_has_item(191);
	question = "Would you like a bag of meal?";
	text1 = "He is annoyed. _I don't take charity, and I'm not starving. Give it to some desperate refugee, not me._";

begintalknode 38;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Tell me more?";
	text1 = "_Those were hard days, the Time of Shades. Everything warped, everyone driven mad. I did what I could to help Avernum. I have nothing to apologize for. And I don't like to think about it._";
	text2 = "He silently stares into the fire.";
	
begintalknode 39;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "You scare them off?";
	text1 = "He looks up at the crossed blades on the wall. _Bandits are usually cowards. They don't want to die for the coins they steal. I faced off with them, and they backed down._";
	text2 = "_But they'll tire of me soon enough, and then I die. I need someone young to hunt them down._";

begintalknode 40;
	state = 33;
	nextstate = 34;
	condition = 1;
	question = "Where are they?";
	text1 = "_I don't know. Somewhere south, probably under our feet. There's only one thing I can tell you._";

begintalknode 41;
	state = 34;
	nextstate = 35;
	condition = 1;
	question = "Yes?";
	text1 = "_The last time they came, I got suited up and went out with my blade and I chased them. I know. Foolishness on my part. But those kitties, they're fast. They ran._";
	text2 = "_But they had a goblin with them. It was slower. I almost caught it, but it ducked into an abandoned mine not far south of here._";
	code =	
		sf(113,3,1);
	break;
	
begintalknode 42;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "And then?";
	text1 = "_I was angry, but not angry enough to follow the thing into that hole. I came back home. But who knows? Maybe some of them are hidden down there. That's all I can tell you._";

begintalknode 43;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Good day to you.";
	text1 = "He nods, grunts, and turns back to the fire.";
	action = END_TALK;

	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

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

	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 57;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 58;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

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

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

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

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

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

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

////

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