// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(85,0) == 0;
	question = "special";
	text1 = "You reach Fort Spire, which is truly one of the more unique structures in Avernum. It is a small stone fort, perched on top of a gigantic stone spire, suspended over an enormous cavern.";
	text2 = "This was Avernum's gateway into the Abyss, until they abandoned it. Now the floor is littered with the signs of a hasty retreat. The fort has been abandoned to the Abyss.";
	text3 = "And the Abyss, it appears, did not hesitate to take advantage. You can see a handful of armed men and women down the hall to the north."; 
	action = SET_SDF 85 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(85,1) == 0;
	question = "special";
	text1 = "The second floor of Fort Spire is even more disorganized than the first. Garbage and bat guano are scattered everywhere, and the smell of sulfur is in the air.";
	text2 = "Your keen adventurer's senses instantly become alert. You sense something nearby. Something powerful and malevolent. Which is walking from room to room, hunting for prey.";
	action = SET_SDF 85 1 1;


begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "At last, the hideous demon is too small to generate more bats. The creature instead falls apart, leaving a black and greasy stain on the floor.";

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Somehow, Hrramen-Drayssa summoned this lizard to protect her. It is very large and very mean.";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "These are several members of some Abyss militia, rushed here to claim Fort Spire before anyone else can seize it.";
	text2 = "They don't like Avernite soldiers. At all. They tell you to talk to Galvas, their commander, and otherwise ignore you.";

