// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,0) == 0 && gf(58,9) == 0;
	question = "special";
	text1 = "You enter Spire, the southern town in the Abyss. It was once a miserable, crumbling settlement, full of filth and brigands. It is still dirty and disorganized, but there has been a lot of construction and cleaning lately.";
	text2 = "Most of the walls and gates show signs of recent construction or repair. A citizen walks by with a wheelbarrow full of trash. Guards wield new weapons. Something recently gave them powerful motivation to straighten things up.";
	text3 = "You also notice that the people, while rough and armed, are not as desperate or starved looking as citizens elsewhere in Avernum. Considering how remote the Abyss is, this is truly odd.";
	text4 = "And yet, as calm as things here seem, this is still the Abyss. Partially mopped-up bloodstains dot the walkways, and the screams of the Arena echo through the town. Visitors here still need to be on their guard.";
	action = SET_SDF 58 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,3) == 0 && gf(58,9) == 0;
	question = "special";
	text1 = "You are just outside the infamous Spire Arena. Mercenaries, thugs and the desperate have long come here to risk their lives, in return for the hope of cash and fame. Happily, most of them escape with only maiming.";
	text2 = "All are welcome to enter the pit, for the privilege of facing off against Spire's menagerie of bizarre and dangerous beasts. You can hear the shouts of the bloodthirsty patrons coming from within.";
	action = SET_SDF 58 3 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,4) == 0 && gf(58,9) == 0;
	question = "special";
	text1 = "You enter the Arena. There is a pit in the middle, looking down upon the battle floor below. Scruffy spectators stand around it, shouting encouragement and making bets.";
	text2 = "You peer over the edge. A young brigand has just come off far worse in a battle with a young hellhound. The pitmaster stopped the fight. With luck, the thug's broken bones will mend and the scarring won't be too visible.";
	text3 = "Your entry attracts some attention at first. Avernite soldiers don't come here often. But the spectators soon turn to watch the next battle.";
	action = SET_SDF 58 4 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,5) == 0 && gf(58,9) == 0;
	question = "special";
	text1 = "You peer through the opening and are surprised to see a tiny garden. This is the private sanctuary of the mayor of Spire.";
	text2 = "If the sign outside is to be believed, your presence here will attract the ire of the guards. Taking great care might be wise.";
	action = SET_SDF 58 5 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,6) == 0 && gf(58,9) == 0 && gf(58,2) > 0;
	question = "special";
	text1 = "When you return to Spire, the mood in the air is very different. The calm and confidence of the people has disappeared overnight. Work clearing the trash and repairing the walls has ceased. Thugs loiter in the corners.";
	text2 = "You eavesdrop on the conversations and soon learn what has happened. Mayor Annatolia is dead. Nobody knows what killed her, but her loss seems to have already broken the spirit of the town.";
	action = SET_SDF 58 6 1;

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,8) == 0 && gf(130,4) == 3 && gf(58,9) == 0;
	question = "special";
	text1 = "Spire is not entirely docile or law-abiding. Someone is currently being mugged in the hovel to the west. Three nephilim are attacking a young man with a rapier. They advance on him from three directions. Unsporting.";
	text2 = "The young man looks familiar. You've met him somewhere.";
	action = SET_SDF 58 8 1;
	code =
		if (gf(130,12) == 0)
			rs(2);
		activate_hidden_group(31);
		set_name(6268,"Herwin");
		set_boss_level(6268,1);
		set_new_abil(6268,20);

		set_name(6269,"Nephil Mugger");
			set_name(6270,"Nephil Mugger");
		set_name(6271,"Nephil Mugger");
break;

// Mayor Annatolia

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "You meet the mayor of Spire. She is an old woman, wearing a tattered, faded parody of the purple sash the mayors of Avernum wear. Though she is thin and weak, she must possess great strength and cunning to command this place.";
	text2 = "Her reaction to meeting a representative of Avernum is peculiar. She is neither nervous nor resentful. In fact, she seems plainly unconcerned.";
	text3 = "_Ah, welcome to you, Avernite. I am Mayor Annatolia, leader of Spire. We are always courteous to soldiers from your nation, provided they obey our laws and don't cause trouble. And move on quickly._";
	text5 = "Mayor Annatolia picks at her sash idly with her fingers. _There is more you wish to know? I suppose I can spare a short amount of time. Very short. We extend every courtesy to the representatives of your troubled nation._";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "I would like to know what is happening in the Abyss.";
	text1 = "_I see._ She takes a sip of tea and stares up at the ceiling. _I'm afraid I am too busy for a discussion of local politics. Far too busy._";
	text2 = "_I will tell you that there are brigands on the roads. Though that is not unusual. That the Blight has ravaged our crops. Which you have already seen. And that you should avoid Bargha. Which is always true._";

begintalknode 12;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "All of your crops are destroyed?";
	text1 = "_They are. It is a great challenge. We will have to struggle to survive. Still, I think you will find that we of the Abyss are ingenious and flexible._";

begintalknode 13;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "What is happening in Bargha?";
	text1 = "_Well, Bargha has long attracted the strong and mad, and those who would be ruled by the strong and mad, but Lord Farrar, the current warlord there, is particularly, well, strong and mad._";
	text2 = "_He has refused to let anyone leave his lands, and he reserves the right to rob any merchant or soldier who comes within range. I would be very careful about him._";
	text3 = "_Oh, you know. Chaos. Tumult. A power struggle to replace the warlord you slew. Thank you for that, by the way. Very unpredictable. And thus dangerous. Good for us, though._";
	action = DEP_ON_SDF 170 10 0;
	
