// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(142,0) == 0 && has_spec_item(25) == 0 && get_quest_status(168) == 2;
	question = "special";
	text1 = "You find the ruins of a caravan. This must be where Priestess Kyra's holy symbols were stolen from. You investigate, looking for clues.";
	text2 = "It looks like the wagons were attacked and smashed up by something very large and strong, probably humanoid, probably wielding a club. The guards ran off, and the lizards guarding the caravan were dragged away.";
	text3 = "You note that there is a trail of debris leading off to the west.";
	action = SET_SDF 142 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(142,1) == 0;
	question = "special";
	text1 = "Since this mine was abandoned, something else has taken up residence here. Your first clue is all of the bones you see scattered ahead, some of which were left here to attack you.";
	action = SET_SDF 142 1 1;


begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several soldiers patrolling the road south of Dharmon. They're friendly enough to speak with you for a short time.";
	text2 = "They warn you that, if you're heading south to Fort Remote or Patrick's Tower, you should be careful. A caravan on that route was recently attacked and destroyed.";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This small, crystal box is empty.";
	text3 = "This small, crystal box contains three holy symbols, wrapped in velvet. The symbols are made of carved blue crystal, intricate and lovely.";
	text4 = "They're not enchanted, but they're likely quite valuable to whoever they were being delivered to. You take them.";
	code =
		if (gf(142,5) == 0) {
			sf(142,5,1);
			set_spec_item(25,1);
			rs(1);
			}
			else {
				rs(3); rs(4);
				}
	break;
			
begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You have located the necromancer's book of rituals. Most of it is useless to you, a collection of mad rantings and instructions for dressing, mummifying, and otherwise messing about with dead bodies.";
	text2 = "You do learn something interesting, though: a chant to focus your mind if certain infernal influences try to take control of it. (Your skill with the spell Ward of Thoughts 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(142,9) == 0) {
			rs(3);
			if (get_stat_total(13) < 6)
				rs(2);
				else {
					rs(4);
					sf(142,9,1);
					alter_stat(30000,67,2);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
			
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  Patrick's Tower - Southeast";
	text3 = "  Fort Remote - South";
	
//

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "There is a massive ogre blocking this corridor. He stands so tall that he has to bend at the knees to keep his head from hitting the ceiling. A necklace of crude crystals hangs around his neck. He must like shiny things.";
	text2 = "Considering how little impulse control these creatures have, you feel fortunate that he didn't attack you on sight. He says, _Hhharrrrgh! I am Horg Toothsnap, and this my lair! Mine! You go out now!_";
	text5 = "Horg Toothsnap, having exhausted his conversational abilities, makes a series of snarling and grumbling noises at you.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "I'd like to talk to you.";
	text1 = "_Hrrrargh! You no talk! Me ogre! Ogres not talk, we stomp! Me no want stomp Avernum soldier. Me will!_";

begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = gf(142,0) > 0;
	question = "Do you know anything about the smashed caravan outside?";
	text1 = "_Ahhhrrrr ... Uhhhhh ... No. Me know nothing. But I know no little people hurt. Just pretty shiny things taken. If me know anything about it, me know that. But me no know no thing. And you no trick me!_";

begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Nice necklace.";
	text1 = "_Arrr ... Yes. Shiny. Pretty. Me like shiny pretty._";

begintalknode 14;
	state = 10;
	nextstate = 11;
	condition = gf(142,5) == 0 && get_quest_status(168) == 2;
	question = "Some crystal holy symbols were stolen. I need them back.";
	text1 = "_Oh. Those._ You spend a minute watching the ogre think. He laboriously calculates how much he wants to keep the holy symbols, how much trouble he might get from retaining them, and what he can get for them.";
	text2 = "Finally, he says, _I find them. They are mine. They are pretty. You want? You give me pretty thing!_";

begintalknode 15;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Die, foul ogre! (Attack.)";
	text1 = "_Ahhrrr! No! You die! Die, bad little person!_";
	action = END_TALK;
	code = 	
		set_attitude(15379,10);
		set_act_at_dist(15336,1);
		alert_char(15336);
		set_act_at_dist(15337,1);
		alert_char(15337);
		set_act_at_dist(15338,1);
		alert_char(15338);
	break;
	
begintalknode 16;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "I'll be going now.";
	text1 = "_Yes! You go! Intruder little person go! Ghharrr!_";
	action = END_TALK;

begintalknode 17;
	state = 11;
	nextstate = -1;
	condition = num_of_item(5) > 0 || num_of_item(6) > 0 || num_of_item(7) > 0;
	question = "Look! I have some crystals!";
	text1 = "You show your more mundane crystals to the ogre. It snorts, unimpressed. _No! Not just pretty! Me want very pretty! Pretty like the ... uhhh ... symbols._";

begintalknode 18;
	state = 11;
	nextstate = -1;
	condition = num_of_item(4) > 0;
	question = "Look! I have a ruby!";
	text1 = "_No! No want ruby. Ruby red. Me no like red._";

begintalknode 19;
	state = 11;
	nextstate = -1;
	condition = num_of_item(9) > 0;
	question = "Look! I have an emerald!";
	text1 = "_No. Emeralds are bad. They make me sneeze! No emerald!_";
	
begintalknode 20;
	state = 11;
	nextstate = -1;
	condition = num_of_item(214) > 0;
	question = "Look. I have a perfect crystal. (Offer it.)";
	text1 = "The ogre looks at the crystal. He likes what he sees. _Yes. Pretty. Pretty pretty. Me like. But I have five symbols._ He holds up three fingers. _You give me five crystals!_ He holds up three fingers.";

begintalknode 21;
	state = 11;
	nextstate = -1;
	condition = num_of_item(214) > 2;
	question = "Look. I have three perfect crystals. (Offer them.)";
	text1 = "The ogre looks at the crystals. He likes what he sees. _Yes. Pretty. Pretty pretty. Me like. But I have five symbols._ He holds up three fingers. _You give me three crystals!_ He holds up three fingers.";
	text2 = "He looks at his fingers. He looks at the crystals. He notes the numbers are the same. _Good!_ He takes the crystals and leaves. A minute later, he returns with a small velvet bundle, which he gives to you.";
	text3 = "It does, indeed, contain three crystal holy symbols. You put them away. _Good! Now me and little person both happy. Now go away!_";
	action = END_TALK;
	code =
		sf(142,5,1);
		set_spec_item(25,1);
		take_num_of_item(214,3);
	break;

begintalknode 22;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "I don't have anything to trade.";
	text1 = "_Then go! Go away!_";
	action = END_TALK;


//

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

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

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

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

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

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

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

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

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

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

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

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

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

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

begintalknode 44;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
//

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