----------------------------------------------------------------------
 * This file is part of Freedroid
 *
 * Freedroid is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Freedroid is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Freedroid; see the file COPYING. If not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 * MA 02111-1307 USA
----------------------------------------------------------------------

If you have questions concerning FreedroidRPG, please send an email to:

freedroid-discussion@lists.sourceforge.net


Beginning of new chat dialog for character="XXXXX"
----------------------------------------------------------------------

<FirstTime LuaCode>
	show(0)
	del_cookie("guard_follow_tux")
	set_bot_state("patrol", "Town-TuxGuard")
	change_obstacle_state("Dixon-autogun", "enabled")
</LuaCode>

<EveryTime LuaCode>
	if (has_cookie("HF-Spencer")) then
		npc_says(_"Red Guard HQ, Spencer speaking.")
		npc_says(_"Are you receiving me?")
		tux_says(_"Yes.")
		tux_says(_"Spencer, we have a problem.")
		npc_says(_"Yes, Richard detected abnormalities with the server. Can you report anything regarding this?")
		tux_says(_"Indeed, the server says it is a gate server, not a firmware server.")
		npc_says(_"Bah!")
		npc_says(_"Must prevent access to the real update server. Can you open the gate?")
		npc_says(_"Inside, follow the mrkers o e groun")
		npc_says(_"Ri ard sa... e c nn cti n *bzzzzzzzzz* bad.")
		npc_says(_"Goo*sizzle*ck.")
		npc_says(_"O*crack*r")
		update_quest(_"Propagating a faulty firmware update", _"Spencer contacted me and said I was supposed to find the real firmware update server. I hope I survive this...")
		add_quest(_"Open Sesame", "It turns out what we thought was the firmware update server was just a gate access server. Spencer speculates the real firmware server is behind this gate. There should be something on the ground I am supposed to follow.")
		end_dialog()
	elseif (has_cookie("tux_has_joined_guard")) then
		npc_says(_"Greetings fellow Red Guard member.")
		hide(2, 12)
	end

	if (has_cookie("Tania_met_Pendragon") and (not has_cookie("Tania-sent-to-Doc")) and (not has_cookie("Tania-set-free"))) then
		show(50)
	end

	if (not has_quest(_"Opening access to MS Office")) and (done_quest(_"A kingdom for a cluster!")) then
		show(37)
	end

	if (not has_quest(_"Propagating a faulty firmware update")) and
	   (done_quest(_"Opening access to MS Office")) then
		show(44)
	end

	if (data_cube_lost and (not done_quest(_"Deliverance"))) then
		show(29)
	end

	show(99)
</LuaCode>
----------------------------------------------------------------------

Nr=0 Text=_"Hi! I'm new here."
<LuaCode>
	npc_says(_"I'm Spencer. I'm the leader of the Red Guard. Is there anything I can help you with?")
	if (has_quest(_"Deliverance") and (not done_quest(_"Deliverance"))) then
		add_cookie("knows_spencer_office")
		show(20)
	end
	hide(0) show(1, 7)
</LuaCode>
----------------------------------------------------------------------

Nr=1 Text=_"I want to join the Red Guard."
<LuaCode>
	npc_says(_"Hmm... Really? Well, you cannot join just like that, you know...", "NO_WAIT")
	npc_says(_"You must prove that you would make a good new member.")
	hide(1) show(2)
</LuaCode>
----------------------------------------------------------------------

Nr=2 Text=_"I really want to become a member."
<LuaCode>
	npc_says(_"This is not so easy. First you must establish a reputation around here. Ask around, talk to people and build your reputation.")
	npc_says(_"Once you're a known character around here, we might let you join the ranks of the Guard.")
	hide(2) show(3, 12)
</LuaCode>
----------------------------------------------------------------------

Nr=3 Text=_"How about some circuits instead?"
<LuaCode>
	npc_says(_"For 15 million circuits, no less, hehe.")
	hide(3, 7, 12) show(4)
</LuaCode>
----------------------------------------------------------------------

Nr=4 Text=_"But I don't have that many circuits!"
<LuaCode>
	npc_says(_"That much I can tell.")
	npc_says(_"Look, I'm just fooling around. We don't let just anyone join the Red Guard.", "NO_WAIT")
	npc_says(_"If you seriously want to join, you have to prove yourself first. You might want to ask around town for things you can do.")
	hide(4) show(7, 12)
</LuaCode>
----------------------------------------------------------------------

Nr=6 Text=_"Maybe I could help somehow?"
<LuaCode>
	npc_says(_"That would be most kind of you, but I doubt that you will be able to clear out the warehouse for us.")
	npc_says(_"But since you are said to be powerful and a former hero, I'll once more put trust into a stranger.")
	npc_says(_"I've unlocked the access-way to the warehouse. It's to the north of this town, somewhat hidden in the woods northeast.")
	npc_says(_"The stuff we need is on the first floor. Don't go any deeper, there are only bots in there.", "NO_WAIT")
	npc_says(_"I wish you the best of luck.")
	add_quest(_"Opening a can of bots...", _"I am supposed to clean out the first level of some warehouse. Sounds easy. It lies nearby, somewhat hidden in the woods north-east of town.")
	change_obstacle_state("AccessDoorToWarehouse", "opened")
	hide(6)
</LuaCode>
----------------------------------------------------------------------

Nr=7 Text=_"How is it going?"
<LuaCode>
	if (has_quest(_"Opening a can of bots...")) then
		if (done_quest(_"Opening a can of bots...")) then
			if (has_cookie("reward_for_warehouse_given")) then
				npc_says(_"Thanks to you, we've been able to transport all the goods we need right now. You've really helped us out there.")
				npc_says(_"Rest assured that we will never forget your brave activity for our community.")
			else
				npc_says(_"Man, you really did it! I can hardly believe it, but all the bots are gone!", "NO_WAIT")
				npc_says(_"Take these 500 circuits as a reward. And be assured that you've earned my deepest respect, Linarian.")
				npc_says(_"Our people are transporting the goods as we speak. It can't be too long until new bots from ships in the orbit of the planet will beam down to replace the dead bots.")
				add_gold(500)
				add_cookie("reward_for_warehouse_given")
				update_quest(_"Opening a can of bots...", _"Ouch. It wasn't. At least I am alive, and the warehouse is clear. *Whew*.")
			end
		else
			npc_says(_"Not too good. Without the supplies from the warehouse we are doomed. So my problems are still the same.")
			npc_says(_"Maybe later, when you grow more experienced you might be able to help us after all.")
		end
	else
		npc_says(_"These are bad times. Interplanetary travel is made impossible by bot ships, so we need to stick to our local resources.")
		npc_says(_"We've got a list of stuff we need from the automated underground storage north of town. But the bots there are numerous.")
		npc_says(_"And currently I can't spare a single man from the town's defenses. It's quite a difficult situation.")
		show(6)
	end
</LuaCode>
----------------------------------------------------------------------

