[Encerrado] Pedido De Npc

webmasterxd
em Tópicos Sem Resposta

webmasterxd

PokemonAbsol
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 16/08/12Posts: 92Char no Tibia: Sedentaria

Tava com um ideia em fazer uma guest pokemon tipo assim : O player fala com npc ai o npc pergunta se ele ja deu dex em Omanyte e Omastar Se ele tiver dado dex ele ganha um premium ou seja um item "xxxx". Se ele nao tiver o npc fala "Procure um Omanyte e Omastar e quando der dex neles volte aqui".

LuckOake

avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 23/07/12Posts: 1104Gênero: MasculinoChar no Tibia: Luck Oake

Área errada, movido.

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

ta ae..

 

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 function checkFosseis(cid)

local poke = ""

 

for a = 1138, 1139 do

if not getPlayerInfoAboutPokemon(cid, oldpokedex[a-1000][1]).dex then

if a == 1139 then

poke = poke..oldpokedex[a-1000][1].."."

else

poke = poke..oldpokedex[a-1000][1]..", "

end

end

end

return poke

end

-------------------------------------

local reward = {{12222, 10}} --{ {id do item, qntdade} } // se quiser por mais itens... { {id do item, qntdade}, {id do item, qntdade} }

-------------------------------------

if getPlayerStorageValue(cid, 659896) == 1 then

selfSay("You already have help me...", cid)

talkState[cid] = 0

return false

end

 

if msgcontains(msg, 'help') and getPlayerStorageValue(cid, 659896) == -1 then

selfSay("You have the dex of the old pokemons Omanyte and Omastar?", cid)

talkState[cid] = 1

 

elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[cid] == 1 and getPlayerStorageValue(cid, 659896) == -1 then

 

local check = checkFosseis(cid)

if check == "" then

selfSay("Thank you very much, take this reward...", cid)

for i = 1, #reward do

doPlayerAddItem(cid, reward[1], reward[2])

end

setPlayerStorageValue(cid, 659896, 1)

else

selfSay("You haven't this poke(s) in your pokedex yet: "..check, 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())

 

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

webmasterxd

PokemonAbsol
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 16/08/12Posts: 92Char no Tibia: Sedentaria

vlw Slicercomo sempre min ajudourep+

SkyDangerous

Deus Kalec
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 17/01/09Posts: 2098Char no Tibia: Adra Sata

Eu tentei fazer por storage mas dava erro, acho que NPC nao aceita storage :c

 

Evite FLOOD.

 

 

Reportado.

Dúvida sanada :)

Me segui lá (:

 

b906.png

http://ageofwar.servegame.com/

IP: ageofwar.servegame.com

TIBIA: 10.78

GLOBAL PERFECT CUSTOM

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
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.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel