begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = 1;
	question = "Baldev";
	text1 = "The tiger here has darker skin than others you have seen.  He shows age, but simultaneously, he shows what would be interpreted as sagacity in a human being.";
	text2 = "Equally surprising is the fact that he is docile and staring at you without the slightest implication that he would rather see your blood on his fangs.";
	text3 = "_Ah...  Humans.  I presume, then, that you aren't with the ogrish brutes who dwell down here?  Greetings, then.  My name is Baldev._";
	text4 = "He spoke!  With a low-pitched, feline growl, he actually formed a coherent sentence.  He seems apt to speak with you.";
	text5 = "Baldev shakes his mane out of what you can only construe to be boredom.";
	text6 = "_Humans, still?  Is there any way I can help you, or vice-versa?_";
	action = INTRO;

begintalknode 2;
	state = 1;
	nextstate = 1;
	condition = get_flag(7,0) == 0;
	question = "You can talk!";
	text1 = "He nods.  _You are quite observant.  I can speak as much or as little as I please._";
	text2 = "_Most tigers, they too can speak.  Few, however, can speak in your tongue.  I would not mind chatting with you, but I have little to speak of here._";
	text3 = "He pauses, moves his head from side to side, and then raises an eyebrow.  _Do me a favor, humans...  Please tell me what your business is here._";
	text4 = "He pauses, moves his head from side to side, and then raises an eyebrow.  _Do me a favor, human...  Please tell me what your business is here._";
	code = 
		if(party_size() > 1)
			remove_string(4);
		if(party_size() == 1)
			remove_string(3);
		set_flag(7,0,1);
	break;

begintalknode 3;
	state = 1;
	nextstate = 1;
	condition = get_flag(7,0) == 1;
	question = "(Explain to him your situation.)";
	text1 = "You tell him that you are Specialists sent here on behalf of Leader, to demoralize the Bugbears.";
	text1 = "You tell him that you are a Specialist sent here on behalf of Leader, to demoralize the Bugbears.";
	text3 = "He backs off in what seems to be disbelief.  _Leader?  Of the North?  And you are his vaunted Specialists!  I am...  ...surprised that he would send his best soldiers to do such a menial task as this.  How...  ...curious._";
	text4 = "He backs off in what seems to be disbelief.  _Leader?  Of the North?  And you are his vaunted Specialist!  I am...  ...surprised that he would send his best soldier to do such a menial task as this.  How...  ...curious._";
	code = 
		if(party_size() > 1){
			remove_string(2);
			remove_string(4);
		}
		else{
			remove_string(1);
			remove_string(3);
		}

		set_flag(63,2,2);
		set_flag(7,0,2);
	break;

begintalknode 4;
	state = 1;
	nextstate = 1;
	condition = get_flag(7,0) == 1;
	question = "(Lie about your situation)";
	text1 = "You tell him that you are adventurers searching for the hidden treasures of the Bugbears.";
	text2 = "His chest heaves lightly and he smiles.  _Ah, the agents of selfish slaughter and radical social change...  Impressive, that you have gotten this far._";
	text3 = "_Well, thanks for sating my curiosity, at any rate._";
	code = 
		set_flag(63,2,1);
		set_flag(7,0,2);
	break;

begintalknode 5;
	state = 1;
	nextstate = 1;
	condition = get_flag(8,0) == 0;
	question = "How long have you been here?";
	text1 = "He growls angrily.  _Grr, I have been imprisoned here ever since those ogreish slime-balls found my pack on the hunt two months ago._";
	text2 = "_There were eight of us, which almost always guarantees safety.  We tigers hunt wisely.  Unfortunately, while wandering through the forest, we stumbled upon a ritual in progress._";
	code = 
		set_flag(8,0,1);
	break;

