// dlg.txt

begintalkscript;

variables;

short i;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(112,0) == 0;
	question = "special";
	text1 = "You enter the crumbling ruins of a small settlement, nestled in these remote tunnels. Not a human settlement, though. The gently curved, luminescent, greenish walls are clearly the work of the vahnatai.";
	text2 = "Those alien creatures are long gone, but some of their magic must remain. Several translucent specters wander aimlessly in the southeast corner, somehow held to life here.";
	text3 = "They don't appear to notice your presence, but you also haven't gotten close to them.";
	action = SET_SDF 112 0 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(112,1) == 0;
	question = "special";
	text1 = "There are more ruined walls of vahnatai origin here. One of their glowing crystals illuminates the cavern.";
	text2 = "There is a another specter here, sitting cross-legged by the west wall. Looking at it gives you chills. You can feel waves of power radiating off of it. It is the ghost of a vahnatai, staring off into space. It hasn't noticed you. Yet.";
	action = SET_SDF 112 1 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(112,2) == 0;
	question = "special";
	text1 = "You find some abandoned tools and crates by the side of the road. The wagon tracks here are recent ... Mold hasn't had time to grow in them yet.";
	text2 = "You must be getting close to a settlement of some sort.";
	action = SET_SDF 112 2 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This small rat wanders around, hunting for tasty garbage. It sniffs at you and wanders away.";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You see the chieftain of this small tribe. He roars at you, consumed with fury. _Stupid little creature! We had good peace. Peace for you, peace for us._";
	text2 = "_Now you come, you kill my people, you break our things. Now I crush you! You pay for what you do here!_";
	text3 = "He wears several glass globes around his neck, suspended from a gold chain. He begins to delicately finger them.";
	


begintalknode 6; // spellbook
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "When you stare within this crystal, you see movement. Looking closer, you can detect words, strange wispy writing and diagrams, written in light floating inside the stone. Some of it seems to be in your language. Interesting.";
	text2 = "You read the human language, collected by vahnatai and stored in this crystal. It is a powerful chant that can restore strength to a wounded ally. (Your skill with the spell Heal increases.)";
	text3 = "You stare into the crystal a bit more, but you don't learn anything new.";
	text4 = "You stare into the crystal for a while, 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(112,5) == 0) {
			rs(3);
			if (get_stat_total(13) < 8)
				rs(2);
				else {
					rs(4);
					sf(112,5,1);
					alter_stat(30000,69,2);
					}
			}
			else {
				rs(1); rs(2); rs(4);
				}
	break;
//

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Prenvil";
	text1 = "You actually find someone living and friendly out here. A tiny, withered prospector, human, about five feet tall. He is unarmed, but he looks small enough to easily escape into any tunnel he finds.";
	text2 = "He gives you a surprised bow when he sees you. _Hello there, soldier,_ he says _I'm Prenvil. Don't see many of your lot out in the little tunnels._";
	text5 = "Prenvil watches the cave walls while he talks to you. He occasionally raps a stone surface with his knuckle or bends down to taste a trickle of cave water.";
	text6 = "Some people, after long enough in Avernum, get an almost supernatural feel for the way the tunnels turn and twist, rise and fall.";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "What are you doing out here?";
	text1 = "_I'm hunting. Scouting. Looking for the lost route. That is what Commander Rana sent me out here to do. No luck yet. But I'm still trying._";

begintalknode 12;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "The lost route?";
	text1 = "_It's long been said that, somewhere in these tunnels, there's a route back to the surface. Rumors. Other rumors say it existed, but foul old Emperor Hawthorne, or his pet wizard Garzahd, destroyed it._";
	text2 = "_The army is paying me to explore and see if I can find sign of the route. Would come in handy, considering what has been happening._";

begintalknode 13;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Where is Commander Rana?";
	text1 = "He chuckles. _Not supposed to talk about it, but you're near enough. Walk out of this twisty little tunnel and go north, and you'll be in an Avernite fort soon enough. She's in command there._";

begintalknode 14;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Isn't it dangerous out here?";
	text1 = "_Oh, yes. But a student of the lore of the caves can do much to pacify those creatures who might want to attack. You'd do well to remember that._";
	text2 = "_Also, I always stay near a narrow crack I can slip into when I'm being menaced. That does a lot to help me avoid anything not made of slime._";

begintalknode 15;
	state = 10;
	nextstate = 12;
	condition = 1;
	question = "Tell me about these tunnels?";
	text1 = "_Well, this little twist is a dead end. I'm about to go elsewhere. Though you've seen enough of the Western Reaches to know there's not much else to see._";
	text2 = "_This part is mighty interesting, though, because of the vahnatai._";

begintalknode 16;
	state = 12;
	nextstate = 13;
	condition = 1;
	question = "Tell me about them.";
	text1 = "_There was a pack of them hiding out back here, about twenty years ago. The Time of Shades. Filled the tunnels with shades and traps and pylons and all sorts of nastiness._";
	text2 = "_Some soldiers cleared the lot out, but some of the traps remain._";

begintalknode 17;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "Any tips?";
	text1 = "_If you see runes or glowing crystals or shades, keep a fair distance. Unless you're the sort that likes to fight. And it looks like you are._ He chuckles.";


//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "Some ogres have erected a crude stone barrier here. One of them is standing guard. The massive fellow holds a stalagmite in one hand, eager to brain you with it.";
	text2 = "He doesn't attack, though. He says, _Hrah! I Rach!_ Spit flies out when he says his name. _You soldiers, you stay away. We not tame ogres. We have deal with you lot. Stay back, or I let your brain loose!_";
	text5 = "Rach bares his fangs at you and gives his stalagmite a few practice swings. _Hrrar! Rach not want you here! We not tame ogres. You go._";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "What do you mean, 'tame ogres'?";
	text1 = "_You soldiers, you get some ogres to help you dig, buy them with food and pretty things, and you think all ogres dumb slaves. We free ogres. We stay here, you keep out. Is deal!_";
	text2 = "Interesting. Some ogres near here must be working for the Avernite army instead of being killed by them.";
	code =
		if (gf(98,1) > 0)
			rs(2);
	break;
	
begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "What is past this gate?";
	text1 = "_Grrrah! Our land! You stay out! We has deal with soldiers! You stay away, we stay away._";

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Maybe I could trade with you.";
	text1 = "_Trade? We proud clan! We want? We take! Talking to humans just makes us slaves. Like north ogres._ Rach spits out something green and vile to express his disgust.";

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "Ogre, step aside or I will puncture you.";
	text1 = "_Hrrah! You break great peace between proud ogres and wormy little humans and lizards and cats. Alarm! Alarm! Slay the little soldier and eat it!_";
	action = END_TALK;
	code =
		set_attitude(30041,10);
	break;
	
begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I'll be going then.";
	text1 = "Rach nods. _That is right. Ogre mighty and strong. When you gone, we say funny things about how weak and small you are. Haw! Haw! Haw!_ With difficulty, you restrain yourself from doing anything that would result in a fight.";
	action = END_TALK;

//

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