Nr=12 Text=_"Have I done enough quests to become a member now?"
<LuaCode>
	if (not done_quest(_"The yellow toolkit")) then
		npc_says(_"I think our teleporter service man, Dixon, has some problem. You might want to talk to him.")
	else
		if (has_cookie("dixon_angry_250")) then
			npc_says(_"Dixon has his toolkit back.", "NO_WAIT")
			npc_says(_"He was in bad mood and told me he had to pay you for getting his own property back.")
			npc_says(_"I think it is the best for him if we leave him alone the next days.", "NO_WAIT")
			npc_says(_"I'm sure he has to do a lot now.")
			-- Joining the guard, tux has to pay 500 circuits.
		else
			if (has_cookie("dixon_angry_350")) then
				npc_says(_"Dixon has his toolkit back.", "NO_WAIT")
				npc_says(_"He seemed quite aggressive and stressed.")
				npc_says(_"Poor guy, if we weren't in such a bad situation, he could have some work-free days, but bot attacks continue all the time.", "NO_WAIT")
				npc_says(_"You better don't bother him the next days.")
				-- Tux will have to pay 700 circuits to join the red guard
			else
				if (has_cookie("dixon_very_angry")) then
					npc_says(_"Dixon has his toolkit back.", "NO_WAIT")
					npc_says(_"He did rail against you though. He said he had to give you 400 circuits to get his toolkit back, his own property.")
					npc_says(_"That was nearly all money he had. He said you were too greedy to become a good member and he doesn't want to see you anymore.")
					npc_says(_"I think everybody has to get a chance. But look ahead! When you are negatively conspicuous again, we will ban you from our town!")
					-- Tux needs to pay 800 circuits to join the guard.
				else
					npc_says(_"Dixon told me about the matter with his toolkit. He seemed pretty impressed by you.")
				end
			end
		end
	end

	if (done_quest(_"Anything but the army snacks, please!")) then
		npc_says(_"When I was eating, Michelangelo told me about his renewed oven energy supply. He seemed very pleased, and so was I.")
	else
		npc_says(_"I think you should visit the town's cook sometime. He's usually in the restaurant kitchen.")
	end

	if (done_quest(_"Novice Arena")) then
		npc_says(_"From Butch I hear you've become a novice arena master. Congratulations.")
	else
		npc_says(_"You might want to score some arena victories. That could also help your reputation a lot.")
	end

	if (done_quest(_"Bender's problem")) then
		npc_says(_"Helping Bender along was also a smart move. But you should be very careful with that one. He can get mad rather easily. A bit of a security threat, but we can't be too picky.")
	else
		npc_says(_"As far as I know, Bender is still very sick.")
	end

	if (done_quest(_"Opening a can of bots...")) then
		npc_says(_"But most importantly, I was very impressed with you when you cleared out the warehouse. That was a huge deed I will never forget.")
	else
		npc_says(_"Personally I'm also worrying about how we will manage to get some necessary supplies from our warehouse. It's filled with bots and we just don't have the manpower to spare to clean them out.")
	end

-- ARE THERE ENOUGH POINTS TO JOIN RG
	if (get_town_score() > 49) then
		npc_says(_"OK. Your list of achievements is long enough. You can join us. So I hereby declare you a member of the Red Guard.")
		npc_says(_"But now that you are in the Guard, know this: There is only one rule for us guards: We stick together. We survive together or we die together. But we do it together.")
		npc_says(_"And now you might want to inspect the guard house. Tell Tybalt to open the door for you. Lukas at the arms counter will give you your armor.")
		npc_says(_"I hope you will prove yourself a worthy member of the Red Guard.")
		display_big_message(_"Joined Town Guard!!")
		add_cookie("tux_has_joined_guard")
		change_obstacle_state("Main Gate Guardhouse", "opened")
		sell_item("Shotgun shells", 1, "Stone")
		sell_item(".22 LR Ammunition", 1, "Stone")
		hide(3, 12)
	else
		if (get_town_score() > 29) then
			npc_says(_"All in all, not quite so bad. But you still need to do the one thing or the other. Then we can talk about it.")
		else
			npc_says(_"I can't accept you into the guard like this. Get going. There are still many things to do for you.")
		end
	end
</LuaCode>
----------------------------------------------------------------------

Nr=20 Text=_"Francis wanted me to give you a data cube."
<LuaCode>
	npc_says(_"Ah, excellent, the list I asked for.")
	npc_says(_"It figures he would ask someone to deliver it for him.")
	tux_says(_"Why's that?")
	npc_says(_"We had a little disagreement, Francis and I. He refused to accept our rule and do the task we gave him.")
	npc_says(_"I had to persuade him myself.")
	npc_says(_"Well, give me the data cube.")
	if (has_item_backpack("Data cube") > 0) then
		show(21, 22, 25, 26)
	else
		show(23, 25, 26)
	end
	hide(20) 
	topic("Deliver the cube")
</LuaCode>
----------------------------------------------------------------------

Nr=21 Text=_"(Give the data cube to Spencer)" Topic="Deliver the cube"
NO_TEXT
<LuaCode>
	tux_says(_"Take this.")
	del_item_backpack("Data cube", 1)
	npc_says(_"Thank you for the good work you have done. I think you deserve a small reward.")
	add_xp(100)
	add_gold(100)
	end_quest(_"Deliverance", _"I gave Spencer the data cube. He gave me a small reward.")
	data_cube_lost = nil;
	hide(20, 21, 22, 23, 24, 25, 26)
	pop_topic("Deliver the cube")
