// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(106,2) == 0;
	question = "special";
	text1 = "You emerge from the dank, winding, chitrach-infested tunnels into ... something else. This isn't wild territory. Four banners mark it as claimed by someone. Each banner bears the symbol of a single, bloodshot, staring eye.";
	text2 = "There are also benches, weaponry, and neat rows of cloaks on pegs. This looks like a place where people suit up to go on patrol. Or go out to hunt.";
	text3 = "There is an irritating humming, just at the edge of perception. You listen carefully. It is chanting ... A low, mesmeric droning that echoes easily through the tunnels.";
	action = SET_SDF 106 2 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(106,3) == 0;
	question = "special";
	text1 = "This isn't a surprise. These tunnels are full of cultists. This is their worship hall, where rogue priests and mindless thugs and drones come together to chant, worship, and reinforce some bizarre belief or another.";
	text2 = "One of Avernum's strengths is that it draws the most independent and brave of the Empire's people. One of its disadvantages is that it draws the crazies too. The Empire, even now, is dangerously intolerant of odd religions.";
	text3 = "There is one priest in the center of the chamber, his hands on the altar. He is surrounded with a strange, magical glow. He chants, _Follow the eye. Follow the eye._";
	text4 = "Several armed people, men and woman, human and not, surround him and chant with him.";
	text5 = "And then one of them sees you. All but the priest break out of their trances very quickly.";
	action = SET_SDF 106 3 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(106,4) == 0;
	question = "special";
	text1 = "This is a large cavern, on the shore of a black, subterranean lake. The cultists have built several crude domes here, which provide shelter. The domes are cold and cramped, but they protect them from the water dripping from above.";
	text2 = "The walls are painted with an intricate repeating eye motif. The tapestries bear the same symbol. The cultists have spent a surprising amount of time on decoration.";
	text3 = "Of course, they must be able to, as they get all of their food and supplies by robbing poorly armed travelers.";
	action = SET_SDF 106 4 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(106,5) == 0 && char_ok(11476);
	question = "special";
	text1 = "At the end of the pathway to the west, you can see something waiting for you. The creature is an orb, several feet in diameter, hovering several feet off of the ground.";
	text2 = "It is watching you. Watching you very intently. The sort of examination you can give when you have a dozen eyes, most of them at the ends of tentacles on the top of your head.";
	action = SET_SDF 106 5 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(106,6) == 0 && gf(106,0) == 2;
	question = "special";
	text1 = "At the top of this remote island, you can see a gruesome sight. Gruesome, but not surprising.";
	text2 = "Several cultists are prepared to enact a sacrifice. They are gathered around an altar stone. A lone man is chained to it. He is small, thin, and young. And, predictably, terrified.";
	text3 = "The Empire works hard to remove all cults from its lands. Watching this unpleasant scene, it's not hard to see why.";
	text4 = "The cultists sway back and forth, lost in ecstatic glory. They haven't seen you yet, but that won't last for long.";
	action = SET_SDF 106 6 1;


//

