GE
otclient

[OTClient] Sistema de Dialogo Otpokemon

Por Gengo, 29 de ago. de 2020 em Tutoriais de Clients

modules
21
19.4k
GengoG
29 de agosto de 2020 às 15:44

[OTClient] Sistema de Dialogo Otpokemon

 

Venho através desse tópico contribuir para a comunidade, um simples modulo de dialogo no estilo do Otpokemon,

não é um sistema de dialogo avançado é algo simples que deixa seu servidor intuitivo.

 

1) Faça o download do modulo no qual se encontra no final do tópico e abrindo a pasta do seu client, extraia e coloque o modulo na pasta modules.

 

2) O módulo utiliza uma função chamada switch que não é comum ter no otclient, porem podemos colocar sem muito esforço, na pasta do otclient abra o arquivo util.lua que se encontra em modules/corelib/ e no final do arquivo coloque o seguinte código:

Spoiler
function switch(indice)
  return function(codetable)
    local case = codetable[indice] or codetable.default
    if ( case ) then
      if ( type(case) == "function" ) then
        return case(indice)
      else
        error("action "..tostring(indice).." not a function")
      end
    end
  end
end

 

 

Feito o passo 1 e 2, vamos para a parte do servidor.

 

1) Crie um arquivo na pasta data/lib/ podendo ter o nome de npcdialog_lib.lua e coloque o seguinte código:

Spoiler
local OpcodeDialog = 80
local Actions = {
  open = 1,
  closed = 2
}

function doSendDialogNpc(cid, npc, msg, opc)
  if ( not opc ) then
    opc = ''
  end
  doSendPlayerExtendedOpcode(cid, OpcodeDialog, table.serialize({ action = Actions.open, data = { npcId = npc, message = msg, options = opc } })) 
end

function doSendDialogNpcClose(cid)
  doSendPlayerExtendedOpcode(cid, OpcodeDialog, table.serialize({ action = Actions.closed }))
end

 

 

2) O arquivo que acabamos de criar utiliza uma função chamada table.serialize que não é comum ter nos servidores, para que funcione sem erros vamos adicionar, abra o arquivo 012-table.lua que fica na pasta do seu servidor em data/lib/ ou você pode criar o arquivo e adicionar o seguinte código:

Spoiler
table.find = function (table, value)
  for i, v in pairs(table) do
	if(v == value) then
	  return i
    end
  end
  return nil
end

table.serialize = function(x, recur)
  local t = type(x)
  recur = recur or {}

  if t == nil then
    return "nil"
  elseif t == "string" then
	return string.format("%q", x)
  elseif t == "number" then
	return tostring(x)
  elseif t == "boolean" then
	return t and "true" or "false"
  elseif getmetatable(x) then
	error("Can not serialize a table that has a metatable associated with it.")
  elseif t == "table" then
    if(table.find(recur, x)) then
	  error("Can not serialize recursive tables.")
	end
	table.insert(recur, x)

	local s = "{"
	for k, v in pairs(x) do
	  s = s .. "[" .. table.serialize(k, recur) .. "]"
	  s = s .. " = " .. table.serialize(v, recur) .. ","
	end
	s = s .. "}"
	return s
  else
	error("Can not serialize value of type '" .. t .. "'.")
  end
end

 

 

 

Feito todo esse procedimento, estarei disponibilizando um npc para que vocês possam ter uma noção de como utilizar esse sistema de dialogo.

 

1) Crie um arquivo na pasta do servidor em data/npc/ chamado Gengo.xml e adicione o seguinte código:

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

<npc name="Gengo" script="gengo.lua">
  <health now="150" max="150"/>
  <look type="1413" head="114" body="119" legs="114" feet="114" corpse="2212"/>
</npc>

 

 

2) Crie um arquivo na pasta do servidor em data/npc/lib/ com o nome gengo.lua e adicione o seguinte código:

 

Spoiler
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onThink()                     npcHandler:onThink()                     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 greetCallback(cid)
  doSendDialogNpc(cid, getNpcId(), "Olá jovem, vejo que você conseguiu chegar até aqui!\nClique em Recompensa e fique feliz pela conquista!", "Fechar&Recompensa")
  return true             
end

