// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(90,0) == 0;
	question = "special";
	text1 = "You are standing at the entrance of a large nephilim settlement. It is far out in the wilderness, a long journey from any Avernite city. The nephilim knew that you were coming. A lot of their warriors are waiting for you.";
	text2 = "And yet, the ranks of the enemy, well-armed and holding back a host of snarling wolves, is not what gets your attention. You see, beyond the warriors, rows of healthy mushrooms.";
	text3 = "You have managed to find one place in Avernum where the Blight has not yet arrived. No wonder they are so desperate to keep outsiders away. One bit of Blighted mushroom on your boot could destroy their crops.";
	text4 = "One of the nephilim steps forward and raises his bow over his head. _Rrrawr! These are Fang Clan lands! Avernites come here, we kill them. You no drive us from caves! Stay away!_";
	action = SET_SDF 90 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(90,1) == 0;
	question = "special";
	text1 = "You advance slowly past the totems, noting that each is topped with a human skull. The Slith Horde aren't the only ones who have been hunting Avernites.";
	text2 = "The nephil who challenged you before lets out a long, angry howl. _Rrraarrr! The Avernites come! Destroy them! Slay them for the mighty Fang Clan!_";
	text3 = "The warriors drop their ropes. Set loose, their vicious wolves bound across the stone toward you.";
	action = SET_SDF 90 1 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(90,2) == 0;
	question = "special";
	text1 = "You get a good look at all of the hard work the nephilim have been doing. They have been digging out tunnels and making drains down here. They plan to expand these caves into a large, impressive fortress.";
	text2 = "You look through the open gate and see that the cave floor slopes upward gently to the north. There are grates set into the floor, and you can hear a dark, icy river flowing below them.";
	text3 = "There are no defenders visible ahead. The chamber is unnervingly empty and quiet. You start to suspect that it is very dangerous down here.";
	action = SET_SDF 90 2 1;

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

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


//

begintalknode 10; // the orb
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You open the trophy box. Inside it, you find some velvet padding. Resting on it are some broken ceramic shards. These are painted with beautiful, delicate designs. Feathers, clouds, and birds in flight.";
	text2 = "You know what this is. Every adventurer in Avernum has heard of it. These shards are the broken remains of the Orb of Thralni. Once a great treasure which gave its owner the power of flight, its power finally ran out.";
	text3 = "You can't leave even the remnants of such an artifact in hostile territory like this. You carefully gather them up.";
	text4 = "The box is empty.";
	code =
		if (gf(90,4) == 0) {
			rs(4);
			sf(90,4,1);
			set_spec_item(9,1);
			}
			else {
				rs(1); rs(2); rs(3);
				}
	break;
	
begintalknode 11; // wheel
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You turn the wheel, opening the gateway out of the enemy fortress. Then, to keep from being trapped in here again, you jam the mechanism with a chunk of rock.";
	text3 = "You try to turn the wheel, but it's still stuck.";
	code =
		if (gf(90,19) == 0) {
			sf(90,19,1);
			rs(3);
			}
			else rs(1);
	break;

begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You are at the entrance to a small shrine, where the nephilim come for blessings from the tribal shaman. In return, they give gruesome offerings and battle trophies, many of which decorate the altar.";
	text2 = "The shaman is here, leaning over the altar. Both of his hands rest upon it. They are surrounded by a faint nimbus of light. The creature is drawing power from the stone.";
	text3 = "He is ready for you. He makes a chopping motion with his hand, and two huge nepharim step out of the shadows. He points at you and mutters, _Slay the invaders._ A glowing shield appears around the two warriors.";

begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The shaman of the Fang Clan collapses and dies. The powerful shield he placed around his two warriors fades.";

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "When you pull the lever, you hear creaking and grinding. The lift shudders under your feet. Then, slowly, it begins to rise.";


begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "When you pull the lever, you hear creaking and grinding. The lift shudders under your feet. Then it begins to descend.";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Unsurprisingly, the Fang Clan is taking advantage of your period of vulnerability on the lift. However, they are not fighting you in a decent, honorable way.";
	text2 = "Instead, archers set up on the ledge above you, ready to shower you with missiles.";

/// 

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "High Chief Grayfang says, _I have said all I have to say to you. You must go now, before my people emerge from hiding to take their revenge._";

begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "High Chief Grayfang closes his eyes for a moment and begins to focus. Then he bends at the knees and draws his blade back. He is about to strike a mighty blow.";

begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "High Chief Grayfang leaps into the air, spinning like a tornado. His blade flies in long, vicious arcs, cutting through the air with blinding speed. Nothing nearby can escape this terrifying onslaught.";

begintalknode 20;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "High Chief Grayfang collapses to the ground, mortally wounded. _They told me ..._ he gasps. _They said none could fight Avernum. They ... They were right. The Fang Clan will ... will ..._";
	text2 = "His head tilts back. He closes his eyes. His chest stops heaving. Until another war chief can rise up to match Grayfang, the power of the Fang Clan is broken. And that will not happen for a long time, if ever.";

begintalknode 21;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You approach the northern gate, walking slowly and carefully. The water and mold on the stone floor make it very slippery.";
	text2 = "As you cross the room, you hear a loud, grinding noise. The machinery built by the nephilim cranks into action. The gate to the south slams shut.";
	text3 = "And then you hear water flowing. You look down through the grate at your feet. The river has been diverted. The water is rapidly rising. The floor slopes gently up to the north.";
	text4 = "If you don't find a way to get to higher ground, you will soon drown.";

