// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(13,0) == 0;
	question = "special";
	text1 = "As you walk east, the air gets painfully hot and humid. The sulfur reek makes you gag. Many would find this environment unpleasant, but it's perfect for slithzerikai.";
	text2 = "There are several gruesome totems along the road, each bearing its own skull. All are fresh, and not all of them are human or nephil. Some of the skulls belonged to slithzerikai, and the tribal symbols they wore in life hang from the posts.";
	text3 = "Whoever resides back here, they sometimes bring doom (or justice) to Avernite and member of the horde alike.";
	action = SET_SDF 13 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(13,1) == 0;
	question = "special";
	text1 = "You round the corner and see the barrier to the north. It is a massive wall with several steel gates set into it. The gates are studded with rusty spikes. Unpleasant things hang from some of the spikes.";
	text2 = "There are slithzerikai on the other side of the gate, watching you. They are members of the horde. They wear the symbols and bear the face markings.";
	text3 = "However, they don't really react. They just watch. They are ready to fling javelins through the windows if need be, but they seem to have otherwise set themselves apart from what is happening.";
	text4 = "Alas, the barrier is big and strong, and you don't have anywhere near the power you will need to tear it down. The only reward waiting for you here is your own place of honor on the spikes.";
	text5 = "As you look around, you sense something huge and powerful. And hot, even hotter than the fumaroles that surround you. You look into the alcove to the southeast and see ... something. An invisible source of heat is warping the air there.";
	action = SET_SDF 13 1 1;
	code =
		if (gf(13,9) == 1)
			rs(4);
			else rs(5);
	break;
	
begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(13,2) == 0;
	question = "special";
	text1 = "This clearing contains several stone domes. Low buildings, roughly fashioned from crude blocks, the sort of structures the slithzerikai built and lived in before the humans came down here and infected them with architecture.";
	text2 = "But this is the home of the Scourge, and they are still making at least a modest effort to cling to the old ways.";
	action = SET_SDF 13 2 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(13,3) == 0;
	question = "special";
	text1 = "There are several totems here, each bearing a slith skull. These are totems of warning. The passage to the east hasn't been settled, and there are no recent tracks on the floor.";
	text2 = "Interestingly, there is a statue of a vahnatai to the east. It is old and crumbling. Give it a few more years, and moss and cavequakes will render it unrecognizable.";
	text3 = "However, it does provide some clues to who lived here before the Scourge came. And what might be lurking back there now.";
	action = SET_SDF 13 3 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(13,4) == 0;
	question = "special";
	text1 = "You are at the low end of a long, high cavern. Several tiers rise above you to the north. Each level contains several Scourge warriors, all ready to give their lives to keep you from advancing.";
	text2 = "In traditional slith fashion, the road to the north is lined with statues of heroes of the horde from ages past. For example, one nearby statue has 'Sss-Thsss' carved into the base.";
	text3 = "Most of the statues have trophies at the base, left by horde warriors in the hope of luck in battle. Considering how the horde has fared against you so far, you don't think that this is working.";
	action = SET_SDF 13 4 1;

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = get_sdf(13,5) == 0;
	question = "special";
	text1 = "A lone slith sage, decrepit with age, is waiting for you in the chamber ahead. He stands on a stone platform, surrounded by lava. There are two huge gongs behind him. Off to the sides, you can see two huge golems, each holding a hammer.";
	text2 = "He stands there calmly, waiting for you. Perhaps he is ready to go to his death quietly. Doesn't seem the way of the horde, though.";
	action = SET_SDF 13 5 1;

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = get_sdf(13,6) == 0;
	question = "special";
	text1 = "This huge, spectacular chamber is the grand meeting place of the Scourge. It is where the circle comes to pass judgment on the course of the invasion in the north.";
	text2 = "Of course, if Avernum retakes the north, they will have to abandon this fortress. But you suspect that this will not happen for a long time.";
	text3 = "A member of the circle stands atop the hill, waiting for you. She is not alone. Eight spectral forms surround her. They are the ghosts of slith warriors, called forth to defend her.";
	text4 = "She stares down at you, raises her huge spear, and lets out a long hiss. _Come, petsss of the dragon. Come and face Tial of the Circle. I cannot let the triad do any dirty work for me today._";
	action = SET_SDF 13 6 1;

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = get_sdf(13,7) == 0 && get_attitude(1471) < 10;
	question = "special";
	text1 = "Despite the punishing heat in this chamber, when you enter, you feel a chill. There is something about the slith sitting at the desk, calmly writing. A sense of pure malevolence.";
	text2 = "There is something odd about him, though, in this steamy chamber, you can't quite tell what it is. There is also something strange about the two basins to your left. You will have to get closer to see more.";
	action = SET_SDF 13 7 1;


