// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(166,0) == 0;
	question = "special";
	text1 = "Some intrepid soul has erected a forge out here in the middle of this black wasteland. Several sentinels stand guard, enchanted clockwork creatures ready to protect the lone blacksmith.";
	text2 = "To the east, by a pool of bubbling lava, you see a huge steel anvil. The craftsman stands next to it, waiting for visitors.";
	action = SET_SDF 166 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(166,1) == 0;
	question = "special";
	text1 = "There are long, gooey ropes of slime all over the floor here. The rock bears many long scratches, all in parallel sets of three. They are long, deep claw marks, left by whatever huge beast patrols these tunnels.";
	text2 = "You can hear it, shuffling and growling in the darkness, hunting for prey. You dread what will happen if the beast finds you.";
	action = SET_SDF 166 1 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(166,4) == 0;
	question = "special";
	text1 = "This is another area of volcanic activity. The ground is a long, jagged expanse of basalt, pocked with steaming pits and bubbling calderas. You can see lava bats and fire lizards hunting in the steam, drawn by the heat.";
	action = SET_SDF 166 4 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(166,5) == 0;
	question = "special";
	text1 = "This cavern is the lair of the horror that stalks these caves. It is full of slime, shed sheets of leathery skin, and the many bones of its victims. The smell is vile.";
	text2 = "Some weapons and armor are scattered among the refuse that fills the room. You are not the first adventurer to find this cave, but you might be the first one to see it and survive.";
	action = SET_SDF 166 5 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This foul worm is the spawn of something much larger. It lies here, wrapped in a protective web of dried mucus, growing nice and big and strong.";
	text2 = "If you disturbed it, it's more than large enough to defend itself.";

//


begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Komlos";
	text1 = "At the end of this remote pathway, you find a blacksmith. He is thin and very old. He stands by his anvil, wielding a hammer he seems barely able to carry. He's waiting for you.";
	text2 = "Though he is here to greet you, he stares oddly off into space. Then you see, in the light of the glowing caldera, that his eyes are covered with a thin, milky film. He must be blind. Somehow, he heard you approach over the constant noise.";
	text3 = "He sniffs the air and says, _All right. No ogres followed you. You can approach. You must be a soldier. Your steps have the marching cadence, and your equipment ... It sounds like quality work._";
	text4 = "_I am Komlos, fading master of these wastes. Do you have any business with me?_";
	text5 = "Komlos stares off into space. His hammer hangs limply in his hand. Making anything must be a real trial for him.";
	text6 = "He constantly concentrates and sniffs the air. _The ogres are always trying to sneak up. I want to be ready when they do._";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Why are you out here all alone?";
	text1 = "_Alone? I'm not alone. I have my sentinels. And I get visitors. And I prefer the quiet._ If the constant rumbling of the calderas could count as quiet.";
	text2 = "_And this is the best place to practice my craft. I have been forging steel here for many a year, and I will until the end._";

begintalknode 12;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Who comes here?";
	text1 = "_Those who want the finest metalwork in Avernum. Fine custom work. And who are willing to pay for it._";

begintalknode 13;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "You can still work out here in your ... condition?";
	text1 = "_My condition?_ He snorts and holds out a trembling hand, palm up. He mutters a word, and there is a flash of light, temporarily blinding you. When your vision returns, he laughs.";
	text2 = "_I see with far more than my eyes. I can sense things you can't imagine._";

begintalknode 14;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What will the end be?";
	text1 = "_They will remake the portal, and all but the strongest will leave. Or the portal will never return, and all but the strongest will die._";
	text2 = "_Either way, it will be a harsher land. One that will not miss me when I go._";

begintalknode 15;
	state = 10;
	nextstate = 12;
	condition = 1;
	question = "Do you have a lot of problems with ogres?";
	text1 = "_Always and ever. They get driven from the tunnels to the north, and they return. Always the same cycle. And always they try to rob from me._";
	text2 = "_They are strong, but not as strong as my sentinels._";

begintalknode 16;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "You command the sentinels?";
	text1 = "_Child, I made the sentinels. And they're more than a match for any ogre._";

begintalknode 17;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Do you want anything done about the ogres?";
	text1 = "_The Tower Colony has told me that they want the ogres left alone. Pfaugh! Foolish mages, thinking they can get anything of value from those creatures. But it is their mistake. I won't interfere._";

begintalknode 18;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Can I buy something from you?";
	text1 = "_What? You insult me! I only do fine custom work! Nothing less. You're lucky I don't toss you out on your ear._";

begintalknode 19;
	state = 10;
	nextstate = 14;
	condition = gf(166,9) < 2;
	question = "Can you do some custom work for me?";
	text1 = "_I suppose. If you earn it._ He chuckles. _I don't want any amateur or thug wandering the underworld with a Komlos blade. No. There is something you can bring me, to show that you are suitable._";
	
begintalknode 20;
	state = 14;
	nextstate = 15;
	condition = 1;
	question = "Go on.";
	text1 = "_I need a flask of mandrake tincture. Any will do, as long as it is pure, but you might have the best luck recovering one that was being delivered to me._";
	text2 = "_A courier was bringing it through the wastes, only to be snatched up by the horror and carried below. I heard the creature's hiss and the courier's scream. Horrible. The tincture should still be below._";
	code = 
		set_flag(166,9,1);
		toggle_quest(90,1);
	break;
	
begintalknode 21;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "Why do you think it's still there?";
	text1 = "_It was being delivered in a metal flask, unlikely to break. And the horror didn't eat it because, if it had, it would be dead. And good riddance._";

begintalknode 22;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "The horror?";
	text1 = "_A creature in the tunnels below us. Old, broken down, and in constant pain. Like me. But still very dangerous. I would suggest sneaking into its lair and looking for the flask, rather than fighting it._";
	text2 = "_The creature is large. You can feel it as it approaches. If you are careful, you should be able to avoid it._";

begintalknode 23;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "How can I get to the lower tunnels?";
	text1 = "_There are two paths near here. One in the waste to the west. The other is past my private storage caves to the north. But I'd rather you stayed out of there._";

begintalknode 24;
	state = 10;
	nextstate = -1;
	condition = gf(166,9) == 1 && party_has_item(287);
	question = "I found some mandrake tincture. (Give it to him.)";
	text1 = "He takes the tincture, removes the cap, and sniffs. Then he nods. _Yes. Good enough. I'll need this to do more work. A tiny bit goes a long way._";
	text2 = "_I suppose you are competent. Certainly, you're the only soldier who has been out here to look after me in weeks. I suppose I have the time to do some work for you._";
	code = 
		set_flag(166,9,2);
		toggle_quest(90,3);
		award_party_xp(400,16);
		take_item(287);
	break;		

begintalknode 25;
	state = 10;
	nextstate = 16;
	condition = gf(166,9) > 1;
	question = "Can you do some custom work for me?";
	text1 = "_Yes, I can. My specialties are blades, bracers, and greaves. Everything I make requires a certain amount of fine steel, and a pair of focusing crystals. The amount of steel needed varies._";
	text2 = "_Normally, I also ask for a thousand coins or more. But, out of loyalty to the defenders of Avernum, I will do this work gratis. For now._";
	
begintalknode 26;
	state = 16;
	nextstate = -1;
	condition = num_of_item(296) > 0 && num_of_item(295) > 1;
	question = "Can you make a pair of bracers for me? (Give 1 fine steel and 2 focusing crystals.)";
	text1 = "Komlos takes the materials in his hands. He holds them for a minute, feeling them. Then he nods and carries them to his forge.";
	text2 = "He heats the metal and begins to hammer it out. Occasionally he takes the crystal and concentrates. Motes of light flow from the crystal into the hot metal.";
	text3 = "After an hour, the bracers are done. He cools them in a pool of water and hands them to you. _Yes,_ he says. _This work is worthy of me._";
	code =
		take_num_of_item(296,1);
		take_num_of_item(295,2);
		reward_give(112);
	break;
	
begintalknode 27;
	state = 16;
	nextstate = -1;
	condition = num_of_item(296) > 1 && num_of_item(295) > 1;
	question = "Can you make a shortsword for me? (Give 2 fine steel and 2 focusing crystals.)";
	text1 = "Komlos takes the materials in his hands. He holds them for a minute, feeling them. Then he nods and carries them to his forge.";
	text2 = "He heats the metal and begins to hammer it out. Occasionally he takes the crystal and concentrates. Motes of light flow from the crystal into the hot metal.";
	text3 = "After an hour, the shortsword is done. He cools it in his pool of water and hands it to you. _Yes,_ he says. _It is a piece worthy of me._";
	code =
		take_num_of_item(296,2);
		take_num_of_item(295,2);
		reward_give(65);
	break;

	