function creatureSayCallback(cid, type, msg)
  if not npcHandler:isFocused(cid) then
    return false
  end
  
  if msgcontains(msg:lower(), "recompensa") then
    local message = ""
    if getPlayerStorageValue(cid, 7000) == -1 then
      setPlayerStorageValue(cid, 7000, 1)
	  doPlayerAddItem(cid, 2160, 1)
	  message = "Você acaba de ganhar uns trocado por chegar até aqui.\nVolte sempre!"
	else
	  message = "Você ja pegou sua recompensa, obrigado e volte sempre!"
    end	
	doSendDialogNpc(cid, getNpcId(), message, "Fechar")
  elseif msgcontains(msg:lower(), "fechar") then
	doSendDialogNpcClose(cid)
	npcHandler:unGreet(cid)	
  end

  return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())

 

 

O npc é algo simples, porem serve para que você possa ter uma noção de como utilizar as funções do npc.

 

Demostrativo dentro do game:

AivYsrD.png

 

Arquivos para download e o scan:

 

Editado Abril 23 por Yan Liima

kttallanK
29 de agosto de 2020 às 15:51

Muito interessante mano, isso melhora bastante a qualidade do servidor!

GabrieltxuG
29 de agosto de 2020 às 16:09

Muito bom meu parceiro o/

29 de agosto de 2020 às 17:27

Maluco, tu é 1 deus!! Isso vai ajudar muitos projetos em OTC!!

anderson127A
29 de agosto de 2020 às 18:07

por curiosidade se eu adicionar isso os outros npc existente fica com essa funçao ou precisa de algo a +
 

function greetCallback(cid)
  doSendDialogNpc(cid, getNpcId(), "Olá jovem, vejo que você conseguiu chegar até aqui!\nClique em Recompensa e fique feliz pela conquista!", "Fechar&Recompensa")
  return true             
end 
GengoG
29 de agosto de 2020 às 18:27
14 minutos atrás, anderson127 disse:

por curiosidade se eu adicionar isso os outros npc existente fica com essa funçao ou precisa de algo a +
 

function greetCallback(cid)
  doSendDialogNpc(cid, getNpcId(), "Olá jovem, vejo que você conseguiu chegar até aqui!\nClique em Recompensa e fique feliz pela conquista!", "Fechar&Recompensa")
  return true             
end 

greetCallback, que é quando inicia a fala com o npc, logo se você deseja que o seu npc comece dialogando e mostra o modulo de dialogo, você precisa adicionar o trecho de codigo a seguir, lembrando que é para cada npc que você deseje que o modulo de dialogo funcione.

function greetCallback(cid)
  -- Aqui vai a função do dialogo do npc
  return true             
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)

 

Yan OliveiraY
29 de agosto de 2020 às 18:28

Parabéns pelo conteúdo! Vai ser muito útil para vários servidores.

 

Fico feliz que em pleno 2020 ainda há membros como você que trazem conteúdos e recursos novos para a comunidade do Xtibia, pois, muitas pessoas não ajudam em nada e não trazem conteúdos/recursos algum para o fórum, mas, para vir pegar conteúdos novos, aparecem rapidinho! Sendo que muitos desses, tem capacidade para contribuir. 

 

Enfim, fico feliz que ainda contribuam para a comunidade.

luangopL
29 de agosto de 2020 às 18:30

Não sei se é só comigo, mas se eu usar o módulo para mais conversas no mesmo npc, quando eu clico na opção final a janela não 'some' '-'

GengoG
29 de agosto de 2020 às 18:33
Agora, luangop disse:

Não sei se é só comigo, mas se eu usar o módulo para mais conversas no mesmo npc, quando eu clico na opção final a janela não 'some' '-'

Entre em contato comigo pelo discord Gengo#8230 ficará mas fácil eu tentar ajudar você do que eu ficar perguntando cada coisa até chegar no problema, assim não fica poluindo muito o tópico com mensagens.

luangopL
29 de agosto de 2020 às 18:44
10 minutos atrás, Gengo disse:

Entre em contato comigo pelo discord Gengo#8230 ficará mas fácil eu tentar ajudar você do que eu ficar perguntando cada coisa até chegar no problema, assim não fica poluindo muito o tópico com mensagens.

#Resolvido! Foi erro meu, não utilizei o npc disponibilizado e deixei passar em branco a função doSendDialogNpcClose(cid)

Vlw @Gengo