begintalknode 6; // sbook
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Surprisingly, when the soldiers abandoned Fort Spire, they left this spellbook behind. Maybe they didn't recognize its value, or perhaps they couldn't bring down the barrier to reach it.";
	text2 = "Most of the spells within are too simple for you or wouldn't be helpful in a battle situation. You do, however, find an incantation that will make your missiles more dangerous. (Your skill with the spell Cloak of Bolts 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(85,7) == 0) {
			rs(3);
			if (get_stat_total(13) < 5)
				rs(2);
				else {
					rs(4);
					sf(85,7,1);
					alter_stat(30000,48,1);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
	
begintalknode 7; // desk
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "In their haste to abandon the fort, a lot of records were left in this desk.";
	text2 = "You flip through the papers, ledgers, inventories, and so on. You don't find anything that seems interesting. Now that the fort has been abandoned, it's all out of date.";
	text3 = "You flip through the papers, ledgers, inventories, and so on. At the bottom of a drawer, you find a notebook with lists of names, locations, and bits of information obtained from those people. Seems interesting. You keep it.";
	code =
		if ((gf(85,3) == 0) && (get_quest_status(187) == 2)) {
			rs(2);
			sf(85,3,1);
			set_spec_item(30,1);
			}
			else rs(3);
	break;

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a huge demon wandering the upper level of the keep. It is a hideous beast, with gray, scaly skin and a pair of bat wings on its back. Its eyesight doesn't seem to be very good, but it has gotten close enough to you to sense you.";
	text2 = "It lets out a hideous screech and lurches toward you.";

begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You have dealt a nasty wound to the hideous bat demon. It stumbles backwards and goes into spasms. Then you see a sight that will, if you survive, give you nightmares for a long time.";
	text2 = "Something starts to slither out of the wound. It is a huge cave bat, bearing massive claws and fangs. It crawls out of the demon and lets out a hideous hiss. Then it pounces toward you.";
	text3 = "The wound the bat crawled out of is now gone. The demon seems much healthier. It is also a little bit smaller.";
	
//

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Galvas";
	text1 = "There are several warriors sitting around this small fire. They are camped in this narrow, cramped hallway. They are dressed like brigands. They have the same crude, mismatched weapons and armor. But, happily, they don't act like it.";
	text2 = "One of them, a young, muscular man, rises to greet you. He doesn't draw his weapon. _I am Galvas, of the Spire militia. We have come to claim this fort, which your side just abandoned. I hope you aren't going to give us trouble._";
	text5 = "Galvas says, _What else do you want? I hope you won't interfere with our claim, or there will be trouble._ The other warriors from the Abyss watch you nervously.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = gf(85,5) == 0;
	question = "I'm just passing through. I mean you no harm.";
	text1 = "Galvas nods. _Well, Avernite warriors are not kept out of the Abyss, as long as they obey our laws and don't cause trouble._";
	code =
		sf(85,5,1);
	break;
	
begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = gf(85,5) == 0;
	question = "Actually, I need your help.";
	text1 = "Galvas looks nervous. _We don't work for you. We work for Spire. But, I suppose, if you have a question, I might answer it. But don't ask us to fight._";
	code =
		sf(85,5,1);
	break;

begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = gf(85,5) == 0;
	question = "Brigands claiming an Avernite fort! I will drive you out! (Attack.)";
	text1 = "The warriors from the Abyss are, to say the least, surprised and taken aback by this response.";
	action = END_TALK;
	code =
		set_attitude(30007,10);
		sf(85,5,1);
	break;

begintalknode 14;
	state = 10;
	nextstate = -1;
	condition = gf(85,5) > 0;
	question = "I'd like to know more about the Abyss.";
	text1 = "He shakes his head. _I'm not going into a big, long thing about it. You want to learn? You'll have to find things out for yourself._";

begintalknode 15;
	state = 10;
	nextstate = 11;
	condition = gf(85,5) > 0;
	question = "You are claiming this fort?";
	text1 = "He nods. _Your lot surrendered it. We are taking it. We were sent from Spire to grab it before anyone from Bargha came. We're closer, so those greedy wretches have no right to it. Wouldn't stop them from trying, though._";

begintalknode 16;
	state = 10;
	nextstate = 12;
	condition = gf(85,5) > 0;
	question = "Do you have control of the fort?";
	text1 = "_Well, we have the gates. We can keep things out. But some pests got here before we did._";
	text2 = "_For example, there's that mad slith. Offered to help us. Seemed like a mercenary. And then she went crazy as soon as we got here._";
	text3 = "_There's a demon upstairs. That's right. A demon. We got here and closed the gates, and then it flew in above. Really nasty._";
	code =
		if (gf(85,6) > 0)
			rs(2);
		if (gf(85,4) > 0)
			rs(3);
	break;
	
begintalknode 17;
	state = 10;
	nextstate = 13;
	condition = gf(85,5) > 0 && gf(86,6) == 0 && gf(85,10) == 0;
	question = "I am looking for Hrramen-Drayssa. Have you met her?";
	text1 = "He spits. _What? You know about that ... That ..._ He curses. _She came along with us. The mayor of Spire said we had to take her. Said she was a mercenary._";
	text2 = "_Then, the moment she gets inside the gate, she runs off. Does something to make lizards appear behind her, guarding her. And keeping us out!_";

begintalknode 18;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "You think you have enough to hold the fort?";
	text1 = "He laughs harshly. _We hardly have enough to hold this corridor. But we'll keep the gates closed until Spire can send more reinforcements for us._";

begintalknode 19;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Tell me about Bargha.";
	text1 = "_That city of madmen at the north end of the Abyss? They won't be happy until they've ridden us down and taken the whole Abyss for themselves. Their warlord won't even let anyone leave the city without his permission._";
	text2 = "_That's the sort of thing we all came to the Abyss to escape, but he's too strong for us to dislodge him._";
	
begintalknode 20;
	state = 12;
	nextstate = -1;
	condition = gf(85,6) == 0;
	question = "Tell me about the slith.";
	text1 = "He spits. _Like to slit her throat. Wish I had._";

begintalknode 21;
	state = 12;
	nextstate = -1;
	condition = gf(85,4) == 0;
	question = "Tell me about the demon.";
	text1 = "_I only saw it as it flew in. It's this horrible bat-thing. Came in with a lot of bats around it. Keeps to itself upstairs, so far. Hope it stays up there. It'd probably tear us apart if it came down here._";

begintalknode 22;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "So where is she now?";
	text1 = "He points to the west. _Back there somewhere._";

begintalknode 23;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Why did the mayor make you take her?";
	text1 = "_Sure she had her reasons. I'm not going to question her about it. But she did us no favors._";

begintalknode 24;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "She made lizards?";
	text1 = "_She had some magic trinket with her. Powerful thing. Made defenses for her. Like to know where she got it. I could use something like that._";

begintalknode 25;
	state = 10;
	nextstate = -1;
	condition = gf(85,6) == 1 && char_ok(9187);
	question = "I have met with Hrramen-Drayssa.";
	text1 = "_This business is far over my head, now. This is stuff between the Abyss and Avernum and things I don't understand. Don't want to know more about it. As long as that mad slith doesn't kill me in my bed, I'll be fine._";

begintalknode 26;
	state = 10;
	nextstate = -1;
	condition = gf(85,4) > 0;
	question = "The demon upstairs is dead.";
	text1 = "_Well, I'm grateful. Not that I can reward you, but I'm glad someone is helping us out here._";

//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Hrramen-Drayssa";
	text1 = "There is a slithzerikai sitting in this carved wooden chair, left behind when the Avernites fled the fort. She wears a golden symbol around her neck. It looks like a claw.";
	text2 = "She watches you with interest. _Ahssss. You passss my servantsss. You are strong enough to help. And you are Avernum army. But are you here to help me? I am Hrramen-Drayssa._";
	text5 = "Hrramen-Drayssa watches you silently from the carved wood throne. She occasionally fingers the gold claw symbol and makes a long, low hissing noise.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = gf(85,6) == 0;
	question = "I'm not here to help you.";
	text1 = "_Ahssss. Unfortunate. I thought you would be someone else. This is my chamber. Avernum hasss abandoned thisss fort. Leave me._";
	action = END_TALK;

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = gf(85,6) == 0;
	question = "I have been sent from the Castle to collect a message.";
	text1 = "Hrramen-Drayssa nods. _Then you are here to get the message from mighty Melanchion. Isss good, but my newsss isss bad. I am sorry to say. Message isss lost, and you must find it._";
	code =
		sf(85,6,1);
	break;

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = gf(85,6) == 0;
	question = "You sent pets to kill me? I will have my revenge! (Attack.)";
	text1 = "Message or no message, you will not tolerate such insolence from this creature. You attack.";
	action = END_TALK;
	code =
		set_attitude(30008,10);
		sf(85,6,2);
	break;

begintalknode 34;
	state = 30;
	nextstate = 32;
	condition = gf(85,6) > 0;
	question = "Who is Melanchion?";
	text1 = "_Melanchion is the great dragon, rising lord of the underworld. The caves reject your kind, and the dragon will ascend. And a few lucky onesss of usss will join the dragon and help it, and we will be rewarded._";

begintalknode 35;
	state = 30;
	nextstate = 33;
	condition = gf(85,6) > 0 && has_spec_item(3) == 0 && gf(170,1) == 16;
	question = "Where can I find that message?";
	text1 = "_Ahsss. I was a failure. I came to the Abyss with Breck-Drayssa, a human. A diplomat. Breck-Drayssa bore the message. I protected him. But I failed him. I should tear out my own throat for the dishonor of it._";
	text2 = "_Breck was taken by the wretchesss of Bargha. The message was taken too. The message must be found._";

begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = gf(85,6) > 0 && has_spec_item(3) > 0 && gf(170,1) == 16;
	question = "I have recovered the message.";
	text1 = "She nods approvingly. _Then take it to your Castle. It isss important. Very important. To Melanchion, and to survival of your people._";
	text2 = "_Me, I stay here. I was sent here by Melanchion asss ally and watcher, to greet messengersss from Avernum._";
	text3 = "The slith waves you away.";
	action = END_TALK;

begintalknode 37;
	state = 30;
	nextstate = -1;
	condition = gf(170,1) == 16;
	question = "There is something else I would like to know.";
	text1 = "Hrramen-Drayssa shakes her head. _No. I was sent here by Melanchion asss ally and watcher, to greet messengersss from Avernum. That isss all. I have done what I need to do. Now you must go, and do what Melanchion requiresss._";
	text2 = "The slith waves you away.";
	action = END_TALK;

begintalknode 38;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "What does your name mean?";
	text1 = "_Hrramen is name I was born with. Drayssa is title of honor, given to me to show I belong to the great wyrm. Melanchion is my master. I proclaim it to all._";

begintalknode 39;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "And that gold claw around your neck?";
	text1 = "_Another symbol of my servitude to the great dragon. The dragon givesss me many honorsss._";

begintalknode 40;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Where is the dragon?";
	text1 = "_Melanchion's will is everywhere. One day, all who stay in Avernum will feel the presence of the dragon._ Hrramen clearly won't answer the question.";

begintalknode 41;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Melanchion wants to kill everyone?";
	text1 = "_Ahssss ... No. Melanchion will only run some of the land. Not even all. Melanchion is no mindless killer, not like the old Empire leadersss. Melanchion is calm and wise._";

begintalknode 42;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "How many have joined Melanchion?";
	text1 = "_More each day. Melanchion is wise, and not a mindless thing. Melanchion would meet with Avernum and trade with them, for the good of both. That is why you are here._";

begintalknode 43;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "What do you have against Bargha?";
	text1 = "_Bargha is unwise. They are close to Melanchion, but they resist the great dragon. They refuse the opportunity and hunt all who bear the name Drayssa._";
	text2 = "_They will pay. They will pay._";

begintalknode 44;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "Do you know where Breck is now?";
	text1 = "_I know nothing about place where Breck-Drayssa is now. I would count myself very lucky if he even still lives._";

begintalknode 45;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "Where should I start looking?";
	text1 = "_Before I leave Spire, I go to one called Gall. Gall knowsss how to find thingsss. Itemsss. People. I ask for Breck-Drayssa to be found, and I come to thisss fort, to meet soldiersss expected from Avernum._";
	text2 = "_Go to Spire and find Gall, and maybe Gall can help._";
	code =
		if (gf(85,10) == 0)
			sf(85,10,1);
	break;
	
begintalknode 46;
	state = 33;
	nextstate = -1;
	condition = gf(85,10) > 1;
	question = "I met with Gall. Is there anything else you can tell me?";
	text1 = "_No. That wasss all. I am here now, by orders of wise Melanchion, and here I must stay._";

begintalknode 47;
	state = 30;
	nextstate = -1;
	condition = gf(85,6) > 0 && gf(29,6) > 0;
	question = "I managed to locate Breck-Drayssa. (Tell the tale.)";
	text1 = "Hrramen-Drayssa nods, but she betrays no emotion at the news. _Melanchion will be interested to hear of thisss. How he reacts to these eventsss will be up to him. I can decide nothing on my own._";

//

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