// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(52,2) == 0;
	question = "special";
	text1 = "As you walk up the road to the east, the air gets colder. The air is more ominously quiet. You see more debris and bone chips along the road.";
	text2 = "Up ahead, on the north side of the road, you can see a fort. It has not had any living residents for many years. It is a crumbling ruin. Only luck and a lack of serious cavequakes have enabled those old walls to remain standing.";
	text3 = "There are two skeletons standing to either side of the gate. They are upright, leaning against the wall. Whatever force enables them to remain standing will, you have no doubt, also help them to attack you.";
	action = SET_SDF 52 2 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(52,3) == 0;
	question = "special";
	text1 = "You enter the tunnels under the ruin. Some of them are old and strewn with debris. Others have been dug out recently, burrowed out by a succession of tireless undead creatures.";
	text2 = "The air is ominously cold, and the constant whispering sound, always just at the edge of perception, is almost maddening.";
	text3 = "You can feel something down here. A powerful, malevolent presence, waiting for unsuspecting victims to stumble into its lair.";
	action = SET_SDF 52 3 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(52,4) == 0;
	question = "special";
	text1 = "You look through the gateway and see an enormous chasm. There is a natural stone spire in the middle. A bridge extends out to it.";
	text2 = "At the north and south ends of the spire, you see two huge crystal spires. They are charged with power, which makes them pulse a soft, ruby red.";
	text3 = "There is a magic circle in the center of the central spire. A bony figure stands in the middle. It doesn't react to your presence. It just stands there.";
	text4 = "However, even from this distance, you can sense its considerable power. Being this close to it makes your exposed flesh feel frostbitten.";
	text5 = "You suspect that this creature is a lich, a powerful wizard who has chosen eternal life in this hideous form. This is the most deadly of the undead. If you pass through the gate, it might decide to ignore you no longer.";
	action = SET_SDF 52 4 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(52,5) == 0;
	question = "special";
	text1 = "You smash this skeleton to bits. Once the life force that animated the bones departs, most of what remains rapidly crumbles into dust.";
	text2 = "However, a few long bone shards, clean and white, remain. You collect them.";
	text3 = "You don't have a use for them right now, but they can be valuable to the correct buyer.";
	action = SET_SDF 52 5 1;
	code =
		if (get_quest_status(197) > 0)
			rs(3);
	break;
	
begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You have found the lich's spellbook. It is actually a thick, black leather binder, crammed full of a disorganized collection of scrolls. They vary widely in their legibility and value.";
	text2 = "In the end, there is only one useful scroll. It describes a chant that calls upon the power of the divine (or the infernal) to massively smite one's enemies. (Your skill with the spell Divine Retribution increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "You browse through the scrolls, but you can't understand any of them. You don't know enough magical lore. (Improve your Arcane Lore skill to understand books like these.)";
	text5 = "The moment you touch the book, frost appears on your hand and begins to run up your arm. You jump away before the cold can reach your heart.";
	code =
		if (gf(52,7) < 2) {
			clear_strings();
			as(5);
			end();
			}
		rs(5);
		if (gf(52,6) == 0) {
			rs(3);
			if (get_stat_total(13) < 14)
				rs(2);
				else {
					rs(4);
					sf(52,6,1);
					alter_stat(30000,77,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	



//

begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Once you are all near it, the lich's bony form has a hideous spasm. You hear the grinding of its bones rubbing together, and clouds of dust fly from its robes. Its head snaps up, and infernal flickers of red light appear in the sockets.";
	text2 = "As the gate behind you slams shut, it opens its mouth. A long, low moan comes out, choked by the clumps of dust that have gathered inside the skull. Finally, it manages to emit a few words._";
	text3 = "_Hrrrruhrrrr ... Whooooo ... Whooo disturbsss the lair of Kavarus? Whooo endsss my peaceful travelsss in the realmsss beyond?_";
	text4 = "The head swivels, and Kavarus sees you. _Life. Foolish, fragile life. Alwaysss interfering. Destroying my guardiansss. Disturbing my peace. I will slay you. Will absorb your spirit and take itsss power!_";
	text5 = "The pylons to the north and south begin to pulse, a low rhythmic hum that makes your bones ache.";
	code =
		sf(52,14,0);
	break;
	
begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The light within the northern crystal changes. The stone changes from soft red to icy blue. The temperature around the northern stone drops quickly, even lower than the bone-chilling cold in the rest of these tunnels.";
	text2 = "The northern stone begins to pulse more quickly. Something is about to happen.";

begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The northern stone releases its power, sending out a gust of icy wind. You grab anything within reach to keep from being flung off of the platform. For a short time, the air around it is deadly cold.";
	text2 = "Kavarus lets out a shrill, amused cackle. The stone returns to its previous red shade.";
	
begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Now the southern stone has turned blue. The air around it grows colder.";

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Kavarus's chest expands as if the creature were taking in a breath. The lights within its skull change. They turn black. They are twin absolute voids, that seems to be trying to suck your life into them.";
	text2 = "Being near the lich makes you feel weaker. You feel a desperate desire to move away, though you aren't sure if you have the strength.";
	
begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Kavarus looks around with his black, depthless eyes, looking for a nearby victim. It is disappointed to find nobody.";
	text2 = "In a moment, its eyes return to being red flickers. The strange aura of doom fades.";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Kavarus looks around with his black, depthless eyes, looking for a nearby victim. It sees one and points a clawed finger.";
	text2 = "You feel a mote of icy cold within your chest. It is small but growing. Soon, everything within you will be still and dead. Kavarus has inflicted its death curse upon you.";

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Kavarus has taken too much damage to maintain this form. It shrieks and shudders. Its cloak crumbles into dust. Its bones shatter.";
	text2 = "In moments, all that is left of the lich is a glowing orb of light, floating before you. It doesn't fade or dissipate. Instead, it floats upward. It rises through the ceiling and is gone.";
	text3 = "The spell holding the gate closed fades. It opens, allowing you to escape.";
	text4 = "Whatever happened to Kavarus, it will be unable to cause any problems around here for a long time.";

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 = "You open the coffin and find a velvet pad within. A long, crystal shard, about a foot long, rests upon it. A dim blue light flickers within the stone. The moment you open the coffin, the air grows very cold.";
	text2 = "The coffin only contains shards of crystal.";
	code =
		if (gf(52,7) < 2)
			rs(2);
			else rs(1);
	break;
	
begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = gf(52,7) < 2;
	question = "Get the shard.";
	text1 = "The moment you reach for the shard, it sprays out an intense wave of cold. You slam the coffin before the thing can suck out all of your warmth ...";
	text2 = "";
	action = END_TALK;
	code =
		damage_char(30000,300,6);
	break;
	
begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = gf(52,7) == 0;
	question = "Break the shard.";
	text1 = "You raise your blade and take aim. However, as you start to swing the weapon, the coffin slams shut.";
	text2 = "The air grows even colder. Clouds of mist appear over the pedestals surrounding the coffin. As you watch in horror, the clouds solidify into guardians ...";
	action = END_TALK;
	code =
		sf(52,7,1);
		
		activate_hidden_group(12);
		set_name(5677,"Runed Sentinel");
		set_level(5677,30);
		set_boss_level(5677,1);
		set_name(5678,"Spirit Sentinel");
		set_level(5678,30);
		set_boss_level(5678,1);
		set_name(5679,"Beast Sentinel");
		set_level(5679,30);
		set_boss_level(5679,1);
		set_name(5680,"War Sentinel");
		set_level(5680,30);
		set_boss_level(5680,1);
	break;
	
begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = gf(52,7) == 1;
	question = "Break the shard.";
	text1 = "You raise your blade, take aim, and swing. You strike quickly, before the magic of the shard can do anything else to defend itself.";
	text2 = "You smash the crystal into a thousand pieces. The light within the stone emerges. It looks like the life force of the lich, last seen rising through the ceiling below.";
	text3 = "You hear a long, ghastly keening noise. It starts loud but fades away quickly. The light breaks up into many small, glowing droplets. Then they dissolve into nothingness.";
	text4 = "The lich has been destroyed forever. It will never be able to reform itself.";
	text5 = "Some of the crystal shards still glow slightly. They look like they might contain some power. You take them.";
	action = END_TALK;
	code =
		sf(52,7,2);
		award_party_xp(400,30);
		reward_give(242);
		reward_give(242);
		reward_give(242);
	break;
	
begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Close the coffin.";
	text1 = "Done.";
	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 = "";
		