<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:include schemaLocation="../quest_data/quest_data.xsd" />
	<xs:include schemaLocation="../import.xsd" />
	
	<xs:element name="quest_scripts" type="QuestScripts" />
	
	<xs:complexType name="QuestScripts">
		<xs:sequence minOccurs="0" maxOccurs="unbounded">
			<xs:element ref="import" minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="item_collecting" type="ItemCollectingData" minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="report_to" type="ReportToData" minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="monster_hunt" type="MonsterHuntData" minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="work_order" type="WorkOrdersData" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="QuestScriptData" abstract="true" >
		<xs:attribute name="id" type="xs:int" use="required" />
	</xs:complexType>
	
	<xs:complexType name="ItemCollectingData">
		<xs:complexContent>
			<xs:extension base="QuestScriptData">
				<xs:attribute name="start_npc_id" type="xs:int" use="required"/>
				<xs:attribute name="action_item_id" type="xs:int" default="0"/>
				<xs:attribute name="end_npc_id" type="xs:int" default="0"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	
	<xs:complexType name="ReportToData">
		<xs:complexContent>
			<xs:extension base="QuestScriptData">
				<xs:attribute name="start_npc_id" type="xs:int" use="required"/>
				<xs:attribute name="end_npc_id" type="xs:int" use="required"/>
				<xs:attribute name="item_id" type="xs:int" default="0"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="MonsterHuntData">
		<xs:complexContent>
			<xs:extension base="QuestScriptData">
				<xs:sequence>
					<xs:element name="monster_infos" type="MonsterInfos" minOccurs="1" maxOccurs="unbounded"/>
				</xs:sequence>
				<xs:attribute name="start_npc_id" type="xs:int" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="MonsterInfos" >
		<xs:attribute name="var_id" type="xs:int" use="required"/>
		<xs:attribute name="max_kill" type="xs:int" use="required"/>
		<xs:attribute name="npc_id" type="xs:int" use="required"/>
	</xs:complexType>
	
	<xs:complexType name="WorkOrdersData">
		<xs:complexContent>
			<xs:extension base="QuestScriptData">
				<xs:sequence>
					<xs:element name="give_component" type="QuestItems" minOccurs="1" maxOccurs="unbounded"/>
				</xs:sequence>
				<xs:attribute name="start_npc_id" type="xs:int" use="required"/>
				<xs:attribute name="recipe_id" type="xs:int" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
</xs:schema>
