// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,0) == 0;
	question = "special";
	text1 = "You are at a large crossroads. Most of the traffic in and out of the Great Cave meets here and then passes through Almaria to the east.";
	text2 = "There are two camps here. To the south, you can see a large platoon of soldiers, who patrol the roadway and make sure that travelers can pass unmolested.";
	text3 = "To the north, there is a cluster of refugees, who have wisely decided to camp near the Avernite soldiers. They are an exhausted and bedraggled lot.";
	action = SET_SDF 147 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(147,1) == 0;
	question = "special";
	text1 = "Though the farmhouse above looked abandoned, this tunnel seems like it was only recently excavated.";
	text2 = "You soon reach a dead end. And yet, oddly, you could swear that you can hear digging nearby.";
	action = SET_SDF 147 1 1;


begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This lizard is hauling Vira the Tinker's goods. Fortunately, a muzzle keeps you safe from its hungry jaws.";

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are two farmers in this hut, sharing a pitifully small roll and looking out the window at the ruin of their crops.";
	text2 = "Amazingly, they don't welcome the armed stranger that just broke into their home. They strongly invite you to leave them alone, so you depart.";
	
begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several soldiers camped at the crossroads, watching for bandits and skribbane addicts and, in general, keeping order. Considering that they could be up north fighting the Slith Horde, it's a pretty plum assignment.";
	text2 = "Your low rank causes them to dismiss you pretty quickly. Offers of stew and ale are not forthcoming. They mutter that you should return to your commanding officer and leave them alone.";
	text3 = "Your rank causes them to wisely decide to share their ale and stew and not anger you. You spend some time trading stories with them. Yours are a lot more interesting than theirs.";
	code =
		if (gf(170,0) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several refugees camped around these fires. They are a tired and hungry lot.";
	text2 = "And, now that the Great Portal is gone, you detect a worrying undercurrent of barely restrained panic.";
	text3 = "You spend some time speaking with them. Fortunately, they are too proud to beg. You trade news with them, but you don't learn much of value.";
	code =
		if (gf(170,1) < 12)
			rs(2);
	break;
	
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is one refugee sitting off to the side. He wears a heavy leather jerkin, and a broadsword hangs at his side. You think you can detect a slight green tint around his mouth.";
	text2 = "When you get close, he snaps, without even looking at you, _Go away! Go! You think you can just bother Igner? Leave me alone!_ He seems very tense. You back away.";
	text3 = "You get close to Igner. This time, he looks at you. _Again? Why are you pestering me? What do you ... A soldier? What do you want?_";
	text4 = "_I am not scared of you. Keep pestering me and, whatever you want to do to me, I'll make sure it doesn't happen._";
	text5 = "You approach Igner again. He shouts, _I have had enough! You won't get me! You won't!_ He whips out his broadsword and lunges at you.";
	action = END_TALK;
	code =
		clear_strings();
		as(1);
		if (gf(147,4) == 0)
			as(2);
			else if (gf(147,4) == 1) {
				as(3); as(4);
				}
				else {
					as(5);
					set_attitude(15896,10);
					}
		inc_flag(147,4,1);
	break;
	

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Vira the Tinker always travels with two huge nepharim bodyguards. They are hired to look impressive and dangerous, not to talk. They brush by you.";

begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = gf(147,3) == 0;
	question = "special";
	text1 = "You step through the secret door and immediately confront a small group of armed people. Some of them are wielding picks. All of them look crazed, with telltale green marks around their mouths.";
	text2 = "They were expanding a natural crack through the stone. They must be smugglers, attempting to connect this crevice to the network of tunnels under Almaria, to the east.";
	text3 = "The moment they see you, they drop their picks and grab their blades. They are willing to kill you to keep their tunnel secret.";
	code =
		sf(147,3,1);
		activate_hidden_group(25);
		alert_char(15885);
		set_name(15885,"Hrothwar");
		set_boss_level(15885,1);
	break;

//

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "There is a small merchant caravan moving up and down this road, doing business with passing travelers. The merchant in charge is always very happy to speak with soldiers, as they have the money to buy things.";
	text2 = "He approaches and bows deeply to you. _Greetings, defender of Avernum. I am Vira the Tinker. But not just a tinker._";
	text3 = "_I have many opportunities to buy the tools of your vital trade. And then I clean them and sell them for reasonable prices. If your superiors have not given you the tools you need to follow your orders, please ask me._";
	text5 = "Vira the Tinker is still enthusiastically working the Almaria crossroads.";
	text4 = "You notice that, under his rough and repeatedly patched cloak, his clothes are quite nice. They are made of wool from the surface. Business must be good.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Where do you get your wares?";
	text1 = "_I buy them from travelers. Refugees fleeing the enemy horde. Wanderers looking for a place to live. And so on. I relieve them of bulky possessions, and I give them valuable currency._";
	text2 = "_Though, lately, it has been unpredictable work. The destruction of the portal has made people desperate. It is hard to do business with desperate people._";
	code =
		if (gf(170,1) < 12)
			rs(2);
	break;

begintalknode 12;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Have you heard any news?";
	text1 = "_Only the standard litany of woe, of vicious losses to the Slith Horde and lack of progress against the Blight._";
	text2 = "_Though, lately, some foolish people attempted to force their way past the Almaria gates without paying the toll. Of course, they failed, and they received vicious beatings for their trouble._";
	text3 = "_The world itself will grind to a halt before Almaria gives up on collecting bridge tolls._";

begintalknode 13;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Know anything about this area?";
	text1 = "_Only that it is wise to stay close to the roads. The patrols have not been as good as in the past at clearing away pests._";
	text2 = "_For example, bandits have been sighted to the south. Nephilim and, I've heard, even a few slithzerikai. That is one rumor I believe._";

begintalknode 14;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "You buy things from the desperate?";
	text1 = "_Of course. Refugees or those attempting to use the Great Portal, they always left home carrying too much. Too much to carry, too much to pass through the portal._";
	text2 = "_They can sell them to me, or they can discard them along the road. I assure you they prefer the former. I assure you I am more ethical than most._";

begintalknode 15;
	state = 12;
	nextstate = 13;
	condition = 1;
	question = "How so?";
	text1 = "_Well, I pay fair prices. And I never traffic in skribbane herb. I would rather die than contribute in the trade of that vicious substance._";

begintalknode 16;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "And people sell things to you to get money to buy it?";
	text1 = "_Of course. I have no doubt of that. I do not know what happens to my money when it leaves my hand. How could I?_";

begintalknode 17;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Let me see what you have for sale.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Vira the Tinker",
		  "Vira makes sure to buy anything he can later resell to soldiers and mercenaries for a profit. He has quite an eclectic selection of gear.",
		  23,3,0);	
	break;

begintalknode 18;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "I want to sell something.";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode 19;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "I'll be going now.";
	text1 = "_Then good day to you, and I hope to see you again. Safe and well, of course._";
	action = END_TALK;
	
begintalknode 28;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  The Castle Gates - Northwest";
	text3 = "  Almaria, The Great Portal - East";
	text4 = "  Castle Food Depot - West";
		
begintalknode 29;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  The Castle Gates - North";
	text3 = "  Almaria, The Great Portal - East";
	text4 = "  Castle Food Depot - West";
	
//

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