// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(94,2) == 0;
	question = "special";
	text1 = "You are close to Cotra, one of Avernum's most famous cities, and its most abused. Cotra has been ruined twice in its short life, once during the Empire invasion and again in the Time of Shades.";
	text2 = "And now, in this current crisis, it looks like this port city is about to be abandoned once again. There are few lights. Nobody travels in and out.";
	text3 = "Only one lonely cook fire glows from within the crumbling walls. The gates are surrounded with debris and abandoned furniture, left behind by refugees who found that they needed to lighten their loads.";
	action = SET_SDF 94 2 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(94,3) == 0;
	question = "special";
	text1 = "When you enter Cotra, you find that the abandonment of the city has advanced far more than you suspected. The buildings within have been mostly or completely torn down. The city walls (or what is left of them) surround a hollow shell.";
	text2 = "There is a camp of Avernite soldiers in the east side of town, the last residents of Cotra. Perhaps they can tell you more about what is happening.";
	action = SET_SDF 94 3 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(94,4) == 0;
	question = "special";
	text1 = "You descend into Cotra's sewers. They are not as advanced as those of Silvar or Almaria. Every time the Cotrans tried to expand them, some calamity interrupted their work.";
	text2 = "There is a heavy smell in the air down here, but not one you expect. It is a sulfurous stink that burns your nose and makes you cough. It smells like an alchemist has been hard at work down here.";
	text3 = "You note a trail of black powder on the floor. Specks of it lead through the gate to the south.";
	action = SET_SDF 94 4 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(94,5) == 0;
	question = "special";
	text1 = "You enter a square chamber underneath the sewer. Sage Asterios is waiting for you. He is standing next to a small barrel. When he sees you, he smiles and looks down at the barrel. _You see? It is ready._";
	text2 = "You inspect the barrel. It is about two feet high. It has been stained a dark red shade, perhaps to serve as a warning. A thin black cord runs out of its base and into a crack in the pavement. It must run under the stones.";
	text3 = "The harsh, sulfurous smell is very strong in here.";
	text4 = "Asterios says, _Come in! Come in! You should see this. It will be quite remarkable. This cask is much weaker than the others. The other casks are deadly._ You aren't sure what he means by that.";
	action = SET_SDF 94 5 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(94,10) == 0;
	question = "special";
	text1 = "You look through the gate and see a terrifying sight. At least a dozen casks, stacked up and ready to blow. This will probably be the last room in the series to be destroyed.";
	text2 = "If you don't get out of Cotra before the fire reaches this chamber, you will never get out at all.";
	action = SET_SDF 94 10 1;

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

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  DANGER!";
	text3 = "  Turn back!";
	text4 = "  Cotra is trapped! If not a soldier, stay out!";

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You speak to the soldiers camped in Cotra. They are a tired, undersupplied, demoralized lot. Many of them are Cotrans, and spending long weeks tearing down their city is understandably difficult for them.";
	text2 = "Still, they understand the necessity of the job. They only want reinforcements to come and help them complete it quickly. They do not have adequate defenses to hold off a decently sized slith raiding party.";



// Commander Myranna

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "The commander of Cotra is sitting by the fire, watching the other soldiers as they carry out the tiresome work of tearing down walls and hauling away blocks.";
	text2 = "When she sees you, she isn't pleased. She rises and says, indignantly, _I am Commander Myranna. What are you doing here? Didn't you see the signs? Cotra is closed off. Only soldiers with orders can be in here._";
	text3 = "_It is hard, dangerous work, and you'd only be in our way. Head out._";
	text5 = "Commander Myranna sits by the cavewood fire, watching the soldiers. They occasionally approach her, exhausted, to get guidance regarding what wall to tear down next. Then she goes back to reviewing maps and eating.";
	text6 = "Attaining such a high rank definitely has advantages.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = gf(94,6) == 0;
	question = "I just need one thing before I go.";
	text1 = "_No. No information. No supplies. You need direction? Go talk to your superior officer. Now leave. That is an order._";
	action = END_TALK;

begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = gf(94,6) == 0 && (gf(177,9) == 1 || gf(170,1) >= 20);
	question = "I have orders from the Castle. I was sent here to help you.";
	text1 = "Commander Myranna looks surprised, though she still doesn't seem pleased. _Really? The Castle finally is helping us? And they sent ... you?_";
	text2 = "She sighs. _I didn't expect much, and I got less. Still, if you are here, I have no choice but to use you._";
	action = SET_SDF 94 6 1;

begintalknode 13;
	state = 10;
	nextstate = 11;
	condition = gf(94,6) > 0;
	question = "What is happening here?";
	text1 = "Commander Myranna says, _I think that is clear enough. Cotra is being destroyed. Torn to the ground. Soon, there will be nothing left here but piles of rubble. Rubble with no military value._";

begintalknode 14;
	state = 10;
	nextstate = 12;
	condition = gf(94,6) > 0;
	question = "What are the soldiers doing?";
	text1 = "_They're tearing down the buildings on the inside of the city. Once they're all down, all that will be left is the sewers and the walls. The sliths could hide in the tunnels or behind the walls, so both have to be destroyed._";
	text2 = "_That would have been a tough job, but then Sage Asterios showed up. He said he could solve that problem. He could destroy it all in an instant. It would be an experiment for him, he said._";

begintalknode 15;
	state = 10;
	nextstate = 15;
	condition = gf(94,6) > 0;
	question = "Can I get some supplies or training?";
	text1 = "She grimaces. _We don't have much. Everything we could spare has gone to Asterios, to make his ... I don't even know what he calls them._";
	text2 = "_Talk to Cowen. She might have a little to spare for you._";

begintalknode 16;
	state = 10;
	nextstate = 13;
	condition = gf(94,6) > 0 && gf(94,8) < 2;
	question = "What do you need from me?";
	text1 = "She nods. _Yes. To business. If this foolishness is to happen, we'd better get to work. Sage Asterios did everything he had to do to destroy Cotra, and then he left the city with one of our patrols. And we lost him._";
	text2 = "_He's probably dead. A real shame, that would be. You should see if you can find him. If you do, bring him back. He is the only one that knows how his ... his casks work._";
	code = 
		set_flag(94,8,1);
		toggle_quest(55,1);
	break;
	
begintalknode 17;
	state = 10;
	nextstate = -1;
	condition = gf(94,6) > 0 && gf(94,8) == 1 && gf(94,7) > 0;
	question = "I'm afraid that Asterios is dead.";
	text1 = "She nods. She doesn't seem sad. _Then we will have to tear apart Cotra the hard way: by hand, one brick at a time. It'll take forever. Such a  pity._";
	text2 = "_Well, you did what you were supposed to. I dismiss you. You can go help someone else. Me, I'm getting back to work._ She waves you off.";
	action = END_TALK;
	code = 
		set_flag(94,8,2);
		toggle_quest(55,3);
	break;

begintalknode 18;
	state = 10;
	nextstate = -1;
	condition = gf(94,6) > 0 && gf(94,8) == 1 && gf(106,1) > 0;
	question = "I have freed Asterios.";
	text1 = "She nods. She doesn't look as pleased as you expected. _Well, then the destruction of Cotra will have to happen, won't it? One of our oldest cities. So many years of work. Such defenses. Smashed to bits._";
	text2 = "_Well, orders are orders. I will prepare our soldiers for a quick departure. You can go tell Asterios to destroy the city before he wanders off again._";
	text3 = "She thinks for a bit. _Also, you need to go down there and help him. Assist him with whatever he needs. That is an order._";
	action = END_TALK;
	code = 
		award_party_xp(300,20);
		set_flag(94,8,2);
		toggle_quest(55,3);
		toggle_quest(56,1);
	break;

begintalknode 19;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Why is this happening?";
	text1 = "_Because we can't hold Cotra anymore. We don't have the soldiers, and there weren't enough people left here to make the town worth saving._";
	text2 = "_But its defenses were strong. If the sliths got in here, we'd have a really hard time shaking them out. So we're razing the city, so that we don't leave behind anything for them._";
	
begintalknode 20;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What happened to the townspeople?";
	text1 = "_Most of them already left. There was no food, and the Slith Horde terrified them. The few stubborn folk that remained, we gave some food and kicked out. They're refugees now. Better that than letting them be killed here._";

