ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
Which npc system do I need for an npc like this:
to work? I don't want the newest most complicated system, I just want one that is stable and works with this basic type of stuff. By the way I am using OTServ 8.60 r.6052
I just want to be able to make everything work in the xml file (like selling/buying stuff, doing this example, and setting storage values for quest) and have all my npcs use a "default.lua" script file.
Code:
?xml version="1.0"?>
<npc name="Billy" script="default.lua" floorchange="0" walkinterval="4000" walkradius="10">
<health now="150" max="150"/>
<look type="133" head="10" body="122" legs="19" feet="10"/>
<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>
</npc>
to work? I don't want the newest most complicated system, I just want one that is stable and works with this basic type of stuff. By the way I am using OTServ 8.60 r.6052
I just want to be able to make everything work in the xml file (like selling/buying stuff, doing this example, and setting storage values for quest) and have all my npcs use a "default.lua" script file.
Last edited: