#!QUESTMAKER_START_SCRIPT Normal Delivery #3
#The player is given a custom item by an existing mob in your world
#to deliver to one or more existing mobs somewhere else in your world. A reward
#is optionally given upon delivery.
#
#!QUESTMAKER_PAGE Quest Name/Criteria
#Enter the unique name and player criteria for your new quest.
#
#Quest ID:
#Enter a unique name/id for your quest:
#$QUEST_ID=$UNIQUE_QUEST_NAME=normal_delivery_1
#
#Quest Name:
#Enter a friendly displayable name for your quest:
#$QUEST_NAME=$STRING=Normal Delivery #1
#
#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 and handing over the item
#to deliver. This must be an existing mob in your world.
#
#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 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 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. Use the code ${2 *} to designate the name of the mob to find.
#$QUEST_NOTIFYSTRING=$LONG_STRING=I need someone to deliver $[1 *] to ${2 *} somewhere.
#
#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. Use the code ${2 *} to designate the name of the mob to find.
#$QUEST_INSTRUCTIONSSTRING=($LONG_STRING)=Find ${2 *} at that one place and give him $[1 *]. Be careful!
#
#!QUESTMAKER_PAGE Specify the Deliveree
#The Deliveree is the mob to which the item will be delivered.
#
#Deliveree mobs:
#Specify the names of the mob who will act as the deliveree mobs.
#Use double-quotes around multi-word names.
#Specify below the name of the area that your deliveree mob or mobs will be created
#in and/or the rooms in which the mob or mobs will be created. You may leave both blank
#to force the quest manager to create the mobs randomly throughout the world if you like.
#Use double-quotes around multi-word areas and room ids/names.
#
#Deliveree Area:
#$DELIVEREE_AREA=($AREA)
#Deliveree Room(s):
#$DELIVEREE_ROOM=($ROOMID)
#
#Deliveree mobs:
#Specify the mobs who will act as the deliveree mob or mobs. You might want to mix things
#up by making them mobile.
#$DELIVEREE_MOBS=$MOBXML_ONEORMORE
#
#Captureables chance:
#Specify the percent chance that a mob will be found in a particular room.
#$DELIVEREE_CHANCE=($EXPRESSION)=10
#
#Deliveree response:
#You may optionally specify some additional bit of speech the deliveree
#mob will say to the players after they arrive.
#$DELIVEREE_ANNOUNCE=($LONG_STRING)=Are you here to deliver $[1 *]? If so, give it to me!
#
#!QUESTMAKER_PAGE Deliverable item
#Create the item which the deliverer mob will give to the player to
#be taken and given to the deliveree mob.
#
#Deliverable Item:
#You may select from the available items below or create a
#new item just for this quest.
#$DELIVERABLE_ITEM=$ITEMXML
#
#Num Deliverees:
#specify the number of the deliverable items must be delivered to mobs
#matching the deliveree. The announcer will give the player the correct
#number of items to deliver.
#$DELIVEREE_COUNT=($EXPRESSION)=1
#
#Delivery response:
#You may optionally specify some additional bit of speech the deliveree
#mob will say to the players after they have handed over the item/items.
#$DELIVERY_RESPONSE=($LONG_STRING)=Thanks!
#
#!QUESTMAKER_PAGE Quest Completion
#Select some rewards for completing the deliveries:
#
#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
#
#!QUESTMAKER_END_SCRIPT Normal Delivery #3
set name $QUEST_ID
set display $QUEST_NAME
set author $#AUTHOR
set wait 1
set interval 1
quiet
set area $ANNOUNCER_AREA
set room $ANNOUNCER_ROOM
set mobgroup
set mob reselect $ANNOUNCER_NAME
give stat keyplayer true
give script LOAD=$QUEST_ID_announcer.script
set area
set room
set mobgroup
set mob
import items $QUEST_ID_item.xml
set itemgroup loadeditems
set item itemgroup
set room
set area $DELIVEREE_AREA
set roomgroup $DELIVEREE_ROOM
set duration 0
<?xml version="1.0"?>
<FILE><NAME>$QUEST_ID_rewarditems.xml</NAME><DATA><ITEMS>$REWARD_ITEMS</ITEMS></DATA></FILE>
<FILE><NAME>$QUEST_ID_item.xml</NAME><DATA><ITEMS>$DELIVERABLE_ITEM</ITEMS></DATA></FILE>
<FILE><NAME>$QUEST_ID_mobs.xml</NAME><DATA><MOBS>$DELIVEREE_MOBS</MOBS></DATA></FILE>
<FILE><NAME>$QUEST_ID_announcer.script</NAME>
<DATA>
ONCE_PROG 100
if EVAL('$QUEST_ANNOUNCECHANNEL' != '')
$QUEST_ANNOUNCECHANNEL $QUEST_NOTIFYSTRING -- Come see me for more information.
endif
~
GREET_PROG 100
if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n)
if QUESTSCRIPTED($n *)
if VAR($n $QUEST_ID_DELIVERED >= $DELIVEREE_COUNT)
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
mpquestwin $n *
mpendquest $n
mpqset * STATISTICS SUCCESS
IF EVAL('$MULTIPLE' == 'PREV')
mptransfer $n $n
ENDIF
endif
else
if ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) )
if EVAL('$MULTIPLE' == 'YES') OR !QUESTWINNER($n *)
sayto "$n" $QUEST_NOTIFYSTRING -- just say '^yi accept^?' or '^yi accept $QUEST_NAME^?' to take on this quest.
endif
endif
endif
endif
~
SPEECH_PROG p i accept $QUEST_NAME
if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n) and ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) ) and !QUESTSCRIPTED($n *)
if EVAL('$MULTIPLE' == 'YES') OR !QUESTWINNER($n *)
sayto "$n" $QUEST_INSTRUCTIONSSTRING
mpqset * STATISTICS ACCEPTED
for $0 = 0 to< $DELIVEREE_COUNT
if !HAS($i '$[1 *]')
mpoload fromfile $QUEST_ID_item.xml '$[1 *]'
MPQSET * QUESTOBJ $b
endif
give "$[1 *]" "$n"
next
mpscript $n INDIVIDUAL SAVABLE STATIC=LOAD=$QUEST_ID_playertrack.script
endif
endif
~
SPEECH_PROG p i accept
if ISLIKE($n '$QUEST_CRITERIA') and ISPC($n) and ( EVAL('$MULTIPLE' != 'PREV') or QUESTWINNER($n previous) ) and !QUESTSCRIPTED($n *)
if EVAL('$MULTIPLE' == 'YES') OR !QUESTWINNER($n *)
sayto "$n" $QUEST_INSTRUCTIONSSTRING
mpqset * STATISTICS ACCEPTED
for $0 = 0 to< $DELIVEREE_COUNT
if !HAS($i '$[1 *]')
mpoload fromfile $QUEST_ID_item.xml '$[1 *]'
MPQSET * QUESTOBJ $b
endif
give "$[1 *]" "$n"
next
mpscript $n INDIVIDUAL SAVABLE STATIC=LOAD=$QUEST_ID_playertrack.script
endif
endif
~
</DATA></FILE>
<FILE><NAME>$QUEST_ID_playertrack.script</NAME>
<DATA>
ONCE_PROG 100
mpsetvar $i INSTRUCTIONS $QUEST_INSTRUCTIONSSTRING
if var($i $QUEST_ID_DELIVERED = '')
mpsetvar $i $QUEST_ID_DELIVERED 0
endif
IF !isquestmobalive(1 '$QUEST_ID')
MPENDQUEST '$QUEST_ID'
ENDIF
mpsetvar $i PROGRESS Delivered: $<$i $QUEST_ID_DELIVERED>/$DELIVEREE_COUNT
if QVAR(* REMAINING == '')
MPENDQUEST $i
else
mpsetvar $i TIME_REMAINING $%QVAR(* REMAINING)%
endif
~
RAND_PROG 25
IF !isquestmobalive(1 '$QUEST_ID')
MPENDQUEST '$QUEST_ID'
else
if QVAR(* REMAINING == '')
MPENDQUEST $i
else
mpsetvar $i TIME_REMAINING $%QVAR(* REMAINING)%
endif
ENDIF
~
QUEST_TIME_PROG * -1
MPECHOAT $i The quest "$QUEST_NAME" has ended.
~
QUEST_TIME_PROG * 1
MPECHOAT $i The quest "$QUEST_NAME" has 1 minute remaining.
~
GREET_PROG 100
if QUESTMOB($n *) AND CANSEE($n $i) AND EVAL('${1 *}' != $n)
mpforce $n sayto $i $DELIVEREE_ANNOUNCE
endif
~
FUNCTION_PROG DEL_LAST_MOB
IF QUESTMOB('$<$i $QUEST_ID_LASTMOB>' *)
mppurge room '$<$i $QUEST_ID_LASTMOB>'
ENDIF
~
CNCLMSG_PROG ENTER ALL
if EVAL($n == $i)
mpargset $g $%INROOM($t)%
if EVAL('$<$i $QUEST_ID_LASTROOM>' != '') AND EVAL('$<$i $QUEST_ID_LASTMOB>' != '')
mpat '$<$i $QUEST_ID_LASTROOM>' MPCALLFUNC DEL_LAST_MOB
mpsetvar $i $QUEST_ID_LASTMOB
mpsetvar $i $QUEST_ID_LASTROOM
endif
if EVAL($g != '') AND VAR($i $QUEST_ID_DELIVERED < $DELIVEREE_COUNT)
if QUESTROOM($g *) or ( EVAL('$CAPTUREABLES_ROOMS' == 'ALL') AND QUESTAREA('$%INAREA($t)%' *))
if !STRIN('$<$i $QUEST_ID_ROOMLIST>' $g)
if !STRIN('$<$i $QUEST_ID_FOUNDROOMS>' $g)
if rand($DELIVEREE_CHANCE)
mpsetvar $i $QUEST_ID_FOUNDROOMS $<$i $QUEST_ID_FOUNDROOMS> "$g"
else
mpsetvar $i $QUEST_ID_ROOMLIST $<$i $QUEST_ID_ROOMLIST> "$g"
endif
endif
if STRIN('$<$i $QUEST_ID_FOUNDROOMS>' $g)
mpat '$g' mpmload fromfile $QUEST_ID_mobs.xml any
MPGSET $b REJUV 0
MPQSET * QUESTOBJ $b
mpsetvar $i $QUEST_ID_LASTMOB $b
mpsetvar $i $QUEST_ID_LASTROOM $g
endif
endif
endif
endif
endif
~
GIVING_PROG all
if EVAL($o == '$[1 *]') AND QUESTMOB($t *) AND EVAL('${1 *}' != $t)
mpargset $g $%INROOM($t)%
mpforce $t mpjunk $o
mpforce $t sayto "$i" $DELIVERY_RESPONSE
mpsetvar $i $QUEST_ID_DELIVERED ++
mpsetvar $i $QUEST_ID_ROOMLIST $<$i $QUEST_ID_ROOMLIST> "$g"
if EVAL($DELIVEREE_COUNT > 1)
mpechoat $i That' $<$i $QUEST_ID_DELIVERED> / $DELIVEREE_COUNT
endif
mpsetvar $i PROGRESS Delivered: $<$i $QUEST_ID_DELIVERED>/$DELIVEREE_COUNT
else
mpforce $t sayto "$i" What's this?
mpforce $t give "$o" "$i"
endif
~
ENTRY_PROG 100
for $0 = 1 to '$%NUMMOBSROOM(*)%'
mpargset $1 '$%ROOMMOB($0)%'
if QUESTMOB($1 *) AND EVAL('${1 *}' != $1)
mpforce $1 sayto "$i" $DELIVEREE_ANNOUNCE
endif
next
~
</DATA></FILE>