// TOWN DIALOGUE SCRIPT
//    Town 99: Tower of Elderan

begintalkscript;

variables;

short i,j,k,r1,choice;

// Bill

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Bill";
	text1 = "An archer in the Avernum army is being held in this cell. You can tell from the insignia on his armor. And his equipment. His captors didn't even bother to strip him of his bow, arrows, and armor.";
	text2 = "He looks up at you when you enter the cell, but he doesn't react to your presence. He doesn't betray a flicker of emotion. _Oh. A visitor. I am Bill._";
	text5 = "Bill sits with his back to the wall of the cell, lost to apathy. His imprisonment doesn't seem to be an issue of great concern to him.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Are you a prisoner here?_";
	text1 = "He stares at you vacantly, as if there were no point in talking to you. _Yes, I've been waiting here for quite a while._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Waiting for what?_";
	text1 = "_For Elderan to deal with me._";

begintalknode;
	state = 3;
	nextstate = 4;
	condition = gf(102,11) == 0;
	question = "_That sounds ominous._";
	text1 = "_Elderan isn't really evil, you know? Just dedicated._ He thinks. _No, that's wrong. He is evil. Dedicated, and evil._ His mind seems to be elsewhere.";

begintalknode;
	state = 4;
	nextstate = 5;
	question = "_Bad combination._";
	text1 = "He lifts his hair from his forehead, revealing an odd symbol. _I'm cursed. I can never leave this tower. I die if I do. My commander, Houghton, tried it._";

begintalknode;
	state = 5;
	nextstate = 6;
	question = "_I'm almost afraid to ask, but what happened to Houghton?_";
	text1 = "_I saw him die. He tried to run, but didn't get three steps before he keeled over. So I came back to my cell, to make my peace._";

begintalknode;
	state = 6;
	nextstate = 7;
	question = "_To make your peace with what?_";
	text1 = "_With death. I'm ready to die. I just hope it's not in an experiment._";

begintalknode;
	state = 7;
	nextstate = -1;
	question = "_Elderan experiments on people?_";
	text1 = "_Don't ask. You don't want to know._ He wavers slightly. _I'm sorry. This is very tiring. I don't... I ... I will sleep now._ Without another word, he lies down and stops responding to your questions.";
	action = END_TALK;

begintalknode;
	state = 1;
	nextstate = 15;
	condition = gf(102,11) >= 1;
	question = "_Elderan is dead! You are free to escape!_";
	text1 = "He barely seems to hear you.";

begintalknode;
	state = 15;
	nextstate = -1;
	question = "_Didn't you hear me? Elderan is dead._";
	text1 = "He sits and stares at the wall. _It doesn't matter. His curse lives on. I can't leave the tower. Just leave me alone._ You try to keep talking with him, but he ignores you.";
	action = END_TALK;

// Bill

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 28;
	question = "Bill";
	text1 = "An unwashed, scruffy man sits hunched in the corner. His robes hang loosely from his emaciated body. His fingers trace idly over a symbol on his forehead.";
	text2 = "He looks up at you. He seems unsurprised by your presence. _I'm Bill. Hello._";
	text5 = "Bill continues to sit still, touching the symbol on his forehead. It is a blue tattoo, an intricate tracery of thin lines.";
	action = INTRO;

begintalknode;
	state = 28;
	nextstate = 29;
	question = "_What is that symbol on your head?_";
	text1 = "_It's my curse. Elderan put it on me when he captured me. It's a new technique he's developing for keeping people docile. Experimental._";

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_Tell me about the curse._";
	text1 = "_Elderan puts it on all his prisoners. If we step out of the tower, we die. I'll live the rest of my life in here. So will Bill. But until then, I can try to be useful._";

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_There is another Bill around?_";
	text1 = "_In the next cell. Two of us named Bill. Bill._";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_Useful to whom? To Elderan?_";
	text1 = "_Useful to Avernum. I try to pick up information when I can. For example, did you know that this tower was used to store records?_";

