Your IP : 216.73.216.182


Current Path : /home/cmowner/CoffeeMud/resources/quests/random/
Upload File :
Current File : //home/cmowner/CoffeeMud/resources/quests/random/auto_delivery1.xml

<?xml version="1.0"?>
<!-- ----------------------------------------------------------------------------
Copyright 2020-2025 Bo Zimmerman

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--------------------------------------------------------------------------------

See guides/RandomAreas.html for information about documents of this type.

template: auto_delivery1
settable vars: 
    template(auto_delivery1)
    category(whatevs)
    targetarea_name(area name)
    targetname(mobs name)
    num_targets(num mobs to deliver to)
    itemname(name of an item), item_level(#), item_material($)
	xp_amount_awarded
	gold_amount_awarded
	quest_point_awarded(YES,NO)
	reward_items()
	target_min_arealevel(#), target_max_arealevel(#)
	quest_multiple(YES, NO, or PREV)
-->

<QUEST ID="auto_delivery1" QUEST_TEMPLATE_ID="auto_delivery1">
	<QUEST_ID DEFINE="quest_id">${h:quest_template}_R$[100000000?999999999]</QUEST_ID>
	<QUEST_CRITERIA  SELECT="Pick-1">
		<QUEST_CRITERIA CONDITION="$target_min_arealevel = ''">+SYSOP +LEVELS -&lt;$[$target_level - $level_span] -&gt;$[$target_level + $level_span]</QUEST_CRITERIA>
		<QUEST_CRITERIA CONDITION="$target_min_arealevel != ''">+LEVEL -&lt;$target_min_arealevel -&gt;$target_max_arealevel </QUEST_CRITERIA>
	</QUEST_CRITERIA>
	<FREQUENCY>1</FREQUENCY>
	<DURATION>90 minutes</DURATION>
	<CATEGORY>$quest_category</CATEGORY>
	<DELIVEREE_MASK>-HOME "+$target_area_name" -NAME "+$target_name"</DELIVEREE_MASK>
	<DELIVERABLE_ITEM>${SELECT: ANY\. from $target_item}</DELIVERABLE_ITEM>
	<QUEST_POINT>$quest_point_awarded</QUEST_POINT>
	<GOLD>$gold_amount_awarded</GOLD>
	<EXP>$xp_amount_awarded</EXP>
	<MULTIPLE>$quest_multiple</MULTIPLE>
	<NEXT_QUEST>$next_quest_id</NEXT_QUEST>
	<FACTION>$target_faction</FACTION>
	<NUMFACTION>$[$target_faction_amt / 500]</NUMFACTION>
	<DELIVEREE_COUNT>$num_targets</DELIVEREE_COUNT>
	<QUEST_NAME SELECT="Pick-1">
		<QUEST_NAME>You need ${target_item_name} $reason_verbed to $c_target_name in ${C:target_area_name}</QUEST_NAME>
		<QUEST_NAME>You want ${target_item_name} $reason_verbed to $c_target_name in ${C:target_area_name}</QUEST_NAME>
		<QUEST_NAME>${C:reason_verb} ${target_item_name} to $c_target_name in ${C:target_area_name}</QUEST_NAME>
		<QUEST_NAME PICKWEIGHT=99 CONDITION="$deityname!=''">$deityname needs ${target_item_name} $reason_verbed to $c_target_name in ${C:target_area_name}</QUEST_NAME>
	</QUEST_NAME>
	<QUEST_WINSPEECH_TEXT>${j:1:quest_winspeech}</QUEST_WINSPEECH_TEXT>
	<QUEST_INSTRUCTIONSSTRING>${j:1:quest_instructionstring}</QUEST_INSTRUCTIONSSTRING>
	<DELIVERY_RESPONSE>${j:1:quest_delivered}</DELIVERY_RESPONSE>
	<DELIVEREE_ANNOUNCE>${j:1:quest_hellospeech}</DELIVEREE_ANNOUNCE>
	<REWARD_ITEMS>${SELECT: ANY\. FROM $dungeon_treasure_items}</REWARD_ITEMS>

	<STRING load="/resources/quests/random/inc_questcommon.xml" />

	<STRING id="quest_winspeech" SELECT="Any-1">
		<STRING>You have $reason_verbed!</STRING>
		<STRING>${c:reason_verbed} at last!</STRING>
		<STRING>Congratulations!</STRING>
		<STRING>You have completed the $reason_verb task, that will be all.</STRING>
	</STRING>
	
	<STRING ID="reason_short" define="reason_short" SELECT="Any-1">
		<STRING>You need ${target_item_name} $reason_verbed!</STRING>
		<STRING>You must $reason_verb ${p:target_item_name}!</STRING>
		<STRING>Assistance required delivering ${p:target_item_name}!</STRING>
		<STRING>${c:reason_verb} ${p:target_item_name} for goodness sake!</STRING>
		<STRING>${c:reason_verb} ${p:target_item_name}, quickly!</STRING>
		<STRING>You want ${target_item_name} $reason_verbed!</STRING>
	</STRING>

	<STRING ID="quest_instructionstring" SELECT="ALL">
		<STRING ACTION="PREPEND">$reason_desc</STRING>
		<STRING ACTION="APPEND">$reason_short</STRING>
		<STRING SELECT="Any-1" CONDITION="'YES' in $target_is_aggressive">
			<STRING>You might have to $hurt_them_phrase, so be ready.</STRING>
			<STRING>If you $hurt_them_phrase, it'll be no problem.</STRING>
			<STRING>Be ready to $hurt_them_phrase.</STRING>
			<STRING>If they seem reluctant, $hurt_them_phrase.</STRING>
			<STRING>Only $hurt_them_phrase if they resist.</STRING>
			<STRING>${C:hurt_them_phrase}, before they do you.</STRING>
		</STRING>
	</STRING>

	<STRING ID="quest_delivered" PREDEFINE="reason=$reason">$quest_delivered</STRING>
	<STRING ID="quest_hellospeech" PREDEFINE="reason=$reason">$quest_hellospeech</STRING>
	<STRING ID="reason_verbed" PREDEFINE="reason=$reason">delivered</STRING>
	<STRING ID="reason_verb" PREDEFINE="reason=$reason">deliver</STRING>
	<STRING ID="reason_desc" PREDEFINE="reason=$reason">$reason_desc</STRING>
	<STRING ID="reason" DEFINE="reason" SELECT="Pick-1">
		<STRING CONDITION="$target_int &gt; 5">$reason_theyoweme</STRING>
		<STRING CONDITION="$num_targets=1">$reason_partytime</STRING>
		<STRING CONDITION="$target_int &gt; 5">$reason_iowethem</STRING>
		<STRING>$reason_ilostthem</STRING>
		<STRING>$reason_gendeliver</STRING>
		<STRING CONDITION="$target_int &gt; 5">$reason_idoforthem</STRING>
		<STRING CONDITION="$target_int &gt; 5">$reason_wedotogether</STRING>
		<STRING>$reason_idotothem</STRING>
		<STRING>$reason_wedotoeachother</STRING>
		<STRING PICKWEIGHT=99 CONDITION="$deityname!=''">$reason_deitydo</STRING>
	</STRING>
	<STRING ID="reason_deitydo" SELECT="All" REQUIRES="deityname=$">
		<STRING define="quest_delivered">$quest_generic_delivered_speeches</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_short">${c:deityname} wants $target_item_name delivered to ${p_target_name}.</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:deityname} requires that I start a ${target_item_name} factory with ${p_target_name} help.</STRING>
			<STRING>${c:deityname} requires that ${c:p_target_name} and I study $target_item_name today.</STRING>
			<STRING>${c:p_target_name} has insulted ${c:deityname}'s honor, and only a ritual delivery of $target_item_name will satisfy it.</STRING>
			<STRING>${c:deityname} wants $target_item_name delivered to ${p_target_name}.</STRING>
			<STRING>${c:deityname} wants $target_item_name delivered to ${p_target_name}.</STRING>
		</STRING>
	</STRING>

	<STRING id="quest_generic_hello_speeches" SELECT="Any-1">
		<STRING>$$n, are you looking for me?</STRING>
		<STRING>Hello $$n, have you got something for me?</STRING>
	</STRING>

	<STRING id="quest_generic_delivered_speeches" SELECT="Any-1">
		<STRING>How wonderful! Thank you $$n!!</STRING>
		<STRING>${c:reason_verbed} at last! Thank you $$n!</STRING>
		<STRING>Good work!</STRING>
		<STRING>Thank you $$n, that will be all.</STRING>
	</STRING>
	
	<STRING ID="c_target_name" define="c_target_name" SELECT="Any-1">
		<STRING condition="$num_targets=1">${c:target_name}</STRING>
		<STRING condition="$num_targets>1">$num_targets ${p:target_name}</STRING>
	</STRING>

	<STRING ID="p_target_name" define="p_target_name" SELECT="Any-1">
		<STRING condition="$num_targets=1">${c:target_name}</STRING>
		<STRING condition="$num_targets>1">${p:target_name}</STRING>
	</STRING>

	<STRING ID="reason_theyoweme" SELECT="All">
		<STRING define="quest_delivered">$quest_generic_delivered_speeches</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>$p_target_name promised to repair $target_item_name for you.</STRING>
			<STRING>$p_target_name promised to store $target_item_name for you.</STRING>
			<STRING>$p_target_name promised to give a good home to $target_item_name.</STRING>
			<STRING>$p_target_name promised to clean $target_item_name for you.</STRING>
		</STRING>
	</STRING>
	
	<STRING ID="reason_partytime" SELECT="All">
		<STRING define="quest_delivered" SELECT="Any-1" >
			<STRING>Yay! ${c:target_item_name} has been delivered! Let the party BEGIN!</STRING>"
			<STRING>You've been needing $target_item_name!</STRING>"
			<STRING>${c:target_item_name} is your favorite thing!</STRING>"
			<STRING>We can finally begin the festivities now that ${c:target_item_name} is here!</STRING>"
		</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:target_name} invited me to a party, but I can't go.</STRING>
			<STRING>It's ${target_name}s birthday today.</STRING>
			<STRING>It is officially ${C:target_area_name} Day, and I'm giving $target_name $target_item_name.</STRING>
			<STRING>It was ${target_name}s birthday last week, and I'm late with a present.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_iowethem" SELECT="All">
		<STRING define="quest_delivered">$quest_generic_delivered_speeches</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You wish to reward $p_target_name with $target_item_name for reasons.</STRING>
			<STRING>You owe ${p_target_name} $target_item_name for their assistance to you.</STRING>
			<STRING>You owe ${p_target_name} $target_item_name for saving your life.</STRING>
			<STRING>${c:p_target_name} forgot to pick up $target_item_name this week.</STRING>
			<STRING>You swore to protect ${p_target_name}, and so $target_item_name must be delivered immediately!</STRING>
		</STRING>
	</STRING>
	<STRING ID="reason_ilostthem" SELECT="All">
		<STRING define="quest_delivered" SELECT="Any-1">
			<STRING>You found $target_item_name!</STRING>
			<STRING>${target_item_name} has been found!</STRING>
			<STRING>Congratulations for finding $target_item_name!</STRING>
		</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:p_target_name} lost $target_item_name and so I need your help.</STRING>
			<STRING>${c:p_target_name} left ${target_item_name}.</STRING>
			<STRING>${c:p_target_name} can't find ${target_item_name} and I found it.</STRING>
			<STRING>${c:target_item_name} was dropped by $p_target_name, and needs returned.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_gendeliver" SELECT="All">
		<STRING define="quest_delivered">$quest_generic_delivered_speeches</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You need $target_item_name delivered to $p_target_name.</STRING>
			<STRING>You need ${p_target_name} to be given $target_item_name.</STRING>
			<STRING>You need ${p_target_name} be have $target_item_name brought to them.</STRING>
			<STRING>${c:target_item_name} needs to be delivered to $p_target_name.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_idoforthem" SELECT="All">
		<STRING define="quest_delivered">$quest_generic_delivered_speeches</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You wish to give ${p_target_name} a gift of $target_item_name.</STRING>
			<STRING>I think ${p_target_name} really wants $target_item_name.</STRING>
			<STRING>You want to help out ${p_target_name} with $target_item_name.</STRING>
			<STRING>You need to see if ${p_target_name} likes $target_item_name.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_wedotogether" SELECT="All">
		<STRING define="quest_delivered">$quest_generic_delivered_speeches</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:p_target_name} and you are experimenting with $target_item_name today.</STRING>
			<STRING>You need ${p_target_name} to also have $target_item_name so we can compare experiences.</STRING>
			<STRING>You want ${p_target_name} to reproduce $target_item_name for $target_area_name.</STRING>
			<STRING>${c:p_target_name} and you are parading around $target_area_name with our $target_item_name today.</STRING>
			<STRING>I fear an invasion of $target_area_name and need ${p_target_name} brought $target_item_name to help with defense.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_idotothem" SELECT="All">
		<STRING define="quest_delivered">$quest_generic_delivered_speeches</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You must $hurt_verb ${p_target_name}, and do it in secret.</STRING>
			<STRING>${c:p_target_name} insulted me and must be notified.</STRING>
			<STRING>You are giving away ${target_item_name} to all the children of $target_area_name.</STRING>
			<STRING >${c:p_target_name} needs $target_item_name for our magicical experiment.</STRING>
			<STRING>${c:p_target_name} deserves $target_item_name for what happened.</STRING>
			<STRING>${c:p_target_name} made me $adj_feeling_bad, and you must make them $adj_feeling_bad by delivering $target_item_name.</STRING>
			<STRING>${c:p_target_name} is going to take this $target_item_name for what they've done.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_wedotoeachother" SELECT="All">
		<STRING define="quest_delivered">$quest_generic_delivered_speeches</STRING>
		<STRING define="quest_hellospeech">$quest_generic_hello_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You are starting a ${target_item_name} factory with ${p_target_name} help.</STRING>
			<STRING>${c:p_target_name} and you are scheduled to study $target_item_name today.</STRING>
			<STRING>${c:p_target_name} has insulted your honor, and only a ritual delivery of $target_item_name will satisfy it.</STRING>
			<STRING>You feel like decorating $target_item_name with ${p_target_name}.</STRING>
		</STRING>
	</STRING>

	<STRING ID="aggression" DEFINE="aggression" SELECT="Pick-1">
		<STRING PICKWEIGHT=50>NO</STRING>
		<STRING PICKWEIGHT="$target_level">YES</STRING>
	</STRING>
	
	<STRING ID="quest_point_awarded" DEFINE="quest_point_awarded" SELECT="Pick-1">
		<STRING PICKWEIGHT=2>NO</STRING>
		<STRING PICKWEIGHT=1>YES</STRING>
	</STRING>

	<STRING ID="gold_amount_awarded" DEFINE="gold_amount_awarded" SELECT="any-1">
		<STRING>$[$target_level*2]</STRING>
	</STRING>

	<STRING ID="xp_amount_awarded" DEFINE="xp_amount_awarded" SELECT="any-1">
		<STRING>$[100 + ($target_level * 3)]</STRING>
	</STRING>

	<STRING ID="target_level" DEFINE="target_level" SELECT="any-1">
		<STRING>${SELECT:MED_LEVEL from $target_area}</STRING>
	</STRING>
	
	<STRING ID="level_range" SELECT="any-1" DEFINE="level_range" MERGE=true>
		<STRING>$target_level</STRING>
	</STRING>
	
	<STRING ID="target_is_aggressive" SELECT="first" DEFINE="target_is_aggressive">
		<STRING CONDITION="$aggression = 'YES'">YES</STRING>
		<STRING>${SELECT: 'YES' from $target where 'Aggressive' in objattrib}</STRING>
	</STRING>

	<OBJECT ID="mql_viable_any_questtargets">
		SELECT: . FROM area\npcs 
			WHERE name\count &gt;= $num_targets 
			and current_intelligence>2 
			and "Aggressive" notin objattrib  
			and "QuestBound" notin affbehav 
			and (SELECT: count\. FROM mob\room\exits) &gt; 0 
			and 'ROOMUNEXPLORABLE' notin (SELECT: current_sensesstr FROM mob\room)
	</OBJECT>
	
	<OBJECT ID="mql_viable_questtargets">
		SELECT: . FROM area\npcs 
			WHERE name\count &gt;= $num_targets 
			and current_intelligence>2 
			and "Aggressive" notin objattrib  
			and "QuestBound" notin affbehav 
			and (SELECT: count\. FROM mob\room\exits) &gt; 0 
			and 'ROOMUNEXPLORABLE' notin (SELECT: current_sensesstr FROM mob\room)
	</OBJECT>
	
	<OBJECT ID="mql_viable_questtarget">
		SELECT: . FROM area\npcs 
			WHERE name\count=1 
			and current_intelligence>2 
			and "Aggressive" notin objattrib  
			and "QuestBound" notin affbehav 
			and (SELECT: count\. FROM mob\room\exits) &gt; 0 
			and 'ROOMUNEXPLORABLE' notin (SELECT: current_sensesstr FROM mob\room)
	</OBJECT>
	
	<OBJECT ID="target" DEFINE="target" SELECT="any-1">
		<OBJECT CONDITION="$targetname!=''">SELECT: ANY\. FROM $target_area\mobs WHERE name=$targetname</OBJECT>
		<OBJECT CONDITION="$targetname='' and $num_targets=1">
			SELECT: ANY\. FROM $target_area\npcs 
				WHERE name\count=1 
				and current_intelligence>2 
				and "Aggressive" notin objattrib  
				and "QuestBound" notin affbehav 
				and (SELECT: count\. FROM mob\room\exits) &gt; 0 
				and 'ROOMUNEXPLORABLE' notin (SELECT: current_sensesstr FROM mob\room)
		</OBJECT>
		<OBJECT CONDITION="$targetname='' and $num_targets &gt; 1">
			SELECT: ANY\. FROM $target_area\npcs 
				WHERE name\count &gt;= $num_targets 
				and current_intelligence>2 
				and "Aggressive" notin objattrib  
				and "QuestBound" notin affbehav 
				and (SELECT: count\. FROM mob\room\exits) &gt; 0 
				and 'ROOMUNEXPLORABLE' notin (SELECT: current_sensesstr FROM mob\room)
		</OBJECT>
	</OBJECT>

	<STRING ID="target_name" SELECT="any-1" DEFINE="target_name">
		<STRING>${SELECT:name from $target}</STRING>
	</STRING>

	<STRING ID="target_int" SELECT="any-1" DEFINE="target_int">
		<STRING>${SELECT:current_intelligence from $target}</STRING>
	</STRING>
	
	<STRING ID="target_faction" SELECT="any-1" DEFINE="target_faction">
		<STRING>${SELECT:factionid from $target}</STRING>
	</STRING>

	<STRING ID="target_faction_amt" SELECT="first" DEFINE="target_faction_amt">
		<STRING CONDITION="$target_faction!=''">${SELECT:factionamt from $target}</STRING>
		<STRING CONDITION="$target_faction=''">0</STRING>
	</STRING>
	
	<OBJECT ID="target_area" SELECT="Pick-1" DEFINE="target_area">
		<OBJECT pickweight=55555 condition="$targetarea_name != ''">SELECT: ANY\. FROM areas where NAME=$targetarea_name</OBJECT> 
		<OBJECT pickweight=1 condition="$targetarea_name = '' and $target_min_arealevel = '' and $num_targets = 1">
			SELECT: ANY\. FROM areas WHERE (SELECT: count\. from $mql_viable_questtarget) &gt; 0
		</OBJECT>
		<OBJECT pickweight=1 condition="$targetarea_name = '' and $target_min_arealevel = '' and $num_targets &gt; 1">
			SELECT: ANY\. FROM areas WHERE (SELECT: count\. from $mql_viable_questtargets) &gt; 0
		</OBJECT>
		<OBJECT pickweight=1 condition="$targetarea_name = '' and $target_min_arealevel != '' and $num_targets = 1">
			SELECT: ANY\. FROM areas WHERE MED_LEVEL &gt;= $target_min_arealevel and MED_LEVEL &lt;= $target_max_arealevel 
				and (SELECT: count\. from $mql_viable_questtarget) &gt; 0
		</OBJECT>
		<OBJECT pickweight=1 condition="$targetarea_name = '' and $target_min_arealevel != '' and $num_targets &gt; 1">
			SELECT: ANY\. FROM areas WHERE MED_LEVEL &gt;= $target_min_arealevel and MED_LEVEL &lt;= $target_max_arealevel 
				and (SELECT: count\. from $mql_viable_questtargets) &gt; 0
		</OBJECT>
	</OBJECT>

	<STRING ID="target_room_id" DEFINE="target_room_id">${SELECT: roomid from $target\room}</STRING>
	
	<STRING ID="target_area_name" SELECT="any-1" DEFINE="target_area_name">
		<STRING>${SELECT:name from $target_area}</STRING>
	</STRING>	
	
	<STRING ID="item_level" define="item_level">$target_level</STRING>
	<STRING ID="target_item_name" define="target_item_name">${SELECT: NAME from (SELECT: FIRST\. from $target_item)}</STRING>
	<OBJECT ID="target_item" define="target_item" SELECT="Any-1">
		<OBJECT condition="$itemname=''">SELECT: ANY\. FROM $item_junk</OBJECT>
		<OBJECT condition="$itemname!=''">
			<ITEM class="GenItem" name="$itemname" display="$itemname lies here">
				<MATERIAL SELECT="Pick-1">
					<MATERIAL PICKWEIGHT=99 CONDITION="$item_material=''">$any_Item_material</MATERIAL>
					<MATERIAL PICKWEIGHT=1 CONDITION="$item_material!=''">$item_material</MATERIAL>
				</MATERIAL>
				<LEVEL SELECT="Pick-1">
					<LEVEL PICKWEIGHT=99 CONDITION="$item_level=''">$level_range</LEVEL>
					<LEVEL PICKWEIGHT=1 CONDITION="$item_level!=''">$item_level</LEVEL>
				</LEVEL>
			</ITEM>
		</OBJECT>
	</OBJECT>
	
	<STRING ID="multi_target" define="multi_target" select="Pick-1">
		<STRING pickweight=2>no</STRING>
		<STRING pickweight=1>yes</STRING>
	</STRING>

	<STRING ID="num_targets" SELECT="any-1" DEFINE="num_targets" MERGE=overwrite>
		<STRING condition="$multi_target!='yes'">1</STRING>
		<STRING condition="$multi_target='yes'">$[3?8]</STRING>
	</STRING>

</QUEST>