tenta assim...
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local msg = msg:lower()
local refineItem = 8306
local playerItem = 9693
if (msgcontains(msg, 'trade') or msgcontains(msg, 'help')) then
selfSay("So, you want to trade your ".. getItemNameById(playerItem) .." for my ".. getItemNameById(refineItem) .. "... Are you sure that?", cid)
talkState[talkUser] = 1
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
if getPlayerItemCount(cid, playerItem) <= 0 then
selfSay("You don't have the ".. getItemNameById(playerItem) ..", go back when you get that!", cid)
talkState[talkUser] = 0
return true
end
doPlayerRemoveItem(cid, playerItem, 1)
doPlayerAddItem(cid, refineItem, 1)
selfSay("So thats it, if you have more go back and talk to me!", cid)
talkState[talkUser] = 0
return true
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
caso n saiba criar o .xml da um toque..








info
Grupo: Campones
Registrado: 01/12/12
Posts: 39
Reputação: 0
Char no Tibia: Lady Malone
Quero um script que o npc troque um item e refinação (8306 pure energy) por um item que o player traz pra ele (jester doll 9693).