ta ligado q aki deveriia tar 100 neh?
if #list >= 2 then
By didogunner, 04 de fev. de 2013 in Tópicos Sem Resposta
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino

ta ligado q aki deveriia tar 100 neh?
if #list >= 2 then
info
Group: Artesão
Joined: 27/04/11
Posts: 112
Reputation: +2

sim
" eu não ia por 100 catch pra testar ;o AHUHUEhuehe
mas o problema é esse? ;X
não esta faltando função pra ele responder na volta? ;o
info
Group: Infante
Joined: 25/01/12
Posts: 1.6k
Reputation: +330

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
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] = 1
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 >= 2 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[cid] = 0
return true
end
elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) then
selfSay("So good bye...", cid)
talkState[cid] = 0
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
eu acho q o talkUser tava errado e não tava ligando com a outra fala do player.. testa ai ;/
info
Group: Artesão
Joined: 27/04/11
Posts: 112
Reputation: +2

Não foi ;/
Xenty não ta faltando voltar pro (msgcontains(msg, 'misson') pro player poder falar? Player: Mission e ele responder "não você não acabou" e se ele acabou Player: Mission " Sim muito bem ai esta seu premio".
Conversa - ele faz isso com YES ;X
13:29 Catcher: Welcome Ghost, what you want?
13:30 Ghost [20]: yes
13:30 Catcher: You haven't caught 100 pokemons yet, come back when you do that...
Edited Fevereiro 4 by DidoGunner
info
Group: Infante
Joined: 25/01/12
Posts: 1.6k
Reputation: +330

você catou 100 pokemons ? ![]()
ele ta dizendo que voce n tem os 100 pokemons catados
info
Group: Artesão
Joined: 27/04/11
Posts: 112
Reputation: +2

não né man
" eu coloquei na conf
if #list >= 2 then
;O somente 2 catchs... mas é ai que ta o que eu falei ![]()
ele fala que eu n catei eu falando hi, yes
a logica certa seria pro hi, mission ( ai ele falar se eu terminei ou não )
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino

tente 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
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 >= 2 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())
mas nem era pra tu poder flar 'yes' direto ![]()
info
Group: Artesão
Joined: 27/04/11
Posts: 112
Reputation: +2

UHAHUahuau né
bom perfeito! como to devendo um rep+ pro stylo a próxima pra variar é sua huauhhuaa
vlw duvida sanada! ;X
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino

sanado, movido
info
Group: Herói
Joined: 28/11/10
Posts: 3.4k
Reputation: +585
Gender: Masculino

info
Group: Artesão
Joined: 27/04/11
Posts: 112
Reputation: +2
Bom o NpC é perfeito! ou quase
só tem um probleminha...
Ele te da a "missão" quando vc completa o catch e vai falar com ele, ele não responde nada
você tem que falar yes ele responde "You haven't caught 100 pokemons yet, come back when you do that..."
Gostaria que ele falasse algo como "você terminou a sua missão?" você fala-se yes
Ai sim ele entrega-se o premio ou fala-se "You haven't caught 100 pokemons yet, come back when you do that..."
;X
Catcher.lua
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 >= 2 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[cid] = 0
return true
end
elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) then
selfSay("So good bye...", cid)
talkState[cid] = 0
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Edited Fevereiro 4 by DidoGunner