anderson127A
31 de agosto de 2020 às 12:54
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 getPlayerAllTowerItens(cid)
	if getPlayerItemCount(cid, 12163) >= 1000 and getPlayerItemCount(cid, 12161) >= 1000 and getPlayerItemCount(cid, 19500) >= 1500 and getPlayerItemCount(cid, 19501) >= 2000 and getPlayerItemCount(cid, 19540) >= 200 and getPlayerItemCount(cid, 15092) >= 100 and getPlayerItemCount(cid, 15098) >= 100 and getPlayerItemCount(cid, 15094) >= 100 and getPlayerItemCount(cid, 19536) >= 50 then
		return true
	end
	return false
end

function doRemoveItensTower(cid)
	doPlayerRemoveItem(cid, 12163, 1000)
	doPlayerRemoveItem(cid, 12161, 1000)
	doPlayerRemoveItem(cid, 19500, 1500)
	doPlayerRemoveItem(cid, 19501, 2000)
	doPlayerRemoveItem(cid, 19540, 200)
	doPlayerRemoveItem(cid, 15092, 100)
	doPlayerRemoveItem(cid, 15098, 100)
	doPlayerRemoveItem(cid, 15094, 100)
	doPlayerRemoveItem(cid, 19536, 50)
	return true
end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then
return false
end

if (msgcontains(msg, 'Embedded Tower') or msgcontains(msg, 'embedded tower')) then

	if getPlayerStorageValue(cid, 509001) >= 1 then
		selfSay("Não preciso mais de sua ajuda, você agora pode explorar a Embedded Tower!")	
		return true
	end

	if getPlayerStorageValue(cid, 659875) == -1 then 
		 selfSay("Antes de tudo preciso checar se eis forte o suficiente para poder entrar lá, você poderia trazer-me {50x Giant Ruby}, {100x Sharpe Leave}, {100x Pawn}, {100x Crimson Feather}, {200x Linearly Guided Hypnosis}, {2000x enchanted gem}, {2000x Rubber Ball}, {1500x Earth Ball}, {1000x Seed}, {1000x water gem}?", cid)
		 talkState[cid] = 1
	else
		 selfSay("Você já fez seus pedidos?", cid)
		 talkState[cid] = 2
	end

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

	  if getPlayerAllTowerItens(cid) then
	
		doRemoveItensTower(cid)
		selfSay("É dito uma lenda à qual a antiga civilização pokémon adorava 3 grandes deuses que trariam prosperidade, hoje são representado-os pelas {Pedra Sagrada da Floresta}, {Pedra Sagrada da Terra} e a {Pedra Sagrada do Mar}, volte quando feito seus {pedidos}!", cid)
		setPlayerStorageValue(cid, 659875, 1)
	  
	  else
	 
         selfSay("Lembre-se, os itens são {50x Giant Ruby}, {100x Sharpe Leave}, {100x Pawn}, {100x Crimson Feather}, {200x Linearly Guided Hypnosis}, {2000x enchanted gem}, {2000x Rubber Ball}, {1500x Earth Ball}, {1000x Seed}, {1000x water gem}...", cid)
         talkState[cid] = 0
         return true
      end
   
elseif msgcontains(msg, 'pedidos') and getPlayerStorageValue(cid, 659875) == 1 then
       selfSay("Você já fez seus pedidos?", cid)
       talkState[cid] = 2
       
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[cid] == 2 and getPlayerStorageValue(cid, 659875) == 1 then

		if getPlayerStorageValue(cid, 60900) >= 1 and getPlayerStorageValue(cid, 60901) >= 1 and getPlayerStorageValue(cid, 60902) >= 1 then
			setPlayerStorageValue(cid, 509001, 1)
			setPlayerStorageValue(cid, 78501, 1)
			selfSay("Pronto agora você pode acessar a tower!", cid)
			talkState[talkUser] = 0		
		else
			selfSay("Você não fez seus pedidos às 3x pedras sagradas;", cid)
			talkState[talkUser] = 0	
		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())

tipo ai eu tenho que adicionar apenas essa funçao que vc falou ou refazer todos os npc mesmo?

