/
com/planet_ink/coffee_mud/Abilities/Common/
com/planet_ink/coffee_mud/Abilities/Diseases/
com/planet_ink/coffee_mud/Abilities/Druid/
com/planet_ink/coffee_mud/Abilities/Fighter/
com/planet_ink/coffee_mud/Abilities/Languages/
com/planet_ink/coffee_mud/Abilities/Misc/
com/planet_ink/coffee_mud/Abilities/Prayers/
com/planet_ink/coffee_mud/Abilities/Properties/
com/planet_ink/coffee_mud/Abilities/Skills/
com/planet_ink/coffee_mud/Abilities/Songs/
com/planet_ink/coffee_mud/Abilities/Specializations/
com/planet_ink/coffee_mud/Abilities/Spells/
com/planet_ink/coffee_mud/Abilities/Thief/
com/planet_ink/coffee_mud/Abilities/Traps/
com/planet_ink/coffee_mud/Behaviors/
com/planet_ink/coffee_mud/CharClasses/
com/planet_ink/coffee_mud/CharClasses/interfaces/
com/planet_ink/coffee_mud/Commands/
com/planet_ink/coffee_mud/Commands/interfaces/
com/planet_ink/coffee_mud/Common/
com/planet_ink/coffee_mud/Common/interfaces/
com/planet_ink/coffee_mud/Exits/interfaces/
com/planet_ink/coffee_mud/Items/Armor/
com/planet_ink/coffee_mud/Items/Basic/
com/planet_ink/coffee_mud/Items/BasicTech/
com/planet_ink/coffee_mud/Items/CompTech/
com/planet_ink/coffee_mud/Items/MiscMagic/
com/planet_ink/coffee_mud/Items/Weapons/
com/planet_ink/coffee_mud/Items/interfaces/
com/planet_ink/coffee_mud/Libraries/
com/planet_ink/coffee_mud/Libraries/interfaces/
com/planet_ink/coffee_mud/Locales/
com/planet_ink/coffee_mud/MOBS/
com/planet_ink/coffee_mud/Races/
com/planet_ink/coffee_mud/Races/interfaces/
com/planet_ink/coffee_mud/WebMacros/
com/planet_ink/coffee_mud/WebMacros/interfaces/
com/planet_ink/coffee_mud/core/
com/planet_ink/coffee_mud/core/collections/
com/planet_ink/coffee_mud/core/interfaces/
com/planet_ink/coffee_mud/core/intermud/
com/planet_ink/coffee_mud/core/intermud/i3/
com/planet_ink/coffee_web/server/
com/planet_ink/siplet/applet/
lib/
resources/factions/
resources/fakedb/
resources/progs/autoplayer/
resources/quests/holidays/
web/
web/admin.templates/
web/admin/grinder/
web/admin/images/
web/clan.templates/
web/pub.templates/
web/pub/images/mxp/
web/pub/sounds/
web/pub/textedit/
#!QUESTMAKER_START_SCRIPT Competitive Mystery #1
#A 3-Level mystery where players must question existing mobs from your world to
#discover WHO did something, what ITEM they did it with, and what their MOTIVE was.
#The victim and quest-announcer/manager are also existing mobs, and the victim
#may optionally start off dead.  The suspects and items are CREATED by you.
#
#!QUESTMAKER_PAGE Quest Name/Duration
#Enter the unique name and starting time/duration for your new quest.
#Times are entered as a simple number or math expression to denote a
#time in default ticks (4 second period), or you may follow the expression 
#with the word seconds, minutes, hours, days, mudhours, muddays, mudweeks,
#mudmonths, or mudyears.  Time expressions may include numbers, math 
#symbols, or the ? operator to generate random numbers.  Example:
#"5 + 3?10 minutes" would generate a frequency of 8-15 minutes.#
#
#Quest ID:
#Enter a unique name/id for your quest:
#$QUEST_ID=$UNIQUE_QUEST_NAME=competitive_mystery_1
#
#Quest Name:
#Enter a friendly displayable name for your quest:
#$QUEST_NAME=$STRING=Competitive Mystery #1
#
#Quest Frequency:
#This is the time between quest starts.
#$FREQUENCY=$TIMEEXPRESSION=90 minutes
#
#Quest Duration:
#This is how long your quest remains running, and how long a player 
#accepting the quest has to complete the quest and report back in.
#$DURATION=$TIMEEXPRESSION=90 minutes
#
#Quest-Player Criterium:
#You may leave this entry blank, or enter a Zapper Mask to describe what
#kinds of players may participate in this quest.  You can use this to set
#race, level, or other requirements.
#$QUEST_CRITERIA=$ZAPPERMASK
#
#!QUESTMAKER_PAGE Specify the Announcer
#The Announcer is the mob who will be announcing the quest initially. This must
#be an existing mob in your world.  They will announce the quest to players
#once, and then mark whether the player says they accept the quest.  The player
#will then return to the announcer to make their guesses on WHO did the thing,
#WHAT they did it with, and what their MOTIVE was.  If the guesses are correct,
#the announcer will optionally reward the player.
#
#Announcer Area/Room: 
#Specify below the name of the area that your Announcer mob will be located
#in and/or the room in which the mob can be found.  You may leave both blank
#to force the quest manager to find the mob somewhere in the world, but this
#will hurt the performance of your mud, so use with care.
#Use double-quotes around multi-word areas and room ids/names.
#  
#Announcer Area:
#$ANNOUNCER_AREA=($AREA)
#Announcer Room ID:
#$ANNOUNCER_ROOM=($ROOMID)
#
#Announcer mob name: 
#Specify the name of the mob who will act as the Announcer mob.  
#Use double-quotes around multi-word names.
#If you specified an area or room above, then the mob must be located there.
#You may optionally have the quest manager select a 'random' mob by entering
#a mob name of ANY, or ANY MASK= followed by a Zapper Mask (see help on 
#ZAPPERMASKS for information on zapper mask syntax).
#Remember, if the quest manager can not find your mob, the quest will not
#be started.
#$ANNOUNCER_NAME=$NAME
#
#!QUESTMAKER_PAGE Specify the Victim
#The Victim is the mob that the thing (whatever it was) was done to, whether
#it be good, bad, or very very bad.  This must be a mob on your map, and you
#may optionally kill him off as the quest starts.  The victim and announcer
#must be different.  If your mystery really doesn't need a victim, you can
#always make the victim a neutral party somewhere.  Be creative!
#
#Victim Area/Room: 
#Specify below the name of the area that your Victim mob will be located
#in and/or the room in which the mob can be found.  You may leave both blank
#to force the quest manager to find the mob somewhere in the world, but this
#will hurt the performance of your mud, so use with care.
#Use double-quotes around multi-word areas and room ids/names.
#  
#Victim Area:
#$VICTIM_AREA=($AREA)
#Victim Room ID:
#$VICTIM_ROOM=($ROOMID)
#
#Victim mob name: 
#Specify the name of the mob who will act as the Victim mob.  
#Use double-quotes around multi-word names.
#If you specified an area or room above, then the mob must be located there.
#You may optionally have the quest manager select a 'random' mob by entering
#a mob name of ANY, or ANY MASK= followed by a Zapper Mask (see help on 
#ZAPPERMASKS for information on zapper mask syntax).
#Remember, if the quest manager can not find your mob, the quest will not
#be started.
#$VICTIM_NAME=$NAME
#
#Victim Dies: Specify whether the victim is killed when the quest is started.
#$VICTIM_DIES=$CHOOSE=TRUE,FALSE
#
#Victim greeting: 
#Specify what the victim says to people when they enter the room about their
#quest, assuming the above is FALSE.  Notice the use of special 
#Code Strings to insert details about
#the quest into the string.  $TARGET is the victim, $WHEREHAPPENED is where the
#victim (alive or dead) is, $WHENHAPPENED is a random time.  You can also include
#things like $WHEREAT to say where the suspects started off at, or even give
#away some answers by mentioning the $AGENT, $TOOL, or $MOTIVE.
#$VICTIM_GREETING=$LONG_STRING=Something was done to or for me at $WHEREHAPPENED on $WHENHAPPENED.  Go see the announcer about it.
#
#!QUESTMAKER_PAGE Announcer greetings/instructions
#Here's where you specify any special text said by the announcer regarding
#your quest
#
#Announcer greeting: 
#Specify what the announcer says to people when they enter the room about their
#quest.  Notice the use of special Code Strings to insert details about
#the quest into the string.  $TARGET is the victim, $WHEREHAPPENED is where the
#victim (alive or dead) is, $WHENHAPPENED is a random time.  You can also include
#things like $WHEREAT to say where the suspects started off at, or even give
#away some answers by mentioning the $AGENT, $TOOL, or $MOTIVE.
#$QUEST_NOTIFYSTRING=$LONG_STRING=We have a mystery that needs solving! Something was done to or for $TARGET at $WHEREHAPPENED on $WHENHAPPENED.
#
#Announcer instructions: 
#Specify what the announcer says to people who have accepted the quest.  This 
#should give some details about what is to be done.  You can leave this blank
#if you like.  You may use the same sort of variables as were used in the greeting.
#$QUEST_INSTRUCTIONSSTRING=($LONG_STRING)=What's the world coming to? Something was done to or for $TARGET at $WHEREHAPPENED on $WHENHAPPENED.  The possible items are probably still there. You should go there and starting asking the folks in nearby rooms about those items, and any other clues you gather.  Then come back here and announce, one at a time, WHO you think did it, their MOTIVE, and what ITEM they used.  No wrong guesses are allowed.  Questioning the people around that room will reveal all the clues you need.
#
#Announcer announcement:
#Select what type of annoucement the Announcer will make when the quest starts.
#$QUEST_ANNOUNCEMENT_TYPE=$CHOOSE=YELL,QUESTCHAT,MPECHO,SAY
#This is what the announcement says.  Leave it blank if you only want him to talk to people who enter the room with him.
#$QUEST_ANNOUNCEMENT=($LONG_STRING)=We have a mystery that needs solving! Something was done to or for $TARGET at $WHEREHAPPENED on $WHENHAPPENED.  Come see me about it IMMEDIATELY!!
#
#Announcer solve instructions: 
#Specify what the announcer says to people who have accepted the quest and are 
#trying to solve it. This can be some more details about what is to be done.  You can leave this blank
#if you like.  You may use the same sort of variables as were used in the greeting.
#$QUEST_SOLVESTRING=($LONG_STRING)=So you think you have solved it, huh? OK, now give it to me slowly, one at a time, WHO did it, what was their MOTIVE, and what ITEM did they use?  Please use the full item names.
#
#!QUESTMAKER_PAGE Announcer completion announcements
#Here's where you specify any special text said by the announcer regarding the end of your quest.
#
#Announcer congratulations:
#Select what type of speech the Announcer will make when the answers to the mystery are successfully given to the announcer.
#$SOLVED_RESPONSE_TYPE=$CHOOSE=QUESTCHAT,MPECHO,SAY,YELL
#This is what the congratulations says.
#$SOLVED_RESPONSE_TEXT=($LONG_STRING)=$n has solved the mystery! $AGENT did it with $TOOL for $MOTIVE!
#
#Announcer warning message:
#Select what type of speech the Announcer will make when 5 minutes remain in the quest, and there still isn't a winner
#$WARNING_RESPONSE_TYPE=$CHOOSE=QUESTCHAT,MPECHO,SAY,YELL
#This is what the warning message says.
#$WARNING_RESPONSE_TEXT=($LONG_STRING)=I'm 5 minutes away from solving this one myself.  Better figure out those clues and bring me your guesses!
#
#Announcer failure message:
#Select what type of speech the Announcer will make when the answers to the mystery are never guessed by a player.
#$UNSOLVED_RESPONSE_TYPE=$CHOOSE=QUESTCHAT,MPECHO,SAY,YELL
#This is what the failure message says.
#$UNSOLVED_RESPONSE_TEXT=($LONG_STRING)=I had to solve the mystery myself.  It appears $AGENT did it with $TOOL for $MOTIVE!
#
#!QUESTMAKER_PAGE Specify the Tools
#The Tools are the items that comprise the list of things the action might have
#been done with.  In other words, one of these items was used to commit
#the crime, or do the action to the victim.
#
#The Tools: List here all possible tools for your mystery.  You may list more
#than are actually used in the mystery to mix things up.
#$TOOLS_ITEMS=$ITEMXML_ONEORMORE
#
#Number of Tools: Specify how many of the above tools will be chosen for use in the mystery.
#The higher this number, the more complex the mystery will be and more difficult to solve.
#You should never enter a number that might be larger than the number of total items above.
#You may, however, use math expressions: For instance, 1 + 1?3 would generate a number of 2-4 tools.
#$NUM_TOOLS=$EXPRESSION=3
#
#Tools Area/Room: 
#Specify below the name of the place that your Tools will be created in.
#Use double-quotes around multi-word areas and room ids/names.  
#If you want the tools to be created where the victim is, leave the AREA 
#blank and use WHEREHAPPENED as the room.
#If you want the tools to be created where the suspects are, leave the AREA 
#blank and use WHEREAT as the room id.
#  
#Tools Area:
#$TOOLS_AREA=($AREA)
#Tools Room ID:
#$TOOLS_ROOM=($ROOMID)
#
#!QUESTMAKER_PAGE Specify the Suspects
#The Suspects are the mobs that comprise the list of possible mobs who did the action
#with the above tool to the victim.  One of the suspects will be chosen as the WHO did it mob.
#
#The Suspects: List here all possible suspects for your mystery.  You may create more
#than are actually used in the mystery to mix things up.
#$SUSPECTS_MOBS=$MOBXML_ONEORMORE
#
#Number of Suspects: Specify how many of the above suspects will be chosen for use in the mystery.
#The higher this number, the more complex the mystery will be and more difficult to solve.
#You should never enter a number that might be larger than the number of total mobs above.
#You may, however, use math expressions: For instance, 1 + 1?3 would generate a number of 2-4 mobs.
#$NUM_SUSPECTS=$EXPRESSION=3
#
#Suspects Area/Room: 
#Specify below the name of the place that your Suspects will be created in.
#Use double-quotes around multi-word areas and room ids/names.  
#If you want the suspects to be created where the victim is, leave the AREA 
#blank and use WHEREHAPPENED as the room.
#You may also create them in a jail, or in a hidden room, since they dont 
#actually DO anything during the quest except roam around (if they can).
#  
#Suspects Area:
#$SUSPECTS_AREA=($AREA)
#Suspects Room ID:
#$SUSPECTS_ROOM=($ROOMID)
#
#!QUESTMAKER_PAGE The Witnesses
#The Witnesses are the mobs that will hold one or more clues to solving the mystery.  They
#are always chosen in proximity to the victim, so make sure your area is well populated with
#intelligent mobs who can speak and respond to chatting players.
#
#Witness Radius: Enter the maximum number of rooms away from the location of the victim to
#select existing witness mobs.  This number or expression should be large enough to capture
#enough mobs to act as useful witnesses, and also be small enough that your players wont have
#to wander too far to find the witnesses.  During the quest, the witnesses will not be able
#to walk around.
#$WITNESS_RADIUS=$EXPRESSION=5
#
#Witness Names: You may enter here the names of one or more mobs around the victim, putting double
#quotes around multi-word names, and separating multiple names with spaces.  You may also use 
#ANY, or the ANY MASK= syntax and include a Zapper Mask that described what sort of mobs can be used 
#as witnesses.  A witness may be chosen multiple times to hold many different clues.  If you like, 
#you may even set it up so that only ONE mob knows all of the clues, but that's not recommended.
#$WITNESS_NAMES=$NAME=ANY MASK=+INT 6
#
#!QUESTMAKER_PAGE The Motives
#The motives are a simple list of space-delimited phrases that describe the possible motives for
#the action done by the suspect against the victim with the item/tool.
#
#The Motive List: List here the possible motives for the action taken.  Each motive should be
#separated by spaces.  If a motive includes more than one word, put the motive in "double quotes".
#A valid motive should answer the question: The act was done because of X.
#$MOTIVE_LIST=$LONG_STRING="drunken anger" "jealous love" "insulted honor" 
#
#Number of Motives: Specify how many of the above motives will be chosen for use in the mystery.
#The higher this number, the more complex the mystery will be and more difficult to solve.
#You should never enter a number that might be larger than the number of total motives listed above.
#You may, however, use math expressions: For instance, 1 + 1?3 would generate a number of 2-4 motives.
#$NUM_MOTIVES=$EXPRESSION=3
#
#!QUESTMAKER_PAGE Quest Completion
#Select some rewards for completing the quest by giving the announcer mob the three correct answers:
#
#Reward items: 
#Specify zero or more items to choose from as a reward 
#$REWARD_ITEMS=$ITEMXML_ZEROORMORE
#
#Quest Point?
#$QUEST_POINT=$CHOOSE=YES,NO
#Amount of money (an amount, or leave blank):
#$GOLD=($EXPRESSION)
#Amount of experience points, blank for none, or a number% for percent of exp to next level:
#$EXP=($STRING)=10%
#
#Player Faction to give to or take from:
#$FACTION=($FACTION)
#If you selected a faction above, enter a new numeric amount, 
#or enter +value to add, or --value to subtract:
#$NUMFACTION=($STRING)
#
#Select whether a player may complete this quest multiple times,
#or 'prev' to require a previous quest, if multiple found.
#$MULTIPLE=$CHOOSE=YES,NO,PREV
#
#If you choose, you may have completion of this quest automatically start another.
#If this is what you want, enter the next quests name here:
#$NEXT_QUEST=($EXISTING_QUEST_NAME)
#
#$WHEREHAPPENED=$HIDDEN=$%QVAR(* WHEREHAPPENED)%
#$WHEREAT=$HIDDEN=$%QVAR(* WHEREAT)%
#$WHENHAPPENED=$HIDDEN=$%QVAR(* WHENHAPPENED)%
#$TARGET=$HIDDEN=$%QVAR(* TARGET)%
#$AGENT=$HIDDEN=$%QVAR(* AGENT)%
#$TOOL=$HIDDEN=$%QVAR(* TOOL)%
#$MOTIVE=$HIDDEN=$%QVAR(* MOTIVE)%
#!QUESTMAKER_END_SCRIPT Competitive Mystery #1

set name $QUEST_ID
set display $QUEST_NAME
set author $#AUTHOR

set wait $FREQUENCY
set interval 1
#quiet
set minplayers 1
set playermask $QUEST_CRITERIA


# Set up the announcer
set area $ANNOUNCER_AREA
set roomgroup
set room $ANNOUNCER_ROOM
set mobgroup
set mob $ANNOUNCER_NAME
give stat keyplayer true
take behavior MudChat
give script LOAD=$QUEST_ID_announcer.script~

# Set up the victim
set area $VICTIM_AREA
set room $VICTIM_ROOM
set roomgroup
set mobgroup
set mob $VICTIM_NAME
set target mob
give stat rejuv 999999
give script ONCE_PROG\;IF EVAL('$VICTIM_DIES' == 'TRUE')\;MPDAMAGE $i 99999999 99999999 kill\;ENDIF\;~\;GREET_PROG 100\;if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n) and ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) )\;if EVAL('$MULTIPLE' == 'YES') OR !QUESTWINNER($n *)\;sayto "$n" $VICTIM_GREETING\;ENDIF\;ENDIF\;~\;
set wherehappened room
set whenhappened -1?-10

# Set up suspects
set mob
set mobgroup
set roomgroup
set area $SUSPECTS_AREA
set room $SUSPECTS_ROOM
set whereat room
import mobs $QUEST_ID_suspects.cmare
load mobgroup $NUM_SUSPECTS any
set agentgroup $NUM_SUSPECTS
set mobgroup agentgroup-agent
give behavior Mobile
give affect Prop_SafePet
give script LOAD=$QUEST_ID_suspect.script~
set mob agent
give behavior Mobile
give affect Prop_SafePet
give script LOAD=$QUEST_ID_suspect.script~

