// TOWN DIALOGUE SCRIPT
//    Town 53: Empire Archives

begintalkscript;

variables;

short i,j,k,r1,choice;

// Aydin

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Aydin";
	text1 = "An unkempt, unshaven Avernite is being held in this cell. He wears traveling clothes and has a dagger at his belt. His captors didn't even bother to disarm him before they threw him in here.";
	text2 = "He looks very glad to see you. _Greetings, friend! Well met, indeed! I am Aydin!_";
	text5 = "Aydin says, _Anything else I can help you with? Any way I can show my gratitude for my rescue?_";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Why are you locked up here?_";
	text1 = "_I and my lady were captured and brought here by the Empire._";
	action = SET_SDF 53 17 1;

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Your lady would be?_";
	text1 = "He looks worried. _Josie. My partner and fellow mage. We were both brought here. She was placed in the next cell, but I have no idea if she is still all right. I am very worried. I can't leave until I'm sure she is all right._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_How did the Empire get their filthy hands on you?_";
	text1 = "_We were captured through our carelessness. We were hiding on one of the northern islands, but we didn't flee soon enough when the invasion came. They caught us while we were leaving._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Why are you imprisoned in the archives?_";
	text1 = "_I suspect the Empire brought us here to get vengeance on us._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_What did you do?_";
	text1 = "_We are traitors to the Empire. We gave the Avernum government information which helped them assassinate Hawthorne. For that, they had planned a vicious punishment indeed._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_Punish you how?_";
	text1 = "_They were going to leave us here for the rest of our lives, slowly driven mad by the loneliness. But it didn't work, obviously. I've only been here for a year. Once I find out what happened to Josie, we can escape!_";

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_What holds you in this cell?_";
	text1 = "_Magic. No surprise. I am charmed. I can't walk out of it. Fortunately, now that you have opened the door and broken the seal, I can teleport out. First, though, I need to know if Josie is all right._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(53,18) >= 1 && gf(53,17) >= 1;
	question = "_I met someone named Josie in the next cell._";
	text1 = "His face lights up. _Thank you! Please tell her that I am all right. Now, at last, I am free to leave._ He bows to you and begins to mutter a spell. Before your eyes, he fades away.";
	action = END_TALK;
	code =
		sf(53,17,1);
		sf(53,25,1);
		erase_char(5300);
	break;

begintalknode;
	state = 1;
	nextstate = 6;
	question = "_Can you teach me any magic?_";
	text1 = "_I ... No. I am too tired. Too desperate to be free. This is a huge library. You must be able to find something._";

begintalknode;
	state = 6;
	nextstate = -1;
	condition = 1;
	question = "_Do you know where I can find any specific pieces of information?_";
	text1 = "_No. I know little about this place. I'd look for the indexes._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I need to go now._";
	text1 = "_All right. Find Josie. I need to make sure she is all right._";
	action = END_TALK;

// Josie

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 28;
	question = "Josie";
	text1 = "You meet a woman with long, unkempt hair, a torn dress, and a wild look. Her lonely imprisonment has clearly damaged her.";
	text2 = "She runs up to you and says, in a loud voice, _Welcome! Welcome! I am Josie! Welcome, rescuer!_";
	text5 = "Josie stares at you, relieved to have contact with another person at last. She shakes slightly as she talks to you.";
	action = INTRO;

begintalknode;
	state = 28;
	nextstate = -1;
	question = "_Are you all right?_";
	text1 = "_Here a year. Lonely. Oh, so lonely, worried about Aydin, worried, magic seal outside forcing me to stay in here, charmed, can't leave cell, oh, I wish I could leave._";

begintalknode;
	state = 28;
	nextstate = 29;
	question = "_What are you doing here?_";
	text1 = "_I and my husband were imprisoned here, until now._";
	action = SET_SDF 53 18 1;

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_Where is your husband?_";
	text1 = "_Aydin. He's in the next cell._";

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_How did you wind up locked up like this?_";
	text1 = "_We lived on one of the northern islands, in a well guarded tower. Well, we thought it was guarded. We were a great help to Avernum. Great help. But when the invasion came, when we fled the tower, they caught us._";
	text2 = "_But it doesn't matter! We can escape now._";

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_No tower in Avernum is safe from the tendrils of the Empire._";
	text1 = "_Yes, it is sad. Sad. Very sad. You spend days conjuring a beautiful work of architecture to call home, and no doubt it's rubble now. All destroyed._";

begintalknode;
	state = 28;
	nextstate = 31;
	question = "_Why did the Empire imprison you?_";
	text1 = "_We told them how to get assassins to the surface to slay Emperor Hawthorne. It worked. So I guess the invasion is, in part, our fault._ She sighs. _Now that you've helped us, I wish I could assist you._";

begintalknode;
	state = 31;
	nextstate = 28;
	question = "_It might be partly your fault, but it would have happened eventually._";
	text1 = "_Yes. A foul and brutal act that had to happen. But now that we can escape, perhaps we can help turn the tide._";

begintalknode;
	state = 31;
	nextstate = 28;
	question = "_You brought disaster upon us all._";
	text1 = "_Yes. I deserve all that happened here, for all the death I caused. I should stay to be destroyed, but I lack the courage._";

begintalknode;
	state = 28;
	nextstate = 32;
	question = "_You are free to escape._";
	text1 = "_First, I need to know that Aydin is all right. Aydin. Poor, poor Aydin. I can leave when you tell me that he is all right._";

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_Can you assist me before you go?_";
	text1 = "_Alas, we will need all our power to get to safety, and we know nothing about this fortress. I am sorry._";


begintalknode;
	state = 28;
	nextstate = -1;
	condition = gf(53,17) >= 1 && gf(53,18) >= 1;
	question = "_I met a man named Aydin in the next cell. He seemed to be in good shape._";
	text1 = "_Now, now I can leave. Thank you. Tell Aydin I am fine. I must use magic to leave. Only safe way. Good bye._ She casts a spell. As you watch, she slowly fades away.";
	action = END_TALK;
	code =
		sf(53,26,1);
		erase_char(5301);
	break;

