// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(6,3) == 0;
	question = "special";
	text1 = "There is a lot of rubble in this cavern. It looks like it was cleared away recently, opening a narrow path through to the west.";
	action = SET_SDF 6 3 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(6,4) == 0;
	question = "special";
	text1 = "This room is also clogged with rubble. There are also two stone servants here, magical constructs made to do menial labor. They are old, and their magic is failing. Chunks are actually falling out of them.";
	text2 = "However, they have done their job: They have kept this corridor free of debris. Because of them, you are able to pass through and reach ... this dead end.";
	text3 = "You look around, wondering if this is really the end of this passage. You notice that the far wall has several odd stone outcroppings.";
	action = SET_SDF 6 4 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(6,5) == 0 && gf(6,1) == 0;
	question = "special";
	text1 = "You emerge from the tunnels into Fort Monastery. It doesn't take long for the soldiers to find you. They constantly patrol the entire fort looking for slith infiltrators. And you're not sure you've ever met anyone happier to see you.";
	text2 = "The soldiers of Fort Monastery, what few of them remain, gather to greet you and learn of news outside their walls. They are a hungry, scarred, exhausted lot, but you learn that they have kept the horde at bay for months.";
	text3 = "They don't stay for long, though. Their leader, Captain Khatessa, shouts for them to return to their posts. As he returns to the front gate, he says, _You should see the commander. He's in the northeast barracks._";
	text4 = "And then the crowd dissipates. Keeping the slithzerikai at bay requires constant effort of vigilance. You're frankly surprised that they can still maintain the effort.";
	action = SET_SDF 6 5 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(6,6) == 0;
	question = "special";
	text1 = "There are quite a few cairns in the back of the fort. They are all recent work. All of them contain a recently fallen Avernite soldier. Some of them bear the warrior's weapon or favored possession. It is a somber place.";
	text2 = "Of course, if peace ever comes, these graves will be moved outside. That happy day still looks very distant.";
	action = SET_SDF 6 6 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(6,7) == 0 && gf(6,1) == 0;
	question = "special";
	text1 = "From here, you get a good look at the enemy outside the gates. Camps full of savage slithzerikai warriors, waiting for a good chance to scale the walls and finally destroy the defenders.";
	text2 = "And yet, you are also seeing a lot of faded, graying scales and worn claws. The best and the strongest of the horde's warriors are sent to the front lines. Keeping Fort Monastery bottled up? That task goes to those seen as weak.";
	text3 = "But this will not last forever. Soon, the horde will tire of having an Avernite outpost within its lands. Fort Monastery has no chance of surviving against a serious assault. It must get relief soon.";
	action = SET_SDF 6 7 1;




//

begintalknode 10; // portal mess
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to use the portal pylon, but it is dormant. It probably needs a mage to come out and repair it. And that's unlikely to happen as long as the siege continues.";

begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The stone servant sways gently from side to side. It doesn't respond to your presence. It just crumbles quietly.";

//

begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a crowd of slithzerikai guarding the front gate. When one of them sees you, he points and shouts. In moments, a horde of the enemy is on their feet, eager to chase you down and impale you on their spears.";
	text2 = "You start to feel very alone.";

begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There aren't many soldiers left in Fort Monastery, but they are all highly experienced, battle-hardened, and eager to take as many slithzerikai with them as they can before they go.";
	text2 = "They are mainly eager to learn how things are going in the outside world. You tell them everything that has happened, and they seem heartened. However, the fact that the Manburner is still alive does a lot to feed their nightmares.";
	text3 = "They are mainly eager to learn how things are going in the outside world. When they learn how all of the leaders of the slith horde have been destroyed, they are understandably pleased. Though not enough to actually feel hope.";
	text4 = "Now that the siege has been lifted, they are feeling something besides simple fatalism. They are eager to go out, raid some caravans, and find a way back to Avernum. It is possible that some of them might even survive the war.";
	code =
		clear_strings();
		as(1);
		if (gf(6,1) > 0)
			as(4);
			else if (gf(170,8) > 0)
				as(3);
				else as(2);
	break;

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This soldier is sitting on a bench, facing the altar, eyes closed, lost in thought. You don't disturb him.";

begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to talk to the commander, but he shakes his head. _No more time to talk. Just stay close to me and kill every slith you can.";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The commander is exhausted. He only wants to return to his office and rest.";

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "None of the soldiers are able or willing to talk to you right now. The only thing they are concentrating on is destroying as many of the enemy as possible.";

begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The commander reaches a vantage point above the gates. He looks down at them and smiles. Then he looks around Fort Monastery for what may be the final time. _I hate the place,_ he mutters.";
	text2 = "Then, when he sees you are close, he says, _Now we will see how well the captain has maintained discipline. And how well the slithzerikai have. Because nobody expects this._";
	text3 = "He makes a signal with his hands. The soldiers by the gate stare at him, confused. He makes the signal again. And again. Then he nods. The soldiers are reluctant to commit suicide, but they are obedient. They open the gates.";
	text4 = "A moment later, chaos reigns. The commander shouts, _To the gates! The slithzerikai are coming through!_ Meanwhile, outside, the barbarians are howling madly. Some of them are charging the gates, determined to get through while they can.";
	text5 = "The commander's instincts were correct. The slith attack will be disorganized, and you might be able to kill them as they run inside. Success would be assured, were the enemy not so numerous. As it is, a bloody ordeal lies ahead of you.";
	
begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "It is easy to pick out, among the swarming attackers and defenders, the general of the slithzerikai. He stands a full head taller, he wields a massive spear in one hand, and his face has been disfigured by a truly spectacular scar.";
	text2 = "When his remaining eye falls upon you, he stops. He looks at you intently for a moment. Then he points his spear at you and bellows a challenge to you. Somehow, he knows who you are.";
	text3 = "He starts to wade forward through the battle, eager to challenge you.";

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

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

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

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

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

// Commander Matos

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "This is clearly the commander of the fort. He looks up from his desk. For a moment, you have to convince yourself that he is not of the undead. He is deathly pale and worryingly thin. This post has left him a withered husk.";
	text2 = "_So you have come,_ he mutters. _I heard of your grand entrance. We have hoped for relief for so long, but ..._ He looks you over. _You are not enough to save us._";
	text3 = "You note that his armor and weapon are old, dented, and dotted with rust. He hasn't seen actual combat for many a year. Which, considering how frail he is, is a good thing.";
	text5 = "Captain Matos looks out at the barracks, considers going out to review the troops, and decides not to bother. He sighs. _What is it? Something else you want?_";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Tell me about Fort Monastery.";
	text1 = "_Oh, how I hate this place. So many years, out here, neglected, undersupplied, far from civilization. And then they finally let me retire._";
	text2 = "_And then Fort Monastery finally becomes important! But I didn't care, because I was free. And then I was forced to return. And now I will die here._";

begintalknode 32;
	state = 30;
	nextstate = 33;
	condition = gf(6,1) == 0;
	question = "What is your current situation?";
	text1 = "_We are trapped. Cut off. Fending off the horde. Killing the ones we can. Distracting them. Tying up their soldiers. Being a thorn in their side._";
	text2 = "_We all gave up on living a long time ago. Happily, the hope of vengeance keeps them all going._";

begintalknode 33;
	state = 30;
	nextstate = 35;
	condition = gf(6,1) > 0;
	question = "What is your current situation?";
	text1 = "He laughs. For once, he doesn't sound bitter. _We will be on the offensive now. The horde must keep most of its soldiers near the Eastern Gallery. We are free to harass their caravans and waylay their patrols._";
	text2 = "_Yes, it is a great risk. But none of my soldiers are willing to leave now, not when we are hurting them._";

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = gf(177,10) == 0;
	question = "I would like to help you.";
	text1 = "He looks you over. He consults some papers on his desk. He shakes his head. _No, you look competent, but you aren't enough._";
	text2 = "_There are too few of us and too many of them, and you, while competent, won't be enough to tip the balance. You should slip out the way you came and continue to follow your orders._";

begintalknode 35;
	state = 30;
	nextstate = 37;
	condition = (gf(177,10) == 1 || gf(170,1) > 24) && gf(6,13) == 0;
	question = "I have been sent by the Castle to help you lift the siege.";
	text1 = "You tell him about Levitt's orders. He is upset, but the fear of upsetting Avernum's spymaster is real. _He ... He can give these orders, I suppose._";
	text2 = "_But the Castle doesn't understand. Suppose we kill the soldiers outside. That will attract the attention of the triad. The Impaler will send a real threat. The Shadow will come, and the Manburner. And then we'll be finished._";
	code =
		if (gf(177,10) == 0)
			sf(177,10,1);
	break;

begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = gf(6,1) > 0;
	question = "Is there anything else I can do for you?";
	text1 = "_Harass the slithzerikai. Kill them wherever you can. Also, we have a job board. You can consult that. We have put a few tasks upon it, in the hope that bounty hunters will find their way here._";

begintalknode 37;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Can I get some supplies?";
	text1 = "Commander Matos laughs. It is not a kind laugh. _We have nothing to spare. Not a javelin, not a mushroom. It is only the help of a few loyal Avernites outside these walls that we have not starved._";
	text2 = "";

begintalknode 38;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "What made Fort Monastery important?";
	text1 = "_The horde. The slithzerikai came out of the deep tunnels to the north, and we went from backwater to bulwark overnight._";
	text2 = "_Then we got supplies and attention aplenty. Just not enough to actually stop the invaders. Our commanders underestimated the foe, and here we are._";

begintalknode 39;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "You were free?";
	text1 = "_So many years here, and I was finally released. I was going to go south to the Great Cave. Spend the rest of my years in ... Well, what passes for comfort in the underworld._";
	text2 = "_But the horde came, and I delayed. I still have a sense of duty. It is all that got me through the long years here._";

begintalknode 40;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "Why did you have to return?";
	text1 = "_They replaced me with a young commander. Dashing. Brave. Inspiring, Oh, the troops loved him._";

begintalknode 41;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "And what happened?";
	text1 = "_Didn't know to keep his head low. The young fool. Walked out to the front to see the slith advance. The Manburner saw him. She burnt his head off from a hundred paces. Soldiers talked about it for weeks._";
	text2 = "_So they brought me back. Made me a commander after thirty years. Thirty years! And the soldiers hate me. But they know I keep them alive._";

begintalknode 42;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "And you command them still?";
	text1 = "_That is my post. I mostly stay back here. Sometimes, I emerge. I shout at and belittle them. Order a flogging or two. Then I come back here._";
	text2 = "_They hate me. They've all hated me, always, all these years. But it keeps them ... Engaged._";

begintalknode 43;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "And you haven't tried to break out?";
	text1 = "_No. There is nowhere for us to go. Without these walls to protect us, the sliths would tear us apart, make no mistake about that._";
	text2 = "_We are trapped here, until Avernum can send a proper army to relieve us._";

begintalknode 44;
	state = 33;
	nextstate = 34;
	condition = 1;
	question = "I'd like to know more about the enemy.";
	text1 = "He laughs bitterly. _Keeping us penned in is not, shall we say, a prized position in the armies of the horde. More a punishment. But that does not keep them from trying to distinguish themselves by wiping us out._";

begintalknode 45;
	state = 34;
	nextstate = -1;
	condition = 1;
	question = "How often do they attack?";
	text1 = "_Every week or so. They are wearing us down, bit by bit, but we make them pay. We use our ballistae to fire their own javelins back at them._";
	text2 = "_We won't last much longer, but they will pay for this fort in blood._";

begintalknode 46;
	state = 34;
	nextstate = -1;
	condition = 1;
	question = "Is it always a frontal attack?";
	text1 = "_No. They are savage, but cunning. They have many tricks. Tunnels. Spells. They chant to keep us from sleeping. They fling rotting meat, and worse, over our walls. They want to drive us mad before they kill us._";
	text2 = "_But they haven't done it yet. And, when I die here, I'll die knowing that I saw Fort Monastery be useful after all._";

begintalknode 47;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "You aren't fleeing?";
	text1 = "_Not yet. I have scouts looking for tunnels and passages we can use to slip south. When the attention of the horde turns to us again, we will have an escape route. But, until then, we will do some good._";
	text2 = "He seems actually enthusiastic and engaged. Perhaps for the first time in his life.";

begintalknode 48;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "What is the risk?";
	text1 = "_That the horde will return and besiege us once again before we can prepare an escape route for ourselves. But don't worry. I may die here, but at least some of my soldiers will be rewarded with escape._";

begintalknode 49;
	state = 37;
	nextstate = 38;
	condition = 1;
	question = "Ummm ... They are all dead. I killed them myself.";
	text1 = "Matos's jaw drops. He is stunned. _Dead? All three of them dead? You mean that there might be ... That explains a lot. Not long ago, many of the slith outside left. We thought it was a trick. But ..._";
	text2 = "_This changes things._";

