Kooask 0 Postado Abril 17, 2013 Share Postado Abril 17, 2013 Eu estou com duvida na estorage para liberar a outfit ... Eu deixei assim: 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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'mission') and getPlayerStorageValue(cid, 705655) == -1 then selfSay("You need catch atleast 100 pokemons, can you do it?", cid) talkState[cid] = 1 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[cid] == 1 and getPlayerStorageValue(cid, 705655) == -1 then local list = getCatchList(cid) if #list >= 50 then selfSay("Thank you very much,take you reward...", cid) setPlayerStorageValue(cid, 181644, 1) -- storage para liberar outfit setPlayerStorageValue(cid, stg, 1) -- para ele nao fazer a missao novamente doPlayerAddExperience(cid,30000) setPlayerStorageValue(cid, 705655, 1) else selfSay("You haven't caught 100 pokemons yet, come back when you do that...", cid) talkState[cid] = 0 return true end elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) then selfSay("So good bye...", cid) talkState[cid] = 0 return false end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Eu coloquei a estorage da data/xml/outfits . Minha duvida é ! Ta configurado certo ? Porque quando o player pega 100 de catch e nao da pra pega a outfit, vai me chinga ate ;/ Link para o comentário https://xtibia.com/forum/topic/212344-encerrado-npc-catcher/ Compartilhar em outros sites More sharing options...
Insight 21 Postado Abril 17, 2013 Share Postado Abril 17, 2013 (editado) Tente este 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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local stoQuest = 9873242 --storage para n pegar o premio 2x local stoOut = 181644 --storage da roupa if (msgcontains(msg, 'mission') or msgcontains(msg, 'help')) and (not talkState[talkUser] or talkState[talkUser] == 0) then if getPlayerStorageValue(cid, stoQuest) >= 1 then selfSay("You already did this quest!", cid) talkState[talkUser] = 0 return true end selfSay("You need catch atleast 100 pokemons to win the reward, can you do it?", cid) talkState[talkUser] = 1 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, stoQuest) >= 1 then selfSay("You already did this quest!", cid) talkState[talkUser] = 0 return true end local list = getCatchList(cid) if #list >= 100 then selfSay("Thank you very much, take you reward...", cid) setPlayerStorageValue(cid, stoOut, 1) setPlayerStorageValue(cid, stoQuest, 1) doPlayerAddItem(cid, 11638, 1) --box 4 talkState[talkUser] = 0 return true else selfSay("You haven't caught 100 pokemons yet, come back when you do that...", cid) talkState[talkUser] = 0 return true end elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) then selfSay("So good bye...", cid) talkState[talkUser] = 0 return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Editado Abril 17, 2013 por Insight Link para o comentário https://xtibia.com/forum/topic/212344-encerrado-npc-catcher/#findComment-1505546 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/212344-encerrado-npc-catcher/#findComment-1734146 Compartilhar em outros sites More sharing options...
Posts Recomendados