begintalknode 28;
	state = 16;
	nextstate = -1;
	condition = num_of_item(296) > 3 && num_of_item(295) > 1;
	question = "Can you make a broadsword for me? (Give 4 fine steel and 2 focusing crystals.)";
	text1 = "Komlos takes the materials in his hands. He holds them for a minute, feeling them. Then he nods and carries them to his forge.";
	text2 = "He heats the metal and begins to hammer it out. Occasionally he takes the crystal and concentrates. Motes of light flow from the crystal into the hot metal.";
	text3 = "After an hour, the broadsword is done. He cools it in his pool of water and hands it to you. _Yes,_ he says. _It is a piece worthy of me._";
	code =
		take_num_of_item(296,4);
		take_num_of_item(295,2);
		reward_give(85);
	break;
	
begintalknode 29;
	state = 16;
	nextstate = -1;
	condition = num_of_item(296) > 3 && num_of_item(295) > 1;
	question = "Can you make a pair of greaves for me? (Give 3 fine steel and 2 focusing crystals.)";
	text1 = "Komlos takes the materials in his hands. He holds them for a minute, feeling them. Then he nods and carries them to his forge.";
	text2 = "He heats the metal and begins to hammer it out. Occasionally he takes the crystal and concentrates. Motes of light flow from the crystal into the hot metal.";
	text3 = "After an hour, the greaves are done. He cools them in his pool of water and hands them to you. _Yes,_ he says. _It is a piece worthy of me._";
	code =
		take_num_of_item(296,3);
		take_num_of_item(295,2);
		reward_give(354);
	break;


// CONCVERSATION CONTINUE BELOW



begintalknode 30;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This sentinel is a large, enchanted figure of living rock. As you get close to it, the air goes from stifling to searing. The power coming off this creature makes it painful to be nearby.";
	text2 = "It shows no sign of recognizing your presence. You back away.";

begintalknode 31;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "A huge, hideous monster looms out of the shadows. It is a twisted, mutant monstrosity, part animal, part bug, probably the result of magical experimentation gone wrong.";
	text2 = "It looks old and in great pain. Its limbs have many cracks and bends, probably from badly healed breaks. Many of the deadly spines that once festooned its body have broken off.";
	text3 = "It is vicious, and it is hungry. It lunges toward you. And yet, its tentative, pained movements make you think that you might be able to drive it off.";

begintalknode 32;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The creature is old, but it can still breed young. Hideous larval creatures, destined to become hideous monsters of their own. They are wrapped in thick webs of dried mucus, growing and gaining strength.";
	text2 = "The horror lets out a loud shriek. One of its young tears loose from its lair.";
	
begintalknode 33;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Your blows are taking this twisted creature to new, unimagined realms of agony. It lets out a deafening screech, spraying you with spittle and ooze. The slime burns where it touches you. You wipe it off quickly.";
	text2 = "The horror lunges at you again with such ferocity that its shell starts to crack under the force of its onslaught. It ignores its agony as it tries to finally drive the intruder from its lair.";

begintalknode 34;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "At last, the magic and will holding the horror together give out. The creature literally falls apart, spraying the walls with acidic bile.";
	text2 = "Whew.";

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

// FINISH KOMLOS CONVO

begintalknode 37;
	state = 16;
	nextstate = -1;
	condition = num_of_item(296) > 2 && num_of_item(295) > 1;
	question = "Can you make a spear for me? (Give 3 fine steel and 2 focusing crystals.)";
	text1 = "Komlos takes the materials in his hands. He holds them for a minute, feeling them. Then he nods and carries them to his forge.";
	text2 = "He heats the metal and begins to hammer it out. Occasionally he takes the crystal and concentrates. Motes of light flow from the crystal into the hot metal.";
	text3 = "After an hour, the spear is done. He cools it in his pool of water and hands it to you. _Yes,_ he says. _It is a piece worthy of me._";
	code =
		take_num_of_item(296,3);
		take_num_of_item(295,2);
		reward_give(385);
	break;

begintalknode 38;
	state = 16;
	nextstate = 10;
	condition = 1;
	question = "I don't need anything right now.";
	text1 = "_Then I will return to my other work. Not much to do, but I will find something._";
//

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 = "";
		