KO

[Encerrado] Npc "Catcher"

Por Kooask, 17 de abr. de 2013 em Tópicos Sem Resposta

3
417
KooaskK
17 de abril de 2013 às 09:30

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 ;/

InsightI
17 de abril de 2013 às 12:09

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 por Insight

5 anos depois...
StigalS
21 de abril de 2018 às 02:44
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.