begintalknode 14;
	state = 12;
	nextstate = -1;
	condition = gf(100,10) == 0;
	question = "He would even assault a warrior of Avernum?";
	text1 = "_He would enjoy it immensely. In Avernum's weakened state, he feels he has no reason to fear retribution._";

begintalknode 15;
	state = 10;
	nextstate = -1;
	condition = gf(85,10) == 1;
	question = "I am looking for someone named Gall.";
	text1 = "_Oh? Really? I didn't imagine you would be here on that sort of business. And yet, I see no reason to interfere. You might find him in the arena. That is where he does his ... business._";

begintalknode 16;
	state = 10;
	nextstate = 13;
	condition = gf(58,7) == 0;
	question = "Spire seems to be doing well.";
	text1 = "She nods and gives you an almost imperceptible smile. _These are troubling times. I do all I can to keep my people fed and protected._";

begintalknode 17;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Why are you building the walls?";
	text1 = "_Oh, that project has been going on for almost thirty years. It has only been recently that I was able to compel the ... disorganized people of Spire to work to complete them. Fear for survival does much to focus the mind._";

begintalknode 18;
	state = 13;
	nextstate = 14;
	condition = 1;
	question = "Where are you getting food now?";
	text1 = "She runs a hand through her gray hair and looks up at nothing in particular. _In such times, all must find allies where they can. But this is Abyss business, not yours._";

begintalknode 19;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "Who is your ally?";
	text1 = "She frowns. _Again, that is Abyss business. Now, excuse me. I am very busy. Good day._ The ogres guarding the hall take a step closer to you. You decide to move on.";
	action = END_TALK;
	
begintalknode 20;
	state = 14;
	nextstate = 10;
	condition = gf(85,10) > 0;
	question = "Are you acquainted with the dragon Melanchion?";
	text1 = "Her face becomes expressionless. The ogres begin to move forward. She stops them with a single motion of her hand. Then she lets out a sigh. _Of course. This was inevitable._";
	text2 = "_Yes. I have been in touch with the mighty dragon. There is no need to maintain any more pretense. I will tell you of the dragon. A small amount._";
	action = SET_SDF 58 7 1;
	
begintalknode 21;
	state = 14;
	nextstate = 10;
	condition = 1;
	question = "I'd like to talk about something else.";
	text1 = "She nods grimly. _That seems wise._";

begintalknode 22;
	state = 10;
	nextstate = 15;
	condition = gf(58,7) > 0;
	question = "Tell me about Melanchion.";
	text1 = "_I will say little. I will only say this. Melanchion is a dragon, the greatest one in the underworld. He has emerged from the low tunnels into the chaos that plagues us, and he is looking for allies._";
	text2 = "_There is a power struggle in the underworld. Avernum is one side. Melanchion is another. And me, I must look out for Spire as best I can._";

begintalknode 23;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "Melanchion can provide food?";
	text1 = "_Melanchion's power is great. He can provide many things._";

begintalknode 24;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "What do you give Melanchion for his help?";
	text1 = "She thinks long and hard before she responds. _Very little, but a debt is being incurred. I think the dragon wants allies. And he will get them, since Avernum is so weak._";

begintalknode 25;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "Does Melanchion have other allies in these parts?";
	text1 = "_No. Bargha has rejected the dragon. I'm sure they will pay for that, in time._";
	text2 = "";

begintalknode 26;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "Where is Melanchion?";
	text1 = "_That I will not say._";

begintalknode 27;
	state = 10;
	nextstate = -1;
	condition = gf(58,1) > 0;
	question = "I put a scarab under your bed. Just so you know.";
	text1 = "_What? You ... You are a spy? An assassin? I don't know why you brought your treachery to me, but there is only one way to deal with it. And, when you are dead, I will have your scarab removed._";
	text2 = "She makes a motion with her hand. The ogres see the signal and obey the command ...";
	action = END_TALK;
	code =
		sf(58,9,1);
		sf(58,1,0);
		make_zone_hostile();
	break;
	
begintalknode 28;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "That is all I need to know.";
	text1 = "_Then I give you permission to stay in Spire. For a short time. Try not to cause any trouble._ She returns to work, planning the rebuilding of her town.";
	action = END_TALK;

// Herwin

begintalknode 33;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "The young duelist straightens out his tunic, cleans his blade, and turns to face you. His pale skin still shows a touch of healthy color. He must be from the Empire. He's only been down here for a few months.";
	text2 = "You recognize him. You met him at the Fissure Post in the Great Cave, looking out longingly at the underworld. He doesn't remember you.";
	text3 = "_Greetings, soldier. I am Herwin, traveler and sword-for-hire. It is good to see a civilized face, considering the quality of the ruffian you meet out here._";
	text5 = "Herwin sits down by the west wall and cleans his blade. Occasionally, he looks up at you. _Humble surroundings, I know. I hope to move up to something better. After my reputation is established, I mean._";
	action = INTRO;
	code =
		if (gf(130,12) == 0)
			rs(2);
	break;
	
begintalknode 34;
	state = 30;
	nextstate = 31;
	condition = gf(58,13) == 0;
	question = "Your father asked me to look for you.";
	text1 = "_Ah. I should have known that he would try to reel me back in. Unfortunate. Now I must move on. However, I have no desire to return to the surface. Please let my father know that I am well. And am not leaving._";
	action = SET_SDF 58 13 1;
	
begintalknode 35;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Why won't you return to the surface?";
	text1 = "_Because life up there is like being slowly suffocated by soft blankets. All right for some. Not for me, or my sister for that matter. My father will simply have to accept that he raised brave children._";

begintalknode 36;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "But you are in danger here.";
	text1 = "He grins. _I know. I would not have it any other way. I will live less, but I will actually be alive._";

