// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(122,2) == 0;
	question = "special";
	text1 = "You emerge from one of the Honeycomb's twisted, disorienting tunnels and find yourself standing before a pair of huge, steel gates. They are very old, covered with cracks and thick patches of lichen, but they are still very sturdy.";
	text2 = "The gates are surrounded by statues and wall carvings, all depicting demons, dragons, and long, sinuous reptiles. It would be lovely if this place wasn't so ominous.";
	text3 = "You look at the gates, trying to see a way through. Whoever built them made them to last. You won't be able to get into here from the Honeycomb. You will have to find a way in somewhere else.";
	text4 = "As you stare at them, several twisted wolf creatures walk up to them. They open slightly, the wolves slip under, and the gates slam shut again. This must be the source of the horrors plaguing the Mertis and the Honeycomb.";
	text5 = "As you stare at the gates, several twisted wolf creatures run through them. This must be the source of the horrors plaguing Mertis and the Honeycomb.";
	action = SET_SDF 122 2 1;
	code =
		if (gf(122,20) == 0) 
			rs(5);
			else rs(4);
		activate_hidden_group(43);
	break;
	
begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(122,3) == 0;
	question = "special";
	text1 = "You hear a shrill howling sound, echoing out of the tunnel to the north. As you try to see what is causing the unnerving sound, you also hear many feet striking the stone floor, as if several creatures have leapt down from above.";
	action = SET_SDF 122 3 1;
	code =
		activate_hidden_group(44);
	break;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(122,4) == 0;
	question = "special";
	text1 = "You pass through the Dragon Gate. On the other side, you find a wide, airy gallery, full of trees, moss, and the heavy smell of decay.";
	text2 = "Many sets of tracks criss-cross the scum on the floor, testifying to the multitudes of beasts born and raised here. None of those creatures are visible now.";
	text3 = "However, in the mists to the west, you can hear them. Many fierce, howling, hungry beasts. Something temporarily holds them in check. They aren't far ahead. This is a very dangerous area.";
	action = SET_SDF 122 4 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(122,5) == 0;
	question = "special";
	text1 = "These low tunnels are much quieter and cooler. The smells of dust and rot are heavy in the air. And there is magic, too. Motes of light float all around you, and your hair starts to stand slightly on end.";
	text2 = "There is a magic circle in the center of this room. The stone in the middle is worn slightly, as if someone spent many hours standing there. It is currently dark and empty. The power you feel comes from elsewhere.";
	text3 = "The energy in the air is thick and oppressive. Whatever lurks down here, it is an extremely dangerous foe.";
	action = SET_SDF 122 5 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(122,6) == 0;
	question = "special";
	text1 = "This tunnel is choked with rubble and debris. It doesn't look like anyone has been here for a long time. Climbing up over the heaps of jagged rocks is very time-consuming.";
	text2 = "And, perhaps, dangerous. As you near the top, you see heaps of jumbled bones. Well, bone fragments. Someone has smashed them to bits. You have no idea what creature they come from.";
	text3 = "Farther back, you think you can see something moving in the shadows. Something very slow and very large.";
	action = SET_SDF 122 6 1;



//

begintalknode 10; // wheel
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a large wheel here. A chain has been wrapped around it several times and then disappears into a hole in the ground. With some effort, you are able to turn it.";
	text2 = "You hear, through the windows to the south, the sound of steel grinding across stone. After two revolutions, the wheel refuses to turn anymore. It is stuck.";
	text3 = "You try to turn the wheel, but it is still stuck. The mechanism is jammed.";
	code =
		if (gf(122,20) == 0) {
			rs(3);
			sf(122,20,1);
			}
			else {
				rs(1); rs(2);
				}
	break;

