// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(62,3) == 0;
	question = "special";
	text1 = "After your long, harrowing journey, you have finally reached a settlement. Cookfires burn on the hills above, surrounded by humans and a scattering of nephilim.";
	text2 = "All around you, supplies and trash have been discarded in the fungal undergrowth. These are the unwanted remnants of what was stolen from refugees and caravans back in the Eastern Gallery.";
	text3 = "A lone man, wearing the long robes of a mage, watches you from the path above. He stands alone, ready to bravely confront the invader. The marauders watch from a distance, waiting to see if you can be turned away without a fight.";
	action = SET_SDF 62 3 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(62,4) == 0;
	question = "special";
	text1 = "You enter the tunnels under the marauder camp. They are very different from what was above, far colder, windier, and mustier. Your hair immediately stands on end. You can feel invisible presences all around you. Hidden spirits, watching.";
	text2 = "There is a deep, black chasm to the south. A large shard of crystal, taller than you, is perched next to it. A wisp of light extends from the shard into the pit. This thin rope of energy sways slowly back and forth, as if fishing.";
	text3 = "Then the crystal flashes. There is a sharp zapping sound. The tendril of light jerks. And a spirit has been caught and pulled out of the pit. It floats aimlessly, hunting for warmth. And then it senses you.";
	text4 = "Through the wind, you think you can hear a similar zapping noise, echoing from somewhere in the distance. There are more of these crystals nearby, and they will continue to construct powerful defenses until they are stopped.";
	text5 = "You hear a yelp of terror. You look to the west and see Ozimus. He turns and flees. Perhaps you can hunt him down before the spirits of these caves gather and overwhelm you. These caves are extremely dangerous.";
	action = SET_SDF 62 4 1;
	code =
		if (gf(62,1) > 0)
			rs(5);
		spawn_creature(6766);
				set_name(6766,"Chasm Shade");
				set_boss_level(6766 ,-1);
				set_summon_level(6766 ,1);
				place_particle_num(6766 ,1,1,8);
	break;
	
begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(62,5) == 0;
	question = "special";
	text1 = "There are several vats here, full of murky grayish water. The fluid moves slowly under its own power, occasionally shifting enough to give a glimpse of bone or pallid flesh.";
	text2 = "Someone is preparing more skeletons and zombies, to provide defenses for this hideous place."; 
	action = SET_SDF 62 5 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(62,7) == 0;
	question = "special";
	text1 = "You pull your cloak tight and shudder. This is the heart of the necropolis. There are two magic circles on this ledge, overlooking the huge chasm. There are shades dancing out in the open air, floating and bobbing on the icy wind.";
	text2 = "A lone man stands in the eastern circle. He is very old and frail, and his skin has a ghastly blue pallor. His arms are out, and he struggles to command the raw, magical power of this place. If he knows you are here, he is ignoring you.";
	text3 = "The circle he is standing on is glowing faintly. You notice that the other circle is glowing too. They seem to be here to boost the power of someone trying to draw power from the pit.";
	action = SET_SDF 62 7 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  THIS LAND CLAIMED BY OZIMUS";
	text3 = "  ALL WHO WOULD BE FREE AND FED ARE WELCOME";
	text4 = "  ALL SLAVES OF AVERNUM SHOULD FEAR US";



//