begintalknode 21;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Where was Asterios from?";
	text1 = "_The surface. He's an Empire sage. An alchemist. He was down here when the Great Portal was destroyed, looking for supplies to purchase._";
	text2 = "_Once he saw he was trapped, he started looking for ways to make himself useful. And to test out his new concoctions on us._";

begintalknode 22;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "What does Asterios want to do?";
	text1 = "_He says that he can destroy the walls and the sewers in a minute. That he can summon some huge, fiery cataclysm. That was his word. 'Cataclysm.' He said he would use alchemy, not magic._";
	text2 = "_We got word from the Castle. They already knew all about that Empire sage in our lands. Asterios could do what he said, they told me. Our orders were, get him what he wants and let him do his work._";

begintalknode 23;
	state = 12;
	nextstate = -1;
	condition = gf(94,8) < 2;
	question = "Where is Asterios now?";
	text1 = "_We lost him. And that brings us to exactly why we need you._";

begintalknode 24;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What do you think of this plan?";
	text1 = "_I think it's mad. I told anyone who'd listen. Stupid waste of a good fort. And I think that nobody wanted to hear what I had to say. So I have to follow orders._";

begintalknode 25;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Where did he go?";
	text1 = "_One of my scouts saw movement at the old tannery, to the west, in the outskirts of town. I sent a patrol to investigate. Asterios wanted to go with. I let him. None of them came back._";
	text2 = "_Bad luck, too. He was going to destroy Cotra the next day._";
	text3 = "_As for where he ended up ... I mean, where his body ended up, I have no idea._";
	
begintalknode 26;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Why did you let him leave?";
	text1 = "She frowns. _Tread lightly. You are talking to a superior, and I won't take any insubordination._";
	text2 = "_Asterios was a sage. Flighty. Easily distracted. His alchemy probably left him with a soft brain. Maybe he wanted to walk along and look for herbs._";
	text3 = "_Doesn't matter. The Castle told me to do what he said. So I let him go._";

begintalknode 27;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "What did Asterios ask for?";
	text1 = "_Strange things. Sulfur. Coal from the fire. Rocks. Trash. Plants. No idea why he wanted any of it. Not my job to ask._";

begintalknode 28;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Have you sent soldiers to look for the sage?";
	text1 = "She looks annoyed. _You take me for an idiot? They scoured the woods and fens to the west. They didn't have numbers or equipment to hunt in the tunnels, so I didn't make them._";
	text2 = "_Wouldn't matter if I had sent them down there. If Asterios ended up in the tunnels, he's passed through a chitrach by now._";

begintalknode 29;
	state = 10;
	nextstate = -1;
	condition = gf(94,8) > 1;
	question = "Any more guidance for dealing with Asterios?";
	text1 = "_Just, whatever he does, be ready to run. And go deal with him now, before anything else goes wrong._";
	action = END_TALK;

// BOOM ENC

begintalknode 30;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "When you are in the chamber, Sage Asterios turns to look at you. _Yes. Yes. You have come to see this. Excellent. I know that the commander wanted you to help me, but very little remains to be done._";
	text2 = "He picks up a lit candle from the floor and indicates the cask. _This is full of firedust._ He indicates a thin rope, covered with black dust, that runs from the cask into a crack in the floor. _Now, what I ..._";
	text3 = "And then the gate behind you begins to close.";

begintalknode 31;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Sage Asterios looks at the closed gate, perplexed. _That is not right. Probably a malfunction. It is fortunate I had not touched fire to the rope. If I had, we would be in great danger._";
	text2 = "You hear footsteps to the west. You turn and see Commander Myranna enter the room. Sage Asterios looks relieved.";
	text3 = "_Ah, commander. Here to see the event, I see. Well, there will be a delay._ He points at the closed gate. As you look at the gate, you think you can hear shouting. Very faint, coming from the tunnel.";
	text4 = "The commander says, _Yes, that is a problem. Let me take a look. Together, we might be able to force it open._";

begintalknode 32;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Sage Asterios looks down at the gruesome wound in his chest and screams, _Betrayal! Treachery! Well, I will not die alone!_";
	text2 = "Before you can stop him, he mutters a spell. A flash of flame flies from his hands to the cask.";
	text3 = "Then there is smoke, and fire, and your shattered body flying across the room. And then nothingness.";
	code =
		erase_char(30000);
	break;
	
