// TOWN DIALOGUE SCRIPT
//    Town 5: Cotra

begintalkscript;

variables;

short i,j,k,r1,choice;

// Yong-Mi

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 21;
	question = "Yong-Mi";
	text1 = "You meet a young, dark-skinned woman. Her black hair streams out from under her helmet. At first, you think she is another Empire infiltrator. Then you see the crude remains of the Avernite sun insignia on her shoulder, held on by a thread.";
	text2 = "She quickly waves you over and pulls you out of sight. She whispers, _It's good to get help. I'm Yong-Mi. A scout._";
	text5 = "Yong-Mi looks left and right, constantly watching for looters, Empire soldiers, or worse. It's amazing that she's been able to get this close.";
	action = INTRO;

begintalknode;
	state = 21;
	nextstate = 22;
	question = "_What are you doing here?_";
	text1 = "She peeks around the corner to make sure nobody is coming, and says, _I've been watching the ruins._";

begintalknode;
	state = 22;
	nextstate = 23;
	question = "_This place is a mess._";
	text1 = "She shakes her head. _This was a beautiful city, as fine as any down here. Look what the eyebeasts did to it!_";

begintalknode;
	state = 23;
	nextstate = -1;
	question = "_What did they do?_";
	text1 = "_There were a bunch of them, I don't know how many. They flew into town, blasting it with spells as they went. Once there were holes in the walls, the enemy soldiers could come in._";
	text2 = "_If you look carefully, you'll see all the blasts came from inside the town. The outer walls are still intact._";

begintalknode;
	state = 21;
	nextstate = 24;
	question = "_What have you seen in Cotra?_";
	text1 = "_Both Empire soldiers and gazers are here. That's why I'm risking my life. We need to find out what the Empire is planning to do here. It still hasn't been fully occupied, and there's some weird tension._";

begintalknode;
	state = 24;
	nextstate = 25;
	question = "_Tension? What do you mean?_";
	text1 = "_The Empire convinced the eyebeasts to help them take the town, but the beasts don't want to leave. They're in the northwest. And the Empire wants the town, of course. But they only have a few troops here, protecting the smelter._";
	text2 = "_There's a truce between the two, but eyebeasts are evil and arrogant creatures._";

begintalknode;
	state = 25;
	nextstate = 26;
	condition = gf(5,12) <= 1;
	question = "_There is a smelter here?_";
	text1 = "_In the southeast corner of town. They're holding Cotra's forge. I think they want it for their use down here. I was told to disable it, if I could. If you could do it for me, I'd be able to get out of here. It's well guarded, and I can't do it myself._";
	action = SET_SDF 5 12 1;
	code =
		toggle_quest(39,1);
	break;
	
begintalknode;
	state = 25;
	nextstate = -1;
	question = "_Why were the eyebeasts helping the Empire?_";
	text1 = "_Who knows? Maybe they were paid. Or they hate Avernum. Not my business._";

begintalknode;
	state = 25;
	nextstate = 27;
	question = "_Do you think the truce will hold?_";
	text1 = "_One keeps to their half of town, the other keeps to the other half. Still, neither is too well defended. A careful attacker could do some damage!_";

begintalknode;
	state = 27;
	nextstate = 28;
	question = "_Are you going to do any of that damage?_";
	text1 = "_I'm alone. It won't be me. I'm getting out of here soon, so Avernum can find out what I saw. Then I'm getting drunk._";

begintalknode;
	state = 28;
	nextstate = -1;
	question = "_I suppose after this you'll deserve a drink or two._";
	text1 = "_Look around this horrible place long enough, and you'll want to get drunk too._";

begintalknode;
	state = 21;
	nextstate = -1;
	condition = gf(5,12) == 1 && gf(5,11) <= 3;
	question = "_I haven't been able to destroy the smelter yet._";
	text1 = "_I'm not surprised. There are Empire troops everywhere._";

begintalknode;
	state = 21;
	nextstate = -1;
	condition = gf(5,12) == 1 && gf(5,11) >= 4;
	question = "_I have completely destroyed the smelter._";
	code =
	run_hardcode(24);
	break;

begintalknode;
	state = 21;
	nextstate = -1;
	condition = gf(5,12) >= 2;
	question = "_Now that the smelter has been destroyed, are you leaving?_";
	text1 = "_Yes. Immediately. Thank you again for your help. I'll be sure to tell my superiors how you helped me. It's greatly appreciated._ She bows and slips off down the passage.";
	action = END_TALK;
	code =
		sf(5,13,1);
		erase_char(516);
	break;

//


begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	text1 = "An eyebeast is hovering in the far end of the hall. Two skeletons stand to either side. They are still adorned with the shreds of their Avernite garb. One was the mayor. The other was the commander.";
	text2 = "The eyebeast glides toward you. As it approaches, you start to feel dizzy. Its dark magic plays with your mind. It says, _We are the eyes, the gaze. We are Thunla-Far. We are not afraid._";
	text3 = "The eyebeast inspects you. _You are a hero. You have danger. We do not care about you. We want you to be away. Leave our fortress to us._";
	
begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_This is not your fortress._";
	text1 = "_It is now. The humans here were pitiful. We took it by our right. It is ours._";
	
begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_You want it for your Empire masters?_";
	text1 = "Thunla-Far's eyestalks quiver in agitation. _We have no masters. We used them to take this place. It will be ours. The humans will be expelled. The Empire is our enemy. We never forget._";
	
begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_I don't want to fight you._";
	text1 = "_Then we spare you. Go._ Dizziness overwhelms you. You find yourself somewhere else.";
	action = END_TALK;
	code =
		relocate_char(get_pc_id(0),59,55,FALSE);
		relocate_char(get_pc_id(1),60,55,FALSE);
		relocate_char(get_pc_id(2),60,56,FALSE);
		relocate_char(get_pc_id(3),59,56,FALSE);
		set_view_center(59,55);
	break;
	
begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_You need to leave this place._";
	text1 = "_No. It is ours. It will be our nest. We will live here. We will learn. We will see all places. We will hunt where we choose._";
	text2 = "_Your simple sight must choose now. I hope your weak eyes see the wisdom. Will you leave, or must we slay you?_";

begintalknode;
	state = 41;
	nextstate = -1;
	condition = 1;
	question = "_Never mind. I'll go._";
	text1 = "_Your weak eyes see clearly. We spare you. Go._ Dizziness overwhelms you. You find yourself somewhere else.";
	action = END_TALK;
	code =
		relocate_char(get_pc_id(0),59,55,FALSE);
		relocate_char(get_pc_id(1),60,55,FALSE);
		relocate_char(get_pc_id(2),60,56,FALSE);
		relocate_char(get_pc_id(3),59,56,FALSE);
		set_view_center(59,55);
	break;
	

begintalknode;
	state = 41;
	nextstate = -1;
	condition = 1;
	question = "_I will slay you, monster._";
	text1 = "_We are amused. We accept the risk. We choose to fight, prevail, and feed._ The skeletal abominations lurch toward you. The eyes of the beast focus on you, and you start to feel confused.";
	action = END_TALK;
	code =
		set_attitude(30009,10);
	break;
