// TOWN DIALOGUE SCRIPT
//    Town 12: Angierach

begintalkscript;

variables;

short i,j,k,r1,choice;

// Quinby

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Quinby";
	text1 = "An insubstantial figure floats in the middle of this cell. It silently rotates toward you when you enter. It looks like the ghost of a male human.";
	text2 = "You stand alert, waiting for it to lurch for you. Instead, the ghost sighs. _I was Quinby._";
	text5 = "Quinby hovers near you. It watches patiently. It has all the time in the world.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Why do you lurk here, spirit?_";
	text1 = "_I was a mage of high renown. I served Avernum. Then I was brought to Angierach._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_You say you are of great renown? I've never heard of you._";
	text1 = "_Well, somewhat high renown then. I did all right. Not well enough, though._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_What happened to you in Angierach?_";
	text1 = "_This is the heart of darkness. The Ten questioned me, and then I received the standard fate for prisoners here. Escape is not an option._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_Who are these Ten you mentioned?_";
	text1 = "_This fort was created for ten powerful creatures, so that they could, in quiet and safety, perform cruel and twisted acts, and create foul magic to aid the Empire. That is why they take so many prisoners._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_So what is the final fate of prisoners?_";
	text1 = "_Prisoners are brought here to be experimented on. If they're lucky. Some, like me, if they know about magic, have their minds drained. Then they are left in their cells to starve. In constant agony._";
	text2 = "_The Ten are evil beyond redemption._";

begintalknode;
	state = 3;
	nextstate = 5;
	question = "_Even as a mage, you couldn't escape?_";
	text1 = "_I was a mage. I could have unlocked my door, but I didn't have the power to bring down the golems beyond it. If someone could defeat them, though, the doors could be opened._";

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_If I can kill the golems, how can we open the door?_";
	text1 = "_There is a lever somewhere outside these cells. Pull it, and escape will be possible. I only found out about this after my death, but I hope to be avenged by telling you._";
	
begintalknode;
	state = 5;
	nextstate = 7;
	condition = get_terrain(0,9,50) != 0;
	question = "_Can you unlock the door for me?_";
	text1 = "_No, I can't. Not anymore. Not now that I am dead. I have lost a good part of my powers. I could barely even weaken that crumbling wall to the north._";

begintalknode;
	state = 7;
	nextstate = -1;
	condition = gf(12,13) == 0;
	question = "_Crumbling wall? Weaken it? Could you do that?_";
	code =
	run_hardcode(49);
	break;

begintalknode;
	state = 1;
	nextstate = 9;
	condition = 1;
	question = "_Can I help you?_";
	text1 = "_I am beyond help. I fade away day by day. Soon, I will vanish. All I can hope for is to be avenged._";

begintalknode;
	state = 9;
	nextstate = 1;
	condition = gf(12,17) == 0;
	question = "_By all that I hold sacred, you will be avenged!_";
	text1 = "The spirit glows red briefly. _I want the Ten to die. They let me starve to death in this cell, as they have so many others. I want them dead._";

begintalknode;
	state = 9;
	nextstate = 1;
	condition = gf(12,17) > 0;
	question = "_I have destroyed the lich._";
	text1 = "_Oh. I thought hearing that would make me feel something. I guess I am beyond that now._";

begintalknode;
	state = 9;
	nextstate = 1;
	condition = 1;
	question = "_I will do what I can._";
	text1 = "_Then fight for Avernum. It is all I can ask for._";

begintalknode;
	state = 1;
	nextstate = 10;
	condition = 1;
	question = "_How can I get out of Angierach?_";
	text1 = "_I have overheard little. Some of the withered humans said something about a master key while they were destroying me._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "_What did they say?_";
	text1 = "_They were jealous. They said the main key was held by the lich. Held in a hidden cell beyond its lair. She never let them borrow it._";
	text2 = "_I didn't make out any more than that, as my agony grew too great._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I'll be going now._";
	text1 = "_All right. Good luck. I'll go back to quietly vanishing. I'm sure I'll be gone any day now._";
	action = END_TALK;


