// dlg.txt

begintalkscript;

variables;

short i;


begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  GREAT PORTAL - SOUTH";
	text3 = "  TOWER COLONY - EAST";
	text4 = "  GREAT CAVE - WEST";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a pack of large goblins hiding in this old ruin. It looks like they have been collecting piles of possessions discarded by the refugees. Furniture. Jars. Even bits of stolen food.";
	text2 = "When their leader spots you, he lets out a loud, angry shout. _Invader! We keep to selves, and you attack! That makes you the bad one! We punish you now!_";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are a few guards along the road leading to the Great Portal. Huge, burly soldiers with wicked pole arms, ready to do whatever it takes to keep order among the desperate refugees.";
	text2 = "They nod at you as you pass, but they have no interest in talking.";

begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a large camp of refugees here. The heat and radiation from the portal are wearing steadily away at them. They are very irritable, and fights are common. You eavesdrop on one of the conversations:";
	text2 = "_Hey! Is that soldier listening to us? How rude! Let's go away._";
	text3 = "_I've drawn black in the lottery three times now. I'm sure it's rigged. You have to know someone to get a gray or a white._";
	text4 = "_I've seen goblins rooting around in the trash, looking for things. One of them saw me, and they ran into the northern tunnels._";
	text5 = "_The inn kicked me out. They do it to everyone. You can only stay there for so long. I begged, but no luck._";
	text6 = "_Of course there's no more lotteries! That way, all the merchants and Empire visitors and politicians and soldiers can go through and leave us to rot._";
	text7 = "_They bring a lot of food down through the portal. And then they cart it off. Don't know where it goes, but we never get any._";
	text8 = "_If the Slith Horde gets down here, we're all dead. There's nowhere to hide. And no food to eat._";
	code =
		clear_strings();
		as(1);
		as(2 + get_ran(1,0,6));
	break;
	
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";


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

// Carole

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "This inn was built very recently, and very quickly. It looks like the mortar was barely dry before refugees began to move in. There is a fireplace that has never been lit and a cooking pit without food to be cooked in it.";
	text2 = "The innkeeper stands behind the counter, keeping a close watch on the small amount of food on the shelves. The constant heat and the hum from the portal have put him in an ill temper.";
	text3 = "_Ah. A soldier. I'm Carole, and this is my inn. My small, miserable inn. Ask what you want, but I don't have much for you._";
	text5 = "Carole stands behind the counter, watching the small reserves of food. He occasionally looks out at the inn with disgust. He can't look at the fireplace without snorting.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Tell me about this inn.";
	text1 = "_This ridiculous inn? That I was brought here to run? It was built by the army. Shows they don't know anything about making an inn. Or about anything going on out here._";
	text2 = "_And it's empty anyway. None but a madman would stay here now, with the portal gone mad._";
	code =
		if (gf(170,1) < 12)
			rs(2);
	break;
	
begintalknode 12;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What's wrong with the inn?";
	text1 = "_Soldiers built it. And, being soldiers and not knowing any better, they copied their standard design for a barracks. So they put a fireplace in it. A fireplace! Who in this sweltering hellhole needs a fireplace?_";
	text2 = "_No offense, but ... The military mind._ He shakes his head.";

begintalknode 13;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Where are you from?";
	text1 = "_Formello. I had a small inn there. That was lost to the Slith Horde, of course. They needed someone to run this place, and I had a bad position in the lottery, so I volunteered. No pay, but I get room and board._";
	text2 = "_Not that I'm complaining. It's far better than wandering the roads._";

begintalknode 14;
	state = 11;
	nextstate = 12;
	condition = gf(170,1) < 12;
	question = "And how are the customers?";
	text1 = "_Desperate. Angry. The army set the rules. I don't charge much, but nobody can stay more than two days. Enough to get fed and rested and back on the road._";
	text2 = "_It's a fair system, I suppose, but I get all sorts of backtalk when I tell people to move on._";

begintalknode 15;
	state = 11;
	nextstate = -1;
	condition = gf(170,1) >= 12;
	question = "And where are the customers?";
	text1 = "_Gone. I would be too if I had any sense. The portal has gone mad. You can't sleep or think for the sound and the raw power. And the howls of the imps, when they get killed by the soldiers. And the soldiers when they get killed._";
	text2 = "_I'm glad there's no refugees here, though. They're getting scared and desperate. Dangerous desperate._";

begintalknode 16;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Anybody fight back?";
	text1 = "He nods. _But that's what the guards are there for. This is like a tiny food depot. And the army sends food nowhere without guards._";

begintalknode 17;
	state = 10;
	nextstate = 18;
	condition = 1;
	question = "Tell me about this area.";
	text1 = "_Not much to tell. The portal is south. The Honeycomb is north. And the road to the northern Avernum is east._";

