// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(0,0) == 0;
	question = "special";
	text1 = "You step away from the portal, dazed and nauseated as usual, and take a moment for your head to clear. When you look around, you realize that the miserable feelings of choking heat and vertigo you were feeling were not just from the journey.";
	text2 = "You are standing at a cliff at the edge of an enormous chasm. It is painfully hot and humid. Clouds of steam and sulfurous gases rise from the chasm, and you can see the glow of lava far, far below.";
	text3 = "To the north is a fortress, burrowed into the cliff face over the pit. The walls are cracked and scarred, and burns and ancient bloodstains are everywhere.";
	text4 = "It looks like this place has been settled by a long series of madmen and monsters over the years, each of whom was only extracted with great violence. And then the fort, freshly abandoned, attracted someone else.";
	text5 = "As you enter, you feel part of a long, noble lineage of adventurers. Not that this makes you feel safe. No, you feel very unsafe indeed.";
	action = SET_SDF 0 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(0,1) == 0;
	question = "special";
	text1 = "The entry hall to the fortress contains the remnants of old, abandoned magical ... Machines? Traps? You can't be sure.";
	text2 = "There are four crystal pylons. Three of them are cracked and mostly dormant. A faint blue light flickers within them.";
	text3 = "The fourth pylon glows fiery red, an unpredictable, jerky flame, eager to escape. When you enter, the rune at its base begins to flicker hungrily.";
	action = SET_SDF 0 1 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(0,2) == 0;
	question = "special";
	text1 = "There is a pot in the northern alcove. A large pot, easily big enough to hold something ... large. It has been sealed shut by several loops of chain.";
	text2 = "The chains have been there for a long time. They are rusty. You are surprised that they haven't broken and fallen off by now.";
	text3 = "And as you look at them, you realize that you can hear them rattling, very gently. Something is making them shake.";
	action = SET_SDF 0 2 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(0,3) == 0 && gf(0,13) == 0;
	question = "special";
	text1 = "Happily, not all of this fortress is hostile. You have found a camp of vahnatai. Friendly vahnatai warriors from Tenevra, who came here to clear the way and hunt for the cultists.";
	text2 = "There are several warriors sitting around a small, smoky fire in the center of the room. When you enter, they leap to their feet, razordisks in their hands. Then, when they see that you are an Avernite, they calm down."; 
	text3 = "They sit back down and stare into the fire, ignoring you. Some of them sharpen their weapons, giving them a keen razor's edge.";
	text4 = "There is one vahnatai sitting off from the others in an alcove to the north. She waves for you to approach.";
	action = SET_SDF 0 3 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(0,4) == 0;
	question = "special";
	text1 = "Even though these tunnels are very hot, when you enter them you feel a distinct chill. There is something malevolent down here, a dark, lingering presence.";
	text2 = "There is a large gallery stretching away from you to the north. Years of cavequakes have filled it with huge piles of rubble, blocking off most of it.";
	text3 = "However, just to the north, you can see that someone dug away a tunnel in the west wall. The cultists must have found a different route in to the gravesite of Rentar-Ihrno.";
	action = SET_SDF 0 4 1;

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = get_sdf(0,5) == 0 && char_ok(46);
	question = "special";
	text1 = "You finally reach the center of the spiral, the domed hall from which Rentar-Ihrno led her mad, doomed war against Avernum (and, you suppose, everyone who wasn't a vahnatai).";
	text2 = "You can sense something here. A haunt. A malevolent, ultimately irrelevant presence. That, and the sad little piles of rocks and broken crystal shards in the middle of the room, are all that remain of that infamous vahnatai wizard.";
	text3 = "But there is someone else here, someone alive. An old, hunched vahnatai, standing in the northern magical circle. Just in front of you, there is another circle. Empty at the moment.";
	text4 = "The other vahnatai doesn't move or react to your presence. A faint magical shield surrounds him, sealing him in. Time inside his bubble seems to have stopped.";
	text5 = "However, as you stare at him, you hear speech. He doesn't talk. The words seem to appear in your mind:";
	text6 = "_You have come, as I asked. Step in the circle. We will begin the summoning. If you do not submit, Avernum will pay._";
	action = SET_SDF 0 5 1;

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = get_sdf(0,6) == 0;
	question = "special";
	text1 = "Suddenly, the basalt under your feet begins to vibrate. You hear a deep, ominous rumbling. And then steam starts shooting out of the caldera that surround you.";
	text2 = "At the same moment, showing awesome timing, you hear several howls of fury. Several of the vahnatai cultists, who clearly knew that you were coming, emerge from hiding.";
	action = SET_SDF 0 6 1;
	code =
		set_terrain(1,3,29,0);
		set_terrain(1,3,32,0);
		set_terrain(1,5,46,0);
		set_terrain(1,5,50,0);
		activate_hidden_group(1);
		add_range_to_group(22,29,2);
		
		sf(0,15,2);
	break;
	
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = get_sdf(0,8) == 0;
	question = "special";
	text1 = "There is a faintly glowing rune in the middle of this room. It is surrounded by the bodies of several vahnatai. Well, bones. All of which are rapidly crumbling into ash.";
	text2 = "When you approach the rune, it glows brightly. A few sparks rise from it. And then the glow diminishes, and it returns to its quiet state.";
	text3 = "Whoever this trap was meant to ensnare, it happily ignores you.";
	action = SET_SDF 0 8 1;