//// 

begintalknode 22;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to turn the wheel, but it is stuck. Something is holding it in place. You put all of your effort into turning it, but, until something releases it, it won't budge.";

begintalknode 23;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is another rumbling sound. The wheel by the north wall turns slightly. The gate goes up slightly. And then several globs of slime flow into the room. You're trapped by water in one direction and goo in the other.";

begintalknode 24;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You find that the wheel's mechanism is not locked. You turn it as quickly as you can, drawing the chain up through a hole in the floor. The gate slowly begins to rise.";

begintalknode 25;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is another rumbling sound. The wheel by the north wall turns slightly. The gate goes up slightly. And then you are joined in the chamber by a pack of terrified rats.";
	text2 = "They are scared of drowning and looking desperately for something to climb. Like, say, you.";

begintalknode 26;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is another rumbling sound. The wheel by the north wall turns slightly. The gate goes up slightly, and more blobs of slime flow into the room.";
	text2 = "You hope the nephilim are grateful to you for clearing all these pests out of their sewer.";

begintalknode 27;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You hear a deep grinding noise behind you, followed by a clunk. Much to your relief, the water finally stops flowing.";

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

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

//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "You find, to your surprise, that the chieftain of this fortress is standing here, alone, in front of his throne, waiting for you. His blade is out, but he makes no motion to attack. He wears a beautiful gold ring, sparkling with jewels.";
	text2 = "Instead, he makes a little salute to you with the blade. He says, _Hmurrr. I am High Chief Grayfang. I am the leader of the mighty Fang Clan. Mrrr. I have made a decision._";
	text3 = "_You must leave. I have had the guards step aside. You will go.  Take the little treasures you have found and leave us._";

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "You are the leader of all of the Fang Clan?";
	text1 = "_Hmrrrr. There are many little clans in our number. All answer to me. We are proud and fierce, but, when confronted, sometimes we must be wise._";

begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "How do I leave?";
	text1 = "_The wheel is to the west. Turn it to open the gate. Walk straight out, and none will stop you. And do not return._";

begintalknode 33;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Why are you not fighting me?";
	text1 = "_I would have no more of my people die to fight you. We slay Avernites when we must, but we will not throw our lives away, not in such a time of crisis._";
	text2 = "_There is a time of great trial and poverty and hunger ahead. We will have Avernum know one thing._";
	
begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I have not come this far to run away. Die!";
	text1 = "The chieftain of the Fang Clan seems neither surprised or unafraid. _You make your choice. Now you will learn. None rise to lead the mighty Fang Clan without great skill of arms!_";
	text2 = "He lunges at you. In an instant, his motions become a blur. He is amazingly fast, and his aim is sure. From the cliff below, you can hear the shouts of nephilim warriors. They are coming to their chieftain's aid.";
	action = END_TALK;
	code =
		set_attitude(9767,10);
	break;
	
begintalknode 35;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "What Avernites have you slain?";
	text1 = "_Soldiers who attacked us. Those who would rob us. Those who would settle in our land. Those who would bring the Blight to our crops._";
	text2 = "_We kill those who threaten us. Or come near us. It is our survival or yours._";

begintalknode 36;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Have you killed any Avernite soldiers?";
	text1 = "_Very few. Only those we had to. Though, not long ago, some soldiers tried to fly past, along the river. Powerful magic, but it failed them. They fell to their deaths._";
	text2 = "_Hmrrrr. They died in our lands, so we claimed them as trophies. All the better to scare away invaders._";

begintalknode 37;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "What must Avernum know?";
	text1 = "_We of the Fang Clan will never return to the surface. The Empire would kill us! We will never join you. We will not be tame! We will be our own creatures, proud and free!_";
	text2 = "_And we will claim land for our own. Like this land here. This is ours. We attacked you instead of parleying you. This was our mistake, one that has cost us dearly._";
	text3 = "He twists the beautiful gold ring nervously on his finger. _Now, tell me. Will you leave in peace, or will you challenge our right to hold this land?_";

begintalknode 38;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "I will go peacefully.";
	text1 = "High Chief Grayfang nods. _Then open the gate and depart and do not return. If you come back, we will slay you. This is the land of the Fang Clan!_ He turns away.";
	action = END_TALK;
	

begintalknode 39;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "You have no right to claim Avernite land for your own. You will have to go.";
	text1 = "The chieftain of the Fang Clan seems neither surprised or unafraid. _You doom yourself with your greed. We will not surrender this land. Now you will learn. None rise to lead the mighty Fang Clan without great skill of arms!_";
	text2 = "He lunges at you. In an instant, his motions become a blur. He is amazingly fast, and his aim is sure. From the cliff below, you can hear the shouts of nephilim warriors. They are coming to their chieftain's aid.";
	action = END_TALK;
	code =
		set_attitude(9767,10);
	break;

begintalknode 40;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Actually, I'm just in this for the treasure. (Attack.)";
	text1 = "The chieftain of the Fang Clan seems neither surprised or unafraid. _So you are a mercenary after all. Now you will learn. None rise to lead the mighty Fang Clan without great skill of arms!_";
	text2 = "He lunges at you. In an instant, his motions become a blur. He is amazingly fast, and his aim is sure. From the cliff below, you can hear the shouts of nephilim warriors. They are coming to their chieftain's aid.";
	action = END_TALK;
	code =
		set_attitude(9767,10);
	break;

//

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