begintalknode 18;
	state = 18;
	nextstate = -1;
	condition = 1;
	question = "How are things at the portal?";
	text1 = "_The soldiers keep things well under control. Nobody hops the line. If you got a good draw in the lottery, you go to the surface. Otherwise, you wait._";
	text2 = "_It would be all right, but the power, and the sound. It drives everyone a little mad._";
	text3 = "_I haven't looked. I don't want to. I can feel it. The power, and the sound. It's driving everyone mad._";
	text4 = "_And, if it isn't fixed, well, things will get bad. Very bad._";
	action = DEP_ON_SDF 170 1 10;
	
begintalknode 19;
	state = 18;
	nextstate = -1;
	condition = 1;
	question = "How are conditions on the road up north?";
	text1 = "_Not bad. The soldiers have it under control, though they won't let your lot by without orders. You can't just travel that road anymore._";
	text2 = "_I heard a rumor that there were deserters. Soldiers scared of the Slith Horde. And I believe it._";
	
begintalknode 20;
	state = 18;
	nextstate = -1;
	condition = 1;
	question = "What is the Honeycomb?";
	text1 = "_An impossible tangle of tunnels, just north of here. Full of rogues and monsters since back in the day. You walk in, and you just get lost and turned around and by the time you know what's going on something is eating you._";
	text2 = "_Not enough gold in all Avernum to get me to set foot in there._";

begintalknode 21;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Can I buy some food?";
	text1 = "_Don't you have a fort you can get food from? If a refugee sees me handing out supplies to a soldier instead of one of their lot, it'll be a riot!_";

begintalknode 22;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Can I get a room?";
	text1 = "_I'm full, and there's a lot of refugees waiting ahead of you._";
	text3 = "_Oh, stop wasting my time. Go back to your fort. These rooms are for refugees. If they ever come back._";
	action = DEP_ON_SDF 170 1 10;
	
begintalknode 23;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "I'll be going then.";
	text1 = "Carole nods and then gets back to work. He winces constantly, as the Portal-induced headache burrows ever deeper into his head.";
	action = END_TALK;

//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Sergeant Mrrerum";
	text1 = "This hall is large, impressive, and mostly empty. Rows of benches face a large stage. There is a stone basin in the middle of the stage. Tapestries are everywhere, giving the room an impressive aura.";
	text2 = "A nephil soldier is sweeping in the corner. He calls, _Lotteries are canceled. Come back ..._ Then he sees you. _Oh, sorry. Didn't see you were a soldier._";
	text3 = "_I'm Sergeant Mrrerum. I run the lotteries. None of them for now, though. So I just watch the hall._";
	text5 = "Sergeant Mrrerum continues to sweep the hall. Like most nephilim, he's an inherently tidy creature. Soot constantly blows into the hall, coating everything he cleans.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Tell me about the lottery.";
	text1 = "_It is the way we determine who gets to use the Great Portal and go to the safety of Upper Avernum. Well, it was how we found out._";
	text2 = "_We held one lottery every month. Everyone came and signed up. We counted the applicants and put in that many tickets._ He points at the basin on the stage. _And each person drew one._";

begintalknode 32;
	state = 30;
	nextstate = 32;
	condition = 1;
	question = "Why are the lotteries canceled?";
	text1 = "_Because there are too many tickets out there already. Too many large families waiting for their turn. And the mages are worried about the safety of the portal. Until the backlog has been worked through, no lotteries._";
	text3 = "_The obvious reason. No portal._";
	action = DEP_ON_SDF 170 1 10;
	
begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Know anything about the portal?";
	text1 = "_That the power from it makes my hair stand on end, and the sounds it makes make my head hurt. But it's our only hope._";
	text3 = "_It's a tornado of uncontrolled power, spitting out demons. It's the headstone for the grave that is Avernum. That's what I know about it._";
	action = DEP_ON_SDF 170 1 10;

begintalknode 34;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Why did they want to go to Upper Avernum?";
	text1 = "_I imagine Upper Avernum's ability to actually grow food had something to do with it._";

begintalknode 35;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "And what were the tickets?";
	text1 = "_There were black ones. That meant they didn't get anything and had to try again next month. There were grey tickets. That meant that person's family could use the portal in three months._";
	text2 = "_And there were white tickets. That put you and your immediate family at the front of the line. There were very, very few of those._";

begintalknode 36;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Is this the only place where lotteries happened?";
	text1 = "_No. Each major city could have one every three months. Those have all stopped too, of course._";

begintalknode 37;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Could I enter a lottery?";
	text1 = "_Mrrrr? You're a soldier. That means you get food, and, in return, you're stuck down here._";