begintalknode 10; // spellboox
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Unsurprisingly, Nociduas has a thick spellbook, full of powerful and complicated recipes and incantations. Alas, most of them are written in a cipher you are unable to decode.";
	text2 = "Happily, one spell, near the back, is legible and comprehensible. You learn how to create a shield that will magnify the power of your spells. (Your skill with the spell Cloak of the Arcane 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(62,15) == 0) {
			rs(3);
			if (get_stat_total(13) < 12)
				rs(2);
				else {
					rs(4);
					sf(62,15,1);
					alter_stat(30000,58,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Ozimus collapses to the ground, mortally wounded. You'll never know how this mild-mannered wizard ascended to lead this pack of brigands. Or perhaps they chose him and stuck him in front whenever anyone dangerous approached.";
	text2 = "When he hits the ground, his chitrach charm breaks into tiny fragments. He must be the one who created them. That would provide a good reason for the marauders to keep him around.";
	text3 = "When his body is on the ground, you can see that he is wearing a small onyx charm. A tiny, carved chitrach. You take it.";
	text4 = "Now that he is dead, the marauders will no longer be a particularly significant or dangerous force.";
	code =
		sf(62,1,1);
		if (has_spec_item(13) == 0) {
			rs(2);
			set_spec_item(13,1);
			}
			else rs(3);
	break;

begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You catch up to Ozimus. He is standing next to a powerful magical barrier, sustained by the magic of the mages surrounding the circle.";
	text2 = "When you get close, he lets out a terrified yelp. Then he makes a motion with his hand, closes his eyes, and walks through the barrier.";

begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Ozimus sees that he is not safe here. He lets out a terrified screech and runs down the tunnel.";
	text2 = "He may be a powerful and cunning mage and craftsman, but he, shall we say, lacks the warrior spirit.";

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You round the corner and see Ozimus. He stands at the top of the stairway. He's muttering to himself, _I can't go down. Not down there. Nociduas will ... He will ..._";
	text2 = "And then he turns and sees you. He realizes he has no choice. He looks down in the dark stairway. _It is this or death. I might survive ..._";
	text3 = "He runs downstairs. Unfortunate. As long as he lives, you can't be sure that this pack of marauders won't rise again.";
	code =
		sf(62,22,1);
		erase_char(6696);
	break;
	
begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The circle here is surrounded by several young mages, probably apprentices to Ozimus. All of the flame-flinging mages here were probably trained by him. All the better to defend this little rogue colony.";
	text2 = "The apprentices are chanting in unison, working on another of the spells Ozimus taught them. Something to summon defenders to protect the encampment.";
	text3 = "As they chant, they take turns taking breaks, so that they can use spells to try to hold you at bay.";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You see now why Ozimus was so terrified of coming down here. Several of the chasm shades have cornered him in an alcove to the west. He stands there, frozen, as they suck the life out of him.";
	text2 = "Whoever lives down here, they are far more powerful than the marauders above. And they are no more likely to be friendly to you."; 

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You realize in horror that something is protecting Nociduas from your blows. They seem to roll off of his skin, not even leaving a mark.";
	text2 = "He cackles at you. _You see, fool? I am no longer of this plane. I exist in the spirit world. It is only there that I can he harmed!_"; 
	text3 = "He returns to concentrating on commanding the undead spirits. The circle under his feet helps him to call aid.";

begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "When you stand in the circle, something strange happens. For a moment, you don't feel cold anymore. You hear whispering all around you. The circle seems to be calling ghosts to you, bending them to your will.";
	text2 = "And then, with a soft, popping noise, a shade appears at your side. It doesn't attack you. Instead, it begins to drift toward Nociduas, eager for vengeance against the one who has been tormenting it.";

begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Nociduas falls to his knees, gasping. His control over the power of the chasm weakens for one fatal moment.";
	text2 = "And then a horde of ghosts appears. One moment, the air around him was icy and still. The next, there are vengeful spirits everywhere. They reach into Nociduas and, ignoring his hideous screams, rip the soul out of his body.";
	text3 = "And then they disappear. Nociduas's hollow shell crumbles to the ground. The cavern is still and empty. The power of this place is in balance once again.";

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 = "This box is full of letters. Looking through them quickly, you get a very interesting summary of why these people are here.";
	text2 = "They are letters sent from Khrez-Yss the Shadow, spymaster of the Slith Horde, to Ozimus. Apparently, in return for recruiting these thugs and bringing them here, Ozimus and a select few would be spared death on the spears of the horde.";
	text3 = "Khrez-Yss also shared several magical secrets with Ozimus, regarding the creation of useful magical charms.";
	text4 = "There are also references to Nociduas, a necromancer in the tunnels below. Khrez-Yss suggests trying to recruit Nociduas. Failing that, the mad wizard is to be left alone.";
	code =
		sf(62,2,1);
	break;

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


//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "The mage on the hill holds out his hand. You can see that it is trembling. You have little doubt he would prefer to hide behind all of the other brigands.";
	text2 = "_Stop,_ he shouts. _I command you. I am Ozimus, and we claim these tunnels. Avernites have no place here! Turn back, or you will be destroyed!_";
	text3 = "You notice that he is wearing a black charm around his neck. He is too far away for you to get a good look at it, but it looks like a small, onyx bug.";
	
begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "What gives you the right to claim this land?";
	text1 = "_Nobody gave us anything! We took this land. And, if you are all Avernum bothered to send to remove us, I think we will keep it._ He smiles, satisfied at the quality of that line.";

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = gf(77,3) > 0;
	question = "I'm looking for the marauders who have been attacking caravans near Fort Dranlon. Know anything about it?";
	text1 = "He looks even more nervous. _We know nothing of it. You are in the wrong place._ He casts a quick glance at the piles of abandoned goods and smashed crates around him. He clearly wishes that they had been better at tidying up.";
	text2 = "_We will not be accused. You must leave. Now._";

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I just want to come in and talk and trade.";
	text1 = "_Avernites are not welcome here! Leave or die!_";
	
begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = has_spec_item(13) > 0;
	question = "Nice charm. I have one just like it. (Show it.)";
	text1 = "When he sees the charm, he looks ill. _Yes. That ... That is ... Oh. So you are the one. Well, I ..._";
	text2 = "And then he turns and runs away. It might be your imagination, but you think that you can see some of the people watching from the cookfires shrug.";
	action = END_TALK;
begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I think you are brigands, and you will need to be destroyed. (Attack.)";
	text1 = "_Ah._ Ozimus nods. _Well, when you put it that way ..._ He turns and runs away.";
	text2 = "It might be your imagination, but you think that you can see some of the people watching from the cookfires shrug.";
	action = END_TALK;
	
begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I'll just go then.";
	text1 = "Ozimus nods quickly, relieved. _Yes. Yes. You must go. And, if you leave, we will spare you._";
	text2 = "He turn and walks away. Very quickly. He barely keeps from fleeing in panic.";
	action = END_TALK;

//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "You have gotten the wizard's attention. He turns to look at you. He is another mage who has gotten desperately old but maintained his life by filling in the empty spots with magic. This is a good place for it.";
	text2 = "He opens his mouth. Icy tendrils of mist come out. _Yessssss ... New fuel. I am Nociduas. This is my home. By entering, by disturbing my work, your life is forfeit to me._";
	code =
		set_attitude(6750,10);
		sf(62,16,1);
		
		spawn_creature(6755);
		spawn_creature(6756);
		spawn_creature(6757);
		spawn_creature(6758);
		set_aggression(6755,20);
		set_aggression(6756,20);
		set_aggression(6757,20);
		set_aggression(6758,20);
		set_name(6755,"Circle Protector");
		set_name(6756,"Circle Protector");
		set_name(6757,"Circle Protector");
		set_name(6758,"Circle Protector");
	break;
	
begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "You know anything about the brigands upstairs?";
	text1 = "He looks perplexed. _You are near to death, and you ask about them? They were insects. I tolerated them. I let them stay. They kept pests and adventurers away. I had nothing else to do with them._";
	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "What is this place?";
	text1 = "_It is a place of raw power, that draws spirits to it, in a vortex. It holds them here, imprisoned. Angry. Waiting for one to come strong enough to master them._";
	text2 = "_I have been here for many years, master of this necropolis, growing in power and joy._ Yeah. He looks like a real happy guy.";
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Why do you have to kill me?";
	text1 = "_My servants ... They are agitated, hard to control, unless they can feed on a living being from time to time. I no longer have brigands above to feed them. I must use you._";
	text2 = "_Don't worry. You will be frozen, unable to move or scream. I think, after a time, it will not hurt._";
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "I'll just be going, then. (Run.)";
	text1 = "_I think not. When I send my hunters after you, you will come back to confront me. Yes. Flee now. You will be back soon enough._";
	text2 = "He looks at the other circle and sighs. _Oh. It is not protected. Come, guardians._ He waves a hand, and several defenders appear on the other circle.";
	action = END_TALK;

	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "You will not kill me so easily. (Attack.)";
	text1 = "Nociduas prepares to defend himself, but then he notices something.";
	text2 = "He looks at the other circle and sighs. _Oh. It is not protected. Come, guardians._ He waves a hand, and several defenders appear on the other circle.";
	text3 = "Then he turns back to you. _Yes. My pets love to feed on adventurers. Their favorite snack. Come and fight me._";
	action = END_TALK;


// 70

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "When you reach the base of the cliff, a figure floats out of the shadows to look at you. It is a gazer. It floats several feet above the ground. Its eyestalks move lazily around, watching for intruders.";
	text2 = "As it comes out, it mutters, _What is it, Nociduas? We hope you brought something better to ... Oh._ One of its eyes spies you. In a moment, all stare at you. _You are not Nociduas. We would know. Where is he?_";


begintalknode 71;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "He is dead.";
	text1 = "_Ah. Well, we will not have our privacy disrupted again._";

begintalknode 72;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "It is none of your business.";
	text1 = "_Well, we are not foolish. We know your only way here was through him. Something always kills his kind eventually._";

begintalknode 73;
	state = 71;
	nextstate = 72;
	condition = 1;
	question = "Who are you?";
	text1 = "_We are Tizka-Eye! We are here to preserve our privacy. We do not like anything on two legs. We want to be left alone._";

begintalknode 74;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "Did you have dealings with Nociduas?";
	text1 = "_We did exchange things. Knowledge. Weapons. Meat. We tolerated that mad human because he deflected the power of the chasm._";
	text2 = "_We have no reason to deal with you._";

begintalknode 75;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "I would like to trade with you.";
	text1 = "_No. We tire of your kind. You will only leave us alone. We will let the war above pass in peace._";

begintalknode 76;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "I challenge you, monster. Fight me!";
	text1 = "_Monster? All we wish to do is rest in this pit and study and eat in peace. And, despite the insult, we will not take the risk of fighting one who destroyed Nociduas._";
	text2 = "_We are going. Do what you want below, but stay out of our cave._ Tizka-Eye floats off.";
	action = END_TALK;
	
begintalknode 77;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "That is all I have to say.";
	text1 = "Tizka-Eye bobs in an odd little nodding motion. _Then leave us to our privacy. Stay out of our cave and all will be peace._ It floats off.";
	action = END_TALK;

////

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "You get close enough to inspect this crystal. A tendril of light extends from it into the chasm, fishing for shades. The air around the shard is painfully cold.";
	text5 = "This crystal is still cracked and inactive.";
	code =
		if (gf(62,gf(62,25)) > 0)
			rs(1);
			else rs(5);
	break;
	
begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = gf(62,gf(62,25)) == 0;
	question = "Break the crystal.";
	text1 = "The stone is powerful, but delicate. You deliver one sharp blow, and a long crack appears in its side. The string of light dangling into the chasm fades.";

	action = END_TALK;
	code =
		sf(62,gf(62,25),1);
	break;
	
begintalknode 92;
	state = 90;
	nextstate = -1;
	condition = gf(62,gf(62,25)) == 0;
	question = "Touch the crystal.";
	text1 = "The moment your hand makes contact with the stone, ice crystals begin to appear, racing up your arm. As you yank your arm away, a wave of icy cold flies out from the shard.";
	action = END_TALK;
	code =
		set_char_status(30000,19,40);
	break;

begintalknode 93;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "Leave the shard alone.";
	text1 = "You back away.";
	action = END_TALK;
	
////

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