begintalknode 11; // spellbook
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This spellbook belonged to Hirickis. Most of the rituals within involve ways to summon and mold creatures gradually, far slower than would be useful to you in a dungeon situation.";
	text2 = "However, one spell, used to clean away failed experiments quickly and efficiently, seems very helpful. (Your skill with the spell Arcane Blow 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(122,18) == 0) {
			rs(3);
			if (get_stat_total(13) < 14)
				rs(2);
				else {
					rs(4);
					sf(122,18,1);
					alter_stat(30000,59,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = gf(122,10) == 0;
	question = "special";
	text1 = "The howling and hissing in the shadows suddenly grows much louder. The creatures in the mists respond to your incursion in the time-honored way of monsters everywhere.";
	text2 = "Several large, muscular forms are lurching through the mists toward you. They are very fast, and their fangs gleam white in the dim light.";
	text3 = "Another form, larger and slower, follows them through the mist. It stalks you on four legs, supervising the attack.";
	code =
	break;
	action = SET_SDF 122 10 1;
	code =
		activate_hidden_group(45);
	break;
	
begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = gf(122,11) == 0;
	question = "special";
	text1 = "As you progress through this tangled, slimy jungle, you hear hissing. A horde of reptilian horrors advance out of the mist.";
	action = SET_SDF 122 11 1;
	code =
		activate_hidden_group(46);
	break;

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = gf(122,12) == 0;
	question = "special";
	text1 = "Another wave of beasts runs out of the tunnel to the west. These creatures are bricks of solid muscle, hurtling toward you on four legs. Their jaws look like they could grind granite into powder without effort.";
	action = SET_SDF 122 12 1;
	code =
		activate_hidden_group(47);
	break;

begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Kazass-Hrros collapses and dies. Avernum now has one fewer of these majestic, powerful, and very dangerous creatures.";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Hirickis starts to waver under the force of your attacks. _You are skilled. I admit it. But I have learned my own tricks in my years in the wilderness. I ..._ A nimbus of light starts to surround him.";
	text2 = "_Oh. I thought I would have more time to taunt ..._ And with a flash of light, he disappears.";

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Once again, Hirickis is surrounded by a nimbus of light. _You see? Again, I am pulled to safety. Soon, I will make new servants to harry you._ And he disappears.";

begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Once again, Hirickis is surrounded by a nimbus of light. _It is time to do you the honor of a proper fight. Follow me. Follow me into my inner sanctum. You must earn the right to kill me!_";

begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "At last, Hirickis's long, mad journey is at an end. His ancient, withered body collapses to the ground. The glow of the circle of runes at his feet fades away.";
	text2 = "At the end, he is tempted to beg for his life, but, with great effort, he keeps his mouth closed. He closes his eyes and expires.";
	text3 = "You see that he has a key on a thong around his neck. You take it.";

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

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

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

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

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

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

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

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

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

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

//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "The waves of creatures attacking you have been driven and directed by a huge drake. These greedy, malevolent creatures are rare in Avernum these days. Humanity has mostly driven them into the lower tunnels.";
	text2 = "This old, withered specimen, however, has not been scared away. It is a bitter, angry, vengeful creature.";
	text3 = "_Ahssss,_ it hisses over the roar of battle. _I am Kazass-Hrros, and I will not be driven from here! We will continue to plague you humans. I will have my revenge!_";

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "You and who will plague Avernum?";
	text1 = "_Ahssss! I and the wizard. The mighty wizard below! We will not be defeated. We will hound you out together!_";

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "What do you want revenge for?";
	text1 = "_Your kind, your Avernum, you slew the drakes. You slew the dragons. It is good that we fight here, in what was once the home of the mighty dragon Athron. A good place to take my revenge!_";

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Is there no way I can pay to you leave me be?";
	text1 = "The drake actually stops for a moment to think about this. _Hssss. Tribute for my hoard? I will always accept tribute for my hoard._";
	text2 = "He shakes his head. _But no. The wizard brings me plenty to buy my servicesss. And, when you are dead, your goodsss will make my hoard mightier still._";

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Please spare me. I'll be going now. (Flee.)";
	text1 = "_Hssss! Too late! I will have your thingsss for my own! Your valuablesss will line my nest!_ The drake lunges after you.";
	action = END_TALK;
	
begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Avernum is about to have one less drake. (Attack.)";
	text1 = "Kazass-Hrros prepares to meet your charge. _I do not fear you! Ahssss! Keep my chosen lair or die! Those are the only choicesss for me now!_";
	action = END_TALK;

	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "You finally find someone in these quiet, grim catacombs. And you soon wish you hadn't.";
	text2 = "He is a wizard, standing in the middle of this circle. A translucent field of energy extends up from the runes on the floor, protecting him and holding him upright. He's old enough that he needs the help.";
	text3 = "When he sees you, he lets out a long, tired sigh. _Soldiers. Always soldiers, invading the home of Hirickis. Never leaving me alone. Never letting me do my work. Always driving me away._";

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Who are you?";
	text1 = "_Hirickis! The mighty wizard Hirickis! Founder of a new Empire! If only you peons would leave me alone for five minutes!_";
	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "You have fought Avernite soldiers before?";
	text1 = "_Avernite soldiers. Empire soldiers. There is nobody who won't pester mighty Hirickis._ He holds up his arms. The withered skin bears many burns and scars.";
	text2 = "_But always I escape. Always leave to try again. But no longer!_";
	
begintalknode 53;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "What are you trying to do here?";
	text1 = "_Only a simple thing. Only good, honest work for a wizard._";
	
begintalknode 54;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "Which is?";
	text1 = "_I am creating hordes of deadly monsters, in order to drive out lesser beings and create a new, mighty Empire. With me at the head. Forever._";
	text2 = "_A simple, reasonable thing, easy to complete. It is what is due for one of my skills. But you lesser beings keep trying to drive me away._";
	
begintalknode 55;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "And you have tried this before?";
	text1 = "_Of course. Each time, on a larger scale. And always someone comes to drive me away. I always escape, through careful negotiation. And crass bribery. I admit it._";
	text2 = "_But now ..._ He looks down at his withered hands. _I just don't know._";
	
begintalknode 56;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "Well, could you maybe stop creating so many monsters?";
	text1 = "_Of course not. You lesser beings, with your stubborn independent streaks, keep refusing me my due. I will not stop trying to claim the utter mastery I deserve!_";
	
begintalknode 57;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "I think I've seen enough. I'll be going.";
	text1 = "Hirickis nods. _Reason at last. I will not stop you from going._ He waves you away. _But I suggest you start to run. I will take steps to make sure you do not pester me further._";
	action = END_TALK;
	
begintalknode 58;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "I will not tolerate your madness. Prepare to die!";
	text1 = "_What? Really? Again? Well, all right. Another battle. The cycle goes round and round. I get older and tireder. Come on, little creature. Let me show you all I have learned in my years here._";
	action = END_TALK;

///

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "Hirickis falls to his knees, his old wounds accompanied by a host of newer ones. Then he falls forward, catching himself with his hands. He shakes his head.";
	text2 = "_No. No. I have lost. Again. I get stronger. The soldiers get stronger. It never ends._";
	text3 = "_Now is the point where I offer ... offer my treasures. My trinkets. For a chance. To escape. To start again._";

begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Treasures? Did you say treasures? I would love some treasures!";
	text1 = "He shakes his head. _No. No longer. No more. I am worn out._";
	text2 = "He slowly, painfully rises to his feet. _Come on. I will use the last remnants of my strength. See if you can defeat me. Rob me of everything! End my torment!_";
	action = END_TALK;
	
begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "I will not spare you, even if you bribe me. Unless the bribe was, say, very large.";
	text1 = "He shakes his head. _No. No longer. No more. I am worn out._";
	text2 = "He slowly, painfully rises to his feet. _Come on. I will use the last remnants of my strength. See if you can defeat me. Rob me of everything! End my torment!_";
	action = END_TALK;

begintalknode 73;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "No more talk, monster. Your reign of madness ends here!";
	text1 = "He nods. _At last. Someone who extends to me the honor of true defeat. So long ... so long ..._";
	text2 = "He slowly, painfully rises to his feet. _Come on. I will use the last remnants of my strength. See if you can defeat me. Rob me of everything! End my torment!_";
	action = END_TALK;


////

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