// TOWN DIALOGUE SCRIPT
//    Town 5: Pergamos, part 5

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

begintalkscript;

variables;

short val, choice;
string valline;

// *** Angus ***
begintalknode 1;
	state = -1;
	personality = 56;
	nextstate = 2;
	condition = 1;
	question = "Angus";
	text1 = "A dirty, smelly man wearing robes is working in the dump.  You wonder how he can survive without a mask.";
	text2 = "He seems to be beating on rodents with the stick he's carrying.";
	text3 = "He waves as he spots you and smiles.  _Hello, I'm Angus._ he says.";
	text4 = "_Are you looking for me?_";
	text5 = "Angus stops beating on small animals as you approach.";
	text6 = "_Howdy once again._ he says as he hacks up a loogie and spits it towards a small, furry creature.";
	action = INTRO;

begintalknode 2;
	state = 2;
	personality = 56;
	nextstate = -1;
	condition = 1;
	question = "What do you do?";
	text1 = "_Awww shucks, I guess I process the garbage delivered here from Pergamos._ he replies.";
	text2 = "_Sometimes there's good stuff in what's dumped._ Angus adds.";
	text3 = "He lowers his voice _Sometimes there's secret stuff._";
	code =
		set_flag(5, 2, 1);
	break;

begintalknode 3;
	state = 2;
	personality = 56;
	nextstate = -1;
	condition = (get_flag(5, 2) > 0);
	question = "What kind of secret stuff?";
	text1 = "_Well, you know, notes, messages and stuff like that._ Angus answers.";
	text2 = "_Some of it is probably embarrassing to the people who wrote it._";
	text3 = "_Most I burn so it doesn't hurt people._ he says.";
	code =
		set_flag(5, 2, 0);
	break;

begintalknode 4;
	state = 2;
	personality = 56;
	nextstate = 7;
	condition = ((get_flag(50, 9) > 0) && (get_flag(50, 10) == 0));
	question = "Have you found a note with a number?";
	text1 = "Angus looks surprised _Why certainly, its a good thing you asked because I was just about to burn it._";
	text2 = "_Do you want it, it can't hurt nobody since there's nothing secret in it?_";

begintalknode 5;
	state = 2;
	personality = 56;
	nextstate = 7;
	condition = (get_flag(50, 10) > 0);
	question = "Do you have another copy of the note you gave me earlier?";
	text1 = "Angus looks stumped _No, but I think I can remember it._";
	text2 = "_Do you want me to tell you?_";

begintalknode 6;
	state = 2;
	personality = 56;
	nextstate = -1;
	condition = 1;
	question = "Goodbye.";
	text1 = "_Bye._ Angus says as he takes a swipe at another small rodent.";
	text2 = "_See ya around._";
	action = END_TALK;

begintalknode 7;
	state = 7;
	personality = 56;
	nextstate = -1;
	condition = (get_flag(50, 10) == 0);
	question = "Yes, I'd like the number.";
	text1 = "Angus shuffles around in his pockets and finally pulls out a tattered note.";
	text2 = "_Here it is._ he says as he gives it to you.";
	action = END_TALK;
	code =
		set_flag(50, 10, 1);
		reward_give(457);
		award_party_xp(200, 30);
	break;

begintalknode 8;
	state = 7;
	personality = 56;
	nextstate = -1;
	condition = (get_flag(50, 10) == 0);
	question = "No, don't need it now.";
	text1 = "Angus says _OK, I'll keep it for you if you end up needing it later_.";
	action = END_TALK;

begintalknode 9;
	state = 7;
	personality = 56;
	nextstate = -1;
	condition = (get_flag(50, 10) > 0);
	question = "Yes, let me know.";
	text1 = "Angus answers your question before getting back to work.";
	action = END_TALK;
	code =
		val = get_flag(50, 3);
		clear_buffer();
		append_string("'The number was ");
		append_number(val);
		append_string(".'");
		get_buffer_text(valline);
		reset_dialog();
		add_dialog_str(0, "Angus pauses then says:", 0);
		add_dialog_str(1, valline, 20);
		add_dialog_str(2, "'But golly gee, I'm not real sure.' he adds.", 0);
		add_dialog_choice(0, "Ok");
		choice = run_dialog(1);		
	break;

begintalknode 10;
	state = 7;
	personality = 56;
	nextstate = -1;
	condition = (get_flag(50, 10) > 0);
	question = "No, I think I know it myself.";
	text1 = "_Well, let me know if you end up needing it._ Angus says.";
	text2 = "He turns and starts sifting through a pile of garbage behind him.";
	action = END_TALK;
