Bom, eu tenho esse npc aqui, queria que vocês me ajudassem a configurar esse npc pra poder teleportar a um canto, npc de barco, só que quando tento falar, hi travel, na hora que falo yes, da erro de call back, alguém pode me ajudar?
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
local itemId = 8261
local countItem = 1
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'mission') then
if getPlayerStorageValue(cid, 30012) == -1 then
npcHandler:say('Good, I need you to infiltre the shadow mountain and get one '.. getItemNameById(itemId) ..' for me, you think you can do this task?', cid)
talkState[talkUser] = 1
else
npcHandler:say('I remember you.', cid)
end
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
npcHandler:say('Nice, i will wait you.', cid)
setPlayerStorageValue(cid, 30012, 1)
talkState[talkUser] = 0
elseif msgcontains(msg, 'treasure') then
if getPlayerStorageValue(cid, 30013) == -1 then
if getPlayerItemCount(cid, 8261) == 1 then
doPlayerRemoveItem (cid, 8261, 1)
setPlayerStorageValue(cid, 30013, 1)
npcHandler:say('I really dont beliave, you geet my treasure, niceee!!! brother, now you can travel with me for galdronia.', cid)
else
npcHandler:say('You do not have my treasure.', cid)
end
else
npcHandler:say('Thank for give my treasure for me.', cid)
end
posicao = {x=1077, y=1082, z=7}
elseif msgcontains(msg, 'galdronia') or msgcontains(msg, 'travel') then
npcHandler:say('Really do you want travel to galdronia? this will cost 50 valys.', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
Pergunta
Fjinst 36
Bom, eu tenho esse npc aqui, queria que vocês me ajudassem a configurar esse npc pra poder teleportar a um canto, npc de barco, só que quando tento falar, hi travel, na hora que falo yes, da erro de call back, alguém pode me ajudar?
Editado por FjinstLink para o comentário
https://xtibia.com/forum/topic/238233-ajuda-com-npc/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados