// dialog script for town 17: Empire HQ level2.

begintalkscript;

variables;
int day6;

// *** guards ***

begintalknode 1;
	state = -1;
	personality = 65;
	nextstate = -1;
	condition = 1;
	question = "Guard";
	text1 = "This guard is wearing armor from top to bottom. You can't think how the poor man breathes within his box made of iron and bronze. You leave him. After all, he is an Empire guard, and you don't want to mess with him.";

// *** high priest playing chess ***

begintalknode 2;
	state = -1;
	personality = 62;
	nextstate = -1;
	condition = 1;
	question = "High priest";
	text1 = "This priestess is playing a game of chess. She doesn't look pleased. Not at all. When you approach, she starts screaming at you. You decide it may be better to leave.";

// *** mage playing chess ***

begintalknode 3;
	state = -1;
	personality = 63;
	nextstate = -1;
	condition = 1;
	question = "Mage";
	text1 = "This mage is playing chess against an angry high priestess. The mage on the other hand, looks pleased, although you don't know why. He appears to be losing. You decide not to disrupt his concentration, and you leave.";

// *** official in dining hall ***

begintalknode 4;
	state = -1;
	personality = 64;
	nextstate = 1;
	condition = 1;
	question = "Official";
	text1 = "This man, dressed in elegant robes, sits at his table and does nothing, except occasionally staring out of the window and drinking a cup of tea.";

begintalknode 5;
	state = 1;
	personality = 64;
	nextstate = 2;
	condition = 1;
	question = "Hello, sir.";
	text1 = "He looks up at you. After just a glance at you, he carefully inspects you from top to bottom. When he is done, he talks. _Um, hi. Do I know you or something? What is the problem?_";

begintalknode 6;
	state = 2;
	personality = 64;
	nextstate = 2;
	condition = 1;
	question = "Should there be a problem?";
	text1 = "He thinks. _Well, of course not, but one never knows. Want a cup of tea?_ You shake your heads. He seems slightly disappointed.";

begintalknode 7;
	state = 2;
	personality = 64;
	nextstate = 3;
	condition = 1;
	question = "Could you tell us where the head of this fort is?";
	text1 = "He puts down his cup and looks at you. _Why?_ You stare at him, surprised. _Why does nobody want to listen to me?_";
	text2 = "_Well of course. Through the corridor to the north, and then the last door to the right._ He nods and points to the corridor. He smiles.";
	text3 = "He is still angry at you for not wanting to listen to him. _You again? Fine, through the corridor, last door on your right. Now leave me be._ You do so.";
	code =
		if (get_flag(17,1) == 0) {
				remove_string(2);
				remove_string(3);
				}
		
		if (get_flag(17,1) == 1) {
				remove_string(1);
				remove_string(3);
				}
		
		if (get_flag(17,1) == 2) {
				remove_string(1);
				remove_string(2);
				end();
				}
	break;

begintalknode 8;
	state = 3;
	personality = 64;
	nextstate = 4;
	condition = 1;
	question = "Um, we'll listen, if it doesn't take too long.";
	text1 = "He smiles. _Thank you, thank you so much. You see, not long ago, I got this package. On it was written, in large friendly letters: _Shut the hell up_. I was angry then, but it seemed to be the title of a game. That is all._";

begintalknode 9;
	state = 4;
	personality = 64;
	nextstate = -1;
	condition = 1;
	question = "Weird... Anyway, can you now tell us where the head of the fort it?";
	text1 = "He keeps smiling. _Well of course. Go through the corridor to the north, and enter at the last door to the right._ You thank him, and leave.";
	action = END_TALK;
	code =
		set_flag(17,1,1);
	break;

begintalknode 10;
	state = 3;
	personality = 64;
	nextstate = -1;
	condition = 1;
	question = "No thanks. Just tell us where the old bugger is.";
	text1 = "It seems you hurt his feelings by saying that. _Fine. Corridor to the north and last door to the right. Now go away._ Indeed, he is angry alright.";
	action = END_TALK;
	code =
		set_flag(17,1,2);
	break;

// *** official in first room ***

begintalknode 11;
	state = -1;
	personality = 66;
	nextstate = 5;
	condition = 1;
	question = "Official";
	text1 = "This nicely dressed man looks frustrated. He has his hands in his hair, and papers are scattered all over the room. It is in complete chaos.";
	text2 = "While the man was once extremely unfriendly, he seems to have calmed down as a result of you promising him to find his wife.";
	text3 = "This man was once frustrated, touchy, and very unfriendly. However, since you rescued his wife, he has become very gentle and friendly.";
	code =
		if (get_flag(17,2) == 0) {
				remove_string(2);
				remove_string(3);
				}
		
		if (get_flag(17,2) == 1) {
				remove_string(1);
				remove_string(3);
				}
		
		if (get_flag(17,2) == 2) {
				remove_string(1);
				remove_string(2);
				}
	break;
	
begintalknode 12;
	state = 5;
	personality = 66;
	nextstate = 6;
	condition = 1;
	question = "What happened here!?";
	text1 = "He now looks at you, and he doesn't seem very pleased with that question. _What!? Who are you guys! I didn't call for you, did I?_";

begintalknode 13;
	state = 6;
	personality = 66;
	nextstate = 7;
	condition = 1;
	question = "No sir, you didn't, but we saw all these papers, so we thought...";
	text1 = "_What? Papers?_ You point to the floor. _Ah, yes. Well, you see, there are some problems here. I'm sorry, but you can't help me._";

begintalknode 14;
	state = 7;
	personality = 66;
	nextstate = -1;
	condition = 1;
	question = "Are you sure we can't help?";
	text1 = "The man grabs a paper from his desk and quickly writes something on it. He then shows it to you. On it is written, in large, friendly letters: _NO! NOW GO AWAY!_ The man throws the paper away and says: _Is it clear now? Go!_";
	action = END_TALK;

begintalknode 15;
	state = 7;
	personality = 66;
	nextstate = 8;
	condition = 1;
	question = "If I may ask, what is your problem?";
	text1 = "Disturbed, he takes his hands out of his hair and stares at you. _What? Yes, of course. You may ask. Last week, you see, my wife gave labour. However, the Senarti kidnapped her, and now I'm trying to figure out how to get her back._";
	text2 = "Tears drop on his clothes, making them all wet. The man looks really anxious. You don't believe you can't help him, though.";
	text3 = "He stands up. _I already told you about my wife, didn't I?_ You nod. _Then go find the poor woman!_ He sits down and waits for you to leave._";
	text4 = "The man smiles. _Well the main problem isn't there anymore. I'm so glad you found her. She is safe now, and the child is a small jewel. I thank you._ He starts looking at his papers again. The problems that remain are purely administrative._";
	code =
		if (get_flag(17,2) == 0) {
				remove_string(3);
				remove_string(4);
				}
		
		if (get_flag(17,2) == 1) {
				remove_string(1);
				remove_string(2);
				remove_string(4);
				}
		
		if (get_flag(17,2) == 2) {
				remove_string(1);
				remove_string(2);
				remove_string(3);
				}
	break;

begintalknode 16;
	state = 8;
	personality = 66;
	nextstate = 5;
	condition = get_flag(17,2) == 0;
	question = "We can help you find her, you know.";
	text1 = "_You can?_ His mouth falls open in amazement. He quickly closes it. _You can!?_ He starts smiling. He stands up from his chair and starts shaking your hand, while screaming _Oh thank you_ fifty times.";
	text2 = "After that he sits down and looks at you. _The Senarti took her to their fort, and then she disappeared. I really don't know where she is. However, I'm confident you'll find her in time._";
	code =
		toggle_quest(12,1);
		set_flag(17,2,1);
	break;

begintalknode 17;
	state = 5;
	personality = 66;
	nextstate = -1;
	condition = get_flag(17,0) == 1 && get_flag(20,20) == 1;
	question = "We found your wife";
	text1 = "In astonishment, the man falls completely silent. _You really did?_ He stands up and walks to the closet, and pulls out a small bag. _This is for you. May it serve you well._ He then gets seated again.";
	text2 = "_Now tell me where she is?_ You do so. When you have finished, the man looks slightly surprised, but happy at the same time. _Good! My men will bring her back soon, I hope. You did say soldiers were fighting Thralni when you came?_";
	text3 = "You nod. The man claps in his hands and smiles. _Very good. I'll just wait and see her coming in when the fight is over._";
	code =
		toggle_quest(12,0);
		set_flag(17,2,2);
		change_coins(250);
	break;

// *** commander in second room ***

begintalknode 18;
	state = -1;
	personality = 67;
	nextstate = 9;
	condition = 1;
	question = "Commander";
	text1 = "The man in this room wears armor. You assume he is some kind of a general. His room is quite nice too. Although you might be able to get to know important things from this man, he doesn't seem very eager to talk.";

begintalknode 19;
	state = 9;
	personality = 67;
	nextstate = 10;
	condition = 1;
	question = "Hello. Can we help with something?";
	text1 = "_Wha? Who are you guys?_ You tell him who and why you are here. _Ah, I see. Well, if you can defeat a complete army, I can give you some sort of a quest._";

