Não é esse arquivo q se edita manda o .lua q fica em data/npc/script/catcher.lua
posta ae. pra eu te ajudar.
Por Djonga, 24 de jan. de 2013 em Tópicos Sem Resposta
info
Grupo: Infante
Registrado: 25/01/12
Posts: 1.6k
Reputação: +330

Não é esse arquivo q se edita manda o .lua q fica em data/npc/script/catcher.lua
posta ae. pra eu te ajudar.
Editado Janeiro 24 por StyloMaldoso
Ok.
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 85 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 >= 85 then
selfSay("Thank you very much,take you reward...", cid)
setPlayerStorageValue(cid, 181644, 1) -- storage para liberar outfit
setPlayerStorageValue(cid, stg, 5) -- para ele nao fazer a missao novamente
doPlayerAddExperience(cid,30000000)
doPlayerAddItem(cid, 11641, 1) --box 4
doPlayerAddMoney(cid, 40000000) --400k
setPlayerStorageValue(cid, 705655, 1)
else
selfSay("You haven't caught 50 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())
info
Grupo: Infante
Registrado: 25/01/12
Posts: 1.6k
Reputação: +330

Scripter pareçe esta funfando 100%, apareçe algum erro console ?
Não, o problema é o seguinte.
eu copiei o script, apenas mudei a quantidade de catch's e os nomes ,e as outfits.
se eu falo com qualquer um , desde que eu não tenha feito a quest de nenhum deles ainda, eu posso pegar a reward, se eu tiver feito a de algum , não posso.
eu acho que é isso que não deixa fazer as outras quests:
setPlayerStorageValue(cid, stg, 5) -- para ele nao fazer a missao novamente
info
Grupo: Infante
Registrado: 25/01/12
Posts: 1.6k
Reputação: +330

Mais quando vc digita 'mission' n aconteçe nd né.. ? n apareçe msm nenum erro console ? ;x sem erro console fica dificil ;/
Não cara, fica sem erro nenhum S: nem fala nada, só falo "Hi, Mission" e ele não responde.
Eu acho que tem alguma coisa a ver com aquela storage e talz.. não?
Editado Janeiro 24 por LordJanden
info
Grupo: Infante
Registrado: 25/01/12
Posts: 1.6k
Reputação: +330

fala assim Hi
e depois..
mission
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

remove essa linha
setPlayerStorageValue(cid, stg, 5) -- para ele nao fazer a missao novamente
Stylo, eu falo assim e não dá certo.
VodKart , eu fiz isso em um NPC, dexo fazer em todos?
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

area incorreta, movido, por favor leia as regras do forum antes de postar!
ok slicer, agora pode me ajudar ? :S
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

tenta usar esse aki como base..
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 = 963852 --storage da quest, para o player n pegar 2x --muda ela em cada npc!!!
local stoOut = 181644 --storage da outfit
if msgcontains(msg, 'mission') 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 85 pokemons, can you do it?", cid)
talkState[talkUser] = 1
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 1 then
local list = getCatchList(cid)
if #list >= 85 then
selfSay("Thank you very much, take you reward...", cid)
setPlayerStorageValue(cid, stoOut, 1)
setPlayerStorageValue(cid, stoQuest, 1)
doPlayerAddExperience(cid,30000000)
doPlayerAddItem(cid, 11641, 1) --box 4
doPlayerAddMoney(cid, 40000000) --400k
else
selfSay("You haven't caught 85 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())
Peeggou caara, mais tem um problema.
eles dão um monte de vez a recompensa :S
Editado Janeiro 25 por LordJanden
info
Grupo: Infante
Registrado: 25/01/12
Posts: 1.6k
Reputação: +330

monte doque doido ? ![]()
doPlayerAddExperience(cid,30000000)
doPlayerAddItem(cid, 11641, 1) --box 4
doPlayerAddMoney(cid, 40000000) --400k
essa é a recompensa Exp/Box/e os 400k oque é esses 'monte ae '? ;/
info
Grupo: Artesão
Registrado: 14/06/11
Posts: 112
Reputação: +11
Gênero: Masculino
Bom, eae ^^
eu tenho um script de um Npc que é Catcher, e decidi fazer vários outros NPC's que dêem outfit.
mas, depois que eu falo com um , todos os outros npcs não respondem depois do "Mission".
meu script é esse:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Catcher" script="catcher.lua" walkinterval="350000" floorchange="0" speed="200" lookdir="2">
<health now="150" max="150"/>
<look type="1413" head="115" body="148" legs="39" feet="41"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, you want some {mission}?"/>
</parameters>
</npc>
alguem pode me ajudar?