begintalknode 10; // spellbook
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The gazer somehow obtained a book of chants and rituals. He probably taught random chunks of them to his cultists, to give their odd religion at least a veneer of ceremony.";
	text2 = "Surprisingly, one of the chants within seems quite powerful. It can be used to restore a spark of life to one who is unconscious. (Your skill with the spell Return Life 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(106,12) == 0) {
			rs(3);
			if (get_stat_total(13) < 8)
				rs(2);
				else {
					rs(4);
					sf(106,12,1);
					alter_stat(30000,76,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;

begintalknode 11; // key
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The only thing left in the box is the velvet padding.";
	text2 = "This box is made of crystal and lined with velvet padding. And yet, all it contains is a tarnished copper key. At least it can be removed from the container with a great sense of grandeur and ceremony. You take it.";
	code =
		if (gf(94,8) == 0)
			rs(2);
		else if (gf(106,10) == 0) {
			sf(106,10,1);
			rs(1);
			set_spec_item(57,1);
			}
			else rs(2);
	break;
	
begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

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

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

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

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 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 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "You come face to face with the leader of this cult, the one who keeps all of the people here in a mindless, violent state. That it is a gazer comes as no surprise.";
	text2 = "Gazers are generally vicious, anti-social, and extremely powerful. This one is very old. Its skin is pale and cracked, and its eyestalks are lifeless. However, you can still sense the waves of raw power coming off of it.";
	text3 = "It is furious with you. It says, in a raspy shriek, _How dare you! How dare you invade the home of Corma-Eye? How dare you slay our servants?_";

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = gf(94,8) == 1;
	question = "I'm looking for someone named Asterios. Have you seen him?";
	text1 = "Corma-Eye gives you an ugly grin. _That useless wretch? We have seen him. But soon, he will be gone forever._";

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "You are leading these cultists?";
	text1 = "_Pfaugh! Cultist is too kind a word for these weak-minded creatures. They are our pets._";

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Die, foul monster! (Attack.)";
	text1 = "_Yes, fight me. But we will not kill you. We will beat you into submission, and we will take your brain. Only then can you replace those you have cost me!_";
	action = END_TALK;
	
begintalknode 34;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "What exactly are you doing here?";
	text1 = "_We have made a fortress, where we will outlast these lean times. And where we will find gifts to give to the Slith Horde._";

begintalknode 35;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Why do you need to hide here?";
	text1 = "Corma-Eye keeps talking to you, watching you, looking for weaknesses, buying time. _Gazers must eat, like all creatures. The eyes must be fed._";

begintalknode 36;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "Gifts for the Slith Horde?";
	text1 = "_The slithzerikai only kill rebellious humans and weak-minded slithzerikai. They are not brutal and mindless like the Empire. They have said they will spare us and let us have our fortress, if we can give them a gift._";
	text2 = "";

begintalknode 37;
	state = 32;
	nextstate = 33;
	condition = 1;
	question = "What sort of gift?";
	text1 = "_Something truly valuable. Like the secrets of an Empire alchemist. One who knows how to unleash great, fiery power. One who we captured, took from you Avernites._ The creature is enjoying taunting you.";
	text2 = "_But we could not take his mind. We could not take his secrets. So I gave him to my pets for their amusement._";

begintalknode 38;
	state = 33;
	nextstate = -1;
	condition = gf(94,8) == 1;
	question = "Empire alchemist? You have Asterios?";
	text1 = "_Had Asterios. We gave him away. I doubt much of him remains._";

begintalknode 39;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "Where is he?";
	text1 = "_Up above, being sacrificed. My pets are bloodthirsty. Sacrifices give them such ... joy. It is difficult for us to find toys to satisfy their bloodlust, but it does keep them content._";

begintalknode 40;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "What did you do to him?";
	text1 = "_We used our powers to pry his mind open. Our pets used cruder methods. Nothing broke him. Something within him ... some training ..._ Corma-Eye's eyestalks twitch in anger.";
	text2 = "_His mind was too strong for him to serve us. And thus, sacrifice._";

begintalknode 41;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "You will free your prisoner.";
	text1 = "Corma-Eye decided that nobody is coming to assist him. His eyestalks glare at you. _Enough. We are through with this._";
	text2 = "_We will not kill you. We will beat you into submission, and we will take your brain. Only then can you replace those you have cost me!_";
	action = END_TALK;

	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "The young man is tied securely to the altar, but he managed to escape damage in the battle. You untie him. He rubs his hands together, trying to restore circulation to them.";
	text2 = "You get a good look at him. He is in his early thirties. He is not entirely pale. He is definitely from the surface. His hands bear the trademark stains of an alchemist.";
	text3 = "_What a relief,_ he says. _I was starting to think I was in real trouble. I am Asterios. Thank you for saving me._";


begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "How did you get here?";
	text1 = "_Well, I needed some herbs to complete a potion I was making. I asked some scouts to find it. The commander suggested I accompany them, to make sure I got what I needed._";
	text2 = "_I should have refused, but I wanted to see more of Avernum. I thought it was safe, but then the cultists ambushed us. And ..._ He shakes his head.";

	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "What do you know about the cultists?";
	text1 = "He shudders and rolls up one of his sleeves. You see some of the marks they left on him. _I know that the world is not worse off without them._";
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "You are going to destroy Cotra?";
	text1 = "_I hope to. Everything is ready. I just need to get back._";
	text2 = "He gives the altar a haunted look. _I hope you won't ask me the secret to my mixture. I have been subjected to a lot of ... questioning lately. It is tiresome._";
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Should I escort you back to Cotra?";
	text1 = "_It is not necessary. I think I can  get back safer alone. I know a few spells. I don't think I'll be in danger of being seen._";
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Why don't you go back to Cotra?";
	text1 = "Asterios nods. _I will see you there soon, I hope. Again, I appreciate your help._";
	text2 = "He mutters a spell. In a moment, he becomes translucent, hard to see unless you are concentrating on it. Then he turns and walks swiftly to the north.";
	action = END_TALK;
	code =
		sf(106,1,1);
		award_party_xp(300,25);
	break;

////

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