# Set a motives, will automatically set a motive
set motivegroup $NUM_MOTIVES $MOTIVE_LIST

# Assign the tools
set mob
set mobgroup
set roomgroup
set area $TOOLS_AREA
set room $TOOLS_ROOM
import items $QUEST_ID_tools.cmare
load itemgroup $NUM_TOOLS any
set toolgroup $NUM_TOOLS
set itemgroup toolgroup
give script LOAD=$QUEST_ID_evidence.script

set area
set roomgroup
set mobgroup
set mob
# Now set up all the evidence
LOAD=$QUEST_ID_toolagentmap.quest wherehappened toolgroup-tool agentgroup-agent
LOAD=$QUEST_ID_toolagentmap.quest wherehappened tool agentgroup-agent 
LOAD=$QUEST_ID_toolagentmap.quest wherehappened toolgroup-tool agent
LOAD=$QUEST_ID_agentmotivemap.quest wherehappened agentgroup-agent motivegroup-motive
LOAD=$QUEST_ID_agentmotivemap.quest wherehappened agent motivegroup-motive
LOAD=$QUEST_ID_agentmotivemap.quest wherehappened agentgroup-agent motive
LOAD=$QUEST_ID_toolmotivemap.quest wherehappened toolgroup-tool motivegroup-motive
LOAD=$QUEST_ID_toolmotivemap.quest wherehappened tool motivegroup-motive
LOAD=$QUEST_ID_toolmotivemap.quest wherehappened toolgroup-tool motive
# Now install a second set to make things easier.
LOAD=$QUEST_ID_toolagentmap.quest wherehappened toolgroup-tool agentgroup-agent
LOAD=$QUEST_ID_toolagentmap.quest wherehappened tool agentgroup-agent 
LOAD=$QUEST_ID_toolagentmap.quest wherehappened toolgroup-tool agent
LOAD=$QUEST_ID_agentmotivemap.quest wherehappened agentgroup-agent motivegroup-motive
LOAD=$QUEST_ID_agentmotivemap.quest wherehappened agent motivegroup-motive
LOAD=$QUEST_ID_agentmotivemap.quest wherehappened agentgroup-agent motive
LOAD=$QUEST_ID_toolmotivemap.quest wherehappened toolgroup-tool motivegroup-motive
LOAD=$QUEST_ID_toolmotivemap.quest wherehappened tool motivegroup-motive
LOAD=$QUEST_ID_toolmotivemap.quest wherehappened toolgroup-tool motive

