Ele não tá trabalhando a condição, caso já tenha o Storage..
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
local reward = 2394
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
if(msgcontains(msg, 'ajuda')) then
talkUser = 1
selfSay('Sim? Mas antes de qualquer coisa, preciso de uma ajuda sua, você poderia levar uma garrafa ao Feiticeiro aqui perto? {sim/não} ', cid)
elseif (msgcontains(msg, 'sim')) then
selfSay('Ótimo, assim que voltar você pode me falar o que querias..', cid)
doPlayerAddItem(cid, 5553, 1)
setPlayerStorageValue(cid,9005,1)
elseif(msgcontains(msg, 'não')) then
selfSay('Eu estou precisando muito disso.. mas estou vendo que terei que fazer sozinho!',cid)
elseif getPlayerStorageValue(cid,9005)==1 then
selfSay('Eu já lhe entreguei o frasco, agora leve!',cid)
elseif getPlayerStorageValue(cid,9005)>1 then
selfSay('Você já entregou o frasco, não te lembras?',cid)
else
selfSay('Isso não me interessa agora!',cid)
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())