Ir para conteúdo
  • Cadastre-se

Suporte [AJUDA] Script NPC Blue Djinn


Posts Recomendados

Olá pessoal, tudo certo? Preciso de ajuda no NPC Bo'Ques que faz parte da missão do Blue Djinn, nessa parte:
 

  Mostrar conteúdo oculto

 

O npc não está exigindo o item 2347 que seria o cookbook, está somente entregando as 3 small sapphire direto, eu gostaria que ele exigisse o item e se o player não tivesse, falaria a seguinte mensagem: 

Too bad. I must have this book.

 

Já agradeço demais pela força!

 

script do npc:

 

  Mostrar conteúdo oculto

 

Link para o post
Compartilhar em outros sites
  • 2 weeks later...
  • Respostas 23
  • Created
  • Última resposta

Top Posters In This Topic

tenta assim:

 local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
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
 
local voices = { {text = 'Now, where was I...'} }
npcHandler:addModule(VoiceModule:new(voices))
 
local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end
 
    local player = Player(cid)
    local missionProgress = player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission01)
    if msgcontains(msg, 'recipe') or msgcontains(msg, 'mission') then
        if missionProgress < 1 then
            npcHandler:say({
                'My collection of recipes is almost complete. There are only but a few that are missing. ...',
                'Hmmm... now that we talk about it. There is something you could help me with. Are you interested?'
            }, cid)
            npcHandler.topic[cid] = 1
        else
            npcHandler:say('I already told you about the recipes I am missing, now please try to find a cookbook of the dwarven kitchen.', cid)
        end
 
    elseif msgcontains(msg, 'cookbook') then
        if missionProgress == -1 then
            npcHandler:say({
                'I\'m preparing the food for all djinns in Ashta\'daramai. ...',
                'Therefore, I\'m what is commonly called a cook, although I do not like that word too much. It is vulgar. I prefer to call myself \'chef\'.'
            }, cid)
        elseif missionProgress == 1 then
            npcHandler:say('Do you have the cookbook of the dwarven kitchen with you? Can I have it?', cid)
            npcHandler.topic[cid] = 2
        else
            npcHandler:say('Thanks again, for bringing me that book!', cid)
        end
 
    elseif npcHandler.topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
            npcHandler:say({
                'Fine! Even though I know so many recipes, I\'m looking for the description of some dwarven meals. ...',
                'So, if you could bring me a cookbook of the dwarven kitchen, I\'ll reward you well.'
            }, cid)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission01, 1)
 
        elseif msgcontains(msg, 'no') then
            npcHandler:say('Well, too bad.', cid)
        end
        npcHandler.topic[cid] = 0
 
    elseif npcHandler.topic[cid] == 2 then
        if msgcontains(msg, 'yes') then
            if not player:getItemById(2347, 1) then
                npcHandler:say('Too bad. I must have this book.', cid)
                return true
            end
 
            npcHandler:say({
                'The book! You have it! Let me see! <browses the book> ...',
                'Dragon Egg Omelette, Dwarven beer sauce... it\'s all there. This is great! Here is your well-deserved reward. ...',
                'Incidentally, I have talked to Fa\'hradin about you during dinner. I think he might have some work for you. Why don\'t you talk to him about it?'
            }, cid)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission01, 2)
            player:addItem(2146, 3)
 
        elseif msgcontains(msg, 'no') then
            npcHandler:say('Too bad. I must have this book.', cid)
        end
        npcHandler.topic[cid] = 0
    end
    return true
end
 
npcHandler:setMessage(MESSAGE_GREET, 'Hey! A human! What are you doing in my kitchen, |PLAYERNAME|?')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Goodbye. I am sure you will come back for more. They all do.')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Goodbye. I am sure you will come back for more. They all do.')
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
 
local focusModule = FocusModule:new()
focusModule:addGreetMessage('hi')
focusModule:addGreetMessage('hello')
focusModule:addGreetMessage('djanni\'hah')
npcHandler:addModule(focusModule)

 

Editado por Aragllov (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  Em 03/04/2023 em 16:21, Aragllov disse:

tenta assim:

 local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
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
 
local voices = { {text = 'Now, where was I...'} }
npcHandler:addModule(VoiceModule:new(voices))
 
local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end
 
    local player = Player(cid)
    local missionProgress = player:getStorageValue(Storage.DjinnWar.MaridFaction.Mission01)
    if msgcontains(msg, 'recipe') or msgcontains(msg, 'mission') then
        if missionProgress < 1 then
            npcHandler:say({
                'My collection of recipes is almost complete. There are only but a few that are missing. ...',
                'Hmmm... now that we talk about it. There is something you could help me with. Are you interested?'
            }, cid)
            npcHandler.topic[cid] = 1
        else
            npcHandler:say('I already told you about the recipes I am missing, now please try to find a cookbook of the dwarven kitchen.', cid)
        end
 
    elseif msgcontains(msg, 'cookbook') then
        if missionProgress == -1 then
            npcHandler:say({
                'I\'m preparing the food for all djinns in Ashta\'daramai. ...',
                'Therefore, I\'m what is commonly called a cook, although I do not like that word too much. It is vulgar. I prefer to call myself \'chef\'.'
            }, cid)
        elseif missionProgress == 1 then
            npcHandler:say('Do you have the cookbook of the dwarven kitchen with you? Can I have it?', cid)
            npcHandler.topic[cid] = 2
        else
            npcHandler:say('Thanks again, for bringing me that book!', cid)
        end
 
    elseif npcHandler.topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
            npcHandler:say({
                'Fine! Even though I know so many recipes, I\'m looking for the description of some dwarven meals. ...',
                'So, if you could bring me a cookbook of the dwarven kitchen, I\'ll reward you well.'
            }, cid)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission01, 1)
 
        elseif msgcontains(msg, 'no') then
            npcHandler:say('Well, too bad.', cid)
        end
        npcHandler.topic[cid] = 0
 
    elseif npcHandler.topic[cid] == 2 then
        if msgcontains(msg, 'yes') then
            if not player:getItemById(2347, 1) then
                npcHandler:say('Too bad. I must have this book.', cid)
                return true
            end
 
            npcHandler:say({
                'The book! You have it! Let me see! <browses the book> ...',
                'Dragon Egg Omelette, Dwarven beer sauce... it\'s all there. This is great! Here is your well-deserved reward. ...',
                'Incidentally, I have talked to Fa\'hradin about you during dinner. I think he might have some work for you. Why don\'t you talk to him about it?'
            }, cid)
            player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission01, 2)
            player:addItem(2146, 3)
 
        elseif msgcontains(msg, 'no') then
            npcHandler:say('Too bad. I must have this book.', cid)
        end
        npcHandler.topic[cid] = 0
    end
    return true
