// TOWN DIALOGUE SCRIPT
// 	Town 15: Khar-Grav

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;

// *** Hidden Ghost ***

begintalknode 1;
	state = -1;
	personality = 150;
	nextstate = 1;
	condition = 1;
	question = "Hidden Ghost";
	text1 = "A slith ghost hides in this secret passage, shaking and clawing at its ethereal body. It looks very upset.";
	text5 = "The ghost waits for your next question.";
	action = INTRO;
	
begintalknode 2;
	state = 1;
	personality = 150;
	nextstate = 2;
	condition = 1;
	question = "What is wrong?";
	text1 = "_Thank the gods you have come!_ it hisses, ignoring your question. _Tell me: have you freed the mining ghosts to the southeast yet?_";

begintalknode 3;
	state = 2;
	personality = 150;
	nextstate = -1;
	condition = get_flag(13,6) == 0;
	question = "No.";
	text1 = "_Then listen carefully. You are here to defeat Nolagh-Khar, correct?_ You nod. _We can help you, if you help us. We are strong when we are not wearing chains. This is what you must do._";
	text2 = "_Near the mine entrance, you will find a bridge over the river where you can cross. Cross and follow the river upstream to the east until you arrive in a room filled with machinery. That is an important room. The demons guard it carefully._";
	text3 = "_Create some sort of diversion to draw attention there, and then run out of that room as fast as you can. Go to the mine center and kill the haakai still guarding the slith ghosts. Do it quickly. You will not have much time._";
	text4 = "_Once the ghosts are free, they will help you. Go now. Free my people._";
	code =
	set_flag(15,17,1);
	end();
break;

begintalknode 4;
	state = 2;
	personality = 150;
	nextstate = -1;
	condition = get_flag(13,6) == 1;
	question = "Yes.";
	text1 = "_Good! Now I may rejoin them. You have done a good deed today. All of Bahssikava thanks you._ The ghost disappears.";
	code =
	award_party_xp(50,50);
	set_flag(15,25,1);
	erase_char(30);
	end();
break;

// *** Nothass ***

begintalknode 5;
	state = -1;
	personality = 151;
	nextstate = 3;
	condition = 1;
	question = "Nothass";
	text1 = "The ghost is an imposing figure, taller than most sliths you've ever met. He beckons you forward. _We must speak,_ he says in a soft, sibilant voice. _My name is Nothass._";

begintalknode 6;
	state = 3;
	personality = 151;
	nextstate = 4;
	condition = 1;
	question = "Who are you?";
	text1 = "_I was a servant in the mansion of our leader, Mayor Balenar. Since our deaths, I have been a slave to the demon king, Nolagh-Khar, at least until I was freed._";

begintalknode 7;
	state = 4;
	personality = 151;
	nextstate = 5;
	condition = 1;
	question = "Freed?";
	text1 = "_Our leader, Voss, managed it somehow. He has freed a number of us from servitude at the hands of the demons. It does not matter. Our freedom is only a temporary reprieve unless you defeat the demon lord.";
	text2 = "_I know you are here to fight Nolagh-Khar, and I will help you as much as I can, but I am afraid that is not much. I can tell you that the eldest son in this house was training to be a warrior, and you can find some potions in his room.";
	text3 = "_I know also that a large number of slith spirits are kept in a large crystal south of here. It is heavily guarded, and it has a magical system to prevent meddling by anyone who is not authorized, but I think there are holes in its protection.";
	text4 = "_That is all the help I can give. I must go now and deal with events in the western mines. Good luck. We are all depending on you._";
	code =
	if (get_flag(14,21))
		remove_string(3);
	set_flag(15,28,1);
	erase_char(65);
	end();
break;

// *** Phaedra identification ***

begintalknode 198;
	state = -1;
	personality = 250;
	nextstate = 99;
	condition = 1;
	question = "Phaedra";
	text1 = "You ask Phaedra if she can identify your items for you. _I sure can,_ she replies, grinning.";

begintalknode 199;
	state = 99;
	personality = 250;
	nextstate = -1;
	condition = 1;
	question = "Please do, then.";
	text1 = "_Sure thing. Only 5 coins per item._ She flashes you another grin,  daring you to ask why she is charging you. You don't.";
	action = ID 5;