</LuaCode>
----------------------------------------------------------------------

Nr=22 Text=_"(Lie about the oversight of the data cube)" Topic="Deliver the cube"
NO_TEXT
<LuaCode>
	next(23)
</LuaCode>
----------------------------------------------------------------------

Nr=23 Text=_"(Apologize for the oversight of the data cube)" Topic="Deliver the cube"
NO_TEXT
<LuaCode>
	if (not data_cube_lost) then
		tux_says(_"Oh, erm... Hehe, I think I forgot it somewhere.")
	else
		tux_says(_"Hm, I still don't have the data cube.")
	end
	npc_says(_"... What?")
	npc_says(_"Then you had better go and look for it. Don't waste my time, Linarian.")
	data_cube_lost = true
	hide(21, 22, 23)
	pop_topic("Deliver the cube")
</LuaCode>
----------------------------------------------------------------------

Nr=24 Text=_"(Lie about the loss of the data cube)" Topic="Deliver the cube"
NO_TEXT
<LuaCode>
	tux_says(_"I think I lost the data cube.")
	npc_says(_"Come on, you've got to be kidding! ...")
	npc_says(_"So I will call one minion for this job. You are very useless, unable to bring a small thing.")
	npc_says(_"Get out of my sight!")
	end_quest(_"Deliverance", _"I lied about the data cube and Spencer thinks now I lost the cube. I won a little time for people in cryonic stasis. But, I couldn't stop Spencer's project.")
	add_xp(250)
	hide(21, 22, 23)
	end_dialog()
</LuaCode>
----------------------------------------------------------------------

Nr=25 Text=_"How did you persuade Francis? Did you beat him up?" Topic="Deliver the cube"
<LuaCode>
	npc_says(_"No, nothing so violent. Let's just say I know more about Francis than he would like to remember.")
	npc_says(_"Francis is someone who is very understandable. I just had to find the right words.")
	npc_says(_"Anyway, we have nearly been close friends since.")
	hide(25)
</LuaCode>
----------------------------------------------------------------------

Nr=26 Text=_"Why didn't Francis want to do this task you gave him? What was it?" Topic="Deliver the cube"
<LuaCode>
	npc_says(_"We had an unfortunate misunderstanding, so we had a very hard time talking together.")
	npc_says(_"I wanted him to go through the people in cryonic freezing in the facility, and make a list of disposable ones and people unlikely to survive. This cube contains that list.")
	tux_says(_"Disposable people? Unlikely to survive? Can't they just stay in cryonics indefinitely?")
	npc_says(_"No. They take up a lot of space, and keeping them alive takes a lot of power, which is running out. Most of the people there are sick or dying anyway, which is why they're frozen in the first place. We can't afford to waste any resources.")
	npc_says(_"We even had to confiscate the town cook's macrowave oven battery, which means we can't eat warm food anymore. We needed it to keep the town's defenses up.")
	update_quest(_"Deliverance", _"I learn incredible information. Apparently the data cube stored a list of people in freezing in the cryonic facility. Spencer wants to dispose of some of them because keeping them alive uses up the town's power...")
	hide(26) show(24)
</LuaCode>
----------------------------------------------------------------------

Nr=29 Text=_"I would like to talk about the Francis' cube."
<LuaCode>
	npc_says(_"Well, I'm listening to you. But you must be quickly, I've no time to loose.")
	npc_says(_"If you found the data cube, just give it.")
	if (has_item_backpack("Data cube") > 0) then
		show(21, 22)
	else
		show(23)
	end
	hide(29)
	topic("Deliver the cube")
</LuaCode>
----------------------------------------------------------------------

Nr=37 Text=_"I've heard Richard obtained new information on the town."
<LuaCode>
	npc_says(_"Yes, that's right, and in fact it might be crucial. As you may have heard, the MS office is defended by a disruptor shield. They open it only to let out new armies of bots.")
	npc_says(_"The data on the cube he obtained indicates the existence of a secret experimental facility in this region. Our findings suggest that they were testing some new form of disruptor shield for MS, so the shield can be controlled from that facility.")
	npc_says(_"If the information is true, then you can take over the control droid and disable the shield permanently so we can get in.")
	npc_says(_"We know that MS had a firmware update system, which could be used to propagate a malicious update to disable all bots. It is very alluring, but to perform this trick you need to hack the control droid, which is in the heart of the HF. To enter HF you would have to disable the disruptor shield.")
	npc_says(_"This seems like a gift sent from the heavens. Cleaning the Hell Fortress is not going to be easy, though..")
	hide(37) show(38)