end
 
npcHandler:setMessage(MESSAGE_GREET, 'Hey! A human! What are you doing in my kitchen, |PLAYERNAME|?')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Goodbye. I am sure you will come back for more. They all do.')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Goodbye. I am sure you will come back for more. They all do.')
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
 
local focusModule = FocusModule:new()
focusModule:addGreetMessage('hi')
focusModule:addGreetMessage('hello')
focusModule:addGreetMessage('djanni\'hah')
npcHandler:addModule(focusModule)

 

Mostrar mais  

ele ainda não está exigindo um cookbook

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 Under
      Apresentando o Tibia-IA: A IA para Desenvolvimento de Servidores Tibia! 
       O que é o Tibia-IA?
      Um modelo de IA especializado para Tibia! Ele está atualmente em teste gratuito, e eu adoraria que vocês o experimentassem. Basta acessar https://ai.tibiaking.com, criar uma conta e começar a usar totalmente de graça! 
       Versão Experimental Fechada
      Atualmente, algumas funcionalidades ainda estão em desenvolvimento. No momento, apenas a geração de scripts está disponível para o público.
      Se encontrarem qualquer problema nos scripts gerados, me avisem! Vamos juntos construir a IA mais poderosa para ajudar no desenvolvimento de servidores Tibia!  
      Contato direto discord : underewar
       Acesse agora: https://ai.tibiaking.com
       Como funciona?
       Geração automática de scripts LUA para TFS  Suporte a diferentes eventos, criaturas, NPCs, magias, etc.  Ferramenta em constante evolução para aprimorar o desenvolvimento Novidades em breve confira no site. O acesso ao Tibia-IA está disponível para testes GRATUITOS! 
      Basta criar uma conta em: https://ai.tibiaking.com
      Utilize a IA para gerar seus scripts de forma simples e rápida
      Envie feedbacks para ajudarmos a tornar a ferramenta ainda melhor!

      Problemas relatar diretamente no meu discord pessoal : underewar
       
       
    • Por braianlomas
      Como faço para corrigir esse problema para meu cliente, eu uso o tfs 0.3.6  
      Quero resolver esse problema que tenho no meu cliente, como e onde posso resolver?  
      Eu uso o tfs 0.3.6, não tenho as fontes do cliente, se você puder me dar eu vou amá-las para sempre  
       

       
    • Por A.Mokk
      Ola pessoal, estou tentando compilar o TFS 1.5 Downgrade para 8.60 atraves do MSVC 2022, ao tentar compilar da o seguinte erro:
       
       
      Fiz o download do MSVC, GitDash, TFS-SDK-3.2, e de varios boosts que tentei, ao fazer o seguinte procedimento no GitDash:
       
      Ao chegar em ./bootstrap-vcpkg.bat o GitDash nao consegue realizar o procedimento corretamente, alguem poderia me ajudar ?

      Tentei de diversas formas mas o mesmo erro sempre persiste, atualmente meu servidor utiliza TFS 0.4, consigo compilar sem nenhum problema no MSVC 2010, porem, as limitações do TFS 0.4 estão me fazendo precisar atualizar, se alguem souber como corrigir esses erros eu agradeço !

      Tutoriais utilizados :
      Compiling on Windows (vcpkg) · otland/forgottenserver Wiki · GitHub
      Compiling on Windows · otland/forgottenserver Wiki · GitHub
      Compilando TFS 1.3 com vídeo-aula - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
      Compilar TFS 1.3 Vcpkg - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
       
      O que acontece no Powershell:
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary 2.3.6
      Qual o motivo deste tópico? 
      Queria fazer com que os players não pudessem mexer no aleta sio, pois, agora os mesmos estão conseguindo mexer nos itens
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      canary para o cliente 13.16
      Qual o motivo deste tópico? 
      Não consigo encontrar onde ajusta
      to com o problema no 13.16  o exausted, por exemplo os kinas era pra combar exori, erori gran e exori min, porém não ta indo ta dando exausted o char ta soltando magia ou runa e não consegue usar as potions
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
  • Estatísticas dos Fóruns

    96842
    Tópicos
    519599
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo