// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(20,0) == 0;
	question = "special";
	text1 = "Although the human workers were driven out of these tunnels many months ago, the sour smell that still pervades this workshop is unmistakable.";
	text2 = "This was an alchemical lab. A large one, safely distant from any settlements, where the noxious and caustic chemicals needed for alchemy and magic could be safely produced in quantity.";
	text3 = "The floor is covered with slimy trails. Thin, moist, sluglike tracks. Caustic goo that has left the stone beneath it pitted and crumbling.";
	text4 = "In the absence of watchful alchemists, some of the goop they were working on is now moving about on its own.";
	action = SET_SDF 20 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(20,1) == 0;
	question = "special";
	text1 = "You keep a watchful eye open for tracks. Animal, humanoid, anything that would alert you to the presence of something besides slime in these tunnels.";
	text2 = "And you find something. Someone has been walking around here lately. Someone on two legs, wearing boots. Possibly human. Avernite slithzerikai sometimes wear boots, but the sliths of the horde rarely do.";
	action = SET_SDF 20 1 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(21,1) == 0;
	question = "special";
	text1 = "To the north, at the top of a gentle rise in a corner of this huge cavern, you can see an Avernite fortress. It is Fort Monastery, one of the newer and more remote of Avernum's outposts.";
	text2 = "And it has seen a lot of action lately. The walls are covered with cracks and blast marks. And yet, somehow, it still stands. This is one keep that has somehow managed to stand against the slithzerikai for months.";
	text3 = "But it is under siege. A huge slith force is camped around it. To get to its gates means fighting your way through an enormous horde. Warriors, mages, warlizards, even a summoned demon or two.";
	text4 = "If it is possible to enter Fort Monastery, it won't be through the front door.";
	action = SET_SDF 21 1 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(20,2) == 0;
	question = "special";
	text1 = "You enter the lower level of the workshop. The air is stale and smells strongly of vinegar. Your eyes and nostrils start to burn, but you can still breathe. Barely.";
	text2 = "You stop moving and listen carefully. Someone is talking not far ahead. Quiet, sibilant voices.";
	action = SET_SDF 20 2 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(20,3) == 0;
	question = "special";
	text1 = "As you round the corner, something happens in the cavern ahead. A lone figure steps out of the shadows. He turns, looks at you, and waves you forward.";
	text2 = "And then several armed figures, muscular and reptilian, rush out of the far passage. They charge the first figure with vicious intent. It is an ambush and, had you arrived a minute later, the victim would surely have been doomed.";
	action = SET_SDF 20 3 1;
	code =
		activate_hidden_group(19);
		set_level(2203,25);
		set_name(2203,"Sage Savara");
		set_name(2204,"Horde Tunnel Hunter");
		set_name(2205,"Horde Tunnel Hunter");
		set_name(2206,"Horde Tunnel Hunter");
		set_name(2207,"Horde Tunnel Hunter");
		
	break;
	
begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 7; // spellbook
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "When the humans evacuated this workshop in the face of the slithzerikai invasion, this spellbook was left behind. The magical barrier kept damaging moisture out, but that doesn't make the peculiar script within easier to decipher.";
	text2 = "Happy, you are able to comprehend one relatively simple spell. All it does it summon forth fire. Lots and lots and lots of fire. (Your skill with the spell Fireblast 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(20,9) == 0) {
			rs(3);
			if (get_stat_total(13) < 10)
				rs(2);
				else {
					rs(4);
					sf(20,9,1);
					alter_stat(30000,56,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several large rats out on this battlefield, scavenging. They shy away from you. They aren't interested in prey that can fight back.";

begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This scuttler has been paralyzed and mummified in webbing. The spiders may be dangerous, but they do a good job of ridding the caves of noxious pests.";


// Scout Savara

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "This man is clearly shaken by the ambush. He leans against the wall and trembles uncontrollably. He's been down here for a long time. He wears the robes of a mage, though they are so stained by slime and mold that it's hard to tell.";
	text2 = "After a minute, you calm him down slightly. He mutters, _I was never meant for this life. I am no battle mage. I have been as heroic as I dare. I am going. Today. I will stay here no more._";
	text3 = "You try to calm him down a bit more. He finally looks you in the eye. _I ... I thank you. I ... I am Sage Savara. It has been difficult here. I am grateful. But I am leaving._";
	text5 = "Sage Savara looks around the tunnels, trying to decide how best to sneak out. _Now that you are here, I can go. You might think me a coward, but I have done enough. I assure you._";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Where are you from?";
	text1 = "_From here. I worked here. When the other sages were evacuated, I said I would stay. The sliths have hunted me, and I thought my skills would keep me hidden. Until now, they have._";

begintalknode 12;
	state = 10;
	nextstate = 12;
	condition = 1;
	question = "What are you doing down here?";
	text1 = "_I am trying to help Fort Monastery. I have been working on keeping a secret way into the fort clear. But they don't want my help._";
	text2 = "_I don't fight. That is not what I can do. I just support the fort._";
	
begintalknode 13;
	state = 10;
	nextstate = 13;
	condition = gf(6,1) == 0;
	question = "Tell me about these tunnels.";
	text1 = "_The passages to the south are full of horrors. I don't go down there. I can't tell you more about them._";
	text2 = "_To the north, I have kept open a small, hidden passage into Fort Monastery. But I don't think that will last long. If you want to enter the fort, you will have to hurry._";

begintalknode 14;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What did you do here?";
	text1 = "_I grew algae. That is all. I am no warrior. All I fight is fungus._ He laughs hysterically.";

begintalknode 15;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Why did you stay?";
	text1 = "_Love of Avernum? Desire for adventure? Idiocy? I think I wanted to help Fort Monastery. But the sliths, they came so fast. I didn't have time to rethink the decision._";

begintalknode 16;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "How did you hide?";
	text1 = "_My spells help me blend into the shadows. To be quiet. To keep myself in the tiniest cracks. It was all right until some slith realized I was down here. Then they started hunting me in earnest, and I couldn't ..._";
	text2 = "He looks down at the bodies. _Well, you saw what happened._";

begintalknode 17;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Don't want your help? What do you mean?";
	text1 = "_I'm trying to help them escape, and all they want is to stay and fight! They're mad!_";

begintalknode 18;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "How have you been working on the tunnel?";
	text1 = "_I can command stone servants. We had several of them, to move around noxious mixtures. I put them to work on a different task._";

begintalknode 19;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "How are conditions in the fort?";
	text1 = "_Poor, but they survive. I have found and foraged food for them. If they are determined to die there, I at least could keep them from starving. But no more. I am done. I can't survive here now._";
	
begintalknode 20;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "How can I enter Fort Monastery?";
	text1 = "_Go north until you see the stone servants. Then search the walls for hidden buttons. Use the middle one. The other two lead to traps._";
	text2 = "_I worked with the mage inside the fort to make the defenses. They have worked this far, but not for long._";

begintalknode 21;
	state = 13;
	nextstate = 14;
	condition = 1;
	question = "Why do I have to hurry?";
	text1 = "_The horde knows that I have been down here. Soon, these passages will be full of the enemy. Then it is only a matter of time until they find the passage into the fort._";

begintalknode 22;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "And then?";
	text1 = "_Then the Avernites in the fort will collapse the passage, and they will be truly trapped._";
	text2 = "";

begintalknode 23;
	state = 10;
	nextstate = -1;
	condition = gf(6,1) > 0;
	question = "The siege on the fort has been lifted.";
	text1 = "_Is that true? Then I can leave with a clear conscience. Thank you for telling me._";

begintalknode 24;
	state = 10;
	nextstate = -1;
	condition = gf(6,1) == 0;
	question = "You are really going to leave?";
	text1 = "_I am. I have no choice. Soon, the warriors of the enemy will flood into these tunnels, hunting for me and for a secret way into Fort Monastery._";
	text2 = "_I can do nothing more here. I must go._";

begintalknode 25;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "I'll be moving on now.";
	text1 = "Sage Savara nods. _I thank you for saving my life. I hope, one day, to meet you again. Assuming, of course, that my powers conceal me as I return to safety. Farewell._";
	action = END_TALK;


//

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 295;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You look around, hunting for another warrior of the horde to fight. The ground is slick with blood. You have to struggle to keep your balance. There are no enemies in sight. You search the smoke, sure that a foe must be lurking out there.";
	text2 = "But there are no enemies left. The siege has been lifted. Fort Monastery is free.";
	text3 = "Of course, you have only succeeded in saving a quiet, abandoned ruin. But you have killed a lot of the enemy. The Castle will at least be happy to hear of that.";
	text4 = "A weak cheer rises from the ramparts of Fort Monastery. It has been a long, painful siege, and they have suffered agonizing losses. But, at last, they are free.";
	code =
		rs(3); rs(4);
		if (gf(6,9) > 0)
			as(3);
			else if (gf(6,2) == 0)
				as(4);
	break;
	
	
////

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