</LuaCode>
----------------------------------------------------------------------

Nr=38 Text=_"I'd like to participate in this operation."
<LuaCode>
	npc_says(_"That's most kind of you to volunteer. So far, I've sent two scouts into the area. They have found the facility entrance and unlocked the gate.")
	npc_says(_"That is a good sign, because it shows that the key combinations from the data cube were correct.")
	npc_says(_"However, we lost contact with them shortly after they went inside. They also reported heavy bot resistance.")
	npc_says(_"I'd be glad if you could take a look. But use the utmost care. We can't afford to lose another guard.")
	hide(38) show(39, 40)
</LuaCode>
----------------------------------------------------------------------

Nr=39 Text=_"OK. I'll be careful. But I'll do it."
<LuaCode>
	npc_says(_"Good. The base entrance is somewhat hidden in the caves to the northeast. Best to use the north gate out of town, then head east, and turn north again along the shore.")
	npc_says(_"I wish you the best of luck for this operation. It might be that our survival depends on it. Don't wait for assistance.")
	npc_says(_"Try to get control over the disruptor shield if you can. The control droid should be somewhere on the lowest level of the installation. Simply destroying the droid might suffice in disabling the shield.")
	add_quest(_"Opening access to MS Office", _"Spencer has revealed the information from the data cube evaluation to me. It seems there is an old military research facility north of the town. By taking over the control droid, I should be able to control the disruptor shield at the facility. I could activate it permanently, thereby locking off the Hell Fortress, and the bots it's producing, forever. Alternatively, I could disable it, and fight my way through the Hell Fortress droids until I reach the main control droid and update it, thereby disabling all bots in the entire area around town in one fell swoop.")
	change_obstacle_state("DisruptorShieldBaseGate", "opened")
	hide(39, 40)
</LuaCode>
----------------------------------------------------------------------

Nr=40 Text=_"I don't feel like doing it now. I'd rather prepare some more."
<LuaCode>
	npc_says(_"Good. You should be well prepared if you intend to go.")
	npc_says(_"Also there is no need to hurry with this. After all, the installation is not running away, so it's best to take a cautious approach.")
	hide(40)
</LuaCode>
----------------------------------------------------------------------

Nr=44 Text=_"It's done. Your soldiers were killed, but I managed to reach a computer terminal that controls the shield. Access to the bot factory is now open, after I changed the password on the terminal so as to prevent the bots from enabling the shield again."
<LuaCode>
	npc_says(_"Good. We cannot help you much in this final mission, but I can tell you what our recon teams gathered behind the factory doors. You will enter a zone that used to be a MS office.")
	npc_says(_"They carried out some development there, and had part of their patching division and update management department. The actual factory is located behind the office.")
	npc_says(_"With a bit of luck, you might not need to access it. We know they have their update server in the office.")
	npc_says(_"If you can find it and get it to propagate a faulty update, this could suffice to stopping bots dead in their tracks.")
	npc_says(_"Look for the entrance of the office in the crystal fields. I will send a message to the guards so they let you pass. Then you will be on your own.", "NO_WAIT")
	npc_says(_"However I'll ask Richard to see if we can contact you as soon as you find the server so we know if you're alive and there is still hope, or if things are going to go back to the way they were before you were taken out of stasis sleep...")
	npc_says(_"Good luck.")
	add_quest(_"Propagating a faulty firmware update", _"I can now enter the fortress and find the upgrade server terminal. The fortress gates are in the Crystal Fields. Spencer told the guards to open the doors for me. He said he'd probably contact me when I found the server.")
	hide(44) show(45)
</LuaCode>
----------------------------------------------------------------------

Nr=45 Text=_"I will need some time to get myself ready before I clean up Hell Fortress."
<LuaCode>
	npc_says(_"You had better be ready.")
