Blz galera to aqui com um problema e preciso da ajuda de vcs...
eu mesmo editei o nome de alguns itens, to dizendo isso para vcs não se confundirem.
é um npc de missão, nem vo explicar pq o arquivo ja mostra o que eu quero...
NPC1
STORAGE = 100010 -- Não Mecha
ITEM = 5956 -- Item a ser adicionado para completar a quest
QUANT = 1 -- Quantidade de items a ser adicionado
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 santaNPC(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if (parameters.present == true) then
if (getPlayerStorageValue(cid, STORAGE) < 1) then
doPlayerAddItem(cid, ITEM, QUANT)
setPlayerStorageValue(cid, STORAGE, 1)
npcHandler:say('Vlw camarada e boa sorte!!!', cid)
else
npcHandler:say('voce ja pegou sua missao.', cid)
end
end
npcHandler:resetNpc()
return true
end
npcHandler:setMessage(MESSAGE_GREET, "Iae |PLAYERNAME|. Voce poderia me {ajudar} com uma coisa?")
local noNode = KeywordNode:new({'nao'}, santaNPC, {present = false})
local yesNode = KeywordNode:new({'sim'}, santaNPC, {present = true})
local node = keywordHandler:addKeyword({'ajudar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce so tem que entregar este ARQUIVO para meu amigo que esta perto do templo. Aceita?'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())
NPC2
STORAGE = 100010 -- Não Mecha
ITEM = 5956 -- Item a ser Removido , dado pelo primeiro NPC
QUANT = 0 -- Quantidade de item a ser removido dado pelo primeiro npc
PREMIO = 9808 -- Premio do NPC
PQUANT = 1 -- Quantidade de premio
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 santaNPC(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if (parameters.present == true) then
if getPlayerStorageValue(cid,STORAGE) == 1 and getPlayerItemCount(cid,2330) >= 1 then
doPlayerRemoveItem(cid,ITEM,QUANT)
doPlayerAddItem(cid,PREMIO,PQUANT)
setPlayerStorageValue(cid, STORAGE, 2)
npcHandler:say('Vlw camarada!!!', cid)
elseif getPlayerStorageValue(cid,STORAGE) >= 2 then
npcHandler:say('voce ja terminou esta missao.', cid)
elseif getPlayerStorageValue(cid,STORAGE) < 1 then
npcHandler:say('Voce nem falou com o noob ¬¬.', cid)
elseif getPlayerItemCount(cid,2330) <= 0 then
npcHandler:say('Voce nao tem nenhum arquivo...', cid)
end
end
npcHandler:resetNpc()
return true
end
npcHandler:setMessage(MESSAGE_GREET, "Iae |PLAYERNAME|.fale {arquivo} se voce esta aqui pela missao! ")
local noNode = KeywordNode:new({'nao'}, santaNPC, {present = false})
local yesNode = KeywordNode:new({'sim'}, santaNPC, {present = true})
local node = keywordHandler:addKeyword({'arquivo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Noob que te mandou aqui?'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())
o erro é esse: pego o item com o npc1 e levo ate o npc2 e ele pergunta se foi npc1 que me mandou, la eu digo que sim e ele fala que eu não tenho o item, mais o item ja ta na minha bolsa. pfv me ajudem queria muito essa missão no meu ot!!!