//


begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "When you get close to the red pylon, there is a flash of light. You hear the crystal crack. The energy flows out ...";
	text2 = "And, in an instant, defenders appear. Yep, it was a trap after all. Still active, if unstable, after all of these years.";
	
begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = gf(0,18) == 0;
	question = "special";
	text1 = "Ahhhh ... Now you know why there are chains wrapped around the pot. Something is trapped within. Something that has been waiting in there for a very, very long time, going more insane with every passing day.";
	text2 = "When you get close, it detects the vibrations of your footprints. With one final, triumphant push, it shatters the chains and lifts the lid.";
	text3 = "And then it leaps out, howling in incoherent rage ...";
	code =
		sf(0,18,1);
		kill_object(15,0);
		spawn_creature(14);
		set_name(14,"Mad Hraithe");
		set_boss_level(14,1);
		force_char_status(14,24,12);
		force_char_status(14,20,12);
		force_char_status(14,21,12);
	break;
	
begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The vahnatai here are hardened warriors, equipped with viciously sharp razordisks and the traditional wave-shaped blades of their people. They sit and meditate, prepared for battle at any moment.";
	text2 = "They do not speak your tongue, so you aren't able to communicate with them.";
	text3 = "However, whenever you walk past, they give you a quick hand signal. It looks like a salute, a little sign of respect.";
	code =
		if (gf(0,7) == 0)
			rs(3);
	break;

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 = "When you step away from the circle, everything gets very quiet. Dagas-Ihrno becomes dormant again. His shades disappear. His shield remains as before. You feel from him a strange sense of disappointment.";
	text2 = "His ritual has been disrupted, but he is still there. Still powerful and dangerous. If Avernum is to be free from the risk he presents, he will have to be fought on his terms.";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Dagas-Ihrno is becoming irritated. _Why are you not dead yet? Increase power! Create more attackers? Crush the Avernite! Rentar-Ihrno, please! Come to me!_";

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You sense from Dagas-Ihrno, for the first time, a sense of despair and defeat. _No. Why am I still here? Why must I fight alone? Mighty Rentar-Ihrno, do you not see what is happening? We need you._";
	text2 = "_No ... I know. I understand now. You require more. More sacrifice. More courage. You will not let your servant die alone. You will not leave me alone. Come, great one! See what I do for you!_";
	text3 = "And Dagas-Ihrno drops his shield. He steps forward, slightly unsteady but still in command of his powers. And he actually speaks. _Yes, I will duel you. Come, outsider. My death or yours!_";
	
begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Dagas-Ihrno collapses, mortally wounded. His glassy eyes stare up at the ceiling. You hear him speak, his voice weak and choked.";
	text2 = "_Yes ... I see you ... You have come. I knew ... I knew you would not let me die alone. You have ... Thank you ... Thank you ..._";
	text3 = "And he dies. The cultists are gone. The strange feeling of haunting persists, but that is all it is. A haunting. Rentar-Ihrno, scourge of Avernum, is truly gone forever.";
	text4 = "Your mission is a success. The vahnatai will be pleased.";

begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Once again, you step into the circle. _You have returned,_ Dagas-Ihrno says. _You know what I would do to Avernum if you flee._";
	text2 = "_Now, it is time! Rentar-Ihrno, return to me!_ Once again, glowing orbs begin to appear next to him.";

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 = "__";


// Andicia-Tel