</LuaCode>
----------------------------------------------------------------------

Nr=50 Text=_"I found someone out in the desert."
<LuaCode>
	npc_says(_"Great, another mouth to feed.")
	npc_says(_"What is this person's name?")
	hide(50) show(51)
</LuaCode>
----------------------------------------------------------------------

Nr=51 Text=_"Tania"
<LuaCode>
	if (has_cookie("tux_has_joined_guard")) then
		npc_says(_"Well, since you are a guard member, I'll let you vouch for this Tania person.")
	else
		npc_says(_"Well, we have enough food for now. I'll let this Tania person in.")
	end

	if (npc_dead("DocMoore")) then
		npc_says(_"I'd say you should take her straight away to Doc Moore, but he was found dead earlier.")
		npc_says(_"You wouldn't happen to know anything about that, would you?")
		if (has_cookie("killed_docmoore")) then
			show(53)
		end
		show(52, 54)
	else
		npc_says(_"You must take her straight away to Doc Moore. We can't have a disease breaking out.")
		add_cookie("Tania-sent-to-Doc")
		update_quest(_"Tania's Escape", _"Spencer said it was okay for Tania to enter the town, as long as she goes to see Doc Moore first thing. Now all I have to do is tell her and Pendragon.")
	end
	hide(51)
</LuaCode>
----------------------------------------------------------------------

Nr=52 Text=_"No, of course not."
<LuaCode>
	npc_says(_"Good.")
	npc_says(_"I didn't think it was you, but you never know.")
	npc_says(_"About your friend, she can come in provided that she pulls her weight around here.")
	add_cookie("Tania-set-free")
	if (has_cookie("killed_docmoore")) then
		update_quest(_"Tania's Escape", _"When I asked about Tania entering the town, Spencer confronted me about Doc Moore's death. I denied everything and he bought it! He says it is OK for Tania to enter the town: I should tell her and Pendragon.")
	else
		update_quest(_"Tania's Escape", _"When I asked about Tania entering the town, Spencer said Doc Moore was found dead! Oh, and Tania can enter the town. I should go tell her that.")
	end
	hide(52, 53, 54)
</LuaCode>
----------------------------------------------------------------------

Nr=53 Text=_"He and I had a disagreement, which we settled."
<LuaCode>
	npc_says(_"I am the law here. If you have a problem, you come to me.")
	if (has_cookie("tux_has_joined_guard")) then
		npc_says(_"I'm going to strip you of your membership in the Red Guard.")
		del_cookie("tux_has_joined_guard")
		change_obstacle_state("Main Gate Guardhouse", "closed")
		npc_says(_"Your friend can come in, but we will be watching the two of you closely.")
		add_cookie("Tania-set-free")
		update_quest(_"Tania's Escape", _"When I asked about Tania entering the town, Spencer confronted me about Doc Moore's death. I told him the truth, and he kicked me out of the Red Guard. But he let Tania in, Now all I have to do is tell her and Pendragon.")
	else
		npc_says(_"As the law, I pronounce you GUILTY of MURDER.")
		npc_says(_"The punishment is death.")
		update_quest(_"Tania's Escape", _"When I asked about Tania entering the town, Spencer confronted me about Doc Moore's death. He found me guilty of murder, and sentenced me to death.")
		set_faction_state("redguard", "hostile")
		end_dialog()
	end
	hide(52, 53, 54)
</LuaCode>
----------------------------------------------------------------------

Nr=54 Text=_"I killed him just to see what it was like. It was awesome."
<LuaCode>
	npc_says(_"You are a sociopath, and a danger to us all!")
	npc_says(_"We must stop you before you kill again.")
	update_quest(_"Tania's Escape", _"When I asked about Tania entering the town, Spencer confronted me about Doc Moore's death. He found me too dangerous to live.")
	set_faction_state("redguard", "hostile")
	end_dialog()
	hide(52, 53, 54)
</LuaCode>
----------------------------------------------------------------------

Nr=99 Text=_"I'll be going then."
<LuaCode>
	npc_says(_"See you later.")
	end_dialog()
</LuaCode>
----------------------------------------------------------------------

End of chat dialog for character="XXXXX"