begintalknode 6;
	state = 1;
	nextstate = 1;
	condition = get_flag(8,0) == 1;
	question = "What was the ritual?";
	text1 = "_The ritual was a throng of Bugbears standing outside of their walls, dancing around a black, demonic statue.  It was bizarre, and some of my fellows were curious enough to investigate._";
	text2 = "_I have honor.  I was leading the hunt, and I had vowed to protect those who served under me.  When the bugbears noticed my fellows, I leapt into the fray._";
	text3 = "_Alas, the ritual at that point had already been completed._";
	code = 
		set_flag(8,0,2);
	break;

begintalknode 7;
	state = 1;
	nextstate = 1;
	condition = get_flag(8,0) == 2;
	question = "What happened thereafter?";
	text1 = "_The statue...  It was horrible!  It grew wings, and began shooting horrible beams at my fellows.  Beams of darkness, beams of fire, beams of lightning...  There was no end to it._";
	text2 = "_I cannot remember particularly well what happened, I only remember seeing my comrades dying in my midst.  I was clubbed unconscious by a Bugbear warrior who had crept up behind me in my confusion._";
	text3 = "_The next morning, I woke up in a room, lying on a rune.  It was their experimentation chamber._";
	code = 
		set_flag(8,0,3);
	break;

begintalknode 8;
	state = 1;
	nextstate = 1;
	condition = get_flag(8,0) == 3;
	question = "What did they do to you?";
	text1 = "_The Bugbear mage, who with his shamans had led the ritual, pressed a button on a control panel as I awoke.  A shining, white beam shot forth from the control panel to me as I laid half-comatose._";
	text2 = "_The beam attempted to warp my mind, to the point where I would regard the inhumane curs who apprehended me as my fellows.  The more I fell into their trance, the more I became disgusted._";
	text3 = "_I resisted.  The Bugbear mage must have noticed, for as I pushed back, he stopped the beam.  I would have attacked them at that very moment, were they not too high for me to reach._";
	text4 = "_I was led back into my cell, where I have been ever since._";
	code = 
		set_flag(8,0,4);
	break;

begintalknode 9;
	state = 1;
	nextstate = 1;
	condition = get_flag(8,0) == 4;
	question = "Have they been feeding you?";
	text1 = "_Yes, albeit not well.  I hunger, even if I do not starve.  Every so often, the Bugbear mage meanders up to the same platform and presses a button.  Marginally edible food appears in my cell afterwards._";
	text2 = "_Oh, but I constantly hunger for the meat of a doe or hare.  True meat on my fangs and other delightful thoughts constantly roam my mind..._";
	text3 = "He pauses.  _Humans!  If you wouldn't mind, do me a favor._";
	code = 
		set_flag(8,0,5);
	break;

begintalknode 10;
	state = 1;
	nextstate = 1;
	condition = get_flag(8,0) == 5;
	question = "How might we help you?";
	text1 = "_Isn't it obvious?  Help me escape!  I would be indebted to you, were you to help me flee this wretched place._";
	text2 = "_I know not how to escape, but I suspect that it has to do with the levers on the other side of my cage.  If you could operate them, I could then follow you out of these caverns._";
	text3 = "_I am wealthy among my tribe, and tigers always keep their promises.  Help me escape, and I promise to repay you somehow._";
	code = 
		set_flag(8,0,6);
	break;

begintalknode 11;
	state = 1;
	nextstate = 1;
	condition = get_flag(8,0) == 6 && get_terrain(57,10) == 67;
	question = "You are free.  Join us if you want to.";
	text1 = "Baldev nods.  _So, you finally found a way to free me?_";
	text2 = "He smiles deviously.  _Excellent.  Now, I may finally bathe in the warm glow of the sun once more.  Let us waste no time in escaping._";
	text3 = "(Baldev has joined your party.)";
	action = END_TALK;
	code = 
		set_flag(62,2,2);
		add_char_to_party(81);
	break;

begintalknode 12;
	state = 1;
	nextstate = 1;
	condition = get_flag(8,0) == 6 && get_terrain(57,10) == 63;
	question = "You are still captive, but we will continue trying to free you.";
	text1 = "_Godspeed, then.  Remember, I can make it in your best interest to end my imprisonment._";