begintalknode 33;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You hear a hideous rasp to the east. You turn and see Sage Asterios. He is not quite dead. He has managed, through a superhuman act of will, to rise to his knees. And grab the lit candle he prepared.";
	text2 = "Commander Myranna shouts, _No! You can't!_";
	text3 = "Asterios slowly slumps forward. On the way down, he touches the flame to the rope. The rope begins to burn.";
	text4 = "Asterios closes his eyes. He is dead now, and the carefully guarded secret of firedust dies with him. But that is not the worst of your problems. The burning end of the rope disappears between the stone tiles.";
	text5 = "Very soon, this room will be nothing but a mass of rubble.";
	code =
		if (char_ok(10163) == FALSE)
			rs(2);
	break;
	
begintalknode 34;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The burning end of the rope enters the first cask. It explodes. The floor chokes under your feet. Rocks fall from the ceiling. The first room collapses, burying Asterios away forever.";
	text2 = "But that was only the first cask. There are many more in the hallways ahead. If you don't outrace the explosions, these sewers will be your grave.";

begintalknode 35;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You inspect the cask. It is almost two feet high, sealed shut with wax. A length of thin rope, studded with bits of black dust, comes out of the stone floor and enters it at the base.";
	text2 = "You leave the thing alone. You have never seen anything like it before, and, if you tried to tinker with it, you'd probably just blow yourself up.";

begintalknode 36;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You look back down the stairway and find that it is choked with rubble. You can't go downstairs here.";

begintalknode 37;
	state = -1;
	nextstate = -1;
	condition = gf(94,1) > 0 && gf(94,15) == 0 && gf(94,16) == 0;
	question = "";
	text1 = "You manage to escape the sewers of Cotra. Behind you, you hear another series of explosions. A cloud of dust rises from the pit. The route behind you is blocked.";
	text2 = "The walls of the city still stand. That means that, somewhere below you, there are a series of powerful charges still waiting to be set off. You need to get out of Cotra before they blow.";
	text3 = "As you round the corner, you see several slith warriors. Their spears are covered with blood. They must be the ones that slew the Avernite soldiers. They are confused and disorganized, unsure of how to react to the explosions.";
	code =
		sf(94,15,1);
		sf(94,14,100);
		sf(94,16,1);
		
		activate_hidden_group(12);
		set_name(10187,"Horde Raider Akosss");
		set_boss_level(10187,1);
	break;


begintalknode 39;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The commander brushes past you. _Wait. There is something I must do._";

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

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

// Apprentice Gijon

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "An alchemical workshop has been set up in one of the crumbling buildings. It looks like it has seen heavy use. The floor is stained and burned from spills, and bits of odd black powder are everywhere.";
	text2 = "A young apprentice mage is sweeping up. You wonder if he is still under a vow of silence, until he answers the question by speaking. _Welcome. I am Apprentice Gijon. Do you need anything from our workshop?_";
	text3 = "He is very nervous, but he is doing a good job of hiding it. You only rarely notice his hands shaking.";
	text5 = "Apprentice Gijon continues to clean and maintain the workshop. He's a mage, not an alchemist, so he can't make anything. But he can keep the equipment in good working order. He works slowly so that his shaking hands don't break anything.";
	text6 = "_Do you need anything else?_";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = gf(94,6) == 0;
	question = "Can you tell me about this workshop?";
	text1 = "_Of course! I ... Wait. You are new here. Have you received the commander's permission to stay?_ He soon realizes that you haven't.";
	text2 = "_Sorry, but you'd better speak with the commander. I'll get in terrible trouble if I speak with you before that._";
	action = END_TALK;

	
begintalknode 52;
	state = 50;
	nextstate = 51;
	condition = gf(94,6) > 0;
	question = "Can you tell me about this workshop?";
	text1 = "_We set it up for Sage Asterios when he came here. Orders from the Castle. Give him everything he needed. And this is where we brought him his supplies and watched him make the casks._";
	text2 = "_It is also well-equipped to heal any soldiers wounded in their patrols. Should you need assistance, please ask._";
	