begintalknode 50;
	state = 38;
	nextstate = 30;
	condition = 1;
	question = "You mean you might follow the Castle's orders?";
	text1 = "He looks you over. He consults some papers on his desk. He runs some figures in his head. _Yes. We can challenge them now. We can break out. With your help, I mean. If we act quickly. Yes, I have a plan._";
	text2 = "He looks nervously at his papers. You doubt that Matos has ever actually had a proper plan before. Let alone carried it out. But you don't have much of a choice.";
	code =
		sf(6,13,1);
	break;
	
begintalknode 51;
	state = 30;
	nextstate = 39;
	condition = gf(6,13) == 1 && gf(6,1) == 0;
	question = "It is time to break the siege.";
	text1 = "_Yes. I agree. Right now. No long planning, no chance for their sentries to see what we are doing. At this moment, we can strike with surprise, and my estimations tell me that we can defeat them._";
	text2 = "_Just say the word, and we will leave this room. We can have the soldiers ready in minutes. And then, for once, we will have the upper hand._";
	
begintalknode 52;
	state = 39;
	nextstate = -1;
	condition = 1;
	question = "That is your plan? Attack them?";
	text1 = "_That is the only plan. They are there. We want them not to be there. So we will attack them. Don't worry. We have not been idle. We have prepared a few tricks._";
	
begintalknode 53;
	state = 39;
	nextstate = -1;
	condition = 1;
	question = "I am not ready.";
	text1 = "_Well, go prepare! And quickly! This moment of opportunity will not last._";
	action = END_TALK;
	
begintalknode 54;
	state = 39;
	nextstate = -1;
	condition = 1;
	question = "I am ready.";
	text1 = "He rises unsteadily from his chair. Then he locates his sword. It takes some time. He buckles it on, looks around his quarters, and sighs. _I hate this place._";
	text2 = "_Come on. We have been preparing for this moment ever since many of our attackers slipped away. Stay close, and be ready to help us._";
	action = END_TALK;
	code =
		sf(6,13,2);
	break;
	
begintalknode 55;
	state = 30;
	nextstate = -1;
	condition = gf(6,1) > 0 && gf(6,14) == 0;
	question = "I managed to lift the siege.";
	text1 = "_We saw. It was truly a heroic effort. By the time we realized that it was not a trick and you really were an Avernite hero come to destroy them, the battle was over and it was too late to help you. We are all truly grateful._";
	code =
		sf(6,14,1);
	break;
	
begintalknode 56;
	state = 30;
	nextstate = -1;
	condition = gf(6,14) == 1;
	question = "Now that the siege has ended, do you have any supplies to spare?";
	text1 = "_Not really. We still need to save ... Actually, we do have something. There are some old, disused quarters downstairs. Nobody has stayed down there since the Time of Shades._";
	text2 = "_I will have the door unlocked. Feel free to take anything you find._";
	code =
		sf(6,14,1);
		sf(6,28,1);
	break;
	
	
// Oliver

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "There is, surprisingly, a merchant here. He's drunk. That's not surprising. He is also from the Empire. That part is a little odd.";
	text2 = "There are several packs of supplies on the floor, and he keeps a protective foot on them. He runs his hand through his gray, thinning hair and looks up at you. _I don't recognize you. Don't see many people I don't recognize._ He hiccups.";
	text3 = "_Didn't think I'd see a new face until I died. I'm Oliver. A merchant. Thought I'd get rich by coming here. Stupid of me. Should have known never to come back to this pit._";
	text5 = "Oliver continues to sip a liquid from a metal flask. Perhaps more often than he should. He seems to be hoarding the alcohol in his packs for himself.";
	text6 = "_You want to trade? Might as well. My equipment isn't doing any good in the bags._";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = 91;
	condition = 1;
	question = "What are you doing here?";
	text1 = "He barks out a laugh. _I ask myself that question all the time. I came back down to Avernum to get rich. Sell supplies and food to the desperate underworlders._";
	text2 = "_Then I got too greedy. And now I'm stuck._";

begintalknode 92;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "You have been down here before?";
	text1 = "_That's how I made my fortune. Trading all over Avernum in my younger days. I even came out to this fort. Can't believe I was dumb enough to come back. Even then, I knew nothing good could ever happen here._";

begintalknode 93;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "Why did you come up here?";
	text1 = "_Dumb greed. One day, I found I could get more money for my supplies if I headed north. The next day, I found I could get more farther north. And so on._";
	text2 = "_And then I was here, and the horde broke through Avernite lines and surged toward, well, everything. I saw their scouts on the road. I ran here for safety. And I was trapped._";

