/
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/
<?xml version="1.0"?>
<!-- ----------------------------------------------------------------------------
Copyright 2019-2019 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: normal_protect2
settable vars: 
    template(normal_protect2)
    area_name(area name)
    source_name(mob name)
    targetarea_name(area name)
    multiarea(yes or NO)
    targetname(mobs name)
    num_targets(num mobs to kill)
	aggression(YES,NO)
	xp_amount_awarded
	gold_amount_awarded
	quest_point_awarded(YES,NO)
	announcechannel()
	reward_items()
	quest_multiple(YES, NO, or PREV)
-->

<QUEST ID="normal_protect2" QUEST_TEMPLATE_ID="normal_protect2">
	<QUEST_ID DEFINE="quest_id">${_:source_area_name}_${_:source_name}_${h:quest_template}_R$[100000000?999999999]</QUEST_ID>
	<QUEST_CRITERIA>+SYSOP +LEVELS -&lt;$[$target_level - $level_span] -&gt;$[$target_level + $level_span]</QUEST_CRITERIA>
	<ANNOUNCER_AREA>"$source_area_name"</ANNOUNCER_AREA>
	<ANNOUNCER_ROOM>"$source_room_id"</ANNOUNCER_ROOM>
	<ANNOUNCER_NAME>"$source_name"</ANNOUNCER_NAME>
	<QUEST_ANNOUNCECHANNEL>$announcechannel</QUEST_ANNOUNCECHANNEL>
	<PROTECTED_AREA>"$target_area_name"</PROTECTED_AREA>
	<PROTECTED_ROOM>ALL</PROTECTED_ROOM>
	<PROTECTED_MOB>"$target_name"</PROTECTED_MOB>
	<QUEST_PROTECTME_TEXT>Protect me $$r! They're coming for me!</QUEST_PROTECTME_TEXT>
	<ATTACKER_MOB>${SELECT: ANY\. from $attacker}</ATTACKER_MOB>
	<ATTACKER_PCT_CHANCE>$[5+($target_level/2)]</ATTACKER_PCT_CHANCE>
	<ATTACKER_SIZE>$num_targets</ATTACKER_SIZE>
	<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>$source_faction</FACTION>
	<NUMFACTION>$[$source_faction_amt / 500]</NUMFACTION>
	<QUEST_NAME SELECT="Any-1">
		<QUEST_NAME>${C:source_name} in ${C:source_area_name} needs ${target_name} $reason_verbed</QUEST_NAME>
		<QUEST_NAME>${C:source_name} in ${C:source_area_name} wants ${target_name} $reason_verbed</QUEST_NAME>
		<QUEST_NAME>${C:source_name} in ${C:source_area_name} asks ${target_name} to be $reason_verbed</QUEST_NAME>
		<QUEST_NAME>${C:reason_verb} ${target_name} for ${C:source_name} in ${C:source_area_name}</QUEST_NAME>
	</QUEST_NAME>
	<ATTACKER_SCREAM>${j:1:quest_fightspeech}</ATTACKER_SCREAM>
	<QUEST_NOTIFYSTRING>${j:1:quest_notifystring}</QUEST_NOTIFYSTRING>
	<QUEST_INSTRUCTIONSSTRING>${j:1:quest_instructionstring}</QUEST_INSTRUCTIONSSTRING>
	<QUEST_WINSPEECH_TEXT>${j:1:quest_winspeech}</QUEST_WINSPEECH_TEXT>
	<REWARD_ITEMS>${SELECT: ANY\. FROM $dungeon_treasure_items}</REWARD_ITEMS>

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

	<STRING ID="quest_notifystring" define="quest_notifystring" SELECT="ALL">
		<STRING ACTION="PREPEND">$reason_short  $quest_notifyaddendum</STRING>
	</STRING>

	<STRING ID="quest_notifyaddendum" SELECT="Pick-1">
		<STRING PICKWEIGHT=1>Are you game?</STRING>
		<STRING PICKWEIGHT=1>Are you ready?</STRING>
		<STRING PICKWEIGHT=1>Are you up to it?</STRING>
		<STRING PICKWEIGHT=1>Can you handle it?</STRING>
		<STRING PICKWEIGHT=1>Who's ready?</STRING>
		<STRING PICKWEIGHT=12></STRING>
	</STRING>
	
	<STRING ID="reason_short" define="reason_short" SELECT="Any-1">
		<STRING>${c:target_name} in $target_area_name needs to be $reason_verbed!</STRING>
		<STRING>Help $reason_verb ${target_name} in $target_area_name!</STRING>
		<STRING>Assistance required -- please go $reason_verb ${target_name} in $target_area_name!</STRING>
		<STRING>${c:reason_verb} ${target_name} in $target_area_name for me!</STRING>
		<STRING>${c:reason_verb} ${target_name} in $target_area_name, quickly!</STRING>
		<STRING>${c:target_name} in $target_area_name must be $reason_verbed!</STRING>
	</STRING>

	<STRING ID="quest_instructionstring" SELECT="ALL">
		<STRING ACTION="PREPEND">$reason_desc</STRING>
		<STRING ACTION="APPEND">$reason_short</STRING>
		<STRING ACTION="APPEND" CONDITION="$target_name != $source_name">Find $target_name!</STRING>
	</STRING>

	<STRING ID="reason_verbed">$verb_protected</STRING>
	<STRING ID="reason_verb">$verb_protect</STRING>
	<STRING ID="quest_winspeech" PREDEFINE="reason=$reason">$quest_winspeech</STRING>
	<STRING ID="quest_fightspeech" PREDEFINE="reason=$reason">$quest_fightspeech</STRING>
	<STRING ID="reason_desc" PREDEFINE="reason=$reason">$reason_desc</STRING>
	<STRING ID="reason" DEFINE="reason" SELECT="Any-1">
		<STRING CONDITION="$target_int &gt; 5">$reason_theyoweme</STRING>
		<STRING CONDITION="$target_int &gt; 5">$reason_iowethem</STRING>
		<STRING>$reason_genprotect</STRING>
		<STRING>$reason_idotothem</STRING>
		<STRING>$reason_theydidtome</STRING>
		<STRING>$reason_wedotoeachother</STRING>
	</STRING>

	<STRING id="quest_generic_loser_speeches" SELECT="Any-1">
		<STRING>I guess $target_name is doomed.</STRING>
		<STRING>This is unacceptable.</STRING>
		<STRING>Well, I give up on $target_name being $reason_verbed.</STRING>
		<STRING>You just can't find good help anymore.</STRING>
	</STRING>

	<STRING id="quest_generic_winner_speeches" SELECT="Any-1">
		<STRING>I feel safe now! Thanks!</STRING>
		<STRING>I feel ${c:reason_verbed} now! Thank you for your assistance.</STRING>
		<STRING>Thanks for the help!</STRING>
		<STRING>Thank you adventurer for choosing to $reason_verb me!</STRING>
	</STRING>

	<STRING ID="reason_theyoweme" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="quest_fightspeech" SELECT="Any-1">
			<STRING>Found you $target_name!!</STRING>
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:target_name} is blackmailing ${p:attacker_name} and want revenge!</STRING>
			<STRING>${c:target_name} snitched on ${p:attacker_name} and payback is coming.</STRING>
			<STRING>${c:target_name} witnessed the involvement of ${p:attacker_name} in certain schemes and is not in danger.</STRING>
			<STRING>${c:target_name} messed with the ${p:attacker_name} sister and is now in danger.</STRING>
		</STRING>
	</STRING>
	
	<STRING ID="reason_iowethem" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="quest_fightspeech" SELECT="Any-1">
			<STRING>Hand it over $target_name, or DIE!!!</STRING>
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:target_name} owes the ${p:attacker_name}. </STRING>
			<STRING>${c:target_name} carries something that the ${p:attacker_name} want, and will kill $target_himher for it!</STRING> 
			<STRING>${c:target_name} challenged ${p:attacker_name} on a dare, but is a coward and is now hiding from them.</STRING>
			<STRING>${c:target_name} is working something that the ${p:attacker_name} want, and will kill $target_himher for it!</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_genprotect" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="quest_fightspeech" SELECT="Any-1">
			<STRING>Found you $target_name!!</STRING>
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:target_name} is in great danger from $target_hisher rivals, the ${p:attacker_name}.</STRING>
			<STRING>${c:target_name} is probably just paranoid.  ${c:target_heshe} thinks ${p:attacker_name} are after $target_himher.</STRING>
			<STRING>${c:target_name} has been cursed, drawing unwanted attention to ${target_himher}self in the form of $attacker_name attacks.</STRING>
			<STRING>A mob of ${p:attacker_name} believes $target_name is guilty of horrible acts and are attacking $target_himher!</STRING>
		</STRING>
	</STRING>
	
	<STRING ID="reason_idotothem" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="quest_fightspeech" SELECT="Any-1">
			<STRING>Die ${c:target_name}!!!</STRING>
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:target_name} verbally provoked ${p:attacker_name} and is now in danger.</STRING>
			<STRING>${c:target_name} stole food from ${p:attacker_name} and now they want $target_hisher head.</STRING>
			<STRING>${c:target_name} attacked some ${p:attacker_name} and now they are coming for $target_himher.</STRING>
			<STRING>${c:target_name} has been spying on ${p:attacker_name} and they don't like it.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_theydidtome" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="quest_fightspeech" SELECT="Any-1">
			<STRING>I found you!</STRING>
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>The ${p:attacker_name} have mistaken ${target_name} for their great enemy, and now want to kill $target_himher.</STRING>
			<STRING>${c:target_name} has embarrassed the ${p:attacker_name}, and now they are set on an honor killing.</STRING>
			<STRING>The ${p:attacker_name} are jealous of ${c:target_name} and have decided to express it by killing $target_himher.</STRING>
			<STRING>The ${p:attacker_name} and bigoted against those like ${target_name} and have murder on their mind.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_wedotoeachother" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="quest_fightspeech" SELECT="Any-1">
			<STRING>I'm here to kill you!</STRING>
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${c:target_name} and the ${p:attacker_name} have never gotten along, and now $target_name is in danger.</STRING>
			<STRING>${c:target_name} has started refusing service to ${p:attacker_name} and will be killed for it.</STRING>
			<STRING>${c:target_name} and ${p:attacker_name} have long been rivals, and it's come to a head.</STRING>
			<STRING>${c:target_name} lost a deadly game to the ${p:attacker_name}, and they've come to collect.</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="will_attack_code" DEFINE="will_attack_code" SELECT="Any-1">
		<STRING CONDITION="$aggression='NO'">NO-USE-DEFAULT_BEHAVIOR</STRING>
		<STRING CONDITION="$aggression='YES'">YES-ATTACK-ON-SIGHT</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>

	<OBJECT ID="source_area" SELECT="Pick-1" DEFINE="source_area">
		<OBJECT pickweight=99999 condition="'${SELECT: name FROM area}' != ''">SELECT: . FROM area</OBJECT>
		<OBJECT pickweight=55555 condition="$area_name != ''" and '${SELECT: name FROM area}' = ''>SELECT: ANY\. FROM areas where NAME=$area_name</OBJECT> 
		<OBJECT pickweight=1 condition="$area_name = '' and '${SELECT: name FROM area}' = '' and $multiarea = 'YES'">
			SELECT: ANY\. FROM areas WHERE (SELECT: count\. from $mql_viable_questgivers) &gt; 0
		</OBJECT>
		<OBJECT pickweight=1 condition="$area_name = '' and '${SELECT: name FROM area}' = '' and $multiarea != 'YES'">
			SELECT: ANY\. FROM areas WHERE (SELECT: count\. from $mql_viable_questgivers) &gt; 1
		</OBJECT>
	</OBJECT>

	<OBJECT ID="source_room" DEFINE="source_room">SELECT: . FROM $source\room</OBJECT>
	
	<OBJECT ID="source" SELECT="Pick-1" DEFINE="source">
		<OBJECT PICKWEIGHT=99999 CONDITION="'${SELECT: name FROM mob}' != ''">SELECT: . FROM mob</OBJECT>
		<OBJECT pickweight=55555 condition="$sourcename != ''" and '${SELECT: name FROM mob}' = ''>SELECT: . FROM $source_area\npcs WHERE name = $sourcename</OBJECT> 
		<OBJECT PICKWEIGHT=1 CONDITION="$sourcename = '' and '${SELECT: name FROM mob}' = ''" insert="$mql_viable_questgiver" />
	</OBJECT>

	<STRING ID="source_area_name" SELECT="any-1" DEFINE="source_area_name">
		<STRING>${SELECT:name FROM $source_area}</STRING>
	</STRING>

	<STRING ID="target_level" DEFINE="target_level" SELECT="any-1">
		<STRING>${SELECT:mean\level FROM $target_area\npcs WHERE name = $target_name}</STRING>
	</STRING>
	
	<STRING ID="level_range" SELECT="any-1" DEFINE="level_range" MERGE=true>
		<STRING>$target_level</STRING>
	</STRING>
	
	<STRING ID="source_room_id" SELECT="any-1" DEFINE="source_room_id">
		<STRING>${SELECT:roomid from $source_room}</STRING>
	</STRING>

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

	<STRING ID="source_class" SELECT="any-1" DEFINE="source_class">
		<STRING>${SELECT:class from $source}</STRING>
	</STRING>

	<STRING ID="source_faction" SELECT="any-1" DEFINE="source_faction">
		<STRING>${SELECT:factionid from $source}</STRING>
	</STRING>

	<STRING ID="source_faction_amt" SELECT="first" DEFINE="source_faction_amt">
		<STRING CONDITION="$source_faction!=''">${SELECT:factionamt from $source}</STRING>
		<STRING>0</STRING>
	</STRING>

	<STRING ID="source_align" SELECT="any-1" DEFINE="source_align">
		<STRING>${SELECT:alignment from $source}</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>

	<STRING load="/resources/randareas/desert.xml" />
	<STRING load="/resources/randareas/forest.xml" />
	<STRING load="/resources/randareas/jungle.xml" />
	<STRING load="/resources/randareas/lair.xml" />
	<STRING load="/resources/randareas/rats.xml" />
	<STRING load="/resources/randareas/plains.xml" />
	<STRING load="/resources/randareas/mountains.xml" />
	<STRING load="/resources/randareas/swamp.xml" />
	
	<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 name != $source_name
			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 name != $source_name
			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="pick-1">
		<OBJECT PICKWEIGHT=999 CONDITION="$targetname!=''">SELECT: ANY\. FROM $target_area\mobs WHERE name=$targetname</OBJECT>
		<OBJECT PICKWEIGHT=1 CONDITION="$targetname=''">
			SELECT: ANY\. FROM $target_area\npcs 
				WHERE name\count=1 
				and current_intelligence>2 
				and name != $source_name
				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>
	
	<OBJECT PICKWEIGHT=1 CONDITION="$targetname='' and $source_area_name=$target_area_name">
		SELECT: ANY\. from $source
	</OBJECT>
	
	<STRING ID="attacker_name" SELECT="any-1" DEFINE="attacker_name">
		<STRING>${SELECT:name from $attacker}</STRING>
	</STRING>
	
	<OBJECT ID="attacker" DEFINE="attacker">SELECT: ANY\. FROM $attackers</OBJECT>

	<OBJECT ID="attackers" DEFINE="attackers" SELECT="pick-1">
		<OBJECT PICKWEIGHT=9>SELECT: ANY\. FROM $lair_mobs</OBJECT>
		<OBJECT PICKWEIGHT=9>SELECT: ANY\. FROM $rats_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $desert_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $forest_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $jungle_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $mountain_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $plains_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $swamp_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $lair_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $lair_mobs</OBJECT>
		<OBJECT PICKWEIGHT=1>SELECT: ANY\. FROM $lair_mobs</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="multiarea" define="multiarea">NO</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=100 condition="$targetarea_name = '' and $multiarea != 'YES'">SELECT: any\. from $source_area</OBJECT>
		<OBJECT pickweight=1 condition="$targetarea_name = '' and $multiarea = 'YES' 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 $multiarea = 'YES' and $num_targets &gt; 1">
			SELECT: ANY\. FROM areas WHERE (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_size" SELECT="any-1" DEFINE="target_area_size">
		<STRING>${SELECT:VISITABLE_ROOMS from $target_area}</STRING>
	</STRING>	
	
	<STRING ID="target_gender" SELECT="any-1" DEFINE="target_gender">
		<STRING>${SELECT:gender from $target}</STRING>
	</STRING>
	
	<STRING ID="target_himher" SELECT="any-1" DEFINE="target_himher">
		<STRING CONDITION="$target_gender = 'M'">him</STRING>
		<STRING CONDITION="$target_gender = 'F'">her</STRING>
		<STRING CONDITION="$target_gender = 'N'">it</STRING>
	</STRING>
	
	<STRING ID="target_hisher" SELECT="any-1" DEFINE="target_hisher">
		<STRING CONDITION="$target_gender = 'M'">his</STRING>
		<STRING CONDITION="$target_gender = 'F'">her</STRING>
		<STRING CONDITION="$target_gender = 'N'">it</STRING>
	</STRING>
	
	<STRING ID="target_heshe" SELECT="any-1" DEFINE="target_heshe">
		<STRING CONDITION="$target_gender = 'M'">he</STRING>
		<STRING CONDITION="$target_gender = 'F'">she</STRING>
		<STRING CONDITION="$target_gender = 'N'">it</STRING>
	</STRING>
	
	<STRING ID="target_area_name" SELECT="any-1" DEFINE="target_area_name">
		<STRING>${SELECT:name from $target_area}</STRING>
	</STRING>	
</QUEST>