begintalknode 20;
	state = 10;
	personality = 67;
	nextstate = -1;
	condition = 1;
	question = "Sure we can!";
	text1 = "He pulls his left eyebrow up. _Yeah, sure you can. Please, don't lie to me. Lie to my cat, not to me. Now go. You have kept me from my work long enough._";
	action = END_TALK;

begintalknode 21;
	state = 10;
	personality = 67;
	nextstate = -1;
	condition = 1;
	question = "Um, no. We can't";
	text1 = "_Thought so. Now, if you will excuse me, I have an army to command. Good day to you to._ He turns his back to you and starts reading a letter he just received.";
	action = END_TALK;

// *** Empire HQ chief ***

begintalknode 22;
	state = -1;
	personality = 68;
	nextstate = 11;
	condition = 1;
	question = "Empire HQ chief";
	text1 = "This is the chief of the Empire headquarters of Riverrod province. He is a smallish man with an enormous mouth. You gather that is the reason he became the chief of this place.";
	text2 = "The chief of the Empire headquarters is busy writing several letters. When you enter, the chief immediately greets you and smiles happily at you, after which he starts complementing you for your work.";
	code =
		if (get_flag(5,1) != 2) {
				remove_string(2);
				}
				
		if (get_flag(5,1) == 2) {
				remove_string(1);
				}
	break;

begintalknode 23;
	state = 11;
	personality = 68;
	nextstate = 12;
	condition = 1;
	question = "What do you know about the problems here?";
	text1 = "The man looks up from his work, and takes his glasses off. He quietly looks at you, after which he opens his mouth. A stream of loudly spoken words flows out of it. _What I know about it? Everything! What do you want to know?_";
	
begintalknode 24;
	state = 12;
	personality = 68;
	nextstate = 12;
	condition = 1;
	question = "Tell us about the ones causing it.";
	text1 = "The mouth shuts for a moment, then opens, getting even bigger. _The Senarti you mean? It's better to go to a mage, Flanagan, I think he is called. He lives in Pleasantville. He knows more about them._";

begintalknode 25;
	state = 12;
	personality = 68;
	nextstate = 13;
	condition = 1;
	question = "How about the army?";
	text1 = "_What army? Oh, you mean the soldiers here and in Fort Filbert. Not much, actually. They all wish they weren't soldiers of course, but we can't change that, can we._ He shrugs. _Well, we can, but we don't want to._";

begintalknode 26;
	state = 13;
	personality = 68;
	nextstate = 12;
	condition = 1;
	question = "Why, what is so bad about being a soldier?";
	text1 = "_Usually nothing, but with the Senarti, who are very dangerous, people just want to flee this place. If something bad happens, we'll lose all remaining inhabitants. They'll all flee away at a certain point, I fear._";
	text2 = "_However, with you taking out the Senarti threat, that's not really an issue anymore, is it?_ He grins. He has beautiful teeth.";
	code =
		if (get_flag(5,1) != 2) {
				remove_string(2);
				}
	break;

begintalknode 27;
	state = 12;
	personality = 68;
	nextstate = 14;
	condition = get_flag(5,16) != 2;
	question = "How did these Senarti come here anyway?";
	text1 = "His face turns very serious now. _That is the question. We don't know. If we had known, everything would be a lot easier. We need a band of adventurers, actually._ Now he smiles, and looks at you with great pleasure.";

begintalknode 28;
	state = 13;
	personality = 68;
	nextstate = 11;
	condition = get_flag(5,10) > 0;
	question = "We already started investigating, you know.";
	text1 = "He looks surprised. _You did!? Why didn't I hear anything about it then? That is strange. I shall speak to the Empire liaison in Voughton at once. If you will excuse me..._ He stands up and leaves. _I'll be back in three days._";
	text2 = "He nods. _Yeah, I know. You already told me about it, and I went to Mayor Ruth for her confirmation. She said that you indeed were investigating it all. Very good. You are brave men._";
	code =
		if (get_flag(17,5) == 0) {
				remove_string(2);
				erase_char(6);
				day6 = what_day_of_scenario();
				set_flag(250,7,day6);
				set_flag(17,5,1);
				end();
				}
		
		if (get_flag(17,5) > 0) {
				remove_string(1);
				}
	break;

begintalknode 29;
	state = 13;
	personality = 68;
	nextstate = 12;
	condition = get_flag(5,10) == 0;
	question = "Maybe we can help you?";
	text1 = "He puts the paper down he was holding. _If you could do that, that would be fantastic. I suggest you go to Mayor Ruth, Mayor of Voughton. Ask her if you can do anything about the Senarti problem.";