// LINDA - THIS CHARACTER HAS PURPOSEFULLY ODD GRAMMAR, but fix spelling errors.

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "There is a vahnatai sage sitting in the magic circle, surrounded by a ring of crystals. Until you entered, she was lost in meditation. Now that you are here, you have her full attention.";
	text2 = "She raises a hand in greeting. _I am Clodeca-Tel._ Her voice is calm and only slightly accented. She must have spent time around humans before. _I am glad you had come._";
	text3 = "_I am from far, but I came to meet Avernum. Then I was ... Sidetracked? Yes, that is your word. I came to and offered to help Tenevra with their quest. They said they would send ones to aid us. And here you are._";
	text5 = "Clodeca-Tel sits in the middle of the circle. She occasionally reaches down and rearranges the crystals slightly. You can't make any sense of the patterns, but they seem to help her to concentrate.";
	text6 = "Then she looks up at you with those wide, alien eyes. _Yes? What now would you have?_";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Where are you from?";
	text1 = "_I am from Kherebass, a vahnatai city in what you say is the Northern Reaches. I was there for some years. The Slith Horde advances slowly in those lands. We wanted to make common action with your kind._";
	text2 = "_This is easier, now that we are not in conflict with your kind there._";

begintalknode 32;
	state = 30;
	nextstate = 33;
	condition = 1;
	question = "Why did you come here?";
	text1 = "_I came to these upper lands to deal with Avernum. And I came to this fort because Tenevra asked me to._";

begintalknode 33;
	state = 30;
	nextstate = 37;
	condition = gf(0,7) == 0;
	question = "I am here to help deal with the vahnatai cultists.";
	text1 = "Clodeca-Tel nods. _I am full of fortune that you are here. The cultists are in the lower caves, where Rentar-Ihrno rested and was destroyed._";
	text2 = "_They have powerful wards up that keep us out. But you ... I think they will let you in._";

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = gf(0,7) > 0 && gf(0,14) == 0;
	question = "The cultists have been destroyed.";
	text1 = "Clodeca-Tel nods. The vahnatai warriors behind you raise their hands in an odd victory salute. It is a strangely subdued celebration, over in seconds.";
	text2 = "She says, _Then I will go. I can regain my old mission, and I thank you. The other warriors will remain to scare off those who take this fort. I am grateful, and I hope I can aid your people. Thank you._";
	code =
		sf(0,14,1);
		award_party_xp(300,30);
	break;
	
begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "When will you be going?";
	text1 = "_When the problem here is settled._";
	text3 = "_Very soon, I am happy to say._";
	action = DEP_ON_SDF 0 14 0;
	
begintalknode 36;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "You are not from the same place as these other vahnatai?";
	text1 = "_No. I was a lone journeyer, using magic to travel through slith lands with speed and hiding._";

begintalknode 37;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "You were in conflict with the humans?";
	text1 = "_They came to the place where we slept, where we waited to revive and reclaim our lands and live lives. But we awoke, and humans were there._";
	text2 = "_We were angered. Then we didn't know a word of you or Rentar-Ihrno or the new struggles for our home._";

begintalknode 38;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "What happened between you and the humans?";
	text1 = "_We were ready to fight, but a few brave humans came and saved us from a real danger we faced, and we saw that these new creatures from the surface were not all evil or without thought._";
	text2 = "_We were talking to the humans and expanding when the horde came. And the humans fled, replaced by the pest slithzerikai. Those creatures, we have long fought. And we were happy to resume._";

begintalknode 39;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "What business did you have with Avernum?";
	text1 = "_We can't help Avernum with their Blight. Their way of getting food was dangerous and they put an unwise number of people in these caves. For that, they will face consequences._";
	text2 = "_But we would trade information and effort against the savage sliths. We vahnatai are their enemies._";

begintalknode 40;
	state = 33;
	nextstate = 34;
	condition = 1;
	question = "How did you find Tenevra?";
	text1 = "_Good fortune. Their scouts explored and saw me. They saw I was going to dragon lands, and they talked me. And they brought me to their new colony. Ahhhh ... Not a colony. A camp. Their camp._";

begintalknode 41;
	state = 34;
	nextstate = -1;
	condition = 1;
	question = "And then you came here?";
	text1 = "_For a short time. I saw the best I could do was stopping the cultists before they did harm._";

begintalknode 42;
	state = 37;
	nextstate = -1;
	condition = 1;
	question = "What can you tell me about Rentar-Ihrno?";
	text1 = "_I knew her once, before I went to Kherebass. She hated the human crimes against her kind, and she lashed out. She made herself a crystal soul to carry the war on forever, and she was smashed. Her fragments are below._";
	text2 = "_I told Kherebass her tale, and she was a good example of learning. Her story taught them of the foolishness of using war to regain our caves._";
	text3 = "_But she is destroyed. I believe this. The cultist errand is foolish._";

begintalknode 43;
	state = 37;
	nextstate = -1;
	condition = 1;
	question = "They will let me downstairs?";
	text1 = "She lets out a strange chuckling noise. _Yes. They shout this from beyond their ward. They want Avernites to come. They desire it. Who knows why? They are mad._";
	text2 = "_Maybe ... Maybe they think they should sacrifice you to the one they worship. I trust, when you go below, you will not let them do this._";

