// TOWN DIALOGUE SCRIPT
//    Town 94: Snake Pit

begintalkscript;

variables;

short i,j,k,r1,choice;

// Captain Brehon

begintalknode;
	tag = 10;
	state = -1;
	nextstate = 1;
	question = "Captain Brehon";
	text1 = "A half-starved man is imprisoned in this cell. He's been beaten. His face lights up when he sees you. With grunting and concentration, he manages to rise to his feet.";
	text2 = "_I know a soldier of our land when I see one. Well met, indeed! I am Captain Brehon, proud warrior of the army of Avernum. And alas, of late, a prisoner of the barbarians here._";
	text5 = "Captain Brehon continues to lean against the wall and talk with you. He's surprisingly intact, considering what he's gone through. _How else can I help you? Before I leave, I mean._";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_How did you get down here?_";
	text1 = "_I was stationed at Mertis. We were investigating a savage slith sighting to the south. My patrol was ambushed by the beasts. We were all caught. I was waiting here to die, up 'til now anyway._";

begintalknode;
	state = 2;
	nextstate = 4;
	question = "_What happened to the patrol?_";
	text1 = "_Eight good, strong lads and lasses. I'm the only one left, damn them. All of them died on the altar._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_They were sacrificed?_";
	text1 = "He trembles with anger. _The monstrous waste of it. The slith chief, that Fhyss'Thsss, he was trying to do something to the altar. Restore it somehow. With the blood of my warriors._";
	text2 = "_Nothing he tried worked, so he kept killing us. I'm next in line._";

begintalknode;
	state = 4;
	nextstate = 5;
	question = "_What altar?_";
	text1 = "He looks disturbed. _The altar just outside. You can't imagine what it's like to sleep near that evil thing! It hisses all the time! You can't escape it. And it affects the worms!_";

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_How does it affect the snakes?_";
	text1 = "_They go wild when they're near it. Makes 'em fast and vicious. They'll tear a human apart!_ He shivers as he thinks of what happened to his comrades.";
	
begintalknode;
	state = 1;
	nextstate = 3;
	question = "_What do you know of the sliths here?_";
	text1 = "_They have this bizarre cult, as I'm sure you've seen. They feed us to the worms on their altar, and then they try to talk to it. I was scheduled to be eaten soon, but I'm still planning to escape._";
	text2 = "He shows you a sword he had hidden behind his pallet. _This is my secret._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_How were you planning the escape?_";
	text1 = "_I'll slip out, once the coast is clear. I have a sword. Sword first or feet first, I'm getting out of this place._";

begintalknode;
	state = 3;
	nextstate = 6;
	question = "_How did you get that sword?_";
	text1 = "_I found it here. We weren't the first people to be caught by those damned lizards. Somehow one of them snuck a blade in here._ It's a short sword, pitted and slightly bent, but still effective in skilled hands.";
	text2 = "_With you clearing the way, I should be able to escape._";

begintalknode;
	state = 6;
	nextstate = 7;
	question = "_Are you going to escape now?_";
	text1 = "_No, not yet. I'm too weak to fight. But if you cleared the way, I could make it out. If you killed their chief, I think I could make it. If you kill their chief, come back and let me know._";

begintalknode;
	state = 7;
	nextstate = -1;
	question = "_How can I get out of here?_";
	text1 = "_I know that much. I saw one of them leave when they made me watch one of my comrades get ate. They got a passage at the northwest corner of the big temple. It leads upstairs, I think._";

begintalknode;
	state = 1;
	nextstate = 8;
	question = "_I'm amazed to find someone who is still alive._";
	text1 = "_And I'm amazed to be alive. Sliths are mindless brutes. Vicious and always hungry._";
	text2 = "He seems very uncomfortable about being in the presence of a slith, even a friendly one.";
	code =
		if (slith_present() == 0)
			rs(2);
	break;

begintalknode;
	state = 8;
	nextstate = -1;
	condition = slith_present() > 0;
	question = "_But there's a slith rescuing you now._";
	text1 = "He looks away. _Then I will spare all sliths who rescued me. But no more._";

begintalknode;
	state = 1;
	nextstate = 9;
	condition = gf(36,14) == 0;
	question = "_You should try to escape._";
	text1 = "He asks if you have slain the slith chieftain. When he finds that you haven't, he shakes his head. _I don't just want escape. I want vengeance, and I don't want to throw my life away._";
	text2 = "_If I try to flee and Chief Fhyss'Thsss lives, he's sure to find me. He needs to die._";

begintalknode;
	state = 9;
	nextstate = -1;
	condition = 1;
	question = "_Why don't you fight with me?_";
	text1 = "He seems willing enough, but then you realize that he can barely stand, let alone fight. In the end, you have to leave him in the cell.";
	action = END_TALK;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(36,14) >= 1;
	question = "_I have slain the chief. It's safe for you to escape._";
	text1 = "He stands and removes a rusty short sword from a hiding place. Then he bows to you. _If we meet again, I owe you a lot. I will tell all I find of what you have done for me. Fight on for Avernum. Good luck to you._ He runs from the cell.";
	action = END_TALK;
	code =
		erase_char(9400);
		sf(94,14,1);
		award_party_xp(200,15);
		change_reputation(1);
	break;