//

begintalknode 10; // spellbook
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This spellbook belonged to Vorus of the Circle. You dive eagerly into its tangled and obscure slith script, seeing what you can learn.";
	text2 = "Happily, you do manage to decipher one of the rituals, and it is a powerful spell indeed. It calls down bolts of pure energy to incinerate your foes. (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 search 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(13,14) == 0) {
			rs(3);
			if (get_stat_total(13) < 14)
				rs(2);
				else {
					rs(4);
					sf(13,14,1);
					alter_stat(30000,59,2);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 11; // gong
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This gong is huge. There is no hammer. You won't be able to do anything with it. Though you suspect ringing it would be a very bad idea.";

// 

begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "When you get closer to the alcove, you can tell that there is definitely something here. A powerful presence, concealed mostly from sight.";
	text2 = "And then, with a pop, the creature reveals itself. It is an enormous reptile, looking over you. With relief, you realize that it is Melanchion! As the slithzerikai at the barricade scream in alarm, the dragon looks down at you.";
	text3 = "He looks annoyed. _Ahssss. You think I have nothing more important to do than wait for you? I would never have left my kingdom, but for the fact that a chance to destroy the Scourge is too tempting to pass up._";
	text4 = "_Now follow. I will win entry for you. Then your work begins. You will have to hurry, before they can bring defenses._";
	text5 = "And then, without waiting to see if you are ready, the mighty dragon walks toward the wall.";

begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Melanchion stops moving just out of range of the defenders' javelins. He looks at the wall, sizing it up, trying to decide the best way to bring it down.";
	text2 = "And then he decides that the direct way is best. He begins to mutter a spell. He stares at the gates, focusing his power. The defenders run for help. There is no way it will arrive in time.";
	text3 = "And then the dragon has summoned up all of the power at his disposal. He takes a deep breath. Then he breathes a gout of flame at the gates. The fire seems to go on and on. The steel melts. And then the stone.";
	text4 = "And then there is a massive gap in the gate, and all defenders who were unwise enough to stay at their posts are ash.";
	text5 = "The dragon nods in approval. He mutters, _That is only the first part. The real work remains._ Then he turns and walks back to the alcove.";

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Your betrayal doesn't anger Melanchion. If anything, the dragon is amused. _This is truly what you want, pitiful, soft creature? Do not worry. I will not blame your madness on Avernum. After I have eaten you, I will still save your land._";
	text2 = "And then the dragon takes a deep breath.";

begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The dragon Melanchion seems confused. He doesn't seem to understand why he feels so weak. Why his legs no longer seem to support him. Why he feels ... Dizzy? How can a dragon feel dizzy? Maybe the massive amount of blood loss ... loss ...";
	text2 = "And then the dragon falls. The ground shakes and cracks under the force of his impact. His sightless eyes remain open. A look of surprise and confusion remains on his face.";
	text3 = "The dragon is dead. His attempt to dominate the underworld has come to an end.";
	text4 = "Alas, this means that he will never be able to help repair the Great Portal. The Avernites are trapped in the underworld now, doomed to starve. A time of great suffering and chaos comes. Alas, you do not survive it.";
	code =
		if (gf(170,1) < 30)
			erase_char(30000);
			else rs(4);
	break;

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Melanchion returns to the stone platform and mutters a spell. A large portal appears in front of him. It is faint and already fading, but it only needs to be used once.";
	text2 = "He turns to look at you. _What are you waiting for? Go! Destroy the Scourge, your enemy and mine! I will await news of your success._";
	text3 = "He steps through the portal and is gone.";
	code =
			erase_char(1404);
	break;

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Melanchion ignores you. He is eager to complete this task and return to the job of running his little empire.";

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

begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The old slithzerikai lets out a deep sigh. You can see that he is heavily festooned with baubles, charms and fetishes, the products of a long life as a leader of the horde.";
	text2 = "_I am Vorus of the Circle,_ he says. _I am one of the leaders of the Scourge, and I knew this day would come. I said, but they did not listen. The old story. First, you humansss underestimate usss. Then we return the favor._";
	text3 = "You hear loud noises to either side, the sounds of stone impacting on stone. The two golems, each of which holds a huge stone hammer, have begun to slowly advance upon the gongs.";
	text4 = "_But,_ Vorus continues, _that does not mean we were in the wrong. We just took back what you humansss stole from usss, and I think we will keep it. And, if I must die, it will be fighting the thievesss._";

begintalknode 20;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You have heavily damaged the golem. It grinds to a halt. Then it begins to repair the damage you have done to it. Bits of stone, pulled as if by an invisible hand, skitter across the floor and leap into the holes you made, sealing them.";

begintalknode 21;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "A golem has reached the gong. It swings its hammer and strikes the flat metal circle. You brace yourself.";
	text2 = "No sound emerges.";
	text3 = "At least, no sound you can hear. But then a cloud of mist appears above the magic circle. Faint shapes begin to appear ...";

begintalknode 22;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Vorus of the Circle collapses and dies. Moments later, the two golems crumble into pieces. The first leader of the Scourge has fallen.";

//

begintalknode 23;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Tial of the Circle collapses to the ground, mortally wounded. A wind blows through the cavern. It sounds like a low moan, as spirits, held here by Tial's magic, are freed. In moments, you are alone in the chamber.";
	text2 = "Another leader of the Scourge has fallen.";

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

//

begintalknode 25;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The slith behind the desk rises, and you can see how he is different from the others. Not his utter loathing of Avernites and his delight in tormenting them in any way possible. That is normal.";
	text2 = "No, what is unusual about this one is that he is a spirit. Or part ghost. Or something. He is translucent, and he floats slightly above the ground.";
	text3 = "_Yesss,_ he says. _I am Gssch of the Circle. Of the spirit realm. I am part beyond. I can see ... See far in this world, see into the spirits of the enemy. It ... hurtsss, but it is a pain I welcome to hurt you._";
	text4 = "He floats forward, arms outstretched. _Come. I will be the gateway you pass through to reach the dark realm._";
	text5 = "As he approaches, you get a closer look at the two basins. Both contain liquid. The north pool contains a fluid that is pure black. The south pool's liquid glows a luminous white. These must be what Gssch uses to be ... how he is.";

begintalknode 26;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Gssch opens his mouth. It looks like he is screaming, but no sound emerges.";
	text2 = "You have broken his link between him and this world. All that remains of him now is the ghost part. The dead part. The part that pulls him away, as he slowly dissolves.";
	text3 = "You wonder if that strange spell he used might result in his ending up a ghost, a tormented soul forever doomed to walk between this world and the next. That would be a real pity.";
	
begintalknode 27;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "It was a long, exhausting battle, but you are victorious. The leaders of the Scourge are dead. Now leaderless, the Slith Horde will be far less of a force in the underworld for some time.";
	text2 = "This will be a great help to Avernum, should it ever try to retake the northern caverns. And it is an even greater boon to Melanchion. The dragon will be most pleased.";

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 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

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

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

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

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

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

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

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

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

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

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

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

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

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

begintalknode 44;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
//

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