begintalknode 94;
	state = 91;
	nextstate = -1;
	condition = gf(6,1) == 0;
	question = "They aren't trying to get back to safety?";
	text1 = "_They say that's what they want to do, but there's too many slithzerikai between here and safety. So they're all ready to die, all noble and brave. As for me, I'll probably end up dying with them. But not sober._";

begintalknode 95;
	state = 91;
	nextstate = -1;
	condition = gf(6,1) > 0;
	question = "Now that the siege is lifted, can you get to safety?";
	text1 = "_No! Can you believe it? The stubborn, foolish ... Well, I'd better watch my words. No, I need to go back with soldiers, to protect me. And they won't leave! They all want to be heroes, until the sliths trap them again! Pfaugh!_";
	text2 = "He takes another sip from his flask and mutters darkly to himself.";

begintalknode 96;
	state = 90;
	nextstate = 92;
	condition = 1;
	question = "Do you really trade with the soldiers?";
	text1 = "_Well, they don't have any more money. I have it all. Not that it does me any good._";
	text2 = "_So, when they really need something to keep us all alive, I give it to them. Free._";

begintalknode 97;
	state = 92;
	nextstate = 93;
	condition = 1;
	question = "Free?";
	text1 = "_Free,_ he says mournfully. He looks like he is about to cry.";

begintalknode 98;
	state = 93;
	nextstate = -1;
	condition = 1;
	question = "Say. Could I ...";
	text1 = "_Don't even think about it! You have money. I can smell it on you, and I'll need it to get back to the surface someday. You can pay for my goods._";

begintalknode 99;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "Let me see what you have for sale.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Oliver",
		  "Happily, Oliver has held his most useful equipment back from the soldiers. His wish that someone with money would show up has been granted.",
		  75,5,0);	
	break;


begintalknode 100;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "I would like to sell something.";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode 101;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "I have to go now.";
	text1 = "_Yes. Go be heroic. I'll sit here. And wait for the end._";
	action = END_TALK;
	
// 110 Captain Khatessa

begintalknode 110;
	state = -1;
	nextstate = 110;
	condition = 1;
	question = "Name";
	text1 = "There is a slithzerikai warrior wandering around the fortress, keeping a close eye on the hungry, exhausted soldiers. She wears a captain's insignia. She has a whip hanging from her belt, and you doubt that she's shy about using it.";
	text2 = "She turns and looks at you. _Ahssss. I am Captain Khatessa. You are settling in, I see._";
	text5 = "Captain Khatessa walks around the fort, watching the soldiers and maintaining discipline. All of them get a little more alert whenever the captain is by. When they don't, a bit of furious hissing improves their attitudes.";
	action = INTRO;

begintalknode 111;
	state = 110;
	nextstate = -1;
	condition = gf(6,15) == 0;
	question = "Ahhhh! A slith!";
	text1 = "The other soldiers laugh at this. The captain silences them with a glare and then turns to you. _Yesss. A slith. Here. One who hasss fought for Avernum every day of her adult life._";
	text2 = "_We are grateful you are here. We can use all the help you would give usss. Asss long as you are not foolish._";
	action = SET_SDF 6 15 1;
	
begintalknode 112;
	state = 110;
	nextstate = -1;
	condition = gf(6,15) == 0;
	question = "Greetings to you, captain.";
	text1 = "The slith nods approvingly. _Not all are used to seeing my kind out here in enemy landsss, though my kind has more of a reason to fight the horde than the humansss._.";
	text2 = "_We are grateful you are here. We can use all the help you would give usss._";
	action = SET_SDF 6 15 1;

begintalknode 113;
	state = 110;
	nextstate = 112;
	condition = gf(6,15) > 0;
	question = "What is your purpose in the fort?";
	text1 = "_Ahssss ... Discipline. The only way we can survive in thisss place, with so many against usss, is discipline. Without exception, without mercy. It isss how we have lived so long, killed so many._";
	text2 = "_Now that the siege isss lifted, some hope that I will be ... lenient. Thisss isss wrong. We must be asss disciplined asss ever!_";
	code =
		if (gf(6,1) == 0)
			rs(2);
	break;
	
