// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(100,0) == 0;
	question = "special";
	text1 = "You enter an abandoned, mostly ruined complex. It was built a few decades ago and then sealed off. There are a few faded bloodstains, the signs of long-ago battles. Since then, cavequakes have been breaking the halls and chambers down.";
	text2 = "It is not abandoned, though. You listen carefully. There is something out there. You can hear faint movement and muttering. It would be nice if the mages who came down here to use the athame were still alive, but it's doubtful.";
	action = SET_SDF 100 0 1;


begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(100,2) == 0;
	question = "special";
	text1 = "Whoever originally built this place, they left some active magical traps behind. Some of them have decayed and lost their power, but not this one.";
	text2 = "When you get close, the crystals flash. A pack of snarling creatures appear between them. The beasts' long imprisonment has left them hungry and irritable.";
	action = SET_SDF 100 2 1;
	code =
		activate_hidden_group(32);
	break;
	
begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

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

begintalknode 6; // spell book
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This book has been back here for a very long time. The title reads, _Chants For a New Empire._ You flip through it, reading the militant and rather anti-Avernum songs within.";
	text2 = "One of the songs, in the back, is far older. It is a chant that, properly sung, can refresh the strength of all nearby allies. You study it closely. (Your skill with the spell Mass Healing increases greatly.)";
	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(100,3) == 0) {
			rs(3);
			if (get_stat_total(13) < 8)
				rs(2);
				else {
					rs(4);
					sf(100,3,1);
					alter_stat(30000,70,2);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 7; // athame
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several runes etched on the floor of this hallway. Delicate traceries are etched in the stone, waiting to be charged with magical power. If they had only been completed, the foes you have met would have been kept out.";
	text2 = "Alas, before that could be done, this woman was ambushed and killed. She lies next to a partial ward. She had been intently etching it when the horror you encountered pounced upon her. In moments, it froze her solid.";
	text3 = "There is a small, sharp blade held loosely in her hand, protruding from the ice. With care, you work it loose. It's a beautiful tool, razor sharp and very old. You wrap it up and place it in your pack.";
	code =
		if (gf(100,4) == 0) {
			sf(100,4,1);
			set_spec_item(7,1);
			}
			else rs(3);
	break;

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Loyalist Sepko shouts for help. You can hear shouts to the south. More warriors are coming to join the melee.";

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


//

begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The hallway around you grows very cold. There is a motion out of the corner of your eye. Several figures have come into view surrounding the pit. They are faint, insubstantial shadows, but they are becoming more solid every moment.";
	text2 = "You hear a long, angry moan from the ruined hall to the west. There is another ghost in there. Something about its presence reaches deep within your mind, filling you with terror. The fear makes you want to run back toward the forming specters.";
	text3 = "The specters by the pit seem strangely immobile. They don't seem to sense your presence. As long as you keep a safe distance from them, you might be able to keep them from detecting you.";
	text4 = "The ghost swoops toward you. You involuntarily take a step back. It reaches out its arms, aiming to steal your warmth.";

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

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

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

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

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

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

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

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

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

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

//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "There are several armed humans standing at this intersection. Their armor lacks any visible insignia, but their skin lacks the underworld pallor.";
	text2 = "They're from the surface. They've been down here for a while, but not enough to erase all of the signs. Their leader looks very unhappy to see you. He whips out his rapier and points it at you.";
	text3 = "_Of course. It makes sense that some worm would come poking around down here. Just how our luck has gone. I am Loyalist Sepko. This is an unhappy meeting, worm._";


begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Worm? What do you mean?";
	text1 = "_That is what you Avernites are. Worms. Worms with delusions of grandeur._";

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "How did you get in here?";
	text1 = "He smirks. _There is another route in, guarded by some pliable brigands. Offer a worm some rations and a few coins, and he'll go against his own kind in a moment._";

begintalknode 33;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "What are you doing here?";
	text1 = "_Investigating. Seeing if this place can be reclaimed. Exploring. Soon, it might be a good base. Once we rid ourselves of any inconvenient trespassers._";

begintalknode 34;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Where are you from?";
	text1 = "_I don't think that you need to know that. You won't live long enough for the knowledge to be useful._";

begintalknode 35;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "You're reclaiming this place? For whom?";
	text1 = "_We have been hiding in the wilderness for many years, always running, getting picked off, but some of us remain. Those who remember the true values. Who will rise up and bring purity to the world._";
	text2 = "That is all he says. He seems to feel he's given a suitable answer.";

begintalknode 36;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "I'm looking for an athame. A little magic dagger. Seen it?";
	text1 = "_What? Is this some trickery?_ He clearly has no idea what you're talking about.";

begintalknode 37;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "And I suppose you consider me to be a trespasser.";
	text1 = "He nods. _You are quick. Yes, we will kill you. And then we will clear out some pests. And then ..._";
	text2 = "Sepko stops speaking and looks over his shoulder. He looks concerned.";

begintalknode 38;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "(Attack while he is distracted.)";
	text1 = "You barely take a step before Sepko turns back to you. _You will not get the drop on us that easily._ He raises his blade. _We will ..._";
	text2 = "And then the still of the caverns is broken by a hideous screech, coming from the east. Sepko lets out a loud, angry oath. Your conversation has attracted some of the horrors of the tunnels. They are entering the main hall to investigate.";
	text3 = "He turns to you. _Well, I suppose we had better slay you now, so we will have time to arrange a defense._";
	action = END_TALK;

begintalknode 39;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "What is it?";
	text1 = "_I thought I ..._ he turns back to you. _It doesn't matter. Now I ..._";
	text2 = "And then the still of the caverns is broken by a hideous screech, coming from the east. Sepko lets out a loud, angry oath. Your conversation has attracted some of the horrors of the tunnels. They are entering the main hall to investigate.";
	text3 = "He turns to you. _Well, I suppose we had better slay you now, so we will have time to arrange a defense._";
	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 = "";
		