begintalknode 37;
	state = 30;
	nextstate = -1;
	condition = gf(58,13) > 0;
	question = "You won't reconsider returning to the Great Cave?";
	text1 = "_I may return, but only after I have earned my reputation as a bladesman. Not a moment before._";

begintalknode 38;
	state = 30;
	nextstate = 32;
	condition = 1;
	question = "You are a sword for hire?";
	text1 = "_I am. Bounty hunter. Mercenary. Guard. Reader of job boards. That is the life I have chosen. In these unsettled times, I have no lack of work._";

begintalknode 39;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Have you done many jobs?";
	text1 = "_Several. I have long wondered if my skills with a blade were, in fact, real and effective. It turns out, they are._";

begintalknode 40;
	state = 30;
	nextstate = 33;
	condition = 1;
	question = "Why are you in the Abyss?";
	text1 = "He shrugs. _It just seemed a better place to begin my new career as an adventurer. It seems like a better place to find dishonorable foes to fight and adventures to begin._";

begintalknode 41;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "Has that been the case?";
	text1 = "_As you saw from my little scuffle with those nephilim, it has._";

begintalknode 42;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Good day to you.";
	text1 = "_Good day. I wish you safety, and I hope that you extend me the same courtesy._";
	action = END_TALK;
	
begintalknode 43;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "What about the arena?";
	text1 = "_Using my hard-earned skills to torment captured beasts for the amusement of idiots? I would genuinely rather die._";

	
// Pitmaster Ghrum

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Pitmaster Ghrum";
	text1 = "You meet the arena master of Spire. Spire's arena is very well known, a testament to the brutal nature of the Abyss. Appropriately, the post of Arena Master is traditionally held by an ogre.";
	text2 = "He looks down at you and grunts. _Uhrrr. I am Pitmaster Ghrum. You Avernum soldier. Hah! Not have one of you in pit, not for long, long time. You want fight in arena? You get paid good if you live. And buried good if not._";
	text5 = "Pitmaster Ghrum snorts and spits. _Soldier. Avernum soldier good for business. You got arena business? I one you talk to._";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Tell me about the arena.";
	text1 = "He nods. _Is simple. You go down. You fight. If you live, you get money. You live longer, you get nice items for reward._";
	text2 = "_But you too good. All our stuff to fight dead. Now we go get more monsters. No fights for a long time._";
	code = 
		if (gf(58,10) < 10)
			rs(2);
	break;
	
begintalknode 52;
	state = 50;
	nextstate = 55;
	condition = 1;
	question = "Tell me about yourself.";
	text1 = "_I Pitmaster! Son of Gurunk, greatest Pitmaster! Great honor for me! I run good pit, until I finally die._";

begintalknode 53;
	state = 50;
	nextstate = 51;
	condition = gf(58,11) == 0 && gf(58,10) < 10 && gf(58,12) == 0;
	question = "I want to fight in the arena.";
	text1 = "_You sure? You go down, you not come up 'til bad thing dead or you dead. You get money, but you get beat on too. You sure you fight?_";

begintalknode 54;
	state = 51;
	nextstate = -1;
	condition = gf(58,10) >= 10;
	question = "I want to fight in the arena.";
	text1 = "_You too good. All our monsters dead. We gotta get more. I catch them myself! Come back later._";

begintalknode 55;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "I changed my mind.";
	text1 = "_Then you go, and you not waste precious time of Pitmaster!_";
	action = END_TALK;

begintalknode 56;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "I'm ready!";
	text1 = "_An Avernum soldier in pit. Very exciting. Lots pay to see that. Then you go downstairs. I get foe ready to fight you. You kill, then come back to me for reward._";
	text2 = "_You lucky. Foe now is gladiator. He want fight to prove he strong and you not! Good thing! Big crowd!_";
	text3 = "_You lucky! Now you can fight giant terror monster. Scything claws! Very fast! It come into town to feed, and we trap it! No one ever beat it before! All tickets sell today!_";
	action = END_TALK;
	code = 
		sf(58,11,1);
		sf(58,12,0);
		sf(58,2,0);
		rs(2); rs(3);
		if (gf(58,10) == 0) 
			sf(58,10,1);
		if (gf(58,10) == 2) 
			sf(58,10,3);
		if (gf(58,10) == 4)  {
			sf(58,10,5);
			as(2);
			}
		if (gf(58,10) == 6) 
			sf(58,10,7);
		if (gf(58,10) == 8) {
			sf(58,10,9);
			as(3);
			}
			
	break;
	
begintalknode 57;
	state = 50;
	nextstate = -1;
	condition = gf(58,12) > 0 && gf(58,10) == 1;
	question = "I have defeated my foe. Can I have my reward?";
	text1 = "_Yeah. You good._ Ghrum gives you a bag of coins. _You got good moves. You should fight more. Should go rest first, though._";
	code = 
		change_coins(250);
		sf(58,12,0);
		sf(58,10,2);
	break;
	
begintalknode 58;
	state = 50;
	nextstate = -1;
	condition = gf(58,12) > 0 && gf(58,10) == 3;
	question = "I have defeated my foe. Can I have my reward?";
	text1 = "_Yeah. You real good. People startin' to talk about you._ Ghrum gives you a larger bag of coins. _You want fight more, we got good battle for you next. Come back when you ready._";
	code = 
		change_coins(500);
		sf(58,12,0);
		sf(58,10,4);
	break;