begintalknode 114;
	state = 110;
	nextstate = 115;
	condition = gf(6,15) > 0;
	question = "Is it difficult being a slithzerikai soldier?";
	text1 = "She chuckles. _It isss difficult for all of usss, slith, nephil, human. But I do have to ... answer questionsss. But none are foolish enough to doubt me for long. Or to say stupid thingsss about me._";
	text2 = "_None hate the horde more than me._";
	
begintalknode 115;
	state = 110;
	nextstate = -1;
	condition = gf(6,15) > 0 && gf(6,1) == 0;
	question = "I would like to help you.";
	text1 = "_For now, all we try to do is survive. If you would help usss, you must speak with the commander. He commandsss, I follow._";
	text2 = "_Once, we had jobsss on the board. Until the siege is lifted, it will stay bare._";
	
begintalknode 116;
	state = 110;
	nextstate = -1;
	condition = gf(6,15) > 0 && gf(6,1) > 0;
	question = "I would like to help you.";
	text1 = "_Now that the siege is lifted, we can do much good here. Look on the job board. We have a list of ways you can help usss._";
	
begintalknode 117;
	state = 112;
	nextstate = -1;
	condition = 1;
	question = "What sort of offenses do you punish?";
	text1 = "_Not maintaining equipment. Malingering. Spreading despair. And, worst, stealing food._";
	text2 = "_Before the siege began, we were given many suppliesss. Thisss was before they thought thisss fort might fall. It isss thanksss to them that we have a chance to survive._";
	
begintalknode 118;
	state = 112;
	nextstate = -1;
	condition = 1;
	question = "You have killed a lot of the enemy?";
	text1 = "_Ohhh ... Many. They throw themselvesss against our gatesss and wallsss, and they die, and more are sent. When the horde wantsss to rid themselvesss of a soldier, that poor slith is sent to usss to do the job._";
	
begintalknode 119;
	state = 112;
	nextstate = -1;
	condition = 1;
	question = "How do you punish miscreants?";
	text1 = "_I hurt them asss much as I can without hurting their ability to fight for usss. Those who steal food end up wishing I did kill them. It would be easier._";
	
begintalknode 120;
	state = 112;
	nextstate = -1;
	condition = gf(6,1) > 0;
	question = "Why are you all still here?";
	text1 = "_Because thisss isss not our time to flee! It isss our time to fight! Some wanted to flee, to return to Avernum. I let them know that thisss wasss not truly what they wanted._";
	
begintalknode 121;
	state = 115;
	nextstate = -1;
	condition = 1;
	question = "What sort of stupid things do they say?";
	text1 = "_They say that the slithzerikai caused the Blight! Asss if that sickness doesn't hurt usss as much as othersss. Asss if such diseasesss wouldn't come on their own._";
	
begintalknode 122;
	state = 115;
	nextstate = -1;
	condition = 1;
	question = "Why do you hate the horde so much?";
	text1 = "_Because they call slithzerikai like me traitorsss. There isss no mercy for usss, ever. And, when they catch usss ... The humansss get simple, quick death. If the Slith Horde takesss me alive, I will suffer ... worse. Far worse._";
	text2 = "_So they will never see mercy from me. Ever. Let them die on our wallsss._";
	
begintalknode 123;
	state = 115;
	nextstate = -1;
	condition = 1;
	question = "Did the soldiers here have doubts about you?";
	text1 = "_At first. But now there isss not a man or woman here whose life hasss not been saved by me. And who hasss not saved my life._";
	text2 = "_In such timesss, there are none so foolish as to reject one who isss truly willing to die for our land._";

// 130 Battlemage Winant

begintalknode 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = "Before the siege began, Fort Monastery was hurriedly equipped with a small magical laboratory. It is cramped but well-stocked. The supplies are starting to dwindle, however, as the siege drags on.";
	text2 = "A young mage is sitting in a rocking chair by the west wall. He slowly pushes himself forward and back, as he stares off into space. One look in his eyes tells you that he is quietly reliving some recent battle. In detail.";
	text3 = "When you clear your throat to get his attention, he jumps up as if you'd slapped him. _What? What are you ... Ah. A visitor._ He rises and quickly shakes your hand. _I am Battlemage Winant. At your service._";
	text5 = "Battlemage Winant watches you coldly. The presence of other people seems to bother him. He says, distantly, _What else do you need? I was placed here to help. That is what I do._";
	action = INTRO;

begintalknode 131;
	state = 130;
	nextstate = 131;
	condition = gf(6,1) == 0;
	question = "Tell me more about the siege.";
	text1 = "He says, in a quiet monotone, _The commander could do a better job of telling you the history and the tactics. I only know how it is fought. And what I have done to help fight it._";
	text2 = "_The commander hopes that we can break out one day. I think that is probably just something he says to keep morale up._";
	
begintalknode 132;
	state = 130;
	nextstate = 132;
	condition = gf(6,1) > 0;
	question = "What will you do now that the siege is lifted?";
	text1 = "_I am helping us to plan our escape, while the others go out on futile adventures, thinking they can make a difference._";

begintalknode 133;
	state = 130;
	nextstate = 134;
	condition = 1;
	question = "Have you been helping to defend the fort?";
	text1 = "_Of course. I have helped defend the gates from every attack. I have made new defenders. My spells have ... have ... I have left fields littered with the slithzerikai dead. Frozen. Still._";
	text2 = "His gaze is getting sort of distant again.";
	
begintalknode 134;
	state = 130;
	nextstate = 136;
	condition = 1;
	question = "How can you help me?";
	text1 = "_Of course, I can no longer make potions. No supplies, nothing to spare. But I can train you in some of the spells I have used to keep the enemy from our gates._";
	
begintalknode 135;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "That is all I need.";
	text1 = "_Then I will return to my meditations. Good day._ He returns to his rocking chair and, moments later, he is lost in his unpleasant thoughts.";
	action = END_TALK;
	
begintalknode 136;
	state = 131;
	nextstate = -1;
	condition = 1;
	question = "What would you need to be able to break out?";
	text1 = "_More of us and fewer of them. What else? At some point, we have to be able to walk out and kill them. Avernum will never help us._";
	
begintalknode 137;
	state = 131;
	nextstate = -1;
	condition = 1;
	question = "You don't think you will be able to escape?";
	text1 = "_Captain Khatessa punishes severely anyone who spreads doubt or hurts morale. I am not immune to punishment. I will keep my opinion to myself._";
	
begintalknode 138;
	state = 132;
	nextstate = -1;
	condition = 1;
	question = "How will you escape?";
	text1 = "_On foot, through side tunnels, using supply caches placed by us in advance. I am sending out my little servants to scout, looking for a path. Once I have it, I am told that we will go._";
	
begintalknode 139;
	state = 132;
	nextstate = -1;
	condition = 1;
	question = "Do you think you have a chance of actually hurting the horde?";
	text1 = "_Expressing a negative opinion can be harshly punished, so I will not._";
	
begintalknode 140;
	state = 134;
	nextstate = -1;
	condition = 1;
	question = "You make new defenders?";
	text1 = "_Of course. I need to supplement the paltry numbers of soldiers I have with my own unreliable, temporary constructs. Every time an enemy spear impales one of them, an Avernite soldier is saved._";
	
begintalknode 141;
	state = 134;
	nextstate = -1;
	condition = 1;
	question = "You froze them?";
	text1 = "_Of course. They are reptiles. They do not care for the cold, and fire is not as effective against their thick hides. In my storms of ice, they move slower and slower, until they never move again._";
	
begintalknode 142;
	state = 134;
	nextstate = -1;
	condition = 1;
	question = "Is something wrong?";
	text1 = "He shakes his head. _I was not trained to be a battle mage. It was thrust upon me. And ... I find that taking lives exhausts my mind. I require time to recover. As they slow down, as they die, their cries ..._";
	text2 = "He shudders. _This is the talk of weakness, as the captain would say. Don't think on it._";
	
begintalknode 143;
	state = 136;
	nextstate = -1;
	condition = 1;
	question = "I would like to learn spells.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Battlemage Winant",
		  "Battlemage Winant turns out to be a very powerful mage. He has been well-trained in the arts of war.",
		  76,1,0);	
	break;

	
begintalknode 144;
	state = 136;
	nextstate = 130;
	condition = 1;
	question = "I don't need training.";
	text1 = "Battlemage Winant nods silently.";


// 150 Priestess Rrone Church of the Prevailing Righteousness