set duration $DURATION

<?xml version="1.0"?>
<FILE><NAME>$QUEST_ID_rewarditems.xml</NAME><DATA><ITEMS>$REWARD_ITEMS</ITEMS></DATA></FILE>
<FILE><NAME>$QUEST_ID_announcer.script</NAME>
<DATA>
GREET_PROG 100
	if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n) and ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) )
		if EVAL('$MULTIPLE' == 'YES') OR !QUESTWINNER($n *)
			if !STRIN('$<$i $QUEST_ID_ALREADY_TOLD>' '$n')
				sayto "$n" $QUEST_NOTIFYSTRING -- just say 'i accept' and I'll give you the details.
				MPSETVAR $i $QUEST_ID_ALREADY_TOLD '$<$i $QUEST_ID_ALREADY_TOLD> "$n"'
			endif
		endif
	endif
~

ONCE_PROG
	$QUEST_ANNOUNCEMENT_TYPE $QUEST_ANNOUNCEMENT
	mpsetvar * $QUEST_ID_TOOL ''
	mpsetvar * $QUEST_ID_REWARDED ''
	mpsetvar * $QUEST_ID_LOST ''
	mpsetvar * $QUEST_ID_AGENT ''
	mpsetvar * $QUEST_ID_MOTIVE ''
	MPSETVAR * $QUEST_ID_ACCEPTED ''
	mpsetvar * $QUEST_ID_ALREADY_TOLD ''
