Ir para conteúdo
  • Cadastre-se

Pedido Alguém poderia acresentar a esse NPC uma função na qual não deixe que passe MC's por ele?


Posts Recomendados

Versão 8.60

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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)

local from,to = {x = 126, y = 296, z = 10},{x = 148, y = 315, z = 10} 

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

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'exit') or msgcontains(msg, 'sair') or msgcontains(msg, 'quit') or msgcontains(msg, 'desistir') or msgcontains(msg, 'deixar') then
if isInRange(getCreaturePosition(cid), from, to) then
selfSay('Do you really want to give up the tournament?', cid)
talkState[talkUser] = 3
else
selfSay('You must be in the waiting room to perform this command.', cid)
talkState[talkUser] = 0
end
end

if talkState[talkUser] == 3 then

if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') or msgcontains(msg, 's') or msgcontains(msg, 'si') then
doTeleportThing(cid, torneio.playerTemple)
if getPlayerItemCount(cid, torneio.revivePoke) >= 6 then
doPlayerRemoveItem(cid,torneio.revivePoke,6)
doPlayerRemoveItem(cid,torneio.revivePoke1,6)
end
elseif msgcontains(msg, 'no') or msgcontains(msg, 'nao') or msgcontains(msg, 'não') or msgcontains(msg, 'n') or msgcontains(msg, 'ñ') or msgcontains(msg, 'nn') then
selfSay('You made the right decision, stay and fight with all your strength!', cid)
end
end

if msgcontains(msg, 'tourney') or msgcontains(msg, 'enter') then

if getPlayerItemCount(cid, torneio.revivePoke) >= 1 or getPlayerItemCount(cid, torneio.revivePoke2) >= 1 or getPlayerItemCount(cid, torneio.revivePoke3) >= 1 then
selfSay('You cannot go to the tournament with any kind of {seed of the gods} or {senzus}, this is irregular, please save them and then talk to me again.', cid)
return true
end

if getPlayerLevel(cid) <= 250 then
selfSay('You cannot go to the tournament with a level equal to or below 250.', cid)
return true
end

selfSay('Would you like to participate in the tournament? just have a tournament ticket.', cid)
talkState[talkUser] = 2

elseif talkState[talkUser] == 2 then

if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
if getPlayerItemCount(cid, torneio.revivePoke) >= 1 or getPlayerItemCount(cid, torneio.revivePoke2) >= 1 or getPlayerItemCount(cid, torneio.revivePoke3) >= 1  then
selfSay('You cannot go to the tournament with any kind of {seed of the gods} or {senzus}, this is irregular, please save them and then talk to me again.', cid)
return true
end
if os.date("%X") < torneio.startHour1 or os.date("%X") > torneio.endHour1 then
if os.date("%X") < torneio.startHour2 or os.date("%X") > torneio.endHour2 then
if os.date("%X") < torneio.startHour3 or os.date("%X") > torneio.endHour3 then
if os.date("%X") < torneio.startHour4 or os.date("%X") > torneio.endHour4 then
selfSay('Desculpe, mas o torneio ainda não abriu, volte em 07:50 AM, 11:50 AM, 17:50 AM ou 22:50 PM', cid)
return true
         end
      end
   end
end

if doPlayerRemoveItem(cid, torneio.id, torneio.qntt) then
doTeleportThing(cid, torneio.waitPlace)
doPlayerSendTextMessage(cid, 21, "Welcome to the waiting room, you wait here while we select the other players.")
doPlayerAddItem(cid,torneio.revivePoke,6)
doPlayerAddItem(cid,torneio.revivePoke1,6)
else

selfSay('Voce não tem o bilhete do torneio.', cid)
end
else
selfSay('Certeza que voce nao quer participar? Ok!', cid)
talkState[talkUser] = 0
end
end
end

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por LasseXeterno
      Então, estou tentando adicionar uma nova "race" no meu Ot de base Cyan, tentei seguir 3 tutoriais aqui do tibiaking, um sobre race, porém nos códigos do meu servidor não tem o constant.h e nem o monster.cpp. E o outro tutorial, eu fiz tudo que ele pediu e quando entrei no game para testar, funcionava os golpes e as imunidades, porém não aparecia o número do dano e nem a cor.  Usei esse tutorial como base: 
      Pois ele é derivado. E o outro tutorial que usei foi: 
      Porém nesse, não consegui achar a const.h, e quando fui nos arquivos do creaturescript e adicionei uma cor nova a "COLOR_FAIRY", quando abro o jogo, os pokemons que seriam teoricamente "fada", o que eu usei de teste foi a Clefable. A Clefable tomava IK e dava IK no seu atk do tipo fada. 
      Além de que, o meu erro principal é esse: Warning - Monsters::loadMonster] Unknown race type fairy. (data/monster/pokes/geracao 1/Clefable.xml)
       Pois como eu já disse, não consigo achar onde adicionar uma nova race.

    • Por yuriowns
      Salve rapazes, tranquilo? Preciso de ajuda pra colocar para os npc's que vendem pots verificarem quantos itens possuem no tile em que o player está e se tiver com +80 itens no sqm, o npc avisa e não vende nada até o player ir em um sqm com menos de 80 itens no chão.
       
    • Por A.Mokk
      .Qual servidor ou website você utiliza como base? 
      TFS 0.4
      Qual o motivo deste tópico? 
      Bom pessoal, a algumas semanas atras eu joguei um servidor que havia sistema de imbuimento sendo 8.60, no servidor se utilizava a spellwand para encantar as armas, os comandos eram dado no canal Imbuiment... Gostaria de saber se alguém teria como disponibilizar algum sistema de imbuimento, já procurei pra caramba aqui no fórum mas tudo que encontro é pra versões acima da que eu uso.
       
    • Por Mateus Robeerto
      Não sei se aqui é a área ou algum local para solicitar a alteração do email antigo... Não lembro mais a senha dele, nem a resposta secreta para acessar. Peço a algum administrador ou moderador para, por favor, alterar o email para o novo.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo