<?xml version="1.0" encoding="ISO-8859-1"?>
<npc name="Jade" access="3" lookdir="2" speed="0" walkinterval="0">
<mana now="100" max="100"/>
<health now="1500" max="1500"/>
<look type="136" head="77" body="82" legs="79" feet="10" addon="1" corpse="3128"/>
<interaction range="2" idletime="0" defaultpublic="0">
<!--This will include the merchant interaction, in this way several npc can use the same interaction-->
<include file="merchant.xml"/>
<interact keywords="hi" focus="1">
<!--These are the alternative keywords-->
<keywords>oi</keywords>
<response text="Olá. Como posso te ajudar |NAME|?"/>
</interact>
<interact keywords="bye" focus="0">
<!--These are the alternative keywords-->
<keywords>tchau</keywords>
<response text="Volte sempre."/>
</interact>
<!--
<interact event="onBusy">
<response text="One moment please, |NAME|.">
<action name="addqueue" value="|PLAYER|"/>
</response>
</interact>
-->
<interact event="onPlayerLeave" focus="0">
<response text="Volte sempre |NAME|."/>
</interact>
<interact keywords="name">
<response text="Meu nome é |NPCNAME|."/>
</interact>
<interact keywords="job">
<response text="Sou um comerciante, meu trabalho é te ajudar!"/>
</interact>
<interact keywords="trade">
<keywords>lista</keywords>
<keywords>buy</keywords>
<keywords>sell</keywords>
<list>axe</list>
<response>
<action name="script">
<![CDATA[
openShopWindow(cid, itemlist, -1, -1)
]]>
</action>
</response>
</interact>
<interact event="onPlayerShopSell">
<response>
<action name="price" value="|SELLPRICE|"/>
<action name="script">
<![CDATA[
if(doPlayerRemoveItem(cid, _state.itemid, _state.amount, _state.subtype) == TRUE) then
doPlayerAddMoney(cid, _state.price * _state.amount)
selfSay("Aqui está.", cid)
else
selfSay("Você não tem nenhum.", cid)
end
]]>
</action>
</response>
</interact>
<interact event="onPlayerShopBuy">
<response>
<action name="price" value="|BUYPRICE|"/>
<action name="script">
<![CDATA[
if(getPlayerMoney(cid) >= _state.amount * _state.price) then
local count
for count=0, _state.amount-1 do
local result = doPlayerAddItem(cid, _state.itemid, _state.subtype, 0)
if(result == -1) then
if(count == 0) then
selfSay("Você não tem espaço suficiente para carregar.", cid)
return
else
selfSay("Você não consegue carregar mais.", cid)
doPlayerRemoveMoney(cid, count * _state.price)
return
end
end
end
selfSay("Aqui está.", cid)
doPlayerRemoveMoney(cid, _state.price * _state.amount)
else
selfSay("Você não tem dinheiro suficiente.", cid)
end
]]>
</action>
</response>
</interact>
</interaction>
</npc>