DO
pedido

[Encerrado] Npc catcher

Por DouglasNeves, 26 de jan. de 2013 em Tópicos Sem Resposta

npc de catcher
script
pda
slicer
9
1.7k
26 de janeiro de 2013 às 13:37

Preciso de um script COMPLETO do npc catcher,com 100 caughts ganha a outfit catcher e uma Box+3. OBS: Pda v.1.8 do Slicer

SlicerS
26 de janeiro de 2013 às 20:01

oq exatamente tu quer dizer com 'completo' ja postei varios npcs desse tpw... mas a maioria soh entregando a outfit e box 4 ...

 

tu diz q com 15 catchs ganhei algu, com 30 catchs ganhe outra coisa e assim por diante? se for, me diz quais catchs tu quer q ganhe algu q eu faço aki.. tpw..

ques q ganhe algu nos catchs.. 15, 30, 45, 60, 85 e 100? ...

26 de janeiro de 2013 às 20:29

Não apenas com caught 100,ah pode faze a box 4 ,mas quero o script "completo",no .xml e no "script"

SlicerS
26 de janeiro de 2013 às 20:41

blz... vai em npc/scripts e cria um arquivo .lua com o nome Catcher.lua e cola isso dentro..

 

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[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())

 

 

dai depois volte na pasta npc/ e crie um arquivo .xml com o nome Catcher.xml e cole isso dentro...

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Catcher" script="Catcher.lua" walkinterval="3000" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="1413" head="114" body="119" legs="114" feet="114" corpse="2212"/>

<parameters>
   <parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

 

26 de janeiro de 2013 às 20:49

Testei de deu certo,vlw ae REP+

SlicerS
26 de janeiro de 2013 às 21:24

sanado, movido

9 meses depois...
01 de outubro de 2013 às 22:52
[01/10/2013 22:51:06] [Error - Npc interface]

[01/10/2013 22:51:06] data/npc/scripts/Catcher.lua:onCreatureSay

[01/10/2013 22:51:06] Description:

[01/10/2013 22:51:06] data/npc/scripts/Catcher.lua:37: attempt to get length of global 'getCatchList' (a nil value)

[01/10/2013 22:51:06] stack traceback:

[01/10/2013 22:51:06] data/npc/scripts/Catcher.lua:37: in function 'callback'

[01/10/2013 22:51:06] data/npc/lib/npcsystem/npchandler.lua:391: in function 'onCreatureSay'

[01/10/2013 22:51:06] data/npc/scripts/Catcher.lua:9: in function <data/npc/scripts/Catcher.lua:9>


me ajuda a arrumar aee vlws, meu sv é base erondino 8.54

se funfar dou REP+
nociamN
01 de outubro de 2013 às 22:59

Porque vc nao tem essa funcao getCatchList, e e provável que nao funcione no seu ot.

4 anos depois...
StigalS
21 de abril de 2018 às 03:03
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.