// dialog script for town 13: Tel dakrach.

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	personality = 44;
	nextstate = 1;
	condition = 1;
	question = "Dakrach's spirit";
	text1 = "This is the shade who came to you in the big hall where the sceptres were. He's actually very beautiful. He sits in front of his tomb and looks at you.";
	text3 = "The shade is still here. When he sees you, he comes flying towards you: _Have you done the ceremony already?_";
	code =
		if (get_flag(13,5) == 0)
				remove_string(3);
				
		if (get_flag(13,5) == 1)
				remove_string(1);
				
		if (get_flag(13,5) == 2)
				remove_string(3);
	break;
	
begintalknode 2;
	state = 1;
	personality = 44;
	nextstate = 2;
	condition = get_flag(13,5) <= 1;
	question = "We come for information on your ceremony.";
	text1 = "He winks from time to time. It seems also spirits can have a tick. _Its a dangerous trip to the place where you have to do it. You may not get out of there alive (or at least, that's what I heard)._";
	text2 = "_If you don't succeed, you'll never get out of this crypt. If you leave without doing the ceremony, I'll curse you forever._";

begintalknode 3;
	state = 2;
	personality = 44;
	nextstate = -1;
	condition = 1;
	question = "How do we know where the ceremony takes place?";
	text1 = "_You get there via a gate in this crypt. Its in the northern corner of the crypt. Its open from now..._ You hear a clanking sound of opening gates. _...on.";
	text2 = "_Go. I'll wait here._";
	code = 
		toggle_quest(6,1);
		set_flag(13,5,1);
		flip_terrain(6,3);
	break;

begintalknode 4;
	state = 1;
	personality = 44;
	nextstate = -1;
	condition = get_flag(14,0) == 0 && get_flag(13,5) == 1;
	question = "No, sorry, we didn't do it yet.";
	text1 = "_Then why are you wasting my time! Go do the ceremony, or else..._ He produces a somewhat not scary face. When he realises this and sees you are not scared, he says: _Now go. You're wasting my time._";
	action = END_TALK;

begintalknode 5;
	state = 1;
	personality = 44;
	nextstate = 3;
	condition = get_flag(14,0) > 0 && get_flag(13,5) == 1;
	question = "We did you ceremony. Can we go now?";
	text1 = "_Yes. Now you may go. However, before you go, could you perhaps tell me about life outside?";
	code =
		award_party_xp(30,12);
		toggle_quest(6,0);
		set_flag(13,5,2);
	break;

begintalknode 6;
	state = 3;
	personality = 44;
	nextstate = 4;
	condition = 1;
	question = "Life outside?";
	text1 = "Yeah, you know, the birds, and the flowers. Outside as in _your world._ I'm locked up in this godforsaken place all day. I never see the sunshine.";

begintalknode 7;
	state = 4;
	personality = 44;
	nextstate = 5;
	condition = get_flag(13,5) == 2;
	question = "(Tell him about 'life outside.')";
	text1 = "The spirit listens carefully. He clearly is very interested in your story. When you are finished, he thanks you.";
	text2 = "_Thank you. It is long ago that I saw the sun._ The spirit think for a moment. _I might go out for a bit some other time, you know._ The spirit nods. _You may go now, if you wish._";

begintalknode 8;
	state = 5;
	personality = 44;
	nextstate = 6;
	condition = 1;
	question = "Can we know, by the way, how you died?";
	text1 = "_What?_ The spirit seems truly perplexed by this question. _Well, of course, if you want to..._";

begintalknode 9;
	state = 6;
	personality = 44;
	nextstate = 7;
	condition = 1;
	question = "We asked so, didn't we? Now tell the story.";
	text1 = "_Yeah yeah, coming there. A long time ago, I was a knight. Not just any knight, no. I was quite famous, and people seemed to like me. However, when I had taken the sceptres you stole from me, I was cursed._";
	text2 = "You nod. Being cursed is a logical explanation. The spirit continues: _That curse was quite deadly, in hindsight. I was dead in less than a week._";

begintalknode 10;
	state = 3;
	personality = 44;
	nextstate = -1;
	condition = 1;
	question = "Maybe an other time, sorry. We are sort of... busy.";
	text1 = "_Well, I see you sometime else then._ The spirit waits for to leave.";
	action = END_TALK;

begintalknode 11;
	state = 7;
	personality = 44;
	nextstate = -1;
	condition = 1;
	question = "But didn't anybody do anything about that curse?";
	text1 = "_My family was devastated of course, but I wouldn't let them get a mage or priest. I thought it was all alright. It wasn't._ You thank him for this short story and  leave.";
	action = END_TALK;