// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(117,0) == 0;
	question = "special";
	text1 = "You are on the border of a marshy forest. Cavewood trees grow in thick clumps, ready to be harvested for wood. This species was created by wizards in the early days of Avernum.";
	text2 = "Fortunately, the Blight doesn't affect them. You might be about to starve to death, but you won't lack for firewood.";
	text3 = "The branches of the twisted, gnarled trees are festooned with thick clumps of web. The forest must be infested with spiders.";
	action = SET_SDF 117 0 1;


begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  CASE - WOODSMAN";

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

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You meet Neko, the woodsman's wife. Although her muscular arms and rough hands tell you that she has spent her fair share of time working in the woods.";
	text2 = "She sets out some lichen tea and speaks with you cordially, trading news of events in the Great Cave and beyond. Their home is remote, and she is eager to have a few minutes of civilized conversation.";

//

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "You meet a woodsman, seemingly the only one left in this forest. He is a short, gruff man. A hatchet hangs from his belt, and you suspect that it's been used on more than trees.";
	text2 = "He shakes your hand (with a punishingly tight grip) and says, _I'm Case. Welcome to my home. I hope you're here to help me. I've been asking Dharmon to send a soldier for weeks._ It takes an effort to get him to let go of your hand.";
	text5 = "Case grumbles, _You're still here? Don't you have fighting to do for Avernum? I'd think you'd be busy._";
	text6 = "_Or maybe you can help with my problem. That is what I pay taxes for, starvation or not._";
	action = INTRO;
	code =
		if (gf(117,6) > 0)
			rs(6);
	break;
	
begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = gf(117,6) == 0;
	question = "I'm too busy to help you.";
	text1 = "_What? Are you just here to taunt me? Well, I guess I'm too busy to talk to you. How about that. Be moving on, soldier._";
	action = END_TALK;

begintalknode 12;
	state = 10;
	nextstate = 11;
	condition = gf(117,6) < 2;
	question = "You need help with something?";
	text1 = "_I do. There's a slime in the middle of my forest. Just one, but you know how it works. One day there's one. The next day there's ten._";
	text2 = "_I tried to get rid of it myself, but it was too much for me. Need you to go burn it out. And you should probably hurry._";
	code = 
		set_flag(117,6,1);
		toggle_quest(71,1);
		mark_quest_dest(345,544,0,71);
	break;
	
begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = gf(117,6) == 1 && gf(117,5) > 0;
	question = "I destroyed that pesky slime.";
	text1 = "_And all the bits of it?_ You nod. _And all the bits that fell off of those bits?_ You nod. _Well, I'll be going down there to build a big fire, just to be sure._";
	text2 = "You stare at him pointedly, hoping for a reward. You are disappointed. _Why you gawking at me like that? I'm poor! You want me to pay you for doing your job?_";
	text3 = "_Doesn't the Castle have a quartermaster? Isn't that where you get paid? Go pester him!_ Then he thinks. _But I suppose, before you go, I can sell you some things I found in the woods. I'll give you a fair price, too._";
	code = 
		set_flag(117,6,2);
		toggle_quest(71,3);
		award_party_xp(400,12);
	break;	
	
begintalknode 14;
	state = 10;
	nextstate = 13;
	condition = gf(117,6) > 0;
	question = "Tell me about these woods.";
	text1 = "_Not much to tell. This is one of the best patches in all of southern Avernum for growing cavewood. There are some problems with pests, sure, but overall it's a good place to work._";

begintalknode 15;
	state = 10;
	nextstate = 12;
	condition = gf(117,6) > 0;
	question = "Where are the other woodsmen?";
	text1 = "_Gone. To the Great Portal, most of them. To try to get out of the Underworld. Futile, if you ask me._";

begintalknode 16;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Where is this slime?";
	text1 = "He points to the north. _In the middle of the woods. Look for a hole in the ground. That's where it is._";

begintalknode 17;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Why couldn't you kill it?";
	text1 = "_Because I'd chop a chunk off of it, then that glob would start moving around and chasing me. I chopped it, and it split in two. I ran away, and I think the thing sucked back in all its bits._";
	text2 = "_If I'd kept hacking at it, it would have swarmed me. So that's why I called for you._";

begintalknode 18;
	state = 10;
	nextstate = -1;
	condition = gf(117,6) > 1;
	question = "Anything you can sell me?";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Case's Home",
		  "Case is happy to sell you the products of his forest. And an odd item or two he found while wandering around.",
		  17,2,0);	
	break;

begintalknode 19;
	state = 10;
	nextstate = -1;
	condition = gf(117,6) > 0;
	question = "Good day.";
	text1 = "He nods. _Safe travels to you._";
	text2 = "_And don't forget to kill that slime!_";
	action = END_TALK;
	code =
		if (gf(117,6) > 1)
			rs(2);
	break;
begintalknode 20;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Why is it futile?";
	text1 = "_Because too many people are trying to use it. The odds in the lottery are no odds at all._";
	text2 = "_Well, there's no portal there anymore, is there?_";
	text3 = "_And someone has to stay back here and grow things and keep us all alive, am I right? If they had any sense of duty, they'd still be here._";
	code =
		if (gf(170,1) < 12)
			rs(2);
			else rs(1);
	break;
	
begintalknode 21;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Why does cavewood grow so well here?";
	text1 = "_How should I know? Do I look like a ... ground ... expert ... guy? They grow here. I cut them. That's my life._";

begintalknode 22;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Any problems with brigands?";
	text1 = "_No. They know we got no food. We had to butcher our last lizard a few weeks ago. Now we live on the occasional piece of fruit a tree drops. And there's not much of that._";

begintalknode 23;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Aren't you worried about the spiders?";
	text1 = "_What? Those things? Nah! They're more scared of you than you are of them._";


//

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

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

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

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

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

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

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

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

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

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

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

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

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

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

begintalknode 44;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
//

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 = "";
		