/
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 Escort #2
#The player must escort a mob or mobs that you will create from the location of
#an existing Announcer mob on the map to any room in an AREA of your
#choosing.  You may also optionally create a mob or mobs to attack the player
#along the way.
#
#!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_escort_2
#
#Quest Name:
#Enter a friendly displayable name for your quest:
#$QUEST_NAME=$STRING=Competitive Escort #2
#
#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.  After the
#player accepts the quest, the escorted mobs will follow the player.  The Announcer
#is NOT one of the escorted mobs.
#
#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.  This mob
#will be the one who solicits the player to escort a different mob in the
#same room.  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 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 Escorted mob and destination
#Here's where you specify the mob to be escorted, and the destination
#that the player must bring the mob to to complete the quest.
#
#Escorted mob(s): 
#Create or select the mob or mobs below that the player must escort.  This mob or
#mobs will be waiting in the same room as the announcer for the quest to
#be undertaken.
#$ESCORTED_MOB=$MOBXML_ONEORMORE
#
#Escort destination: 
#Specify some text to name the destination area of the escort.  
#No '" quotes of any kind are required or allowed in this string -- keep it simple.
#Be careful -- if the engine cant find the area, the quest will not succeed.
#$ESCORT_DESTINATION=$STRING
#
#!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.
#$QUEST_NOTIFYSTRING=$LONG_STRING=I need someone to escort these folks.
#
#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.
#$QUEST_INSTRUCTIONSSTRING=($LONG_STRING)=Take these folks to that one place.  Be careful!
#
#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=($STRING)
#
#!QUESTMAKER_PAGE Quest Dangers
#You may optionally have mobs that appear during the quest in the same room as the
#player and the escorted mob.
#
#Attacker mob(s): 
#Create or select the mob below that will appear with the player and  the 
#escorted mob during the quest.  Leave this blank to not generate 
#attackers and allow your world to provide its own dangers.
#**These mobs will automatically attack the player**
#$ATTACKER_MOB=($MOBXML_ONEORMORE)
#
#Attack group size:
#If you specified attacker(s) above, note here the number of above mobs
#which will appear at the same time.
#$ATTACKER_SIZE=($EXPRESSION)=1
#
#Attacker appearance chance:
#If you specified attacker(s) above, note here the percent chance (0-100)
#that they will appear in any given room the player enters.  An attack 
#will only happen once per quest!
#$ATTACKER_PCT_CHANCE=($EXPRESSION)=5
#
#Attacker scream:
#If you specified attacker(s) above, note what they yell when they attack
#the player after appearing.  You may leave this blank
#$ATTACKER_SCREAM=($STRING)=Found you! Charge!
#
#!QUESTMAKER_PAGE Quest Completion
#Select some rewards for completing the quest:
#
#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)
#
#Escorted response: 
#Specify what is emoted in the same room after the player successfully escorts the
#mobs to the designated room.  You may leave this blank if you like.
#$ESCORTED_RESPONSE=($LONG_STRING)=The escort is complete.
#
#!QUESTMAKER_END_SCRIPT Competitive Escort #2

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 area $ANNOUNCER_AREA
set room $ANNOUNCER_ROOM
set mobgroup
set mob $ANNOUNCER_NAME
give stat keyplayer true
give script LOAD=$QUEST_ID_announcer.script
import mobs $QUEST_ID_escorted.xml
load mobgroup any
set mob
give script LOAD=$QUEST_ID_escorted.script

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_escorted.xml</NAME><DATA><MOBS>$ESCORTED_MOB</MOBS></DATA></FILE>
<FILE><NAME>$QUEST_ID_attackers.xml</NAME><DATA><MOBS>$ATTACKER_MOB</MOBS></DATA></FILE>
<FILE><NAME>$QUEST_ID_announcer.script</NAME>
<DATA>
ONCE_PROG 100
	MPSETVAR * $QUEST_ID_ALREADY_TOLD ''
	MPSETVAR * $QUEST_ID_REWARDED ''
	MPSETVAR * $QUEST_ID_WARNED ''
	MPSETVAR * $QUEST_ID_ACCEPTED ''
	MPSETVAR * $QUEST_ID_CHECKEDROOM ''
	MPSETVAR * $QUEST_ID_ATTACKED ''
	MPSETVAR * $QUEST_ID_NUMACCEPTED ''
	$QUEST_ANNOUNCEMENT_TYPE $QUEST_ANNOUNCEMENT
~

QUEST_TIME_PROG * -1
	mpsetvar $i $QUEST_ID_NUMACCEPTED '$<$i $QUEST_ID_ACCEPTED>.LENGTH#'
	for $0 = 0 to< '$<$i $QUEST_ID_NUMACCEPTED>'
		if !QUESTWINNER('$<$i $QUEST_ID_ACCEPTED>.$0' *)
			tell "$<$i $QUEST_ID_ACCEPTED>.$0" You failed to complete your escort quest in time.
	    endif
		mpqset * STATISTICS FAILED
	endif
	MPSETVAR * $QUEST_ID_NUMACCEPTED ''
	MPSETVAR * $QUEST_ID_ALREADY_TOLD ''
	MPSETVAR * $QUEST_ID_ACCEPTED ''
	MPSETVAR * $QUEST_ID_REWARDED ''
	MPSETVAR * $QUEST_ID_WARNED ''
	MPSETVAR * $QUEST_ID_CHECKEDROOM ''
	MPSETVAR * $QUEST_ID_ATTACKED ''