begintalknode 53;
	state = 50;
	nextstate = 53;
	condition = gf(94,6) > 0;
	question = "How long have you served in the war?";
	text1 = "_I ... Well ... Not long. A few months. I completed my apprenticeship and volunteered, and they sent me up here right away. Didn't give me a chance to change my mind._";
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = gf(94,6) > 0;
	question = "Can you teach me any magic?";
	text1 = "_Oh, no. I have barely only left the Tower myself. If I taught you, you'd probably only end up burning your hands off._";
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = gf(94,6) > 0 && gf(106,1) > 0;
	question = "Asterios has been freed.";
	text1 = "_I've seen him. I'm very grateful. The sooner he can come here and do ... whatever he is going to do, the sooner we can leave. We're very vulnerable here._";
	
begintalknode 56;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "How did you assist him?";
	text1 = "_Cleaning. Grinding. Weighing. The sort of things they made us all do at the Tower Colony to punish us. I wasn't insulted, though. I've been in two battles with the horde. I'd rather wash bowls._";
	
begintalknode 57;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "What exactly did he make?";
	text1 = "_I don't know. Some new concoction, of his own recipe. The Empire allowed him to come to the underworld to work on it. He said they didn't want him making the stuff in their own cities._";
	text2 = "_So, when he heard that Cotra would be destroyed, he volunteered to aid us. I'm not sure what he was making, but it was vile-smelling and dangerous._";
	
begintalknode 58;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "Tell me about the casks.";
	text1 = "_They are small barrels. He had us stain them red as a warning. He made powder and put it in the casks. Then he had us carry them into the sewer._";
	text2 = "_He told us to never let any fire get near them, and believe me, we did what he said._";

begintalknode 59;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "Why did you join?";
	text1 = "He looks surprised. _An odd question. I wanted to protect Avernum. You know our history. In times of crisis, to survive, all must do all that they can. Otherwise, we all fall._";

begintalknode 60;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "And have you battled the slithzerikai?";
	text1 = "He gets a haunted look. _I don't want to talk about it. I was no fool. I knew there would be no glory in the battles. Just ugliness. But ... Even then, I don't want to talk about it._";
	text2 = "_I will just follow orders and keep fighting until Avernum is safe from the horde. And I can go home._";

begintalknode 61;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "I could use healing.";
	text1 = "The mage tends to your wounds. He is not a skilled healer, but the bandages and concoctions placed here by Sage Asterios enable him to get the job done.";
	code =
		revive_party();
	break;

begintalknode 62;
	state = 51;
	nextstate = 50;
	condition = 1;
	question = "I want to ask about something else.";
	text1 = "_Of course. Please go on._";

	
// 70

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "There is a sergeant standing in the corner here, tearing apart several crates with a hammer and a pick. She takes the freshly liberated cavewood boards and stacks them off to the side.";
	text2 = "When she sees you, she is eager to take a break from her labors. She wipes her brow with her sleeve and says, _Greetings. I am Sergeant Cowen. Don't see many new faces here._";
	text3 = "_I'm the quartermaster._ She kicks an empty crate. _Though I have little left to hand out._";
	text5 = "Sergeant Cowen continues to tear apart a crate. _This is pointless, I know. But we could use boards more than boxes, so I keep busy._";
	action = INTRO;

begintalknode 71;
	state = 70;
	nextstate = 72;
	condition = 1;
	question = "What are you doing?";
	text1 = "_I'm tearing apart these boxes. Making boards. Seemed the best use of my time. We don't have food to put in them. We don't have much of anything._";

begintalknode 72;
	state = 70;
	nextstate = 73;
	condition = 1;
	question = "You are the quartermaster?";
	text1 = "_I am. It used to be less of a joke. We were outfitted to be here for a while. We had more soldiers and more equipment. Then some were transferred away and others died, and we were stuck here for months._";
	text2 = "_Still had plenty to do, though. Had to find supplies for Asterios._";

begintalknode 73;
	state = 70;
	nextstate = -1;
	condition = gf(94,20) == 0 && gf(94,6) == 0;
	question = "Can I get some supplies?";
	text1 = "She gives you an odd looks. _Can you ... Wait. Are you even allowed to be here? You need the commander's permission to be in Cotra. Go talk to her._";
	action = END_TALK;