~

SPEECH_PROG p i accept
	if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n) and ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) )
		if  EVAL('$MULTIPLE' == 'YES') OR !QUESTWINNER($n *)
			if VAR($n $QUEST_ID_ACCEPTED == '')
				MPSETVAR $n $QUEST_ID_ACCEPTED 'TRUE'
				mpqset * REMAINING $DURATION
				MPSETVAR $n $QUEST_ID_CORRECT 0
				sayto "$n" $QUEST_INSTRUCTIONSSTRING
				mpqset * STATISTICS ACCEPTED
                mpscript $n INDIVIDUAL LOAD=$QUEST_ID_playertrack.script
			else
				sayto "$n" Yes, that's great .. now off with you.
			endif
		endif
	endif
~

SPEECH_PROG solve
	if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n) and ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) ) and VAR($n $QUEST_ID_ACCEPTED != '')
		sayto "$n" $QUEST_SOLVESTRING
	endif
~

SPEECH_PROG all
	if STRCONTAINS($g "i accept") OR STRCONTAINS($g "solve") OR EVAL($g == '')
		RETURN
	endif
	
	if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n) and ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) ) and VAR($n $QUEST_ID_ACCEPTED != '')
		if  EVAL('$MULTIPLE' == 'YES') OR !QUESTWINNER($n *)
			MPARGSET $9 ''
			IF EVAL($9 == '')
				MPARGSET $3 '$%QVAR(* AGENT)%'
				IF STRCONTAINS($g "$3")
					MPARGSET $9 $g
					if VAR($n $QUEST_ID_AGENT != '')
						sayto $n You've already made a guess on the who question.
					else
						MPSETVAR $n $QUEST_ID_AGENT '$%QVAR(* AGENT)%'
						sayto $n Ok, so you think $%QVAR(* AGENT)% did it.
						MPSETVAR $n $QUEST_ID_CORRECT ++
						MPCALLFUNC winner
					endif
				ELSE
					mpargset $0 '$%QVAR(* AGENTGROUP)%'
					for $1 = 1 to $0
						mpargset $2 'AGENTGROUP#$1'
						mpargset $3 '$%QVAR(* $2)%'
						IF STRCONTAINS($g "$3") AND EVAL($9 == '')
							MPARGSET $9 $g
							if VAR($n $QUEST_ID_AGENT != '')
								sayto $n You've already made a guess on the who question.
							else
								MPSETVAR $n $QUEST_ID_AGENT '$3'
								sayto $n Ok, so you think $3 did it.
								MPCALLFUNC winner
								BREAK
							endif
						endif
					next
				ENDIF
			ENDIF
			IF EVAL($9 == '')
				MPARGSET $3 '$%QVAR(* TOOL)%'
				IF STRCONTAINS($g "$3")
					MPARGSET $9 $g
					if VAR($n $QUEST_ID_TOOL != '')
						sayto $n You've already made a guess on the what-was-used question.
					else
						MPSETVAR $n $QUEST_ID_TOOL '$%QVAR(* TOOL)%'
						sayto $n Ok, so you think it was done with $%QVAR(* TOOL)%.
						MPSETVAR $n $QUEST_ID_CORRECT ++
						MPCALLFUNC winner
					endif
				ELSE
					mpargset $0 '$%QVAR(* TOOLGROUP)%'
					for $1 = 1 to $0
						mpargset $2 'TOOLGROUP#$1'
						mpargset $3 '$%QVAR(* $2)%'
						IF STRCONTAINS($g "$3") AND EVAL($9 == '')
							MPARGSET $9 $g
							if VAR($n $QUEST_ID_TOOL != '')
								sayto $n You've already made a guess on the what-was-used question.
							else
								MPSETVAR $n $QUEST_ID_TOOL '$3'
								sayto $n Ok, so you think it was done with $3.
								MPCALLFUNC winner
								BREAK
							endif
						endif
					next
				ENDIF
			ENDIF
			IF EVAL($9 == '')
				MPARGSET $3 '$%QVAR(* MOTIVE)%'
				IF STRCONTAINS($g "$3")
					MPARGSET $9 $g
					if VAR($n $QUEST_ID_MOTIVE != '')
						sayto $n You've already made a guess on the motive question.
					else
						MPSETVAR $n $QUEST_ID_MOTIVE '$%QVAR(* MOTIVE)%'
						sayto $n Ok, so you think the motive was $%QVAR(* MOTIVE)%.
						MPSETVAR $n $QUEST_ID_CORRECT ++
						MPCALLFUNC winner
					endif
				ELSE
					mpargset $0 '$%QVAR(* MOTIVEGROUP)%'
					for $1 = 1 to $0
						mpargset $2 'MOTIVEGROUP#$1'
						mpargset $3 '$%QVAR(* $2)%'
						IF STRCONTAINS($g "$3") AND EVAL($9 == '')
							MPARGSET $9 $g
							if VAR($n $QUEST_ID_MOTIVE != '')
								sayto $n You've already made a guess on the motive question.
							else
								MPSETVAR $n $QUEST_ID_MOTIVE '$3'
								sayto $n Ok, so you think the motive was $3.
								MPCALLFUNC winner
								BREAK
							endif
						endif
					next
				ENDIF
			ENDIF
		endif
	endif