BlazerXB
31 de agosto de 2020 às 13:01
6 minutos atrás, anderson127 disse:
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 getPlayerAllTowerItens(cid)
	if getPlayerItemCount(cid, 12163) >= 1000 and getPlayerItemCount(cid, 12161) >= 1000 and getPlayerItemCount(cid, 19500) >= 1500 and getPlayerItemCount(cid, 19501) >= 2000 and getPlayerItemCount(cid, 19540) >= 200 and getPlayerItemCount(cid, 15092) >= 100 and getPlayerItemCount(cid, 15098) >= 100 and getPlayerItemCount(cid, 15094) >= 100 and getPlayerItemCount(cid, 19536) >= 50 then
		return true
	end
	return false
end

function doRemoveItensTower(cid)
	doPlayerRemoveItem(cid, 12163, 1000)
	doPlayerRemoveItem(cid, 12161, 1000)
	doPlayerRemoveItem(cid, 19500, 1500)
	doPlayerRemoveItem(cid, 19501, 2000)
	doPlayerRemoveItem(cid, 19540, 200)
	doPlayerRemoveItem(cid, 15092, 100)
	doPlayerRemoveItem(cid, 15098, 100)
	doPlayerRemoveItem(cid, 15094, 100)
	doPlayerRemoveItem(cid, 19536, 50)
	return true
end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then
return false
end

if (msgcontains(msg, 'Embedded Tower') or msgcontains(msg, 'embedded tower')) then

	if getPlayerStorageValue(cid, 509001) >= 1 then
		selfSay("Não preciso mais de sua ajuda, você agora pode explorar a Embedded Tower!")	
		return true
	end

	if getPlayerStorageValue(cid, 659875) == -1 then 
		 selfSay("Antes de tudo preciso checar se eis forte o suficiente para poder entrar lá, você poderia trazer-me {50x Giant Ruby}, {100x Sharpe Leave}, {100x Pawn}, {100x Crimson Feather}, {200x Linearly Guided Hypnosis}, {2000x enchanted gem}, {2000x Rubber Ball}, {1500x Earth Ball}, {1000x Seed}, {1000x water gem}?", cid)
		 talkState[cid] = 1
	else
		 selfSay("Você já fez seus pedidos?", cid)
		 talkState[cid] = 2
	end

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

	  if getPlayerAllTowerItens(cid) then
	
		doRemoveItensTower(cid)
		selfSay("É dito uma lenda à qual a antiga civilização pokémon adorava 3 grandes deuses que trariam prosperidade, hoje são representado-os pelas {Pedra Sagrada da Floresta}, {Pedra Sagrada da Terra} e a {Pedra Sagrada do Mar}, volte quando feito seus {pedidos}!", cid)
		setPlayerStorageValue(cid, 659875, 1)
	  
	  else
	 
         selfSay("Lembre-se, os itens são {50x Giant Ruby}, {100x Sharpe Leave}, {100x Pawn}, {100x Crimson Feather}, {200x Linearly Guided Hypnosis}, {2000x enchanted gem}, {2000x Rubber Ball}, {1500x Earth Ball}, {1000x Seed}, {1000x water gem}...", cid)
         talkState[cid] = 0
         return true
      end
   
elseif msgcontains(msg, 'pedidos') and getPlayerStorageValue(cid, 659875) == 1 then
       selfSay("Você já fez seus pedidos?", cid)
       talkState[cid] = 2
       
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[cid] == 2 and getPlayerStorageValue(cid, 659875) == 1 then

		if getPlayerStorageValue(cid, 60900) >= 1 and getPlayerStorageValue(cid, 60901) >= 1 and getPlayerStorageValue(cid, 60902) >= 1 then
			setPlayerStorageValue(cid, 509001, 1)
			setPlayerStorageValue(cid, 78501, 1)
			selfSay("Pronto agora você pode acessar a tower!", cid)
			talkState[talkUser] = 0		
		else
			selfSay("Você não fez seus pedidos às 3x pedras sagradas;", cid)
			talkState[talkUser] = 0	
		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())

tipo ai eu tenho que adicionar apenas essa funçao que vc falou ou refazer todos os npc mesmo?

Ele respondeu: é para cada npc que você deseje que o modulo de dialogo funcione.

anderson127A
31 de agosto de 2020 às 13:11

acontece que eu coloquei e nao foi o npchandler no final
 

function greetCallback(cid)
  -- Aqui vai a função do dialogo do npc
  return true             
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
BlazerXB
31 de agosto de 2020 às 13:13
1 minuto atrás, anderson127 disse:

