Skip to content

Instantly share code, notes, and snippets.

@BenDol
Created December 5, 2014 15:26
Show Gist options
  • Save BenDol/fdf1b8edcc087eba53dc to your computer and use it in GitHub Desktop.
Save BenDol/fdf1b8edcc087eba53dc to your computer and use it in GitHub Desktop.
example.xml
<?xml version="1.0"?>
<interaction>
<interact keywords="bank">
<response text="The depots are very easy to use. Just step in front of them and you will find your items in them. They are free for all tibian citizens."/>
</interact>
<interact keywords="offer">
<!--These are alternative keywords-->
<keywords>sell</keywords>
<keywords>money</keywords>
<keywords>change</keywords>
<keywords>buy</keywords>
<keywords>exchange</keywords>
<response text="We exchange gold, platinum and crystal coins."/>
</interact>
<interact keywords="change;gold">
<response text="How many platinum coins do you want to get?">
<interact keywords="|AMOUNT|">
<response text="So I should change |N1| of your gold coins to |AMOUNT| platinum coins for you?">
<action name="script" value="_state.n1 = _state.amount*100"/>
<interact keywords="yes">
<response>
<action name="script">
<![CDATA[
if getPlayerItemCount(cid, 2148) >= _state.amount*100 then
selfSay("Here you are.", cid)
doPlayerRemoveItem(cid, 2148, _state.amount*100)
doPlayerAddItem(cid, 2152, _state.amount)
else
selfSay("Sorry, you don't have enough gold coins.", cid)
end
]]>
</action>
</response>
</interact>
<interact keywords="|*|">
<response text="Well, can I help you with something else?"/>
</interact>
</response>
</interact>
</response>
</interact>
<interact keywords="change;platinum">
<response text="Do you want to change your platinum coins to gold or crystal?">
<interact keywords="gold">
<response text="How many platinum coins do you want to change to gold?">
<interact keywords="|AMOUNT|">
<response text="So I should change |AMOUNT| of your platinum coins to |N1| gold coins for you?">
<action name="script" value="_state.n1 = _state.amount*100"/>
<interact keywords="yes">
<response>
<action name="script">
<![CDATA[
if getPlayerItemCount(cid, 2152) >= _state.amount then
selfSay("Here you are.", cid)
doPlayerRemoveItem(cid, 2152, _state.amount)
doPlayerAddItem(cid, 2148, _state.amount * 100)
else
selfSay("Sorry, you don't have enough platinum coins", cid)
end
]]>
</action>
</response>
</interact>
<interact keywords="|*|">
<response text="Well, can I help you with something else?"/>
</interact>
</response>
</interact>
</response>
</interact>
<interact keywords="crystal">
<response text="How many crystal coins do you want to get?">
<interact keywords="|AMOUNT|">
<response text="So I should change |N1| of your platinum coins to |AMOUNT| crystal coins for you?">
<action name="script" value="_state.n1 = _state.amount*100"/>
<interact keywords="yes">
<response>
<action name="script">
<![CDATA[
if getPlayerItemCount(cid, 2152) >= _state.amount*100 then
selfSay("Here you are.", cid)
doPlayerRemoveItem(cid, 2152, _state.amount*100)
doPlayerAddItem(cid, 2160, _state.amount)
else
selfSay("Sorry, you don't have enough platinum coins.", cid)
end
]]>
</action>
</response>
</interact>
<interact keywords="|*|">
<response text="Well, can I help you with something else?"/>
</interact>
</response>
</interact>
</response>
</interact>
</response>
</interact>
<interact keywords="change;crystal">
<response text="How many crystal coins do you want to change to platinum?">
<interact keywords="|AMOUNT|">
<response text="So I should change |AMOUNT| of your crystal coins to |N1| platinum coins for you?">
<action name="script" value="_state.n1 = _state.amount*100"/>
<interact keywords="yes">
<response>
<action name="script">
<![CDATA[
if getPlayerItemCount(cid, 2160) >= _state.amount then
selfSay("Here you are.", cid)
doPlayerRemoveItem(cid, 2160, _state.amount)
doPlayerAddItem(cid, 2152, _state.amount*100)
else
selfSay("Sorry, you don't have enough crystal coins.", cid)
end
]]>
</action>
</response>
</interact>
<interact keywords="|*|">
<response text="Well, can I help you with something else?"/>
</interact>
</response>
</interact>
</response>
</interact>
</interaction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment