// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(48,0) == 0;
	question = "special";
	text1 = "You approach the ruins of a human settlement. The signs outside it still proudly give its name: Grindstone. A name that has since been adopted by the town's new residents.";
	text2 = "Grindstone is now occupied by giants. The massive tunnel into the south wall of the cavern, once the entrance to a crystal mine, now leads to their lair.";
	text3 = "As you get closer, you are plainly visible to the giants, who mill about along what was once the main road of the town. They don't bother to raise an alarm.";
	text4 = "They just can't understand why anyone would be foolish enough to attack them. They are, after all, very tall.";
	action = SET_SDF 48 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(48,1) == 0;
	question = "special";
	text1 = "These tunnels have been only recently excavated. The giants dug them out. It probably didn't take them very long.";
	text2 = "You can see a narrow, fast-flowing river that winds its way through their warren. They haven't bothered to build bridges over it. They just threw in a bunch of stepping stones.";
	text3 = "They can walk over the river. You aren't large enough to have that option.";
	action = SET_SDF 48 1 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(48,2) == 0;
	question = "special";
	text1 = "You enter the crystal mine, which still looks much as it did when the giants took over. Their massive feet have worn a trail in the floor, and they have crudely widened out some of the passages.";
	text2 = "Otherwise, it has been left alone. They must live on the lower levels.";
	text3 = "Several piles of boulders have been placed at the entrance. They are throwing stones, sorted, smoothed out, and ready for instant use by the defenders of their lair.";
	action = SET_SDF 48 2 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(48,3) == 0;
	question = "special";
	text1 = "You enter a dining and meeting cavern, where the enormous dullards gather to gnaw bones and discuss the issues of the day.";
	text2 = "At the top of the cliff to the north, you think that you can see the tops of cages.";
	text3 = "You are confident that the cages are occupied. You know this because their residents are crying out in high-pitched voices. _Help us! Helllp ussss! Eeeeeee!_";
	action = SET_SDF 48 3 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This sign is battered but still legible:";
	text2 = "  GRINDSTONE";




//

begintalknode 10; // crystal
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This box is full of bones, trinkets, and other souvenirs of the chieftain's run as head of this tribe. You paw through it, hoping to find a nice magic item or two. But it's junk.";
	text2 = "But then, at the bottom, you find a sheet of crystal. It's about six inches wide and an inch thick. And, when you stare into it, you think that you can see shapes moving around. Indistinct, nebulous humanoid shapes.";
	text3 = "Interesting. You keep it.";
	code =
		if (gf(48,6) == 0) {
			sf(48,6,1);
			set_spec_item(14,1);
			}
			else {
				rs(2); rs(3);
				}
	break;

begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You hear the approaching sounds of grunting and laughter. And huge, booted feet. To the east, someone shouts, _I hope stew is ready! We been hunting! We big hungry!_";
	text2 = "Some giants are coming to the dining hall.";

begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You have reached the throne room of the chieftain of this tribe. He sits on a massive chair, carved from a huge cavewood tree. A massive club sits at his side.";
	text2 = "He watches you with caution as you approach. Giants are simple and bloodthirsty, but he must have had at least a little caution in his head to reach his high position.";
	text3 = "He comes to a decision. He stands, points his club at you, and shouts, _I thank you. I wanted the weaklings out of my tribe. You kill the weak. Tribe is stronger now!_";
	text4 = "_Now you go. You go forward, and I squish you with club. I not weak!_ He isn't boasting. He looks like a deadly foe.";

begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The giant chieftain decides that your threat cannot be ignored. He gives his massive club a few practice swings.";
	text2 = "_All right, little pests! Now I will squish you!_";

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The giant raises his club, aims carefully, and swings it in a wide arc. It delivers a devastating blow. You are flung back across the room.";

begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You find an old, torn spellbook. The giants must have looted it from somewhere. They have also ripped out a lot of the pages, to use the paper for uncertain and unsavory purposes.";
	text2 = "You browse through what is left of the book and are happy to find that one of the spells within is still complete. You learn how to use raw magical energy to make an ally to fight for you. (Your skill with the spell Arcane Summon increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "You browse through what is left of 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(48,5) == 0) {
			rs(3);
			if (get_stat_total(13) < 14)
				rs(2);
				else {
					rs(4);
					sf(48,5,1);
					alter_stat(30000,57,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 20;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 21;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 22;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 23;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 24;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";
	
//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = gf(48,8) == 0;
	question = "Name";
	text1 = "You get close enough to see what is held in these cages. Each of them contains a spider. An intelligent, talking spider.";
	text2 = "The arachnids look out at you pleadingly through the bars. _Please let us out! Pleeeeease! They will eat us! Eeeee!_";
	text3 = "These spiders were, no doubt, kidnapped from their lair near Fort Draco.";
	text4 = "You just stand there with your mouth gaping open. Talking, perky spiders? You'd heard rumors that such a thing existed, but you had attributed them to bad mushroom ale.";
	code =
		sf(48,8,1);
		if (gf(8,3) > 0)
			rs(4);
			else rs(3);
	break;
	
begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = gf(8,3) == 0;
	question = "Where are you from?";
	text1 = "One of them chirps, _We were going to our ancient ancestral mighty home of glory! It's near Fort Draco! And they're going to cook us! Into a meal for their chief! Hellllp!_";

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = gf(8,3) > 0;
	question = "Are you from the spider lair near Fort Draco?";
	text1 = "One of them chirps, _The lair? You mean the others made it! Yayyyy!_ It thinks. _Oh, and I will answer your question. Yes. That is us._";

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Ack! Spiders! (Kill them.)";
	text1 = "You harden your heart and deal swift, merciless blows to the spiders in the cages. Their piteous cries are soon silenced.";
	text2 = "When one of them falls, you can see that she was concealing a small cluster of eggs. You reach through the bars and take them. Who knows? Some alchemist or mage might have a use for them.";
	action = END_TALK;
	code =
		sf(48,10,1);
		set_spec_item(21,1);
	break;
	
begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I'll let you out, little friends. (Release the spiders.)";
	text1 = "As you open the cage doors, the three spiders cheer in unison. _Yay! Yayyyyy!_ Once they are out, one of them says, _Let's go!_";
	text2 = "_We know a way out. The giants have a chimney. We'll go up that!_ And they run off.";
	action = END_TALK;
	code =
		spawn_creature(5229);
		spawn_creature(5230);
		spawn_creature(5231);
	break;
	
begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Ummmm ... Just wait here.";
	text1 = "_No, that's ok! We're much smarter than the giants think we are!_ One of them reaches out with a foreleg and lifts the latch on its cell. Then it frees the others. _Now that you are here, you'll protect us for sure! You're a hero!_";
	text2 = "_We know a way out. The giants have a chimney. We'll go up that!_ And they run off.";
	action = END_TALK;
	code =
		spawn_creature(5229);
		spawn_creature(5230);
		spawn_creature(5231);
	break;

	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

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

	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 57;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 58;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

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

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

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

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

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

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

////

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