begintalknode 74;
	state = 70;
	nextstate = -1;
	condition = gf(94,20) == 0 && gf(94,6) == 1;
	question = "Can I get some supplies?";
	text1 = "_Well, we can't ... Wait. I heard the commander was sending you to find Asterios. So we can complete our mission and go home._";
	text2 = "She smiles. _You can have everything you want. I will unlock the storeroom for you._";
	action = SET_SDF 94 20 1;

begintalknode 75;
	state = 70;
	nextstate = -1;
	condition = gf(94,20) > 0;
	question = "Can I get more supplies?";
	text1 = "_We really have given you all we can spare._";

begintalknode 76;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "Why do you need boards?";
	text1 = "_To burn. To make fortifications in preparation for the inevitable slith attack. To ... build new crates, I suppose._";
	text2 = "_Still, we are generous here in Cotra. If you need a board for something, please help yourself._";

begintalknode 77;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "Do you have enough supplies to survive?";
	text1 = "_No, but that isn't stopping anyone else. We fish and forage. If things get bad enough, we'll see if chitrachs are edible._";

begintalknode 78;
	state = 73;
	nextstate = -1;
	condition = 1;
	question = "Have the slithzerikai attacked?";
	text1 = "_Not yet. We're still protected by Fort Duvno, and we have a good defensive position. And I don't think they realize how few soldiers we have._";
	text2 = "_But that will change. We've seen their scouts. If we don't complete our work here and find a new position soon ..._ She shakes her head.";

begintalknode 79;
	state = 73;
	nextstate = 74;
	condition = 1;
	question = "What did you get for Asterios?";
	text1 = "She laughs. _What didn't he ask for? To make his casks or whatever they are, he wanted charcoal. And herbs. And wood. And ... Some things that are too disgusting to describe. He worked and kept us busy for several months._";
	text2 = "_Now me, I think he is mad. But if he helps us to destroy Cotra, we didn't waste the time._";

begintalknode 80;
	state = 74;
	nextstate = -1;
	condition = 1;
	question = "Do you agree that they should destroy Cotra?";
	text1 = "_I do. It's a hard choice, but it's the right one._";

begintalknode 81;
	state = 74;
	nextstate = -1;
	condition = 1;
	question = "Do you know how to reproduce Asterios's work?";
	text1 = "_Not quite, but we have all been watching him carefully. When Cotra is destroyed, I'm sure we'll all be sent to the Castle to say everything we've found out about his recipes._";
	text2 = "_If he really has something that can destroy a city wall in a moment, well ..._ She snaps a finger. _That is something everyone will want._";

// Sage Asterios

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "You meet Sage Asterios once again. He is standing at a stone table, grinding up some charcoal in a mortar and pestle. Now that he is in his environment, he seems much calmer.";
	text2 = "_Ahhh ... My rescuer. I am so pleased to see you again. Without you, I would have no hope of returning to the surface. Or of completing the job I came to Cotra to do._";
	text5 = "Sage Asterios continues to frantically work, grinding and mixing the components of his concoctions. _Once we have the approval of the commander here, we can complete our fiery task._";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = 91;
	condition = 1;
	question = "You are from the Empire?";
	text1 = "He nods. _I am. I miss it terribly, as you can imagine. I have been trapped down here for some time. But it was they who sent me down here. Nobody on the surface would allow me to create my firedust near them._";

begintalknode 92;
	state = 90;
	nextstate = 92;
	condition = 1;
	question = "How will you destroy Cotra?";
	text1 = "_I have spent months of hard work here making firedust, packing it into casks, and placing them in the sewers. I have connected them with a rope, infused with firedust, that will carry flame from cask to cask. My own invention._";
	text2 = "_Now all that remains is to go downstairs and touch off the conflagration._";

begintalknode 93;
	state = 90;
	nextstate = -1;
	condition = gf(94,8) == 1;
	question = "Are you ready to destroy Cotra?";
	text1 = "_I am, but I do not have permission, and your commander has been slow to give it. Speak with her. Convince her the time to act is now._";

