// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(57,0) == 0;
	question = "special";
	text1 = "You step out of this narrow tunnel and instantly into the sights of several brigands, all of them aiming missiles at you.";
	text2 = "You can instantly tell that they are not your ordinary Abyss thugs. They are a good deal older. Some of them have traces of gray in their hair. They also have been well trained in the use of their weapons.";
	text3 = "They have no use for parleying or threats. They instantly shoot to kill.";
	action = SET_SDF 57 0 1;


begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The leader of the brigands, a mage with a gray beard and thinning hair, sneers at you. _This is a pleasure. You are not a mere Abyssal. You are an Avernite soldier. A true worm!_";
	text2 = "_I've killed many or your kind, and I will be glad to destroy another. And when you are dead, your body will be destroyed. Nobody will ever know what happened to you!_";
	code =
		alert_char(6178);
		alert_char(6179);
		alert_char(6180);
	break;
	
begintalknode 3; //
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This cabinet contained several scrolls. Someone hurriedly incinerated them with a well-aimed spell. Whoever these people were, the evidence was completely and thoroughly destroyed.";

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The leader of the brigands collapses. With his last strength, he spits at you. _You have destroyed one of us, worm, but the ... the ..._";
	text2 = "Before he can finish, his strength runs out. He dies on the cold stone floor.";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The merchant caravan has several well-armed guards. They watch you grimly, unconvinced that you are actually a genuine Avernite soldier.";
	text3 = "The merchant caravan has several well-armed guards. They watch you grimly, unconvinced, even after what you've done for them, that you are actually a genuine Avernite soldier.";
	action = DEP_ON_SDF 57 6 0;

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Several of the lizards that pull the caravan wagons have been chained up here.";

begintalknode 7; // spellbok
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You find the brigand mage's spellbook. Most of the spells within are written in an obscure magical cipher. You have no chance of understanding them. One incantation, however, is in a better known script.";
	text2 = "(Your skill with the spell Terror increases.)";
	text3 = "You browse through the book a bit more, but you don't learn anything new.";
	text4 = "Sadly, you still don't understand it. You don't know enough magical lore. (Improve your Arcane Lore skill to understand books like these.)";
	code =
		if (gf(57,4) == 0) {
			rs(3);
			if (get_stat_total(13) < 8)
				rs(2);
				else {
					rs(4);
					sf(57,4,1);
					alter_stat(30000,51,2);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a natural stone basin in this cave. Water drips into it, very slowly, from a stalactite overhead. There is a thick mineral residue covering the stone. The residue glows slightly.";
	text2 = "The basin is empty. It will take a while to refill.";
	text3 = "You drink the water within. The beneficial magic infusing the water makes you feel very strong.";
	text4 = "You drink the water within. The beneficial magic infusing the water makes your thoughts marvelously clear.";
	text5 = "You drink the water within. The magic within turns sour in your stomach. It burns you.";
	code =
		clear_strings();
		as(1);
		if (gf(57,7) > 0)
			as(2);
			else {
				sf(57,7,1);
				if (gf(57,8) < 4) {
					as(3);
					revive_party();
					set_char_status(30000,12,50);
					}
					else if (gf(57,8) == 4) {
						as(4);
						award_party_xp(400,20);
						}
						else {
							as(5);
							set_char_status(30000,6,10);
							set_char_status(30000,22,10);
							}
				inc_flag(57,8,1);
				}
	break;
	

begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  Fort Spire - South";
	text3 = "  Spire - East";
	text4 = "  Bargha - Northeast";


//

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "There is a small caravan camped around a fire. It looks like this campsite has been used countless times by passing travelers since the earliest days of the Abyss.";
	text2 = "When you get close, the guards draw their blades. They don't sheathe them again until the merchant in charge gets a good look at you. _Calm down,_ she says. _It's an Avernite._";
	text3 = "She invites you to come closer. She looks very worried. None of them have gotten much sleep. _I'm Thyra. From the lands of sanity, like you. Good to see someone who isn't local. The Abyss is even more hostile than usual lately._"; 
	text5 = "Thyra and her guards don't mind you warming yourself by their fire. Thyra works on some scrolls, set out on a pallet by the fire. She occasionally looks up at you. _Always good to have more protection nearby._";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "What are you up here to trade?";
	text1 = "_Nothing that would surprise you. Simple goods. Food. Pots. Tools. In return for foraged crystals and herbs. The same sort of business Avernum has been doing with the Abyss for years._";
	text2 = "";

begintalknode 12;
	state = 10;
	nextstate = 12;
	condition = 1;
	question = "Can you tell me what's been happening in the Abyss lately?";
	text1 = "_Afraid not. We've been camped out here. Normally we go into Spire or Bargha. Or, we did until the Blight. Now I think we're safer out here, as hard as that may be to believe._";

begintalknode 13;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "How long will you be camping here?";
	text1 = "_Until we have done enough business to make the trip worthwhile, or until it gets too dangerous to stay._";
	text2 = "_Business has been slow, but the people will come out for tools and supplies soon enough._";

begintalknode 14;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Why won't you go into Spire?";
	text1 = "She shakes her head. _I can't say I could tell you. Intuition. Something isn't right there. They are dealing with someone or something. I don't know what. But they're making it clear that Avernites aren't welcome._";

begintalknode 15;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Why won't you go into Bargha?";
	text1 = "_Because they have gone mad. The warlord there, he takes what he wants and won't let anyone leave. I'd stay away from there if I were you. No sane merchant would set one foot through their gates._";

begintalknode 16;
	state = 10;
	nextstate = 13;
	condition = gf(57,6) == 0;
	question = "Why are you so worried?";
	text1 = "_Brigands. They have been hitting all the caravans in this area. And not your ordinary muggers, either. They're trained and armed, and they don't just steal. They kill._";
	text2 = "_They've never come out this far, so I think I'm safe here. I hope._";

begintalknode 17;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Where do they come from?";
	text1 = "She points to the southeast. _Somewhere that way. But Spire has sent out hunters to track them down, and they've never had any luck._";

begintalknode 18;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Why do you stay here at all?";
	text1 = "_Because I have no choice. We have to earn a lot of money to buy food. Going back south now would ruin us. We aren't like you soldiers. We don't get the best of everything._";

begintalknode 19;
	state = 13;
	nextstate = -1;
	condition = gf(57,5) > 0;
	question = "Actually, all of those raiders are dead.";
	text1 = "_What? You found them? Thank you! You have done us a real kindness._";
	text2 = "_You know, I don't normally sell the crystals and herbs I get until I get south, but I would let you, and just you, buy a few things at cost. Out of gratitude. Just don't tell anyone I let you._";
	action = SET_SDF 57 6 1;
	
begintalknode 20;
	state = 10;
	nextstate = -1;
	condition = gf(57,6) == 0;
	question = "Can I buy something?";
	text1 = "_I don't normally sell the crystals and herbs I get until I get south. That's the only way I can know what the right price is. Sorry._";

begintalknode 21;
	state = 10;
	nextstate = -1;
	condition = gf(57,6) > 0;
	question = "Can I buy something?";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Thyra the Trader",
		  "Thyra has been trading tinker's goods for Abyss herbs and crystals. Since you helped her, her prices are low.",
		  56,1,0);	
	break;


begintalknode 22;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "Can I sell you something?";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode 23;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "That's all I need to know.";
	text1 = "_Then I thank you for stopping by. You are welcome to camp with us whenever you want._";
	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 = "";
		