begintalknode 59;
	state = 50;
	nextstate = -1;
	condition = gf(58,12) > 0 && gf(58,10) == 5;
	question = "I have defeated my foe. Can I have my reward?";
	text1 = "_You serious gladiator. Gettin' a big name. You like other Avernum soldier, came through and beat all we had years ago._";
	text2 = "Ghrum gives you a larger bag of coins. _Soon you make the big rewards. You want fight more, we got good fight all lined up. Come back when you ready._";
	code = 
		change_coins(750);
		sf(58,12,0);
		sf(58,10,6);
	break;

begintalknode 60;
	state = 50;
	nextstate = -1;
	condition = gf(58,12) > 0 && gf(58,10) == 7;
	question = "I have defeated my foe. Can I have my reward?";
	text1 = "_You sure are big. Nobody ever get so good record as you. Now you in big time, you get big time rewards, made by wizards._";
	text2 = "Ghrum gives you a polished cavewood rod, as well as some cash. _You want fight more, we got real serious big fight all lined up. Come back when you ready. Biggest reward of all!_";
	code = 
		change_coins(500);
		reward_give(246);
		sf(58,12,0);
		sf(58,10,8);
	break;

begintalknode 61;
	state = 50;
	nextstate = -1;
	condition = gf(58,12) > 0 && gf(58,10) == 9;
	question = "I have defeated my foe. Can I have my reward?";
	text1 = "He nods. _You are the best gladiator in town since ... Since last Avernum soldier to come fight here. Long time ago. Time of Shades, it was. You earn the big reward. Give kids dreams of being like you. Good for business!_";
	text2 = "Ghrum gives you a lovely, shining steel breastplate. _That is big prize. It marks you to all who see as master gladiator, who is bad and mean and kills a lot!_";
	code = 
		reward_give(51);
		sf(58,12,0);
		sf(58,10,10);
	break;

begintalknode 62;
	state = 55;
	nextstate = -1;
	condition = 1;
	question = "What happened to Gurunk?";
	text1 = "_He master for years, but basilisk stare slowed him. Then hellhound broke out of cage, jumped up, ate his head. Great ending. We burned him and threw chunks left to pit monsters to make them strong._";
	text2 = "_He would have wanted it that way._";

begintalknode 63;
	state = 55;
	nextstate = -1;
	condition = 1;
	question = "How do you think you will die?";
	text1 = "_One day, I make mistake. One day, monsters in pit get me. Then they eat me. Is best way for ogre to go. If ogre dies of old age, that ogre is coward!_";


// Gall

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "There is a small, wrinkled man sitting in the back corner of the Arena. He isn't shouting, betting, or watching the fights. Instead, he quietly watches the patrons.";
	text2 = "He is trying to be inconspicuous. And thus, naturally, being approached by an Avernite soldier makes him very, very uncomfortable.";
	text3 = "_Ummmm ..._ he says, _I am Gall. I am trying to watch the fights. You are blocking my view. Please move on._";
	text5 = "Gall continues to stare out at the crowd, doing his best to look like you have nothing to do with him.";
	action = INTRO;

begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = gf(58,14) == 0;
	question = "What are you doing here?";
	text1 = "He ignores you. You try to get a few words out of him, but he sits there quietly and uncomfortably and hopes you go away.";
	action = END_TALK;

begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = gf(58,14) == 0 && gf(85,10) == 1;
	question = "Hrramen-Drayssa sent me to speak with you.";
	text1 = "Gall lets out a long, low sigh. _Oh. Well, I took that slith's money, so I suppose I have to talk to you. Unfortunate._";
	action = SET_SDF 58 14 1;
	
begintalknode 73;
	state = 70;
	nextstate = -1;
	condition = gf(58,14) == 0;
	question = "Good day.";
	text1 = "He doesn't say anything. You walk off. He ignores you.";
	action = END_TALK;

begintalknode 74;
	state = 70;
	nextstate = 71;
	condition = gf(85,10) == 1 && gf(58,14) > 0;
	question = "I need to find Breck-Drayssa.";
	text1 = "_Please. Speak quietly. The mayor would not want me putting others in contact with the dragon._";
	text2 = "_I do not know where the dragon's other spy is. I am still inquiring. But it is going very, very slowly. And I might not succeed._";
	code =
		if (gf(58,2) > 0)
			rs(1);
		break;
		
begintalknode 75;
	state = 71;
	nextstate = -1;
	condition = gf(58,2) == 0;
	question = "The mayor is dealing with the dragon?";
	text1 = "Gall winces. _This is why I did not want to talk to you. I am better at getting information than keeping my mouth shut._";

begintalknode 76;
	state = 71;
	nextstate = -1;
	condition = 1;
	question = "Hrramen hired you to find Breck?";
	text1 = "_He did. And he paid me. The dragon has much wealth to throw around. But, money or not, it takes patience to learn._";

begintalknode 77;
	state = 71;
	nextstate = 72;
	condition = 1;
	question = "I don't have time. I need to find Breck-Drayssa now.";
	text1 = "Gall clearly wishes he had never touched any of this business. _Well, I can tell you he's not been to Spire. He must be north. He was grabbed near Bargha. He is still up there._";

begintalknode 78;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "Any idea who I might talk to up there?";
	text1 = "He thinks. _I will regret this, but ... I have an associate named Overbye. In Bargha. If you are foolish enough to enter that madhouse, talk to him._";
	text2 = "_I sent word to him that I was looking for Breck. I have not heard back. That is all I can say. Now leave me._ He returns to watching the crowd.";
	action = END_TALK;
	code =
		sf(85,10,2);
	break;
	
begintalknode 79;
	state = 70;
	nextstate = -1;
	condition = gf(58,14) > 0;
	question = "Why are you watching the crowd?";
	text1 = "_Business._ That is all he says.";

begintalknode 80;
	state = 70;
	nextstate = -1;
	condition = gf(58,14) > 0;
	question = "You deal in information?";
	text1 = "_I do._ He taps his forehead. _The tunnels and caves of Avernum, the people in them, I keep them here. I know much, and I can find out more._";
	text2 = "_But, before you ask, I will not work for you. I have enough problems without allying myself with Avernum._";

begintalknode 81;
	state = 70;
	nextstate = -1;
	condition = gf(58,14) > 0;
	question = "Do you know anything about the dragon?";
	text1 = "_Yes. And I would not be foolish enough to say anything about it to you._";

begintalknode 82;
	state = 70;
	nextstate = -1;
	condition = gf(58,14) > 0;
	question = "That is all I need to know.";
	text1 = "_I am desperately relieved to hear it._ He returns to watching the crowd.";
	action = END_TALK;

//

begintalknode 85;
	state = -1;
	nextstate = 80;
	condition = has_spec_item(22) && gf(58,2) == 0;
	question = "Name";
	text1 = "You are standing next to Mayor Annatolia's bed. It is quite luxurious, with materials brought from the surface at great expense.";
	text2 = "It would be easy to slip the scarab under the mattress.";


begintalknode 86;
	state = 80;
	nextstate = -1;
	condition = 1;
	question = "Leave the bed alone.";
	text1 = "You are a little skeptical about Gladwell's magic. You back away.";
	action = END_TALK;

begintalknode 87;
	state = 80;
	nextstate = -1;
	condition = 1;
	question = "Hide the scarab.";
	text1 = "You lift the mattress and put the scarab under it. In an instant, the scarab comes to life. It leaps up to the mattress and burrows into it.";
	text2 = "However, you doubt that this will do any good. Since the town is on alert and hunting for you, when they realize you have been poking around in the mayor's quarters, they will probably search this room intensively.";
	action = END_TALK;
	code =
		set_spec_item(22,-1);
		if (gf(58,9) == 0) {
			rs(2);
			sf(58,1,1);
			}
	break;
	
// McGoff

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "There is a wrinkled old woman sitting in this chair, leaning back and smoking a pipe. She grins at you with stained teeth when you approach. Her goods look like they have come from all over Avernum.";
	text2 = "She coughs and says, _I'm McGoff. Don't worry. I'm not picky. I'll trade with anyone, even your lot._";
	text3 = "_I buy, sell, and don't ask questions. What do you want?_";
	text5 = "McGoff smokes her pipe and watches traffic pass. She frequently looks over her shoulder, making sure no footpad is trying to steal her wares. She has a long dagger at her belt, just in case.";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = 91;
	condition = 1;
	question = "Who do you trade with?";
	text1 = "_Anyone with money to buy or goods to sell. Merchants. Refugees. Whoever. I'm not particular. I'll even buy from an Avernite!_ She laughs.";

begintalknode 92;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "Where do your wares come from?";
	text1 = "She looks wary. _Don't know. Don't ask. Not interested._";

begintalknode 93;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "Do you only deal with merchants and refugees?";
	text1 = "She takes her pipe out of her mouth and frowns. _I don't ask who people are. I let the money speak for itself._";

begintalknode 94;
	state = 91;
	nextstate = 90;
	condition = 1;
	question = "And do you ever buy stolen goods?";
	text1 = "_You're far from your home territory, Avernite, and I don't like your questions. You want to trade? Trade. Otherwise, move on._";

begintalknode 95;
	state = 91;
	nextstate = 90;
	condition = 1;
	question = "I don't think I need to know anything else.";
	text1 = "She nods. _That's a wise attitude._";

begintalknode 96;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "Let me look at your wares.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("McGoff",
		  "McGoff sells a wide variety of goods. Some of which, you suspect, don't come from entirely legal origins.",
		  57,4,0);	
	break;

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


begintalknode 98;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "That is all I need.";
	text1 = "She nods and sends a puff of pipe smoke at you. _Then be moving on, Avernite._";
	action = END_TALK;

// Mother Twymon

begintalknode 110;
	state = -1;
	nextstate = 110;
	condition = 1;
	question = "Name";
	text1 = "This temple is probably the sturdiest building in Spire. The walls are lined with both weaponry and expensive art. It speaks of both wealth and the power required to retain it.";
	text2 = "The priestess approaches you with a smile and open arms. She wears opulent robes and expensive jewelry. You suspect that she wields more than enough power to defend them.";
	text3 = "She says, _I am Mother Twymon. This is a shrine of the Shrine of Divine Attainment, and we welcome all those who believe in the power of the brave, unchained individual._"; 
	text5 = "Mother Twymon speaks with you, always positioning herself to show off her jewelry and robes to good effect. _So, warrior. What else can the Shrine of Divine Attainment offer you today?_";
	action = INTRO;

begintalknode 111;
	state = 110;
	nextstate = 111;
	condition = 1;
	question = "Tell me about your church.";
	text1 = "_The Shrine of Divine Attainment is dedicated to keeping the spirit of the individual alive in Avernum, in the Abyss, everywhere where the spirit of freedom and adventure has not been crushed._";
	
begintalknode 112;
	state = 110;
	nextstate = 112;
	condition = gf(58,2) == 0;
	question = "I'd like to know more about Spire.";
	text1 = "She nods. _This temple has been here for a long time, building and growing. And, as Spire gains power and influence, it will grow larger still._";
	text2 = "_I have worked hard with Mayor Annatolia to organize the city and build our defenses. Spire will rise like a phoenix._";

begintalknode 113;
	state = 110;
	nextstate = 113;
	condition = gf(58,2) > 0;
	question = "I'd like to know more about Spire. And the death of the mayor.";
	text1 = "She shakes her head. _Spire ... Spire had hope. Now, I fear, it will be torn apart in the tumult to come. Only Annatolia had the strength and cunning to direct this place. And now ..._";
	text2 = "_I desperately wish she had not died._";
	
