// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(160,4) == 0;
	question = "special";
	text1 = "You are at the northern end of an expanse of rocks, stalagmites, and rubble. Very little vegetation grows. While the Great Cave is enormous, mushrooms only grow well in a few small areas.";
	text2 = "Below you to the south, you can see the entrance to a large mine. Gruesome totems line the pathway there. Trinket's tribe is not trying to hide its presence. Goblins are not known for their caution or tactical skill.";
	text3 = "The path down to the mines is being guarded, but not by a goblin. There is a lone human archer walking up and down the road, hunting for prey. When he sees you, he waves and returns to the hunt.";
	action = SET_SDF 160 4 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(160,5) == 0;
	question = "special";
	text1 = "You enter the mines. These tunnels, like many such places in Avernum, were abandoned after the crops started to fail. The miners traded dreams of wealth for dreams of survival and flocked to the Great Portal.";
	text2 = "But monsters abhor a vacuum. The goblins here have strewn refuse and gnawed bones everywhere. If goblins hadn't settled these mines, scuttlers would have. Or rats, or chitrachs.";
	text3 = "You can hear the nasty creatures muttering and cackling in the shadows, not far to the south.";
	action = SET_SDF 160 5 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(160,6) == 0;
	question = "special";
	text1 = "To the east, you see an impressive bit of engineering, something that makes you realize that this was a more impressive mining works than you had thought.";
	text2 = "A pair of iron tracks have been, with great difficulty, laid across the chasm. A broad wooden platform is balanced on the tracks. There is a lever in the middle of the platform and chains underneath.";
	text3 = "Probably, when the lever was pulled, machinery would drag the platform across the chasm. Whatever people were pulling out of this mine, it must have been huge to require such effort.";
	text4 = "The tracks are very narrow and wobbly. Crossing them would be very dangerous. You will need to get across by riding the platform.";
	action = SET_SDF 160 6 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(160,7) == 0;
	question = "special";
	text1 = "At last, you reach the center of the mines. Here you find a spectacular treasure, far more powerful and valuable than anything you are likely to find in your travels.";
	text2 = "There are five natural crystal spires, glowing dimly with natural magic. All nearly flawless, all waiting for someone to extract them and take them to the Tower Colony. Sadly, as they weigh tons, you won't be able to claim them.";
	text3 = "At least you prevented the goblins from destroying them. Those creatures would probably smash them into small, glittering chunks just to have something pretty to carry round.";
	action = SET_SDF 160 7 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(160,8) == 0;
	question = "special";
	text1 = "You round the corner and confront a horde of goblins, some of them holding cave wolves at the end of chains. They are standing in a crude throne room.";
	text2 = "There are two of the creatures in the back of the crowd. One of them is Lord Trinket. He must have run here after attacking you on the platform. The other is a female goblin, slightly shorter and similarly bedecked in gaudy jewelry.";
	text3 = "Trinket points at you. _My servants, the invader has come at last! But listen to me and have faith! For this day, we will prove to the humans that ..._ He doesn't get any farther in his speech, as the goblins scream and charge.";
	text4 = "Amidst the chaos, you think you can see someone watching the fight in the shadows to the east. A humanoid form on the other side of a closed iron gate, someone much larger than a goblin. A slithzerikai.";
	action = SET_SDF 160 8 1;
	code =
		alert_char(17344);
		alert_char(17345);
		alert_char(30040);
	break;
	
begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = get_sdf(160,9) == 0;
	question = "special";
	text1 = "__";
	action = SET_SDF 160 9 1;

//

begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Lord Trinket pulls one of his many pendants from around his neck and dashes it against the floor. Mist pours out of the shattered globe and forms into several vicious, carnivorous worms.";
	text2 = "You wonder, not for the first time, who has been supplying the goblin chief with all of these handy baubles.";

begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Lord Trinket holds out his hands and mutters a word of command. One of his rings crumbles into powder, and a wave of sparkling energy travels outward. The spell blesses all of your foes.";

begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Lord Trinket's consort falls under your attacks. _Esmerelda, my sweet,_ he howls. _I will avenge you! And then I will honor your memory by finding a goblin lass lovelier and less irritable than you! Rest in peace!_";
	text2 = "And then, reinvigorated by the power of his moving speech, he attacks you with great speed and ferocity.";

begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Lord Trinket falls to the ground, mortally wounded. He looks down at the necklaces and rings he wears, seemingly expecting them to revive him. Instead, they begin to crumble into dust, one after the other.";
	text2 = "He looks around into the shadows, trying to find something with dimming eyes. _But ... Khrez-Yss, you said ... I would be saved ... I ..._ And then he dies.";
	text3 = "You note that one item remains around Trinket's neck: a key on a leather thong. You take it.";
	text4 = "So much for the goblin infestation. But ... Who is Khrez-Yss?";
	code =
		set_spec_item(51,1);
	break;
	
begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You get close enough to the shadowy figure to see that he is a slithzerikai, wrapped in a heavy cloak, his face mostly concealed by his cowl. A vicious looking two-tined spear is strapped across his back.";
	text2 = "Though he doesn't seem to be about to attack, as he watches the battle, you get a feeling of great menace. You aren't yet able to speak with him.";
	
begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You search through one of Trinket's boxes, looking for treasure. You find only junk. Gnawed bones. Broken bottles. Moldy items of no interest.";
	text2 = "At the bottom of the box, however, you find something interesting. A leather scroll, covered with writing. It looks like slith script, but you can't understand it.";
	text3 = "It might be interesting. You keep it. Perhaps someone can translate it for you.";
	code =
		if (gf(160,16) > 0) {
			rs(2); rs(3);
			}
			else {
				sf(160,16,1);
				set_spec_item(2,1);
				}
	break;
	
begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "This moldy ledger contains records of the operation of the mine. How many workers. How much expense. Value of crystals obtained. This was a large operation, with a surprising amount of money sunk into it.";
	text2 = "In the schedule, you find intriguing notes regarding, _Time Until Extraction of Great Find._";
	text3 = "The journal contains no hints of what the Great Find might be.";
	
begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You are surprised to find an old spellbook in these mines. Perhaps one of the workers was a mage, perhaps here to evaluate the crystals for quality. It is odd that the book was left behind. Perhaps the mage met a bad end.";
	text2 = "Most of the spells within are too simple or mining-oriented to be useful for you, but one incantation, for the creation of powerful waves of cold, seems useful. (Your skill with the spell Icy Rain increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "You browse through the book, but you can't understand any of it. You don't know enough magical lore. (Improve your Arcane Lore skill to understand books like these.)";
	code =
		if (gf(160,17) == 0) {
			rs(3);
			if (get_stat_total(13) < 3)
				rs(2);
				else {
					rs(4);
					sf(160,17,1);
					alter_stat(30000,46,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
	//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "The archer who is patrolling this road turns and greets you. He's not an Avernite soldier. His skin still has some color to it ... He must be a recent arrival from the surface.";
	text2 = "He is young, not even twenty, and he has plenty of the idiot confidence that can come with youth. He bows to you. _It is good to see a friendly face. I could use company on my lonely hunt._";
	text3 = "_I am Vanderin, bounty hunter and aspiring adventurer, come to Avernum to seek my fortune._";
	text5 = "Vanderin takes a break from the hunt. _It is good to be able to speak with another warrior. Would you care to exchange more intelligence about the insidious goblin menace?_";
	action = INTRO;
	code =
		if (gf(160,2) == 0)
			sf(160,2,1);
	break;
	
begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Where are you from?";
	text1 = "_I came down from the surface, only a year previous. Terrible timing on my part, I am afraid. But I have no intention of leaving._";

begintalknode 32;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Why did you leave the surface?";
	text1 = "_Because I will be an adventurer! A hero! And the surface has no place for heroes. Oh, there are soldiers, growing fat and complacent in their barracks._";
	text2 = "_And there are rogues and assassins, fighting the tawdry political wars between Emperor Redmark and his foes. But nothing for one of true courage and skill. So I came here._";

begintalknode 33;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Why aren't you trying to leave?";
	text1 = "_It would not be hard. I could join the lottery for a turn at the Great Portal. Citizens of the Empire are given an advantage._";
	text2 = "_But Avernum needs warriors. Heroes! And there will always be food available for those who take up arms against your foes._ This is true. Since you joined the army, you've never had to miss a meal.";

begintalknode 34;
	state = 30;
	nextstate = 32;
	condition = 1;
	question = "What are you hunting?";
	text1 = "_Goblins! Small prey, I know, but I am still a lone warrior. And, to be honest, I think I need a tiny bit more practice before I fight dragons, vampires, et cetera._";
	text2 = "_Fortunately, with care, I have been able to pick off several of the creatures when they wandered too far from their mine._";

begintalknode 35;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "What have you learned about their defenses?";
	text1 = "_Very little. Only that the wide tunnel to the south is the main entrance to their lair. I can't go much farther in without risking being swarmed. If only I could join forces with someone._ He looks at you significantly.";

begintalknode 36;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "How many have you killed?";
	text1 = "_Four goblins. Five wolves. But, considering the speed at which the beasts breed, they've probably replaced their losses already, and then some._";

begintalknode 37;
	state = 30;
	nextstate = 33;
	condition = 1;
	question = "Do you wish to keep hunting alone?";
	text1 = "He sighs. _One day, the path of the hero is one of solitude. That's the way I want my stories to be, anyway. But, until I have obtained a few artifacts and heirlooms to wield in battle, I might need to seek assistance._";
	text2 = "_If you are hunting goblins, I would love to aid you in such a noble quest!_";
	text3 = "_I fought with you once. I would be honored to once again!_";
	code =
		if (gf(160,2) == 1)
			rs(3);
			else rs(2);
	break;
	
begintalknode 38;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "You would fight alongside Avernites?";
	text1 = "_Of course. Your kind and mine fought bloody wars once, before I was born. But now, there is no reason we should not be allies. Heroism and battle spirit flows in our veins!_";

begintalknode 39;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "Umm ... Why don't you stay out here? Guard the rear?";
	text1 = "He looks disappointed, but resolute. _If that is the part I must play in these early chapters of my tale, I will do so. I bid you good day._ He returns to the hunt.";
	action = END_TALK;

begintalknode 40;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "Then travel with me! Together, we will create tales of heroism to thrill for centuries to come!";
	text1 = "_Yes!_ Vanderin turns and takes his place by your side. _Lead on. My bow will be at your service, until the goblin tide is turned back from the shore of ... of ... Here!_";
	text2 = "_Yes!_ Vanderin turns and takes his place by your side. _Once again, we set off together, resuming our brave, deadly journey!_";
	text3 = "_But,_ he adds, _I am determined to hunt these goblins. They seem my natural prey for now. If you must travel elsewhere, I will return to this road. You can meet up with me here later._";
	text4 = "(Vanderin will follow you and help you fight the goblins. To heal him, cast a healing spell and click on him to target it. If you tire of his presence, you can talk to him later.)";
	action = END_TALK;
	code =
		if (gf(160,2) == 1)
			rs(2);
			else rs(1);
		sf(160,2,3);
	break;
	
begintalknode 41;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I wish you luck in your hunt. (Leave.)";
	text1 = "Vanderin seems disappointed. _Well, it was a pleasure to have the company of fellow warriors. I will return to my lonely, lonely, lonely patrol._ He walks down the road.";
	action = END_TALK;

begintalknode 45;
	state = -1;
	nextstate = 35;
	condition = 1;
	question = "";
	text1 = "You get Vanderin's attention. _Yes? What is it, fellow prospective hero?_";

begintalknode 46;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "Nothing. Let's keep going.";
	text1 = "_What? You only wished to take a moment to rest? To share a dramatic pause with fellow heroes? I understand completely._";
	action = END_TALK;

begintalknode 47;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "Why don't you go back out to the road? Guard the rear, and so on.";
	text1 = "He seems crestfallen. _Ah. It might be difficult but ... I understand completely._ He slips off into the shadows, attempting to make his way back to the road.";
	action = END_TALK;
	code =
		erase_char(17298);
		spawn_creature(17298);
	break;
	
begintalknode 50;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You have reached Vanderin's small, humble camp. Vanderin walks up to his chest. _One moment._ He unlocks it and removes a few items from within. _I have all I need. You may take whatever might be of use to you._";

begintalknode 51;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Vanderin looks down the dark tunnels of the mine. _Curses. I forgot to bring a torch, and my eyes have not yet gained the uncanny ability to pierce the darkness that you Avernites possess._";
	text2 = "_And yet, I feel we are close to the goal of our quest: complete victory against the goblin scourge._ He thinks. _In this cave, anyway._";

begintalknode 52;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Now that Trinket has fallen, Vanderin looks extremely pleased with himself. _Victory is ours! We have slain the foe and completed our quest! Now, back to town, to quaff flasks of ale and tell tales of conquest._";
	text2 = "_Also, to bandage our wounds. I think I've suffered a bit of bruising._";
	text3 = "_I thank you for your aid in this battle, and I hope that we might fight together again one day. Now, excuse me. I must be off._ With a final bow, he slips into the shadows.";

begintalknode 53;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You hear Vanderin gently humming to himself. You suspect that he is already composing a heroic song about your current adventure.";

begintalknode 54;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You turn unexpectedly and catch Vanderin practicing heroic poses.";	

begintalknode 55;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "As you explore the caverns, Vanderin whispers a tale to you about the time on the surface when he brought down a young aranea all by himself.";		
			
// 170
//// platform 1

begintalknode 170;
	state = -1;
	nextstate = 170;
	condition = 1;
	question = "Name";
	text1 = "You examine the lever and the visible machinery. The goblins appear to have been intelligent enough to leave it alone. It might even still work.";

begintalknode 171;
	state = 170;
	nextstate = -1;
	condition = is_combat() && num_chars_in_group(0) > 1;
	question = "Pull the lever.";
	text1 = "You are too spread out. Pulling the lever now would put you at risk of getting dangerously separated. (End combat and then try again.)";
	action = END_TALK;
	
begintalknode 172;
	state = 170;
	nextstate = -1;
	condition = is_group() || num_chars_in_group(0) == 0;
	question = "Pull the lever.";
	text1 = "You make sure you have a firm footing on the platform and give the lever a pull. The platform vibrates. You hear weights at the end of long chains begin to descend. You are slowly carried across the chasm.";
	text2 = "Vanderin leaps on the platform next to you. _Isn't this exciting? This device seems exquisitely dangerous!_";
	text3 = "Alas, the machinery is very noisy. The creaks and scrapes carry effortlessly through the tunnels. Several hungry cave bats, drawn by the sounds, descend upon you from the high, dark ceiling above.";
	text4 = "(As the platform crosses, you might want to make time pass faster. Click on the active character or press the Space Bar to wait.)";
	action = END_TALK;
	code =
		if ((char_loc_x(get_pc_id(0)) != 415) || (char_loc_y(get_pc_id(0)) != 745))
			relocate_char(get_pc_id(0),415,745,0);
		if ((char_loc_x(get_pc_id(1)) != 416) || (char_loc_y(get_pc_id(1)) != 746))
			relocate_char(get_pc_id(1),416,746,0);
		if ((char_loc_x(get_pc_id(2)) != 415) || (char_loc_y(get_pc_id(2)) != 747))
			relocate_char(get_pc_id(2),415,747,0);
		if ((char_loc_x(get_pc_id(3)) != 414) || (char_loc_y(get_pc_id(3)) != 746))
			relocate_char(get_pc_id(3),414,746,0);
	
		// safety try
		if ((char_loc_x(get_pc_id(0)) != 415) || (char_loc_y(get_pc_id(0)) != 745))
			relocate_char(get_pc_id(0),415,745,0);
		if ((char_loc_x(get_pc_id(1)) != 416) || (char_loc_y(get_pc_id(1)) != 746))
			relocate_char(get_pc_id(1),416,746,0);
		if ((char_loc_x(get_pc_id(2)) != 415) || (char_loc_y(get_pc_id(2)) != 747))
			relocate_char(get_pc_id(2),415,747,0);
		if ((char_loc_x(get_pc_id(3)) != 414) || (char_loc_y(get_pc_id(3)) != 746))
			relocate_char(get_pc_id(3),414,746,0);
	
	
		if ((char_ok(17298)) && (gf(160,2) == 3))
			relocate_char(17298,414,747,0);

		play_sound(137);
		shift_game_rect(744,413,748,426,3);
		set_terrain(1,413,745,252);
		set_terrain(1,413,747,252);
		set_terrain(1,428,745,0);
		set_terrain(1,428,747,0);
		set_object_icon(28920,11);
		
		if (gf(160,13) == 0) {
			spawn_creature(17347);
			telep_char_to_char(17347,random_group_member(0),0);
			spawn_creature(17348);
			telep_char_to_char(17348,random_group_member(0),0);
			}
			else rs(3);
			
		sf(160,10,1);
		if (gf(160,2) < 3)
			rs(2);


	break;
	
begintalknode 173;
	state = 170;
	nextstate = -1;
	condition = 1;
	question = "Leave the lever alone.";
	text1 = "The machinery seems poorly maintained and horribly dangerous. You leave it alone.";
	action = END_TALK;

begintalknode 175;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You look across the chasm to the cavern to the north. It is dark and misty. All you can make out are several huge, looming stone shapes. And two goblins watching you. You recognize one of them. It's Lord Trinket, the goblin chief.";
	text2 = "He fingers one of the pendants hanging from his neck and cackles. _Yesss ... The foolish invader has entered the spider's web, only to feel the bear trap close around his feet! My armies, attack!_";
	text3 = "And then a horde of goblins runs out of the shadows, attempting to leap across the chasm onto your platform. Many of them fall short, falling hilariously into the dark depths below. A surprising number, of them, however, make the leap.";
	
begintalknode 176;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The platform finally passes the goblin ambush. The sinister Lord Trinket shouts, _You have escaped us for now! The next time we find you, you will be forced to escape us again!_";
	text2 = "Now that the goblins are gone, more bats start to circle down, hoping to feed.";
	
begintalknode 177;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You try to pull the lever, only to find that it is stuck in this position.";	
	
begintalknode 178;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You pull the lever, and the platform grinds its merry way across the chasm. Refreshingly, nothing attacks you.";	
	
begintalknode 179;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "At last, the platform reaches the far end of the chasm. With a soul-rending squeal, it grinds to a halt. Amazingly, you survived. The creatures were no great threat, but the machinery was terrifying.";

//// platform 2

begintalknode 180;
	state = -1;
	nextstate = 180;
	condition = 1;
	question = "Name";
	text1 = "You find a second platform. The mechanism is the same and appears to be about as well-maintained as the previous platform.";

begintalknode 181;
	state = 180;
	nextstate = -1;
	condition = is_combat() && num_chars_in_group(0) > 1;
	question = "Pull the lever.";
	text1 = "You are too spread out. Pulling the lever now would put you at risk of getting dangerously separated. (End combat and then try again.)";
	action = END_TALK;
	
begintalknode 182;
	state = 180;
	nextstate = -1;
	condition = is_group() || num_chars_in_group(0) == 0;
	question = "Pull the lever.";
	text1 = "You make sure you have a firm footing on the platform and give the lever a pull. The platform vibrates. You hear weights at the end of long chains begin to descend. You are slowly carried across the chasm.";
	text2 = "Vanderin leaps on the platform next to you. _Another exciting ride? It seems to be too much to hope for, doesn't it?_";
	text3 = "Alas, the moment you are away from solid ground, more goblins step out onto the ledge to the west, accompanied by Lord Trinket. As they prepare to fling javelins, their chieftain laughs.";
	text4 = "_Once again, you have stepped into my doom! The humans say how weak we goblins are, but who, now, is about to die?_";
	action = END_TALK;
	code =
		if ((char_loc_x(get_pc_id(0)) != 439) || (char_loc_y(get_pc_id(0)) != 737))
			relocate_char(get_pc_id(0),439,737,0);
		if ((char_loc_x(get_pc_id(1)) != 440) || (char_loc_y(get_pc_id(1)) != 738))
			relocate_char(get_pc_id(1),440,738,0);
		if ((char_loc_x(get_pc_id(2)) != 439) || (char_loc_y(get_pc_id(2)) != 739))
			relocate_char(get_pc_id(2),439,739,0);
		if ((char_loc_x(get_pc_id(3)) != 438) || (char_loc_y(get_pc_id(3)) != 738))
			relocate_char(get_pc_id(3),438,738,0);
	
		// safety try
		if ((char_loc_x(get_pc_id(0)) != 439) || (char_loc_y(get_pc_id(0)) != 737))
			relocate_char(get_pc_id(0),439,737,0);
		if ((char_loc_x(get_pc_id(1)) != 440) || (char_loc_y(get_pc_id(1)) != 738))
			relocate_char(get_pc_id(1),440,738,0);
		if ((char_loc_x(get_pc_id(2)) != 439) || (char_loc_y(get_pc_id(2)) != 739))
			relocate_char(get_pc_id(2),439,739,0);
		if ((char_loc_x(get_pc_id(3)) != 438) || (char_loc_y(get_pc_id(3)) != 738))
			relocate_char(get_pc_id(3),438,738,0);
	
	
		if ((char_ok(17298)) && (gf(160,2) == 3))
			relocate_char(17298,438,737,0);

		play_sound(137);
		shift_game_rect(726,437,740,441,0);
		set_terrain(1,438,740,251);
		set_terrain(1,440,740,251);
		set_terrain(1,438,725,0);
		set_terrain(1,440,725,0);
		set_object_icon(28921,11);
		
		if (gf(160,14) == 0) {
			spawn_creature(17369);
			spawn_creature(17370);
			spawn_creature(17371);
			spawn_creature(17372);
			set_level(17369,1);
			set_level(17370,1);
			set_level(17371,1);
			set_level(17372,1);

			spawn_creature(17373);
			set_name(17373,"Lord Trinket");
			set_boss_level(17373,2);
			change_max_health(17323,50);
			set_char_unkillable(17373,1);
			}
			else {
				rs(3);
				rs(4);
				}
				
		sf(160,11,1);
		if (gf(160,2) < 3)
			rs(2);	
		break;
	
begintalknode 183;
	state = 180;
	nextstate = -1;
	condition = 1;
	question = "Leave the lever alone.";
	text1 = "The machinery seems poorly maintained and horribly dangerous. And, after what happened last time, nobody could reasonably blame you for finding a different route. You leave it alone.";
	action = END_TALK;
	
begintalknode 185;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Your continued survival irritates Lord Trinket. He points at you and shouts, _Die, my minions! Die for victory!_ More goblins run from the shadows and attempt to jump onto the platform. Some of them actually make it.";
	text2 = "Whatever else you can say about Lord Trinket, he is a truly inspiring leader to his kind.";
	
begintalknode 186;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Lord Trinket shouts, _Now, sample one of the gifts I have received! My patron has given us great power!_ He pulls a talisman away from his neck, breaking the chain. Then he flings it onto your platform.";
	text2 = "When it shatters, it lets out a cloud of mist, which soon coalesces into an unpleasant creature.";
	
begintalknode 187;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "At last, the platform reaches the far end of the chasm. With a soul-rending squeal, it grinds to a halt. With a long string of curses, Trinket and his minions flee into the shadows.";

	
begintalknode 189;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You pull the lever, and the platform carries you across to the other side. There are no guards here, and the machinery powering this platform seems much better maintained than the others.";	
	code =	
		if (gf(160,12) == 0) {
			sf(160,12,1);
			
			if ((char_loc_x(get_pc_id(0)) != 416) || (char_loc_y(get_pc_id(0)) != 718))
				relocate_char(get_pc_id(0),416,718,0);
			if ((char_loc_x(get_pc_id(1)) != 417) || (char_loc_y(get_pc_id(1)) != 719))
				relocate_char(get_pc_id(1),417,719,0);
			if ((char_loc_x(get_pc_id(2)) != 416) || (char_loc_y(get_pc_id(2)) != 720))
				relocate_char(get_pc_id(2),416,720,0);
			if ((char_loc_x(get_pc_id(3)) != 415) || (char_loc_y(get_pc_id(3)) != 719))
				relocate_char(get_pc_id(3),415,719,0);
		
			// safety try
			if ((char_loc_x(get_pc_id(0)) != 416) || (char_loc_y(get_pc_id(0)) != 718))
				relocate_char(get_pc_id(0),416,718,0);
			if ((char_loc_x(get_pc_id(1)) != 417) || (char_loc_y(get_pc_id(1)) != 719))
				relocate_char(get_pc_id(1),417,719,0);
			if ((char_loc_x(get_pc_id(2)) != 416) || (char_loc_y(get_pc_id(2)) != 720))
				relocate_char(get_pc_id(2),416,720,0);
			if ((char_loc_x(get_pc_id(3)) != 415) || (char_loc_y(get_pc_id(3)) != 719))
				relocate_char(get_pc_id(3),415,719,0);
		
		
			if ((char_ok(17298)) && (gf(160,2) == 3))
				relocate_char(17298,417,720,0);
				
			i = 0;
			
			while (i < 10) {
				i = i + 1;
				shift_game_rect(717,404,721,418,1);
				set_terrain(1,418,718,252);
				set_terrain(1,418,720,252);
				set_terrain(1,403,718,0);
				set_terrain(1,403,720,0);
				}
			}
		else {
			sf(160,12,0);
			
			if ((char_loc_x(get_pc_id(0)) != 416 - 10) || (char_loc_y(get_pc_id(0)) != 718))
				relocate_char(get_pc_id(0),416 - 10,718,0);
			if ((char_loc_x(get_pc_id(1)) != 417 - 10) || (char_loc_y(get_pc_id(1)) != 719))
				relocate_char(get_pc_id(1),417 - 10,719,0);
			if ((char_loc_x(get_pc_id(2)) != 416 - 10) || (char_loc_y(get_pc_id(2)) != 720))
				relocate_char(get_pc_id(2),416 - 10,720,0);
			if ((char_loc_x(get_pc_id(3)) != 415 - 10) || (char_loc_y(get_pc_id(3)) != 719))
				relocate_char(get_pc_id(3),415 - 10,719,0);
		
			// safety try
			if ((char_loc_x(get_pc_id(0)) != 416 - 10) || (char_loc_y(get_pc_id(0)) != 718))
				relocate_char(get_pc_id(0),416 - 10,718,0);
			if ((char_loc_x(get_pc_id(1)) != 417 - 10) || (char_loc_y(get_pc_id(1)) != 719))
				relocate_char(get_pc_id(1),417 - 10,719,0);
			if ((char_loc_x(get_pc_id(2)) != 416 - 10) || (char_loc_y(get_pc_id(2)) != 720))
				relocate_char(get_pc_id(2),416 - 10,720,0);
			if ((char_loc_x(get_pc_id(3)) != 415 - 10) || (char_loc_y(get_pc_id(3)) != 719))
				relocate_char(get_pc_id(3),415 - 10,719,0);
		
		
			if ((char_ok(17298)) && (gf(160,2) == 3))
				relocate_char(17298,417 - 10,720,0);
				
			i = 0;
			
			while (i < 10) {
				i = i + 1;
				shift_game_rect(717,404,721,418,3);
				set_terrain(1,419,718,0);
				set_terrain(1,419,720,0);
				set_terrain(1,404,718,252);
				set_terrain(1,404,720,252);
				}
			}


	break;


//

begintalknode 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	question = "";
	text1 = "Now that Lord Trinket has fallen, you hear dry, hissing laughter. You turn and see that it is coming from the dim, shadowy figure lurking behind the bars to the east.";
	text2 = "When you move closer, you see that he is a slithzerikai, wrapped in a heavy cloak, his face mostly concealed by his cowl. A vicious looking two-tined spear is strapped across his back.";
	text3 = "Though he doesn't seem to be about to attack, you get a feeling of great menace. He watches you closely, evaluating you.";
	
begintalknode 191;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "(Watch him silently.)";
	text1 = "He stares back at you, memorizing your face, estimating your skills.";
	
begintalknode 192;
	state = 190;
	nextstate = 191;
	condition = 1;
	question = "Who are you?";
	text1 = "The creature lets out a long, low hiss. Then he speaks. His voice is quiet, confident, and chilling. _Should I kill? Should I spare? Is thisss a trap to catch me? To get me to emerge?_";

begintalknode 193;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "(Walk away.)";
	text1 = "You turn your back on the creature and go about your business. A moment later, you feel safer, as if a dark, deadly presence has receded.";
	text2 = "You look at the bars again. The slithzerikai is gone. His departure did not make a sound.";
	action = END_TALK;
	code =	
		erase_char(17366);
	break;
	
begintalknode 194;
	state = 191;
	nextstate = 192;
	condition = 1;
	question = "Come out here and fight me. I'm not afraid.";
	text1 = "The slith chuckles. _I saw you fight. You are weak. A puny creature, an infant. You do not scare me. Unlessss ... Are you bait?_";
	text2 = "_I want to kill you. Fassst. Easy. Good practice. But no. Exposure not worth killing you. You are meaninglessss._";
	
begintalknode 195;
	state = 191;
	nextstate = 192;
	condition = 1;
	question = "I want to know who you are.";
	text1 = "_Hssss ... You will know. You will all know. We infiltrate. We invade. We strangle you._";
	text2 = "_I want to kill you. Fassst. Easy. Good practice. But no. Exposure not worth killing you. You are meaninglessss._";
	
begintalknode 196;
	state = 192;
	nextstate = -1;
	condition = 1;
	question = "Come out and fight me, coward.";
	text1 = "_So eagerly you beg for death. Perhapsss someday I give what you want. Now, you are not important. Like picking up a copper piece. Not worth effort._";
	text2 = "_But, perhapsss ... You are brave. Good luck. One day, I hope you are worth killing._";
	text3 = "As you start to respond, the creature turns his back on you and walks off into the darkness.";
	action = END_TALK;
	code =	
		erase_char(17366);
	break;
	
begintalknode 197;
	state = 192;
	nextstate = -1;
	condition = 1;
	question = "What is your name?";
	text1 = "_I am the nightmare. My name is screamed upon awakening. Or upon dying. I walk in your landsss freely. I have no fear of you. We come. You will all die._";
	text2 = "_You are brave. Good luck. One day, I hope you are worth killing._";
	text3 = "As you start to respond, the creature turns his back on you and walks off into the darkness.";
	action = END_TALK;
	code =	
		erase_char(17366);
	break;
	
begintalknode 198;
	state = 192;
	nextstate = -1;
	condition = 1;
	question = "I've had enough of you. (Walk away.)";
	text1 = "You turn your back on the creature and go about your business. A moment later, you feel safer, as if a dark, deadly presence has receded.";
	text2 = "You look at the bars again. The slithzerikai is gone. His departure did not make a sound.";
	action = END_TALK;
	code =	
		erase_char(17366);
	break;
	
////

begintalknode 299;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		