begintalknode 150;
	state = -1;
	nextstate = 150;
	condition = 1;
	question = "Name";
	text1 = "There is a lone nephil, wearing long vestments, standing behind this altar. The altar itself is a surprisingly grim affair, a slab of dark stone surrounded by slith skulls and offerings from victorious Avernites.";
	text2 = "She nods to you as you approach. _I greet you, visitor. I am Priestess Rrone. This shrine is dedicated to the Church of the Prevailing Righteousness._";
	text3 = "_Mrrrr. All who fight are welcome here. I will tend to you as best I can, in the hope of victory to come._";
	text5 = "Priestess Rrone walks around the shrine, tending to the soldiers who have come to her. Some come for healing. Others come for reassurance. She comforts them efficiently and sends them back out to the field.";
	action = INTRO;

begintalknode 151;
	state = 150;
	nextstate = 151;
	condition = 1;
	question = "Tell me about your church.";
	text1 = "_I am of the Church of the Prevailing Righteousness._ She rests her hand gently on the gruesome altar. _We are, in a time like this, a church of war. Of fighting for justice, and of opposing the dark, blood-soaked gods of the horde._";
	text2 = "_Though we give healing, this shrine is not a gentle place. I begged to come here because I knew this was what was needed._";
	
begintalknode 152;
	state = 150;
	nextstate = 153;
	question = "How are you holding up in the siege?";
	condition = gf(6,1) == 0;
	text1 = "_I have been preaching and healing and curing and shielding to the limits of my endurance. But then things improve._";

begintalknode 153;
	state = 150;
	nextstate = -1;
	condition = 1;
	question = "Can you teach me?";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Priestess Rrone",
		  "Priestess Rrone knows many powerful chants and rituals, all dedicated to repelling the enemy and winning victory.",
		  77,1,0);	
	break;

	
begintalknode 154;
	state = 150;
	nextstate = -1;
	condition = 1;
	question = "Can you tend to my wounds?";
	text1 = "She nods. _Of course. That is my purpose. I give you strength, so that you can complete the mighty work ahead._";
	text2 = "She lays her hands upon you and begin to chant. You feel energy flow through you.";
	code =
		revive_party();
	break;
	
begintalknode 155;
	state = 151;
	nextstate = -1;
	condition = 1;
	question = "That is a grim altar.";
	text1 = "_It is a war altar. One day, when victory is ours, it will be cleaned and draped with lovely vestments. Until then, it serves as a reminder of our grim purpose here._";
	
begintalknode 156;
	state = 151;
	nextstate = 152;
	condition = 1;
	question = "When did you come here?";
	text1 = "_Soon after the horde came. I served under Abbot Erlanger, in Almaria. It was a comfortable place, a soft posting. But, the moment I heard of the war, I knew I must come. I begged to be allowed to come here. The abbot allowed it._";
	
begintalknode 157;
	state = 152;
	nextstate = -1;
	condition = 1;
	question = "And do you regret it now?";
	text1 = "_No. Not now. Not ever. My whole life has led to me being here. I will stay here as long as I have the chance of harming the horde._";
	
begintalknode 158;
	state = 153;
	nextstate = -1;
	condition = 1;
	question = "How do things improve?";
	text1 = "_Whenever I think I am at the end, that I have no more power in me, I return to this altar. I see what it means, and it sustains me. And I see that there is more power within me than I suspected._";
	
begintalknode 159;
	state = 150;
	nextstate = -1;
	condition = gf(6,1) > 0;
	question = "What will you do now that the siege is lifted?";
	text1 = "_It has been decided that we will head back to Avernum. In time. I keep the troops alive and well until they can return to the safety of Avernum. And then, as soon as I can, I will rejoin the fight._";
	
begintalknode 160;
	state = 150;
	nextstate = -1;
	condition = 1;
	question = "That is all I need.";
	text1 = "_Then go forth, and fight with honor! Mrrrarrr!_";
	action = END_TALK;


begintalknode 295;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You look around, hunting for another warrior of the horde to fight. The ground is slick with blood. You have to struggle to keep your balance. There are no enemies in sight. You search the smoke, sure that a foe must be lurking out there.";
	text2 = "But there are no enemies left. The siege has been lifted. Fort Monastery is free.";
	text3 = "Of course, you have only succeeded in saving a quiet, abandoned ruin. But you have killed a lot of the enemy. The Castle will at least be happy to hear of that.";
	text4 = "A weak cheer rises from the ramparts of Fort Monastery. It has been a long, painful siege, and they have suffered agonizing losses. But, at last, they are free.";
	code =
		rs(3); rs(4);
		if (gf(6,9) > 0)
			as(3);
			else if (gf(6,2) == 0)
				as(4);
	break;
	
////

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