begintalknode 94;
	state = 90;
	nextstate = -1;
	condition = gf(94,8) > 1;
	question = "Commander Myranna says it is time to destroy Cotra. I am to help you.";
	text1 = "Sage Asterios turns from his worktable. _Truly, this is a great day. For me. For you. For history._";
	text2 = "_The stairs down to the first cask are just inside the north wall. You can gain access near the east gate. I will take up my position now. Please join me quickly. And be prepared. You never know what might happen._";
	text3 = "Barely able to contain his excitement, he leaves the workshop.";
	action = END_TALK;
	code =
		sf(94,9,1);
		sf(94,25,1);
		sf(94,26,1);
		erase_char(10153);
	break;
	
begintalknode 95;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "What is firedust?";
	text1 = "_It is a new alchemical concoction, one I have been working on for years. One I have almost perfected. Cotra will be its true test! What I do here will prove that it works._";
	text2 = "_It is a black powder. When massed together and touched with flame, it will produce a fireball to rival even the greatest wizard's spell._ Seems hard to believe.";

begintalknode 96;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "Why wouldn't they let you work on firedust on the surface?";
	text1 = "_Because I would not lie. I made clear to them that it was dangerous work, but I required resources. Resources that required I be near a city._";
	text2 = "_Of course, I would be far enough from the city that any explosions would do no harm. But the mayors, paranoid as always, did not believe me._";

begintalknode 97;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "How is firedust made?";
	text1 = "Asterios shakes his head. _I will use my power to aid Avernum, but that is all. I will not surrender this secret. I have already made this clear to the Castle, and they accepted my terms._";

begintalknode 98;
	state = 92;
	nextstate = -1;
	condition = 1;
	question = "What exactly needs to be done?";
	text1 = "_I need to go to exactly the right place and touch flame to the rope. Then we must all run. Very fast._";

begintalknode 99;
	state = 92;
	nextstate = -1;
	condition = 1;
	question = "What will happen?";
	text1 = "_The firedust casks will explode, one after another, caving in the sewers and collapsing the city walls above._";

begintalknode 100;
	state = 92;
	nextstate = -1;
	condition = 1;
	question = "Why are you doing this?";
	text1 = "_Because, in return, I get the perfect circumstances to test the mixture. Also, the soldiers have worked very hard to obtain materials and bring them to me. What alchemist could ask for more?_";

////

begintalknode 110;
	state = -1;
	nextstate = 110;
	condition = 1;
	question = "Name";
	text1 = "Commander Myranna passes near Asterios on the way to the gate. Then she turns. Her arm is a blur. There is a flash of steel. Asterios falls to his knees, his throat cut.";
	text2 = "You try to stop Commander Myranna, but she is too fast. She leaps toward Asterios. Her arm is a blur. There is a flash of steel. Asterios falls to his knees, his throat cut.";
	text3 = "He points a finger at the cask and tries to mutter a spell. No sound comes out. He collapses.";
	text4 = "Commander Myranna smirks. _You know, I didn't think that would work. There was a good chance Asterios would kill us all. But we survived. Well, I will survive._";
	text5 = "More sounds echo to you from the tunnel to the north. Fighting in Cotra. And screaming.";
	code =
		if (get_attitude(10163) < 10)
			rs(2);
			else rs(1);
		
		erase_char(10162);
		set_attitude(10163,10);
		
		spawn_creature(10164);
		spawn_creature(10165);
		spawn_creature(10166);
		alert_char(10164);
		alert_char(10165);
		alert_char(10166);
		set_name(10164,"Horde Raider");
		set_name(10165,"Horde Raider");
		set_name(10166,"Horde Raider");
		
		sf(94,27,1);
		sf(94,28,1);
		sf(94,1,1);
		
		sf(94,13,3);
		toggle_quest(56,3);
	break;
	
begintalknode 111;
	state = 110;
	nextstate = 111;
	condition = 1;
	question = "Wha ... What?";
	text1 = "_Oh, I think it is not difficult to understand. Asterios is dead. And soon, all of the other Avernite soldiers will be too._ Sure enough, the sounds of battle outside quickly come to an ominous halt.";
	text2 = "_There. Now only you remain. And not for long._";
	
begintalknode 112;
	state = 110;
	nextstate = 111;
	condition = 1;
	question = "You just killed Asterios!";
	text1 = "_Oh, Asterios is only the start. By now, all of the Avernite soldiers in Cotra should be dead._ Sure enough, the sounds of battle quickly come to an ominous halt.";
	text2 = "_There. Now only you remain. And not for long._";