begintalknode;
	state = 31;
	nextstate = 32;
	question = "_What sort of records?_";
	text1 = "_Elderan was the chief record keeper. All sorts of information passed through here, all about the Empire's forces down here. But not long ago, I heard that the records were moved._";

begintalknode;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "_How did you learn it?_";
	text1 = "_I overheard the guards. They freely talk around us. They don't worry about us. We can't do anything anymore. Ever._";

begintalknode;
	state = 32;
	nextstate = 33;
	question = "_The records were moved where?_";
	text1 = "_To one of the Northern Islands. A bunch of scattered islands to the northwest. Hard to get to. In Empire territory. Still, it's interesting knowledge._";

begintalknode;
	state = 33;
	nextstate = 34;
	question = "_Yes. I see that._";
	text1 = "_Imagine what harm someone getting in there could do!_";

begintalknode;
	state = 34;
	nextstate = -1;
	question = "_Like what?_";
	text1 = "He suddenly gets irritated. _Empire records? Troop stuff? You figure it out! Can't you see I'm very busy here?_ He returns to concentrating on the symbol, and ignores you.";
	action = END_TALK;

begintalknode;
	state = 28;
	nextstate = 36;
	condition = gf(102,11) >= 1;
	question = "_I have killed Elderan. It's safe for you to escape._";
	text1 = "_That is good. I am glad to hear that you have avenged me. However, until I unlock the secret of this curse, I can't go anywhere._";

begintalknode;
	state = 36;
	nextstate = -1;
	question = "_But won't you starve to death first?_";
	text1 = "_No. Elderan was a cunning mage, and he liked to save himself work. Food appears for us here, every day. Repulsive, but it sustains life. Hopefully, we can be freed from this prison someday. Just not today._";
	text2 = "_Still, thank you for thinking of me._";
	action = END_TALK;

//

begintalknode;
	tag = 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	text1 = "A pile of human wreckage is slumped in the corner. Once, he was a mighty warrior of the underworld. Then he became the subject of Elderan's attentions. He has been ... changed.";
	text2 = "His hair is stringy and gray. His limbs stick out at slightly odd angles. His skin develops bubbles and then smooths out again. He is a warped, fading shell of a man.";
	text3 = "He looks up at you. His voice is a wet rasp. _I ... I ... I was ..._";

begintalknode;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "_Who are you?_";
	text1 = "_I was Kyass. I was ... Wanted an Empire._ He shudders in pain. The bubbles forming under his skin grow larger.";

begintalknode;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "_You were with the Empire?_";
	text1 = "_No ... Formed an Empire. My own cave. My own city. Formed it. Ahhhhhh._";

begintalknode;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "_Are you all right?_";
	text1 = "Despite his clear distress, he still manages a look of irritation. _What do you think?_";

begintalknode;
	state = 52;
	nextstate = 53;
	condition = 1;
	question = "_You made a city?_";
	text1 = "_I did. Gone. Lost. The Empire came. I fought them. Ahhhhhhh. Hurts. Fought. Tried to keep all I had. Lost it all. Brought to Elderan._";
	code =
		sf(141,20,1);
	break;
	
begintalknode;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "_What happened to the people in your city?_";
	text1 = "_Some fled. The rest ... I failed them._";

begintalknode;
	state = 53;
	nextstate = 54;
	condition = 1;
	question = "_What did Elderan do?_";
	text1 = "_He ... He ..._ Kyass grows still. He calms down. His voice changes. Deeper. Colder. _Kyass is gone. The experiment is a success._ The bubbles are rising all over his skin.";

begintalknode;
	state = 54;
	nextstate = -1;
	condition = 1;
	question = "_Uhhh ..._";
	text1 = "Kyass rises. His skin falls away in sheets, leaving a horror behind. Gleaming, fresh, and hideous. _Elderan will be pleased. I will serve him now. As a gift, I will give him your head._";
	action = END_TALK;
	code =
		sf(99,25,1);
		erase_char(9913);
		spawn_creature(9914);
	break;
	