~

FUNCTION_PROG winner
	if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n) and ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) )
		if  EVAL('$MULTIPLE' == 'YES') OR !QUESTWINNER($n *)
			if VAR($n $QUEST_ID_CORRECT >= 3)
				if EVAL('$EXP' != '')
					mpexp $n $EXP
				endif
				if EVAL('$FACTION' != '')
					mpfaction $n $FACTION +$NUMFACTION
				endif
				if EVAL('$QUEST_POINT' == 'YES') AND !QUESTWINNER($n *)
					mpoload QuestPoint
					give "a quest point" "$n"
				endif
				if EVAL('$GOLD' != '') AND EVAL('$GOLD' > 0)
					mpoload $GOLD
					give $GOLD "$n" 
				endif
				mpoload fromfile $QUEST_ID_rewarditems.xml any
				if EVAL('$b' != '')
					give "$b" "$n"
				endif
				mpsetvar $i $QUEST_ID_REWARDED $n
				mpquestwin $n *
				$SOLVED_RESPONSE_TYPE $SOLVED_RESPONSE_TEXT
				mpendquest *
				mpqset * STATISTICS SUCCESS
				IF EVAL('$NEXT_QUEST' != '')
					mpstartquest $NEXT_QUEST
				ELSE
					IF EVAL('$MULTIPLE' == 'PREV')
						mptransfer $n $n
					ENDIF
				ENDIF
			else
				if VAR($n $QUEST_ID_TOOL != '') AND VAR($n $QUEST_ID_AGENT != '') AND VAR($n $QUEST_ID_MOTIVE != '')
					if VAR($n $QUEST_ID_LOST == '')
						sayto $n I'm sorry $n, your guesses were incorrect.  Thanks for trying.
						MPSETVAR $n $QUEST_ID_LOST 'YEP'
					else
						sayto $n Listen buddy, you lost.  Get over it.
					endif
				endif
			endif
		endif
	endif
