viniciusdrika 26 Postado Junho 4, 2013 Autor Share Postado Junho 4, 2013 Bom essa parte foi resolvido, nenhum erro, so que agora eu falo HELP, e nao acontece mais nada ; Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528111 Compartilhar em outros sites More sharing options...
StyloMaldoso 330 Postado Junho 4, 2013 Share Postado Junho 4, 2013 manow se tive usando o script do sky é so fala "ajuda" --' Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528112 Compartilhar em outros sites More sharing options...
viniciusdrika 26 Postado Junho 4, 2013 Autor Share Postado Junho 4, 2013 Sim deu certo desculpe, o ajuda deu certo desculpe o encomodo . Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528116 Compartilhar em outros sites More sharing options...
Skymagnum 234 Postado Junho 4, 2013 Share Postado Junho 4, 2013 Em 04/06/2013 em 23:11, Enself disse: Acho que arrumei a tag use a script do -Skymagnum Em Npc criei um arquivo chamado Arquiologo.xml Adicione o seguinte script. Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Arquiologo" script="arquiologo.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="134" head="78" body="88" legs="0" feet="88"/> <parameters> <parameter key= "message_greet" value= "hello, talk {help}."/> </parameters> </npc> Testei aqui pelomenos o bug que dava na distro foi retirado mas testei falar com npc não funcionou, ve ai. O erro não era no meu script, era no .xml do npc, eu só postei o .lua. @TOPIC É ajuda depois yes. Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528117 Compartilhar em outros sites More sharing options...
viniciusdrika 26 Postado Junho 4, 2013 Autor Share Postado Junho 4, 2013 (editado) So que agora na hora de falar yes nao acontece nada ; Editado Junho 4, 2013 por viniciusdrika Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528120 Compartilhar em outros sites More sharing options...
Enself 44 Postado Junho 4, 2013 Share Postado Junho 4, 2013 Em 04/06/2013 em 23:29, Skymagnum disse: Em 04/06/2013 em 23:11, Enself disse: Acho que arrumei a tag use a script do -Skymagnum Em Npc criei um arquivo chamado Arquiologo.xml Adicione o seguinte script. Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Arquiologo" script="arquiologo.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="134" head="78" body="88" legs="0" feet="88"/> <parameters> <parameter key= "message_greet" value= "hello, talk {help}."/> </parameters> </npc> Testei aqui pelomenos o bug que dava na distro foi retirado mas testei falar com npc não funcionou, ve ai. O erro não era no meu script, era no .xml do npc, eu só postei o .lua. @TOPIC É ajuda depois yes. O Bug que dava na distro éra na xml eu ja arrumei. Agora o seu script ta com bug na hora do Talk com npc somente funciona o hi , help , yes não está funcionando simplesmente o script não reage. Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528132 Compartilhar em outros sites More sharing options...
AsMinaPira 13 Postado Junho 5, 2013 Share Postado Junho 5, 2013 (editado) Tenta ae: Professor Roger.Xml Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Professor Roger" script="npc.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="523" head="114" body="119" legs="114" feet="114" corpse="2212"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|, i need some {help} with mys researches... Can you {help} me?"/> </parameters> </npc> npc.lua Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function doBuyPokemonWithCasinoCoins(cid, poke) npcHandler:onSellpokemon(cid) end 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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local function givePokemon(cid) local pokemon = "Nome do pokemon aqui local gender = getRandomGenderByName(pokemon) local btype = "normal" local happy = 220 if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then item = doCreateItemEx(11826) else item = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, 11826, 1) end doItemSetAttribute(item, "poke", pokemon) doItemSetAttribute(item, "hp", 1) doItemSetAttribute(item, "happy", happy) doItemSetAttribute(item, "gender", gender) doItemSetAttribute(item, "description", "Contains a "..pokemon..".") doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".") if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then doPlayerSendMailByName(getCreatureName(cid), item, 1) end doPlayerRemoveItem(cid, old, 1) --aki tira o old selfSay("So there is it! Take this pokemon, I think he will be better with you!", cid) setPlayerStorageValue(cid, 345965, 2) --storage da quest end old = ID DO ITEM AQUI if msgcontains(string.lower(msg), 'help') or msgcontains(string.lower(msg), 'ajuda') then selfSay("Hum... I need some itens to mys researches... Can you bring to me a Old Amber?", cid) talkState[talkUser] = 1 elseif (msgcontains(string.lower(msg), 'yes') or msgcontains(string.lower(msg), 'sim')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 345965) <= 0 then selfSay("Ok then go and bring this itens to me and maybe we can revive a old and rare Pokemon!!", cid) setPlayerStorageValue(cid, 345965, 1) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 345965) == 1 then if getPlayerItemCount(cid, old) >= 1 then --1 Old amber... selfSay("Wow then you got the items! Let me see if I could relive that pokemon!", cid) addEvent(givePokemon, 2000, cid) talkState[talkUser] = 0 return true else selfSay("You don't have my itens yet... Come back when you get them!!", cid) talkState[talkUser] = 0 return true end elseif getPlayerStorageValue(cid, 345965) == 2 then selfSay("Hummm.. You already help me, don't you? Thanks again.. but now i can't talk with you...", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) o npc é do slicer, só editei pra o npc recolher apenas 1 item... e o pokemon vai direto pro depot. Editado Junho 5, 2013 por AsMinaPira Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528210 Compartilhar em outros sites More sharing options...
Enself 44 Postado Junho 5, 2013 Share Postado Junho 5, 2013 Em 05/06/2013 em 02:12, AsMinaPira disse: Tenta ae: Professor Roger.Xml Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Professor Roger" script="npc.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="523" head="114" body="119" legs="114" feet="114" corpse="2212"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|, i need some {help} with mys researches... Can you {help} me?"/> </parameters> </npc> npc.lua Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function doBuyPokemonWithCasinoCoins(cid, poke) npcHandler:onSellpokemon(cid) end 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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local function givePokemon(cid) local pokemon = "Nome do pokemon aqui local gender = getRandomGenderByName(pokemon) local btype = "normal" local happy = 220 if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then item = doCreateItemEx(11826) else item = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, 11826, 1) end doItemSetAttribute(item, "poke", pokemon) doItemSetAttribute(item, "hp", 1) doItemSetAttribute(item, "happy", happy) doItemSetAttribute(item, "gender", gender) doItemSetAttribute(item, "description", "Contains a "..pokemon..".") doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".") if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then doPlayerSendMailByName(getCreatureName(cid), item, 1) end doPlayerRemoveItem(cid, old, 1) --aki tira o old selfSay("So there is it! Take this pokemon, I think he will be better with you!", cid) setPlayerStorageValue(cid, 345965, 2) --storage da quest end old = ID DO ITEM AQUI if msgcontains(string.lower(msg), 'help') or msgcontains(string.lower(msg), 'ajuda') then selfSay("Hum... I need some itens to mys researches... Can you bring to me a Old Amber?", cid) talkState[talkUser] = 1 elseif (msgcontains(string.lower(msg), 'yes') or msgcontains(string.lower(msg), 'sim')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 345965) <= 0 then selfSay("Ok then go and bring this itens to me and maybe we can revive a old and rare Pokemon!!", cid) setPlayerStorageValue(cid, 345965, 1) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 345965) == 1 then if getPlayerItemCount(cid, old) >= 1 then --1 Old amber... selfSay("Wow then you got the items! Let me see if I could relive that pokemon!", cid) addEvent(givePokemon, 2000, cid) talkState[talkUser] = 0 return true else selfSay("You don't have my itens yet... Come back when you get them!!", cid) talkState[talkUser] = 0 return true end elseif getPlayerStorageValue(cid, 345965) == 2 then selfSay("Hummm.. You already help me, don't you? Thanks again.. but now i can't talk with you...", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) o npc é do slicer, só editei pra o npc recolher apenas 1 item... e o pokemon vai direto pro depot. Vou ver se é funcional amanhã eu posto estou no nootebok. Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528218 Compartilhar em outros sites More sharing options...
viniciusdrika 26 Postado Junho 5, 2013 Autor Share Postado Junho 5, 2013 Em 05/06/2013 em 02:12, AsMinaPira disse: Tenta ae: Professor Roger.Xml Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Professor Roger" script="npc.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="523" head="114" body="119" legs="114" feet="114" corpse="2212"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|, i need some {help} with mys researches... Can you {help} me?"/> </parameters> </npc> npc.lua Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function doBuyPokemonWithCasinoCoins(cid, poke) npcHandler:onSellpokemon(cid) end 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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local function givePokemon(cid) local pokemon = "Nome do pokemon aqui local gender = getRandomGenderByName(pokemon) local btype = "normal" local happy = 220 if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then item = doCreateItemEx(11826) else item = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, 11826, 1) end doItemSetAttribute(item, "poke", pokemon) doItemSetAttribute(item, "hp", 1) doItemSetAttribute(item, "happy", happy) doItemSetAttribute(item, "gender", gender) doItemSetAttribute(item, "description", "Contains a "..pokemon..".") doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".") if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then doPlayerSendMailByName(getCreatureName(cid), item, 1) end doPlayerRemoveItem(cid, old, 1) --aki tira o old selfSay("So there is it! Take this pokemon, I think he will be better with you!", cid) setPlayerStorageValue(cid, 345965, 2) --storage da quest end old = ID DO ITEM AQUI if msgcontains(string.lower(msg), 'help') or msgcontains(string.lower(msg), 'ajuda') then selfSay("Hum... I need some itens to mys researches... Can you bring to me a Old Amber?", cid) talkState[talkUser] = 1 elseif (msgcontains(string.lower(msg), 'yes') or msgcontains(string.lower(msg), 'sim')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 345965) <= 0 then selfSay("Ok then go and bring this itens to me and maybe we can revive a old and rare Pokemon!!", cid) setPlayerStorageValue(cid, 345965, 1) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 345965) == 1 then if getPlayerItemCount(cid, old) >= 1 then --1 Old amber... selfSay("Wow then you got the items! Let me see if I could relive that pokemon!", cid) addEvent(givePokemon, 2000, cid) talkState[talkUser] = 0 return true else selfSay("You don't have my itens yet... Come back when you get them!!", cid) talkState[talkUser] = 0 return true end elseif getPlayerStorageValue(cid, 345965) == 2 then selfSay("Hummm.. You already help me, don't you? Thanks again.. but now i can't talk with you...", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) o npc é do slicer, só editei pra o npc recolher apenas 1 item... e o pokemon vai direto pro depot. Apareceu seguinte erro [05/06/2013 14:04:20] [Error - LuaScriptInterface::loadFile] data/npc/scripts/Roger.lua:1: '=' expected near 'keywordHandler' [05/06/2013 14:04:20] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Roger.lua [05/06/2013 14:04:20] data/npc/scripts/Roger.lua:1: '=' expected near 'keywordHandler' Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528394 Compartilhar em outros sites More sharing options...
AsMinaPira 13 Postado Junho 5, 2013 Share Postado Junho 5, 2013 Tenta agora... npc.lua Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function doBuyPokemonWithCasinoCoins(cid, poke) npcHandler:onSellpokemon(cid) end 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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local function givePokemon(cid) local pokemon = "Nome do pokemon aqui" local gender = getRandomGenderByName(pokemon) local btype = "normal" local happy = 220 if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then item = doCreateItemEx(11826) else item = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, 11826, 1) end doItemSetAttribute(item, "poke", pokemon) doItemSetAttribute(item, "hp", 1) doItemSetAttribute(item, "happy", happy) doItemSetAttribute(item, "gender", gender) doItemSetAttribute(item, "description", "Contains a "..pokemon..".") doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".") if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then doPlayerSendMailByName(getCreatureName(cid), item, 1) end doPlayerRemoveItem(cid, old, 1) --aki tira o old selfSay("So there is it! Take this pokemon, I think he will be better with you!", cid) setPlayerStorageValue(cid, 345965, 2) --storage da quest end old = ID DO ITEM AQUI if msgcontains(string.lower(msg), 'help') or msgcontains(string.lower(msg), 'ajuda') then selfSay("Hum... I need some itens to mys researches... Can you bring to me a Old Amber?", cid) talkState[talkUser] = 1 elseif (msgcontains(string.lower(msg), 'yes') or msgcontains(string.lower(msg), 'sim')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 345965) <= 0 then selfSay("Ok then go and bring this itens to me and maybe we can revive a old and rare Pokemon!!", cid) setPlayerStorageValue(cid, 345965, 1) talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 345965) == 1 then if getPlayerItemCount(cid, old) >= 1 then --1 Old amber... selfSay("Wow then you got the items! Let me see if I could relive that pokemon!", cid) addEvent(givePokemon, 2000, cid) talkState[talkUser] = 0 return true else selfSay("You don't have my itens yet... Come back when you get them!!", cid) talkState[talkUser] = 0 return true end elseif getPlayerStorageValue(cid, 345965) == 2 then selfSay("Hummm.. You already help me, don't you? Thanks again.. but now i can't talk with you...", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528441 Compartilhar em outros sites More sharing options...
viniciusdrika 26 Postado Junho 5, 2013 Autor Share Postado Junho 5, 2013 Deu certo agora, so tem 1 erro, nada que atrapalhe mais é feio, eu falo Hi Help Yes, nao é na hora demora 1 poquinho dai aparece um otro npc nao importa onde ele esteja no mapa falando "aqui está seu pokemon, muito obrigado" . Acho que entendeu o q ouve '-' Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1528451 Compartilhar em outros sites More sharing options...
vital900 570 Postado Agosto 4, 2013 Share Postado Agosto 4, 2013 Tópico movido para a seção de dúvidas e pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1547374 Compartilhar em outros sites More sharing options...
vital900 570 Postado Agosto 4, 2013 Share Postado Agosto 4, 2013 Tópico movido para a seção de dúvidas e pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1547375 Compartilhar em outros sites More sharing options...
Stigal 584 Postado Abril 21, 2018 Share Postado Abril 21, 2018 A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda. * Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado. Link para o comentário https://xtibia.com/forum/topic/215601-encerrado-pedido-npc-que-pede-1-item-e-o-player-ganha-1-pokemon/page/2/#findComment-1734901 Compartilhar em outros sites More sharing options...
Posts Recomendados