begintalknode 113;
	state = 110;
	nextstate = 111;
	condition = 1;
	question = "Do you hear that? Someone is fighting upstairs.";
	text1 = "She holds up a hand. _One moment. It won't last long._ Sure enough, the sounds of battle quickly come to an ominous halt. _There. Now only you remain._";
	
begintalknode 114;
	state = 111;
	nextstate = 112;
	condition = 1;
	question = "But who killed them?";
	text1 = "_The slithzerikai. Raiders of the mighty horde, here to claim Cotra on my signal. I finally weakened our defenses enough that a small force, with surprise, could do the job._";
	text2 = "_It was risky doing the attack with so few, but that is the way of war. And, as you can see ..._ She nods at Asterios. _We had no time left._";
	
begintalknode 115;
	state = 112;
	nextstate = -1;
	condition = 1;
	question = "You weakened the defenses? How?";
	text1 = "_Offering my soldiers to other postings. Sending them on dangerous patrols. Surrendering supplies. Just small steps, to make me look incompetent but not treasonous._";
	text2 = "_And communicating with the horde, of course._";
	
begintalknode 116;
	state = 112;
	nextstate = -1;
	condition = 1;
	question = "And you had all those in your command killed?";
	text1 = "_It was the price I had to pay to live. It took many sleepless nights to come to the decision, I assure you. But once I saw it was my only hope, I acted._";
	
begintalknode 117;
	state = 112;
	nextstate = 113;
	condition = 1;
	question = "You are in the employ of the Slith Horde?";
	text1 = "_Don't act so shocked. You are only jealous that you did not think of it. Avernum is crumbling. Doomed. I decided, in the end, I want to live. And, when Khrez-Yss the Shadow came to me, I knew I had the chance._";
	
begintalknode 118;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "What did they offer you?";
	text1 = "_Survival. There is a colony of humans near Formello. Those who helped the horde, and who will be spared. I will join them. It is frightening, being at their mercy, but it is my only hope._";
	text2 = "_Even though you have defeated their leaders, Avernum is still trapped and starving. My best hope is still with them._";
	code =
		if (gf(170,8) == 0)
			rs(2);
	break;
	
begintalknode 119;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "And you think you can kill me?";
	text1 = "_It will be a true challenge, I know. I didn't want the Castle to send help. And, when they did, I did not think they would send someone actually competent._";
	text2 = "_And then you managed to rescue Asterios, after I went to so much trouble to lose him. I am not sure that I can slay you. I will do my best. Just bad luck that it came to this._";
	
begintalknode 120;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "Please spare me. Let me join you!";
	text1 = "_What? You aren't serious! This is some trick. And, even if it were not, the mighty horde only takes a few to join them. There is just no room for you._";
	text2 = "She listens. _I think I have delayed you enough. My help is here._ Sure enough, you hear a gate open to the west, letting in several slith raiders.";
	text3 = "_Now we can kill you. We will remove the casks. The horde will seize Cotra, causing Avernum no end of trouble. And I will live!_ She raises her bow, and the warriors advance.";
	action = END_TALK;
	
begintalknode 121;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "You will not get away with this.";
	text1 = "_Perhaps not, but I am a soldier. I never receive a guarantee of success. Still, I think my odds are good. Once you are dead._";
	text2 = "She listens. _I think I have delayed you enough. My help is here._ Sure enough, you hear a gate open to the west, letting in several slith raiders.";
	text3 = "_Now we can kill you. We will remove the casks. The horde will seize Cotra, causing Avernum no end of trouble. And I will live!_ She raises her bow, and the warriors advance.";
	action = END_TALK;

		
begintalknode 295;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Sage Asterios's elaborate network of casks works exactly as intended. The flame reaches the final cache of firedust. A massive series of explosions shakes Cotra.";
	text2 = "Fire shoots up through cracks in the floor. Sections of the cave floor glow red and melt. The shockwave alone is enough to shatter your bones.";
	text3 = "And then, one by one, the walls of Cotra collapse. Soon, there is nothing left of them but long stacks of rubble.";
	text4 = "The city of Cotra, survivor of many wars, is gone forever. Only wreckage marks its passing.";
	
	
////

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