begintalknode 44;
	state = 37;
	nextstate = -1;
	condition = 1;
	question = "What should I do once down there?";
	text1 = "She gives a surprisingly human shrugging motion. _Life in the caves is ever hard. We vahnatai are wise and calm, but we are harsh at those when the peace is disturbed and the people are threatened._";
	text2 = "_These ones are outside the vahnatai people now. They must be ended for all._";

begintalknode 45;
	state = 37;
	nextstate = -1;
	condition = gf(0,11) == 0;
	question = "I am ready to go downstairs.";
	text1 = "_Then I will have the gate below opened. I wish you safety and success. And I hope the vahnatai are correct that Rentar-Ihrno is destroyed. Otherwise ... Her power was great._";
	code =
		sf(0,11,1);
	break;
	

	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "When you step into the magical circle, the voice returns. Though it doesn't come from any particular direction, you are sure that it is coming from the vahnatai in the other circle.";
	text2 = "He says, _I am Dagas-Ihrno. I waited for you to come. Once the weak ones above knew I desired one of your kind, I knew it was only time until you were brought and thrown down._";
	text3 = "_Now you are here. Now the summoning can commence. Now she will return!_";


begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Where are you from?";
	text1 = "_I am from Egli, city of wizards. A pitiful place. A place that forgot how to be proud, to defend what is theirs._";
	text2 = "_I knew Clodeca there, once. Is she still above? Her weakness stinks to me._";

	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "You waited for me?";
	text1 = "_You, or one like you. You all look the same. You all are the same. It is only your presence that will awaken._";
	
begintalknode 53;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "All right. You got me here. Now what?";
	text1 = "_Now your presence in this holy place will bring back mighty Rentar-Ihrno! Now she will sense you and be brought back!_ His voice is breaking up in your mind. You can clearly sense his disordered thoughts, his madness.";
	text2 = "_Yes! Come back to us! Come back and lead! I bring them to you! They are in your place! Do not suffer the intruder to live!_";
	text3 = "There is a brief, expectant pause. Not surprisingly, nothing happens.";
	
begintalknode 54;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "You know, I don't have to stand still for this.";
	text1 = "_Stay!_ The screech inside your mind makes you flinch. _If I leave here, it will be to wander the low tunnels and use all of my power to bring doom to your kind. Submit, or your people will pay._";
	
begintalknode 55;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "I hate to break it to you, but Rentar-Ihrno is nothing but a pile of rocks now.";
	text1 = "Dagas-Ihrno lets out a long screech, a deafening sound inside your head. You take a step back. _You hear this, great leader? You hear this blasphemy? Do not leave me like this. Please return to us!_";
	text2 = "Nothing happens.";
	
begintalknode 56;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "Fine. Bring her here. We will destroy her again.";
	text1 = "Dagas-Ihrno lets out a deep, deafening laugh. _Your arrogance will be punished! Your kind defeated Rentar-Ihrno before. When she returns, her strength doubled, you will regret your arrogance. Come, Rentar-Ihrno! Come!_";
	text2 = "Nothing happens.";
	
begintalknode 57;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "(Just wait.)";
	text1 = "Dagas-Ihrno goes on for a while. Calling Rentar-Ihrno. Cajoling Rentar-Ihrno. Taunting you with your impending doom. Occasionally letting out an ominous cackle.";
	text2 = "Nothing happens.";
	
begintalknode 58;
	state = 52;
	nextstate = 53;
	condition = 1;
	question = "That was fun. Now what?";
	text1 = "_No! I can feel her spirit here. Why is she not returning? Why will she not strike you down? I thought ... thought ..._";
	text2 = "_No. I see my mistake. She will come back, but we need to do more to pull her. To get her attention. With noise! With magic! With joyous violence and justice! Yes! That is the way!_";

begintalknode 59;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "You want to attack me, you nutcase? Go ahead.";
	text1 = "_Yes! I will draw her to the circle! Do not move from it or your kind will suffer greatly! Now! Let the ritual commence!_";
	text2 = "Dagas-Ihrno doesn't move, but glowing orbs start to appear next to him. Fiery constructs, created to destroy you.";
	action = END_TALK;
	
begintalknode 60;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "That sounds interesting. And I'll be going now.";
	text1 = "_No! Do not move from the circle or your kind will suffer greatly! Now! Let the ritual commence!_";
	text2 = "Dagas-Ihrno doesn't move, but glowing orbs start to appear next to him. Fiery constructs, created to destroy you. Meanwhile, Rentar-Ihrno's old magical equipment starts to return to life.";
	action = END_TALK;


////

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