// dlg.txt

begintalkscript;

variables;

short i;


begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(79,0) == 0;
	question = "special";
	text1 = "As you explore the Eastern Gallery, you start to notice certain, unnerving signs. Scratches on the rocky floor. Bits of shed chitin. Gnaw marks on the trees.";
	text2 = "You are entering lands infested with chitrachs. These huge, vicious insects are a plague upon Avernum. They are quick to anger. They eat flesh. And they swarm.";
	text3 = "Normally, soldiers are able to keep their numbers in the Eastern Gallery under control. Alas, in times of crisis, they are needed elsewhere, and the chitrachs breed. Enthusiastically.";
	action = SET_SDF 79 0 1;


begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(65,0) == 0;
	question = "special";
	text1 = "You are close to a farmhouse, set in the north wall of the Eastern Gallery. There are two things that are unusual about it.";
	text2 = "First, it is still settled. There are people living here, seemingly oblivious to the ominous threat of the Slith Horde.";
	text3 = "Second, they seem to be growing. Muck, algae, green goo, you aren't sure what it is, but there are several troughs of it in front of the house. They look vile and smell worse, but the farmers seem to want them here.";
	action = SET_SDF 65 0 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(65,1) == 0;
	question = "special";
	text1 = "This was the secret workshop of a mage. The wizard is on the floor before you, dead. The fatal wounds were made, from the look of it, by spears. Two-tined spears.";
	text2 = "The inner chamber is still sealed off by a magical barrier. The murderers didn't have the ability to get through.";
	action = SET_SDF 65 1 1;

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

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is an old spellbook here. Mold and moisture have been having their way with it. The ink on the pages is runny and fading.";
	text2 = "You are surprised to find this is a prayer book, not a book of spells. Within these pages, you find a rare and powerful chant that can restore a spark of life to one who is near death. (Your skill with the spell Return Life 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(65,5) == 0) {
			rs(3);
			if (get_stat_total(13) < 7)
				rs(2);
				else {
					rs(4);
					sf(65,5,1);
					alter_stat(30000,76,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "With its maker dead, this sentinel's power is fading rapidly. It can barely move under its own power anymore.";

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  NIVEAU'S FARM";
	text3 = "  We're not going! Don't even try!";
	
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The farmers here watch you suspiciously. When you try to talk to them, they tell you that Goodwife Niveau speaks for them.";
	text3 = "The farmers are very grateful to you for your help with the chitrachs. They offer you ale and mushroom bread. As long as you don't try to convince them to leave, they're a friendly lot.";
	text5 = "The farmers are distraught about the death of Goodwife Niveau. They can barely bring themselves to talk.";
	code =
		clear_strings();
		if (gf(65,9) > 0)
			as(5);
			else if (gf(65,7) > 0)
				as(3);
				else as(1);
	break;
	
begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "As you turn to leave Niveau's farm, one of the farmers looks out the window. He points down the hill and shouts, _Chitrachs!_";
	text2 = "Sure enough, a swarm of them are heading up the hill, pincers flailing. They're heading straight for this farm.";


//

begintalknode 10; // Goodwife Niveau
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "You would expect, this close to danger, for a farmer to be happy to see an Avernite soldier. That is not the reception you get. When the aging woman who runs this farm sees you, the first words out of her mouth are, _We're not going!_";
	text2 = "She refuses to talk to you until you assure her that you haven't been sent to drive these people off of their land. Finally, they calm down and talk to you. You note that each and every one of them is armed.";
	text3 = "She says, _Sorry for the cold reception, but your lot hasn't been helping us. I'm Goodwife Niveau. This is our farm, and we're not going to leave. Not while we're close to making progress._";
	text5 = "Goodwife Niveau chats with you, but she is still suspicious. She frequently says, _And don't be trying to get us off this land. Not when we're making progress._";
	action = INTRO;
	code =
		sf(65,6,1);
	break;
	
begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "The soldiers have been trying to make you leave?";
	text1 = "_That's right. They say we can't stay here. As if we aren't smart enough to see how safe it is. They tried to drag us out like they did all the poor Cotrans. We refused to go._";

begintalknode 12;
	state = 10;
	nextstate = 12;
	condition = 1;
	question = "What are you making progress with?";
	text1 = "_The slime. We grow it in vats. It's disgusting and foul stuff, but it's food. You understand that? We think we can grow food!_";

begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = gf(65,7) == 0;
	question = "Have you had many problems with chitrachs?";
	text1 = "_Of course. They're everywhere, and they're spreading. Now ... Killing chitrachs. That's something useful you soldiers could be doing, instead of bothering us._";

begintalknode 14;
	state = 10;
	nextstate = -1;
	condition = gf(65,7) > 0;
	question = "Have you had many problems with chitrachs?";
	text1 = "She looks down at a fragment of chitrach leg from the recent attack. She picks it up and throws it into the fire.";
	text2 = "_I think you've seen the answer to that yourself. Oh, and thank you for your help._";

begintalknode 15;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Do you have anything to trade?";
	text1 = "_Not yet. Someday, we'll sell our food slime to anyone who wants it. For now, we need everything we have to feed and defend ourselves._";

begintalknode 16;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Are you sure you can defend yourself?";
	text1 = "_We have so far. We've killed six sliths and plenty of chitrachs. We're getting lots of practice._";
	text2 = "_And, now that the horde is without its leaders, I don't think they'll be sending out too many more raids._";
	code =
		if (gf(170,8) == 0)
			rs(2);
	break;
	
begintalknode 17;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "But why don't you go somewhere safer?";
	text1 = "She lets out a harsh laugh. _Are you joking? Haven't you heard? The Great Portal has been destroyed. There is nowhere safer! We hold back the sliths here, or we'll be able to hold them nowhere._";

begintalknode 18;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Is it difficult to grow?";
	text1 = "_Not really. Avernum has never had any trouble getting mold and slime to grow. The problem is stopping it. But I think we're the first people to try to grow it as a crop._";

begintalknode 19;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Do you eat it?";
	text1 = "_Some of it. Right now, we can't eat too much without getting sick. But, if we eat a little a day, we can keep from getting hungry._";
	text2 = "_We're trying to raise a sort that you can eat as much of as you want. Well, as much of as you need. I don't think you'll ever want it._";
	
begintalknode 20;
	state = 12;
	nextstate = 13;
	condition = gf(65,4) == 0;
	question = "Can I try some?";
	text1 = "Niveau seems thrilled. _Of course!_ She fetches a bowl of the greenish goop and gives you a taste.";
	text2 = "It's like all of the bad flavors and unhappy thoughts of the world have been poured into your mouth.";
	text3 = "Through application of great dedication and inner strength, you swallow.";
	text4 = "Goodwife Niveau says, _What do you think?_";
	action = SET_SDF 65 4 1;
	
begintalknode 21;
	state = 13;
	nextstate = 10;
	condition = 1;
	question = "Delicious!";
	text1 = "She laughs. _You're very kind, but I saw the look on your face. Still, it's food. Someday soon, that will be all that matters._";

begintalknode 22;
	state = 13;
	nextstate = 10;
	condition = 1;
	question = "Ghhhhhaaahhhhhhhrghhhhh.";
	text1 = "_Yeah. We know. We're working on it. But it is food._";

begintalknode 23;
	state = 12;
	nextstate = 10;
	condition = 1;
	question = "I would like to know something else.";
	text1 = "_Of course. Just as long as you don't try to trick us into leaving._";


//

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