Bot format

From CatchChallenger wiki
Jump to: navigation, search

Bot format

<!--
 default:
 skin is invisible
 -->
<bots>
	<bot id="1">
		<step id="1" type="text">
			<text lang="en"><![CDATA[Hello world!]]></text>
		</step>
	</bot>
	<bot id="2">
		<step id="1" type="text">
			<text lang="en"><![CDATA[Welcome in my shop!<br />
			<br />
			<center>
				<a href="2">Buy</a><br />
				<a href="3">Sell</a><br />
				<span class="remote"><a href="http://catchchallenger.first-world.info/shop/">Buy with real money</a><br /></span>
				<span class="quest"><a href="4">Quest<br /></a></span>
			</center>]]></text>
		</step>
		<step id="2" type="shop" shop="1" />
		<step id="3" type="sell" shop="1" />
		<step id="4" type="quests" />
		<step id="5" industry="9" type="industry" />
		<step id="6" type="zonecapture" zone="arcania" />

		<!-- Farm your success -->

	</bot>
	<bot id="3">
		<step id="1" type="text">
			<text lang="en"><![CDATA[You are into dangerous zone.<br />
			Here grow the root of the evil.<br />
			<br />
			Take care.]]></text>
		</step>
	</bot>
	<bot id="4">
		<step id="1" type="text">
			<text lang="en"><![CDATA[I can learn you some attack<br />
			<br />
			<center>
				<a href="4">Heal</a><br />
				<a href="2">Learn</a><br />
				<a href="3">Quest</a><br />
			</center>]]></text>
		</step>
		<step id="2" type="learn" />
		<step id="3" type="quests" /><!-- show the default failure text if failed -->
		<step id="4" type="heal" />
		<step id="10" type="text">
			<text lang="en"><![CDATA[The bandit want I give you some plants.]]></text>
		</step>
	</bot>
	<bot id="5">
		<step id="1" type="fight" fightid="1" />
	</bot>
</bots>

Quest folder

client_logic.js + text.xml

Only to display the text on the client, client_logic.js:

if(currentQuestStep()==0)
	return '1';//do you want accept the quest
if(currentQuestStep()==1)
{
	if(haveQuestStepRequirements())
		return 50;//give all object to pass to step 2
	else
		return 42;//need more object
}
if(currentQuestStep()==2)
	return '55';//to finish the quest

text.xml:

<text>
	<client_logic id="1">
		<text lang="en"><![CDATA[Ho you hate the empire! Like me.<br />
			Collect 10 tooth to help me.<br />
			<br />
			<a href="11">Yes I hate the empire</a>]]></text>
	</client_logic>
	<client_logic id="42">
		<text lang="en"><![CDATA[I wait you with the 10 teeth]]></text>
	</client_logic>
	<client_logic id="50">
		<text lang="en"><![CDATA[Do you have the 10 tooth for me?<br />
			<br />
			<a href="21">Yes I have it</a>]]></text>
	</client_logic>
	<client_logic id="52">
		<text lang="en"><![CDATA[Thanks, you have finish my quest.]]></text>
	</client_logic>
	<client_logic id="53">
		<text lang="en"><![CDATA[You don't have the requiered quantity.]]></text>
	</client_logic>
</text>

Quest logic

<quest id="2" repeatable="yes" bot="2">
	<name lang="en"><![CDATA[Farm your success]]></name>
	<requirements>
		<quest id="1" />
	</requirements>
	<step id="1">
		<text lang="en"><![CDATA[Abrind 5 craftball to the bandit]]></text>
		<item id="1" quantity="5" />
		<fight id="1" />
	</step>
	<step id="2" bot="4"><!-- just talk with a bot -->
		<text lang="en"><![CDATA[Talk to the reaper]]></text>
	</step>
	<rewards>
		<item id="3" quantity="2" />
		<reputation type="empire" point="-1" />
		<allow type="clan" />
	</rewards>
</quest>