~

QUEST_TIME_PROG * 5
	if VAR($i $QUEST_ID_REWARDED == '')
		$WARNING_RESPONSE_TYPE $WARNING_RESPONSE_TEXT
	endif
~

QUEST_TIME_PROG * -1
	if VAR($i $QUEST_ID_REWARDED == '')
		$UNSOLVED_RESPONSE_TYPE $UNSOLVED_RESPONSE_TEXT
	endif
	mpsetvar * $QUEST_ID_REWARDED ''
	MPSETVAR * $QUEST_ID_ACCEPTED ''
	mpsetvar * $QUEST_ID_TOOL ''
	mpsetvar * $QUEST_ID_LOST ''
	mpsetvar * $QUEST_ID_AGENT ''
	mpsetvar * $QUEST_ID_MOTIVE ''
	mpsetvar * $QUEST_ID_ALREADY_TOLD ''
~
</DATA></FILE>
<FILE><NAME>$QUEST_ID_evidence.script</NAME><DATA>
CNCLMSG_PROG GET all
if EVAL($i == $t)
	mpechoat $n That's EVIDENCE -- you can't do that!
	return CANCEL
endif
~
</DATA></FILE>
<FILE><NAME>$QUEST_ID_agentmotivemap.quest</NAME><DATA>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9I heard about that.  Isn't it terrible?
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 is a dork, but $ARG2 would not do anything for $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yea, crying shame.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 was not one to be involved with $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9It was such a waste.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9I know $ARG2 well enough to know $ARG3 is not a motive.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9I heard all about it.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 thinks $ARG3 is immoral, he wouldn't do anything for that reason.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Heard about that.  What can you do?
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 never gets involved with $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9What`s the world coming to, right?
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 isn't ever into $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Damn shame.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 hates $ARG3, and never gets involved in it.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Big news, right?
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 would never do anything for $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9OMG!!! I KNOW!!!
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG2 is too proud to do anything for $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yea, who hasn`t heard about THAT already?
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG2 doesn't know anything of $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yea, never liked 'em anyway.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG2 is too dumb for $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yea, I hope they catch the killer.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 is far too silly a motive for $ARG2.
	give affect Spell_LedFoot
</OPTION>
</DATA></FILE>
<FILE><NAME>$QUEST_ID_toolmotivemap.quest</NAME><DATA>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yep, I heard about it.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 is hardly the right tool for $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Sure, I heard about that.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG2 is never used when one is into $ARG3
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Sure, I heard all about that.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9No one would use $ARG2 if $ARG3 was involved.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Sure, I heard all about it.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9Everyone knows $ARG2 isn't used for acts motivated by $ARG3.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yep.  Gotta be careful these days.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG3 is not going to make one reach for $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yep.  Gotta watch your back these days.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$_ARG3 is no state for using a $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yes.  Terrible news.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9If $ARG3 was involved, you can be sure $ARG2 was not.
	give affect Spell_LedFoot
</OPTION>
</DATA></FILE>
<FILE><NAME>$QUEST_ID_toolagentmap.quest</NAME><DATA>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yes, it`s terrible news!
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9I've heard $ARG3 is scared of $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9That`s news!
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9I've heard $ARG3 hates $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Everyone is talking about it.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9I've heard $ARG3 thinks $ARG2 is creepy.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Just awful....
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 thinks $ARG2 clumsy and awkward.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES +NAMES "-tax collector"
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Just terrible....
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 never touches $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Frightening, right?
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 won't use $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Scary, right?
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 doesn't like $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Terrifying, right?
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 wouldn't be caught dead using $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Terrifying news!
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 is too proud to use $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Terrifying news!
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 doesn't know how to use $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yes, I know.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 is too dumb to figure out $ARG2.
	give affect Spell_LedFoot
</OPTION>
<OPTION>
	set room ARG1
	set roomgrouparound $WITNESS_RADIUS ANY
	set room
	set mob reselect $WITNESS_NAMES
	take behavior MudChat
	give behavior QuestChat +( victim | murder)\;9Yes, I`m aware of that.
	give behavior QuestChat +( $|ARG2 |  $|ARG3 ::$ARG2_$ARG3)\;9$ARG3 is far too skilled for $ARG2.
	give affect Spell_LedFoot
</OPTION>
</DATA></FILE>
<FILE><NAME>$QUEST_ID_suspects.cmare</NAME><DATA><MOBS>$SUSPECTS_MOBS</MOBS></DATA></FILE>
<FILE><NAME>$QUEST_ID_tools.cmare</NAME><DATA><ITEMS>$TOOLS_ITEMS</ITEMS></DATA></FILE>
<FILE><NAME>$QUEST_ID_playertrack.script</NAME>
<DATA>
ONCE_PROG 100
    mpsetvar $i INSTRUCTIONS $QUEST_INSTRUCTIONSSTRING
~

QUEST_TIME_PROG * -1
	if !QUESTWINNER($i *)
		mpechoat $i The quest '$QUEST_NAME' has ended
	endif
	mpqset * STATISTICS FAILED
~

RAND_PROG 99
    if QVAR(* REMAINING == '')
        MPENDQUEST $i
    else
        mpsetvar $i TIME_REMAINING $%QVAR(* REMAINING)%
    endif
~
</DATA></FILE>
<FILE><NAME>$QUEST_ID_suspect.script</NAME>
<DATA>
SPEECH_PROG ALL
    if eval($t == $i)
        sayto $n As I'm a suspect, I refuse to say anything.
    endif
~
</DATA></FILE>