acontece que eu coloquei e nao foi o npchandler no final
 

function greetCallback(cid)
  -- Aqui vai a função do dialogo do npc
  return true             
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)

Manda pm para mim que eu vou ajudar você.

anderson127A
31 de agosto de 2020 às 13:16

e aquele npc ali em cima
 

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 getPlayerAllTowerItens(cid)
	if getPlayerItemCount(cid, 12163) >= 1000 and getPlayerItemCount(cid, 12161) >= 1000 and getPlayerItemCount(cid, 19500) >= 1500 and getPlayerItemCount(cid, 19501) >= 2000 and getPlayerItemCount(cid, 19540) >= 200 and getPlayerItemCount(cid, 15092) >= 100 and getPlayerItemCount(cid, 15098) >= 100 and getPlayerItemCount(cid, 15094) >= 100 and getPlayerItemCount(cid, 19536) >= 50 then
		return true
	end
	return false
end

function doRemoveItensTower(cid)
	doPlayerRemoveItem(cid, 12163, 1000)
	doPlayerRemoveItem(cid, 12161, 1000)
	doPlayerRemoveItem(cid, 19500, 1500)
	doPlayerRemoveItem(cid, 19501, 2000)
	doPlayerRemoveItem(cid, 19540, 200)
	doPlayerRemoveItem(cid, 15092, 100)
	doPlayerRemoveItem(cid, 15098, 100)
	doPlayerRemoveItem(cid, 15094, 100)
	doPlayerRemoveItem(cid, 19536, 50)
	return true
end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then
return false
end

if (msgcontains(msg, 'Embedded Tower') or msgcontains(msg, 'embedded tower')) then

	if getPlayerStorageValue(cid, 509001) >= 1 then
		selfSay("Não preciso mais de sua ajuda, você agora pode explorar a Embedded Tower!")	
		return true
	end

	if getPlayerStorageValue(cid, 659875) == -1 then 
		 selfSay("Antes de tudo preciso checar se eis forte o suficiente para poder entrar lá, você poderia trazer-me {50x Giant Ruby}, {100x Sharpe Leave}, {100x Pawn}, {100x Crimson Feather}, {200x Linearly Guided Hypnosis}, {2000x enchanted gem}, {2000x Rubber Ball}, {1500x Earth Ball}, {1000x Seed}, {1000x water gem}?", cid)
		 talkState[cid] = 1
	else
		 selfSay("Você já fez seus pedidos?", cid)
		 talkState[cid] = 2
	end

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

	  if getPlayerAllTowerItens(cid) then
	
		doRemoveItensTower(cid)
		selfSay("É dito uma lenda à qual a antiga civilização pokémon adorava 3 grandes deuses que trariam prosperidade, hoje são representado-os pelas {Pedra Sagrada da Floresta}, {Pedra Sagrada da Terra} e a {Pedra Sagrada do Mar}, volte quando feito seus {pedidos}!", cid)
		setPlayerStorageValue(cid, 659875, 1)
	  
	  else
	 
         selfSay("Lembre-se, os itens são {50x Giant Ruby}, {100x Sharpe Leave}, {100x Pawn}, {100x Crimson Feather}, {200x Linearly Guided Hypnosis}, {2000x enchanted gem}, {2000x Rubber Ball}, {1500x Earth Ball}, {1000x Seed}, {1000x water gem}...", cid)
         talkState[cid] = 0
         return true
      end
   
elseif msgcontains(msg, 'pedidos') and getPlayerStorageValue(cid, 659875) == 1 then
       selfSay("Você já fez seus pedidos?", cid)
       talkState[cid] = 2
       
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[cid] == 2 and getPlayerStorageValue(cid, 659875) == 1 then

		if getPlayerStorageValue(cid, 60900) >= 1 and getPlayerStorageValue(cid, 60901) >= 1 and getPlayerStorageValue(cid, 60902) >= 1 then
			setPlayerStorageValue(cid, 509001, 1)
			setPlayerStorageValue(cid, 78501, 1)
			selfSay("Pronto agora você pode acessar a tower!", cid)
			talkState[talkUser] = 0		
		else
			selfSay("Você não fez seus pedidos às 3x pedras sagradas;", cid)
			talkState[talkUser] = 0	
		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())