~

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')
				if VAR($n $QUEST_ID_ACCEPTED == '')
					sayto "$n" $QUEST_NOTIFYSTRING -- just say 'i accept' to take on this quest.
					MPSETVAR $i $QUEST_ID_ALREADY_TOLD '$<$i $QUEST_ID_ALREADY_TOLD> "$n"'
				endif
			endif
		endif
	endif
~

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 == '')
				sayto "$n" $QUEST_INSTRUCTIONSSTRING
				mpqset * REMAINING $DURATION
				MPSETVAR $i $QUEST_ID_ACCEPTED '$<$i $QUEST_ID_ACCEPTED> $n'
				mpsetvar $n $QUEST_ID_ACCEPTED 'YES'
				mpqset * STATISTICS ACCEPTED
                mpscript $n INDIVIDUAL LOAD=$QUEST_ID_playertrack.script
				for $0 = 1 to '$%NUMMOBSROOM(*)%'
				   mpargset $1 $%ROOMMOB($0)%
				   if QUESTMOB($1 *) AND EVAL($1 != $i) AND EVAL('${1 *}' != $1)
				   		mpforce $1 follow $n
				   		if !isfollow($1)
				   			mpforce $1 say I can't follow $n
				   		else
							mpsetvar $i $QUEST_ID_ACCEPTED $n
				   		endif
				   endif
				next
			else
				sayto "$n" Yes, yes, I know .. now off with you.
			endif
		endif
	endif
~
</DATA></FILE>
<FILE><NAME>$QUEST_ID_escorted.script</NAME>
<DATA>
QUEST_TIME_PROG * 1
	if EVAL('$f' != '') AND VAR ($f $QUEST_ID_WARNED == '')
		mpsetvar $f $QUEST_ID_WARNED 'WARNED'
		mpechoat $f You have less than a minute left to complete your escort quest.
	endif
~

DEATH_PROG 99
	IF EVAL('$f' != '') 
		mpechoat $f ^x$i has died.  You've failed the escort quest.^.^N
	else
		mpecho ^x$i has died.  You've failed the escort quest.^.^N
	ENDIF
	mpendquest *
~

RAND_PROG 99
	IF  ISHERE(${1 *})
		RETURN
	ENDIF
	IF EVAL('$f' == '')
		mpecho ^x$n is not following anyone.  The escort quest has failed.^.^N
		mpendquest *
	ENDIF
	IF VAR($f $QUEST_ID_CHECKEDROOM == $d)
		RETURN
	ENDIF
	MPSETVAR $f $QUEST_ID_CHECKEDROOM $d
	if !INAREA($i == '$ESCORT_DESTINATION')
		if VAR($f $QUEST_ID_ATTACKED == '')
			if EVAL('$ATTACKER_PCT_CHANCE' != '') AND RAND($ATTACKER_PCT_CHANCE) AND EVAL('$ATTACKER_SIZE' >= 1)
				mpsetvar $f $QUEST_ID_ATTACKED ATTACKED!
				for $0 = 0 to< $ATTACKER_SIZE
					mpmload fromfile $QUEST_ID_attackers.xml any
					mpqset * QUESTOBJ $b
					mpforce $b YELL $ATTACKER_SCREAM
					mpforce $b kill $f
					MPGSET $b REJUV 0
				next
			endif
		endif
	else
		if EVAL('$f' != '') AND ISLIKE($f '$QUEST_CRITERIA') and ISPC($f) AND VAR($f $QUEST_ID_REWARDED == '')
			mpsetvar $f $QUEST_ID_REWARDED 'REWARDED'
			if  EVAL('$MULTIPLE' != 'YES') AND QUESTWINNER($f *)
				# do nothing
			else
				if EVAL('$EXP' != '')
					mpexp $f $EXP
				endif
				if EVAL('$FACTION' != '')
					mpfaction $f $FACTION +$NUMFACTION
				endif
				if EVAL('$QUEST_POINT' == 'YES') AND !QUESTWINNER($f *)
					mpoloadroom QuestPoint
					mpforce $f GET "a quest point"
				endif
				if EVAL('$GOLD' != '') AND EVAL('$GOLD' > 0)
					mpoloadroom $GOLD
					mpforce $f GET $GOLD
				endif
				mpoload fromfile $QUEST_ID_rewarditems.xml any
				if EVAL('$b' != '')
					give "$b" "$n"
				endif
				mpquestwin $f *
				mpecho $ESCORTED_RESPONSE
				mpendquest *
				mpqset * STATISTICS SUCCESS
				IF EVAL('$NEXT_QUEST' != '')
					mpstartquest $NEXT_QUEST
				ELSE
					IF EVAL('$MULTIPLE' == 'PREV')
						mptransfer $n $n
					ENDIF
				ENDIF
			endif
		endif
	endif
~
</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>