Postado Janeiro 28, 2014 11 anos Faala galera do TK ! Eu fiz uma quest entre nps aqui, tipo , vc pega um item com o npc e entrega pro outro e ganha um premio, mais tipo, o npc entrega o livro pro cara, eu vou no outro npc pra entregar pra ele, e eu com o livro na bag, o npc fala que n tem nenhum livro O.o, como posso arrumar? Vou passar os 2 npcs NPC que da o livro pra entregar pro outro : STORAGE = 100010 ITEM = 9002 QUANT = 1 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('Boa! O meu irmão fica nos Bandit do lado da plantação de cerejas! Boa sorte', cid) else npcHandler:say('Eu já le dei essa quest.', cid) end end npcHandler:resetNpc() return true end npcHandler:setMessage(MESSAGE_GREET, "Olá |PLAYERNAME|. Eu Tenho uma {quest} para voce.") local noNode = KeywordNode:new({'no'}, santaNPC, {present = false}) local yesNode = KeywordNode:new({'entregar'}, santaNPC, {present = true}) local node = keywordHandler:addKeyword({'quest'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Bom |PLAYERNAME|,eu le dei um livro para você {entregar} á meu irmão, você aceita?'}) node:addChildKeywordNode(yesNode) node:addChildKeywordNode(noNode) npcHandler:addModule(FocusModule:new()) E o NPC que entrega o livro pra ele e da a recompensa : STORAGE = 100010 ITEM = 9002 QUANT = 1 PREMIO = 2160 PQUANT = 100 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('Obrigado', cid) elseif getPlayerStorageValue(cid,STORAGE) >= 2 then npcHandler:say('Voce ja completou essa missao.', cid) elseif getPlayerStorageValue(cid,STORAGE) < 1 then npcHandler:say('Voce nao falou com o meu irmão.', cid) elseif getPlayerItemCount(cid,2330) <= 0 then npcHandler:say('Uai, cade o item que o meu irmão te deu?', cid) end end npcHandler:resetNpc() return true end npcHandler:setMessage(MESSAGE_GREET, "Olá |PLAYERNAME|,acredito que o {Frederic} le mandou.") local noNode = KeywordNode:new({'no'}, santaNPC, {present = false}) local yesNode = KeywordNode:new({'livro'}, santaNPC, {present = true}) local node = keywordHandler:addKeyword({'frederic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Frederic mandou voce me entregar o {livro}?'}) node:addChildKeywordNode(yesNode) node:addChildKeywordNode(noNode) npcHandler:addModule(FocusModule:new()) Dai eu falo : Hi ,frederic, livro. Dai ele fala : Uai, cade o item que o meu irmão te deu? E eu estou com o item na bag :S, tem como arrumar ? Editado Janeiro 28, 2014 11 anos por Anuudek (veja o histórico de edições) Atenciosamente, Anuudek.
Postado Janeiro 28, 2014 11 anos testa ae. NPC que da o livro pra entregar pro outro : local STORAGE = 100010 local ITEM = 9002 local QUANT = 1 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('Boa! O meu irmão fica nos Bandit do lado da plantação de cerejas! Boa sorte', cid) else npcHandler:say('Eu já le dei essa quest.', cid) end end npcHandler:resetNpc() return true end npcHandler:setMessage(MESSAGE_GREET, "Olá |PLAYERNAME|. Eu Tenho uma {quest} para voce.") local noNode = KeywordNode:new({'no'}, santaNPC, {present = false}) local yesNode = KeywordNode:new({'entregar'}, santaNPC, {present = true}) local node = keywordHandler:addKeyword({'quest'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Bom |PLAYERNAME|,eu le dei um livro para você {entregar} á meu irmão, você aceita?'}) node:addChildKeywordNode(yesNode) node:addChildKeywordNode(noNode) npcHandler:addModule(FocusModule:new()) E o NPC que entrega o livro pra ele e da a recompensa : local STORAGE = 100010 local ITEM = 9002 local QUANT = 1 local PREMIO = 2160 local PQUANT = 100 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('Obrigado', cid) elseif getPlayerStorageValue(cid,STORAGE) >= 2 then npcHandler:say('Voce ja completou essa missao.', cid) elseif getPlayerStorageValue(cid,STORAGE) < 1 then npcHandler:say('Voce nao falou com o meu irmão.', cid) elseif getPlayerItemCount(cid,2330) <= 0 then npcHandler:say('Uai, cade o item que o meu irmão te deu?', cid) end end npcHandler:resetNpc() return true end npcHandler:setMessage(MESSAGE_GREET, "Olá |PLAYERNAME|,acredito que o {Frederic} le mandou.") local noNode = KeywordNode:new({'no'}, santaNPC, {present = false}) local yesNode = KeywordNode:new({'livro'}, santaNPC, {present = true}) local node = keywordHandler:addKeyword({'frederic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Frederic mandou voce me entregar o {livro}?'}) node:addChildKeywordNode(yesNode) node:addChildKeywordNode(noNode) npcHandler:addModule(FocusModule:new()) Editado Janeiro 28, 2014 11 anos por Maenilse (veja o histórico de edições)
Postado Janeiro 28, 2014 11 anos Autor Ainda não deu /= continua aparecendo : 20:56 Marlon: Olá [Vip] Anuudek,acredito que o Frederic le mandou. 20:56 [Vip] Anuudek [32]: frederic 20:56 Marlon: Frederic mandou voce me entregar o livro? 20:56 [Vip] Anuudek [32]: livro 20:56 Marlon: Uai, cade o item que o meu irmão te deu? Atenciosamente, Anuudek.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.