begintalknode 114;
	state = 110;
	nextstate = -1;
	condition = 1;
	question = "Can you teach me any spells?";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Mother Twymon",
		  "Mother Twymon knows many powerful spells. She will teach them to you, for a price. Her faith gives nothing away for free.",
		  58,5,0);	
	break;
	
begintalknode 115;
	state = 110;
	nextstate = 116;
	condition = gf(58,2) == 0 && gf(170,10) == 0;
	question = "I'd like to know more about Bargha.";
	text1 = "_It is a terrible place. There are few places anywhere now, on the surface or in the underworld, where the individual is more harshly oppressed._";
	text2 = "_I have been tasked to do whatever I can to undermine that dark place. Alas, it is difficult._";
	code =
		if (gf(58,15) > 1)
			rs(2);
	break;
	
begintalknode 116;
	state = 111;
	nextstate = -1;
	condition = 1;
	question = "How do you help your followers?";
	text1 = "_Well, in the Abyss, we help our adherents gain strength and give them advice about how to use that strength to gain power, wealth, and influence._";
	text2 = "_Then, when they have attained those things, we advise them on how those things might be best used._";
	
begintalknode 117;
	state = 111;
	nextstate = -1;
	condition = 1;
	question = "And who crushes the spirit of freedom and adventure?";
	text1 = "_Everyone you can imagine. The Empire. The crown of Avernum. Anywhere and anyone that would oppress free spirits with an excess of laws._";
	text2 = "_We are entering a wild time. King Starrus cannot help you. Only your own courage and wisdom can help you._";
	
begintalknode 118;
	state = 111;
	nextstate = -1;
	condition = 1;
	question = "Is your faith popular in the Abyss?";
	text1 = "_Extremely. The Abyss is full of independent spirits, trying to escape being smothered by excess laws and control. Many come to me, and I provide them with healing, training, and guidance._";
	text2 = "_And, of course, I expect donations in return. My time is precious and limited, after all._";
	
begintalknode 119;
	state = 112;
	nextstate = -1;
	condition = 1;
	question = "How will Spire gain this influence?";
	text1 = "She smiles serenely. _In a chaotic time, it is important to gain allies. To work with them to prevent chaos and famine. After all, the independent spirit is only nourished when anarchy is prevented._";
	text2 = "_There must be laws, after all. Limited laws, but laws nonetheless._";
	
begintalknode 120;
	state = 112;
	nextstate = -1;
	condition = 1;
	question = "Tell me about Mayor Annatolia.";
	text1 = "_An amazing woman. She has ruled Spire for over twenty years. She is frail, but she has great cunning and a ... a presence. Even the ogres obey her._";
	text2 = "_And those who don't ... She is capable of dealing out very harsh punishments when required._";
	
begintalknode 121;
	state = 112;
	nextstate = -1;
	condition = 1;
	question = "You have directed the building of the walls?";
	text1 = "_And the cleaning of the trash, and the organizing of the militia. In the near future, we will need to defend ourselves. That much is sure._";
	text2 = "_This has required some compulsion of work from the people of Spire. But, then, the individual can only succeed if he or she is not first massacred because your city has no walls._";
	
begintalknode 122;
	state = 113;
	nextstate = -1;
	condition = 1;
	question = "How did she die?";
	text1 = "_One night, she went to bed. The next morning, she was dead. The only sign of how she died was a small hole in the back of her head, at the base of her skull. A tiny hole, but clear enough._";
	text2 = "_We suspect assassins from Bargha. I assure you, before Spire crumbles, they will pay._";
	
begintalknode 123;
	state = 116;
	nextstate = -1;
	condition = 1;
	question = "In what way?";
	text1 = "_Their mad warlord, Lord Farrar, will not let anyone leave. He is determined to form his own empire in the chaos, an empire of slaves, and he will let nobody escape it._";
	
begintalknode 124;
	state = 116;
	nextstate = 117;
	condition = gf(58,15) < 2;
	question = "Can I help you act against Bargha?";
	text1 = "She thinks about it. _There is one thing you could do for me, if you ever had the misfortune to be inside that town._";
	text2 = "_I have heard certain rumors. It is believed that there is a secret tunnel into Lord Farrar's fortress, a way to gain entry besides the front gate._";
	text3 = "_If you could locate it for me, I would pay well for that knowledge._";
	code = 
		set_flag(58,15,1);
		toggle_quest(98,1);
	break;	
	
begintalknode 125;
	state = 110;
	nextstate = -1;
	condition = gf(58,15) == 1 && gf(30,3) > 0;
	question = "I found a secret passage into Lord Farrar's Keep.";
	text1 = "You describe what you found. Mother Twymon is very pleased. _I will pass this information along to where it will do some good._";
	text2 = "_Even though Lord Farrar is dead, someone will replace him. Bargha and Spire have a long rivalry. This knowledge will be useful in the future._";
	text3 = "As a reward, she presents you with a pouch of coins and a small, beautifully made bow. _A well-earned reward for a new ally. Be sure to pass on that Spire, in its ascension, helps those who help it._";
	code = 
		set_flag(58,15,2);
		toggle_quest(98,3);
		award_party_xp(400,25);
		reward_give(94);
		change_coins(400);
		if (gf(170,10) == 0)
			rs(2);
	break;		
	
begintalknode 126;
	state = 117;
	nextstate = -1;
	condition = 1;
	question = "Any idea where I should look?";
	text1 = "_No. We only know it exists because of the story of one who escaped Farrar's clutches. Farrar has dealt harshly with anyone he suspects might know of a way into his fort. That makes us think Farrar knows that there is a secret way in._";
	text2 = "_If it exists, we want to find it before he does._";	

	
// Commander Diver

begintalknode 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = "There is a huge nephar warrior pacing near the west gate, inspecting the ballistae and supervising the construction of the city defenses. He looks most displeased that you were able to enter Spire so freely.";
	text2 = "He growls, _Hmrrrr. I am Commander Diver. You Avernites, you not welcome here. You do your business and go._";
	text5 = "Commander Diver watches a few conscripted residents of Spire working on shoring up a wall. He growls at you, _Thought I told you to be going. Mrrrr. Don't try my patience, Avernite._";
	action = INTRO;

begintalknode 131;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "You are building up the city walls?";
	text1 = "_Yes. We find people who loiter, and we make them work. City walls good for all._ He grins showing his fangs. _Never know when we need to defend ourselves from Avernum._";
	
begintalknode 132;
	state = 130;
	nextstate = -1;
	condition = gf(58,2) == 0;
	question = "Tell me about the mayor here.";
	text1 = "_Mayor Annatolia. She says we have to tolerate your kind. Only reason you not thrown out by now._";

begintalknode 133;
	state = 130;
	nextstate = -1;
	condition = gf(58,2) > 0;
	question = "Tell me about the mayor here.";
	text1 = "_Mayor Annatolia. Murdered. Probably by assassin of Bargha, but we not sure. You move on soon or I think you killed her._";
	
begintalknode 134;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "Do you enforce the law here?";
	text1 = "He looks over at a pair of ominous whipping posts set up by the city wall. Then he smiles. _Annatolia gives the laws. I enforce them. I give the punishments. We have no jails. Those who break law, they pay in blood._";
	
begintalknode 135;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "There's something I'd like to know.";
	text1 = "Commander Diver turns his back on you and, without another word, walks away. Some residents of the Abyss really hate Avernites.";
	action = END_TALK;

// Tizane

begintalknode 150;
	state = -1;
	nextstate = 150;
	condition = 1;
	question = "Name";
	text1 = "This young woman looks like a farmer. A trowel hangs from her belt by a leather thong. She also has a long, vicious dagger, currently in its sheath. She wanders around the pool anxiously.";
	text2 = "When you approach her, she looks very nervous. Once she sees that you mean no harm, she calms down slightly. _Greetings, Avernite. I can speak with you for a bit to ease the tedium. I am Tizane._";
	text5 = "Tizane continues to pace around the pool, highly agitated. _What else do you want, soldier? I shouldn't be seen talking to an Avernite for too long. It's not wise._";
	action = INTRO;

begintalknode 151;
	state = 150;
	nextstate = 151;
	condition = 1;
	question = "You are a farmer?";
	text1 = "_That's right. We of the Abyss are not savages. We have homes. We grow crops. We live peaceful lives. Or try to._";
	text2 = "She pats her dagger. _We just have to work harder to protect ourselves than your lot does. It's a small price to pay. Our farmers are not docile or defenseless._";
	
begintalknode 152;
	state = 151;
	nextstate = -1;
	condition = 1;
	question = "How did you come to be in the Abyss?";
	text1 = "_My father stole. My mother was too free a spirit for the laws of Avernum. They both came here. They met and had me. They raised me here. This is my home._";

begintalknode 153;
	state = 151;
	nextstate = -1;
	condition = get_quest_status(189) < 3;
	question = "Tell me about your farm.";
	text1 = "_It's lost! Taken by thugs from Bargha. I put a note on the Job Board about it, but nobody has been brave enough to help me yet._";
	
begintalknode 154;
	state = 151;
	nextstate = -1;
	condition = get_quest_status(189) >= 3;
	question = "Tell me about your farm.";
	text1 = "_I am gathering supplies now. I will return to it soon, and this time I will not lose it._";
	
begintalknode 155;
	state = 151;
	nextstate = -1;
	condition = 1;
	question = "What do you raise?";
	text1 = "_I am planting fruit trees and raising lizards. That is the new way. They started that in Bargha first, and the idea is spreading. They're mad up there, but that is one wise idea Lord Farrar had._";
	
begintalknode 156;
	state = 150;
	nextstate = -1;
	condition = 1;
	question = "I'd like to know more about Spire.";
	text1 = "She shakes her head. _I need help. From the people here, I mean. I won't make them suspicious by blabbing to an Avernite soldier. Sorry, but you'll have to look elsewhere._";

	
// Bysss-Tss

begintalknode 170;
	state = -1;
	nextstate = 170;
	condition = 1;
	question = "Bysss-Tss";
	text1 = "There is an ancient, withered slithzerikai here, watching the front gate of the Spire arena. She looks like she's been here for a very long time. There are stacks of coins and piles of grimy tickets on the table in front of her.";
	text2 = "_Greetingssss,_ she says. _Bysss-Tss welcomes you to Spire arena. Isss ten coinsss to enter. See many fightsss. Much blood. Good time.._";
	text5 = "Bysss-Tss says, _What else do you need? Go see fightsss! Much blood! Exciting!_";
	action = INTRO;

begintalknode 171;
	state = 170;
	nextstate = 171;
	condition = gf(58,28) == 0;
	question = "Can I see a fight?";
	text1 = "_Yessss. Ten coinsss for ticket. Most fighters gone to war or have fled. Some left, though, for little fightsss._";

begintalknode 172;
	state = 170;
	nextstate = -1;
	condition = gf(58,28) > 0;
	question = "Can I see a fight?";
	text1 = "_Yesss. Jussst go in. I open gatesss for you._";
	
begintalknode 173;
	state = 170;
	nextstate = -1;
	condition = gf(58,11) == 0;
	question = "Can I fight in the arena?";
	text1 = "_Yesss. Go around back and find Pitmaster. I glad if you fight. Can sell ticketsss at last._";
	text3 = "_Yesss. Glad if you fight more. You big and strong and sell ticketsss for usss._";
	action = DEP_ON_SDF 58 10 5;

begintalknode 174;
	state = 170;
	nextstate = -1;
	condition = gf(58,11) > 0;
	question = "What is going on?";
	text1 = "_You're not supposed to be here! You need to be fighting! Go down the trapdoor in the back. Fight for usss!_";
	action = END_TALK;

begintalknode 175;
	state = 171;
	nextstate = -1;
	condition = 1;
	question = "Sorry. Not interested.";
	text1 = "_Than go away. Am busy. Only time for paying customersss._";
	action = END_TALK;

begintalknode 176;
	state = 171;
	nextstate = -1;
	condition = coins_amount() >= 10;
	question = "I'll take a ticket. (Pay 10 coins.)";
	text1 = "She takes the coins and hands you a filthy scrap of paper. The gate starts to slowly open. _Yesss. Jussst go in. Gatesss open for you, soldier._";
	action = END_TALK;
	code =
		change_coins(-10);
		sf(58,28,1);
	break;
	
//

begintalknode 200;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Spire's guards are a grimy lot of mixed mercenaries, dragged in from all over Avernum. Their armor is filthy and worn, but their weapons look new.";
	text2 = "They watch you closely, alert for any sign of treachery or lawbreaking. They don't trust Avernites, especially soldiers. Fortunately, they leave you alone.";
	text3 = "They watch you closely, alert for any sign of treachery or lawbreaking. Now that the mayor is dead, everyone here is constantly on the edge of panic.";
	code =
		if (gf(58,2) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode 201;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Spire is full of a wide variety of people. Mercenaries. Farmers. Folks who just want to be left alone.";
	text2 = "Many of them live in large, low barracks built into the town walls. They don't appreciate your intrusion. They stay very quiet.";

begintalknode 202;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "These people are all drinking, betting, and watching the fights below. They have no interest in talking to you.";

begintalknode 203;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Several people in Spire are working on building or repairing the walls. They don't seem to be doing it willingly. The guard must occasionally conscript a few hearty souls to get the job done.";
	text2 = "They stalk past you, grumbling and sweating. None of them are in the mood to talk.";

begintalknode 204;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Spire has several ogres as guards. The creatures are surprisingly disciplined for their kind. They only snarl and spit at you when you get close. They don't actually attack.";

// 

begintalknode 205;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You meet one of the mayor's private guard. He has no interest in speaking with you. He grunts and waves you away.";

begintalknode 206;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There is a guard waiting in this small garden. When he sees you, he snaps, _This is Mayor Annatolia's private courtyard. She's made it clear that nobody is to be allowed back here. Nobody._";
	text2 = "_You'd better be gone before I count three. I see you here again, and I call for the rest of the guard. You won't make it out alive._";

begintalknode 207;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Mayor Annatolia's guard sees you snooping around near Annatolia's private chambers. He's had enough. He shouts an alarm.";
	text2 = "You instantly find yourself very unwelcome in Spire.";

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

//


begintalknode 210;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You reach the center of the arena and look up. The halls above are almost full. The spectators are fascinated to see a soldier of Avernum is demonstrating battle prowess in the pit.";
	text2 = "The exit gates close, and then another gate, in the northwest corner, slowly opens.";
	text3 = "Several goblins, each of them a burly, scarred veteran of the arena, scramble under the gate. They snarl and charge you, unconcerned about their own lives.";
	
begintalknode 211;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You reach the center of the arena and look up. The halls above are almost full. The spectators are fascinated to see a soldier of Avernum is demonstrating battle prowess in the pit.";
	text2 = "The exit gates close, and then another gate, in the northwest corner, slowly opens.";
	text3 = "Several lizards, colored red or blue, scuttle under the open gate.";
	
begintalknode 212;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You reach the center of the arena and look up. The halls above are full. The news has gotten around that a soldier of Avernum is demonstrating battle prowess in the pit.";
	text2 = "The exit gates close, and then another gate, in the northwest corner, slowly opens.";
	text3 = "Three gladiators enter the arena, each determined to put down the upstarts who are challenging their records.";
	
begintalknode 213;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You reach the center of the arena and look up. The halls above are full. The news has gotten around that a soldier of Avernum is demonstrating battle prowess in the pit.";
	text2 = "The exit gates close, and then another gate, in the northwest corner, slowly opens.";
	text3 = "A pair of gazers float into the arena. It is odd that such proud creatures would debase themselves for the amusement of the crowd. On the other hand, it must supply them with a steady supply of wealth. And meat.";
	
begintalknode 214;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You reach the center of the arena and look up. The halls above are so full that some spectators are in danger of falling into the pit. They lean forward, eager to see you confront the final foe.";
	text2 = "The exit gates close, and then another gate, in the northwest corner, slowly opens.";
	text3 = "A deathly silence falls over the crowd above. A horrific beast, ten feet tall, enters the arena. Its shell is a thick chitin, covered with razor-sharp claws and protrusions. It is incredibly quick and completely deadly.";
	text4 = "You come face to face with the Horror of the Pit, the beast that none have ever escaped.";
	
begintalknode 215;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You have emerged victorious in the arena. The cheering from above is deafening. The exit gate slowly begins to open.";

begintalknode 216;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The savage crowd above you goes crazy. They never thought they would see the day someone would defeat the Horror of the Pit. Whatever else you achieve in your lifetime, you are now a legend in the Abyss.";


////

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