begintalknode 38;
	state = 32;
	nextstate = -1;
	condition = gf(170,1) < 12;
	question = "The safety of the portal?";
	text1 = "_Some of the mages are worried. Old, crusty, cowardly souls who say that the portal is under too much stress. If it's used too much, something bad will happen._";
	text2 = "_I say, send more people through. We're getting low on food and the refugees are getting desperate._";

begintalknode 39;
	state = 32;
	nextstate = 33;
	condition = gf(170,1) >= 12;
	question = "When will the portal be repaired?";
	text1 = "_You know the answer to that as well as I do. My guess is, 'Never.'_";

begintalknode 40;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "And what would that mean?";
	text1 = "_Mrrrr. It means most of us will die down here. Sorry, but that's how I see it. Best get used to it now._";

	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Cundo";
	text1 = "You are very surprised to find an old man down here. He's tired, desperately thin, and almost entirely without possessions. Just a dagger and a small ceramic jar.";
	text2 = "He stands and bows when you enter, relieved to see that you aren't a brigand. _Welcome to you. Don't see many people down here. I'm Cundo._";
	text5 = "Cundo sits quietly in this dank little cave, trying to conserve his strength.";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "What are you doing down here?";
	text1 = "_Waiting. Just waiting._ He smiles sadly.";

	
begintalknode 52;
	state = 50;
	nextstate = 53;
	condition = 1;
	question = "Why don't you go somewhere else?";
	text1 = "He pulls a piece of paper out of his pocket and shows it to you. It has a gray spot and a date on it. The date has already passed.";
	text2 = "_This means I can use the portal._";
	
begintalknode 53;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "Aren't you worried about monsters?";
	text1 = "_Nothing down here to worry about but a handful of goblins, and I don't have anything they want to steal. They don't want to eat someone as old and wiry as me. Yet._";
	text2 = "";
	
begintalknode 54;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "What do you eat?";
	text1 = "_Well, I have a stale roll. I'm saving it for a special occasion. And, in the meantime, I eat little lizards I smash. It keeps me going._";
	text2 = "Though, judging from looking at him, not very well.";
	
begintalknode 55;
	state = 52;
	nextstate = -1;
	condition = gf(151,2) > 0;
	question = "I killed those goblins.";
	text1 = "_Oh. Well, I suppose I appreciate it. Though it'll be a lot more lonely down here now._";
	
begintalknode 56;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "What is that?";
	text1 = "_It's my draw from the lottery. Meant that I could use the portal after waiting three months. And that day has passed._";
	
begintalknode 57;
	state = 53;
	nextstate = -1;
	condition = gf(170,1) < 12;
	question = "Why haven't you gone up there yet?";
	text1 = "_Oh, I will. Very, very soon. First, I'll eat my special roll. Then I'll go._";
	
begintalknode 58;
	state = 53;
	nextstate = 54;
	condition = gf(170,1) >= 12;
	question = "But the portal is gone.";
	text1 = "_Well, I don't think it will be forever. That's how Avernum works. We need something, we find it. Something breaks, we fix it. I bet the portal will be replaced any day now._";

begintalknode 59;
	state = 54;
	nextstate = -1;
	condition = 1;
	question = "And if it isn't?";
	text1 = "His face darkens. _Rather not talk about that._";

begintalknode 60;
	state = 50;
	nextstate = 55;
	condition = get_quest_status(170) == 2 && gf(151,1) == 0;
	question = "I found a post on a job board. Your family is looking for you.";
	text1 = "_What? They ..._ he shakes his head. _I just slipped away from them. Thought they'd be wise enough to let me go. More food to go around for them._";
	text2 = "_Just tell them I'm safe. And not to look for me. That's all I can ask of you._";
	action = SET_SDF 151 1 1;
	
begintalknode 61;
	state = 55;
	nextstate = -1;
	condition = 1;
	question = "You mean you just left them?";
	text1 = "_It's happening more than you think. A lot of the old ones. The food gets too short, and we ... We just find a tunnel. And disappear. Not see them again_";
	text2 = "_We've had our turn. We have to leave the food for the ... the ... Sorry. Think I just need my privacy for a bit._ He turns away.";
	action = END_TALK;

////


begintalknode 299;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Unfortunately, the Portal Caldera, in the heart of Avernum, was a poor place to begin your life of crime. Most of the soldiers have had to travel northeast to fight the slithzerikai, but enough remain down here to hunt you down.";
	text2 = "You are jailed in Fort Remote. By the time you are able to get free, the multiple disasters that afflict Avernum have doomed you and all around you.";
	code =
		erase_char(30000);
	break;
		