Ir para conteúdo

Featured Replies

Postado

Bom dia. A demon oak do meu server funciona igual a do global, porém tentando testar ela achei um bug no NPC Oldrak que impossibilita fazer a quest. Qualquer palavra chave que diz a ele, ao inves dele executar o a liberação ou dar o axe ele simplesmente só repete "I won't discuss any further with you for now." para qualquer coisa que diz a ele, além de mandar duas perguntas juntas que deveriam ser separadas no caso uma quando vai pegar o axe e outra depois que termina de fazer a quest.
Alguém saberia me dizer o que está errado nesse script?
Obrigado.

 

Imagem:

Mostrar conteúdo oculto

 

NPC:

Mostrar conteúdo oculto

Editado por dimmebag (veja o histórico de edições)

  • Respostas 5
  • Visualizações 996
  • Created
  • Última resposta

Top Posters In This Topic

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

-- OTServ event handling functions start
		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
		-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
		    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	if (not npcHandler:isFocused(cid)) then
		return false
	end

	if msgcontains(msg, "infested area") or msgcontains(msg, "demon oak") then
		if getPlayerStorageValue(cid, 35735) == 1 then
			npcHandler:say('Did you really defeat it?', cid)
			talk_state = 2
		else
			npcHandler:say('How do you know? Did you go into the infested area?', cid)
			talk_state = 1
		end
			   
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		if getPlayerStorageValue(cid, 35735) == 1 then
		   npcHandler:say('I have searched for dareful heroes like you. ...', cid)
		   npcHandler:say('Take this axe and bring that damn demon oak down, report back to me when you are done. The world depends on you now, kid. ...', cid)
		   npcHandler:say('Good luck, I mean it.', cid)
		   doPlayerSetStorageValue(cid, 35738, 1)
		   DoPlayerAddItem(cid, 8293, 1)
		   talk_state = 0
		else
		   npcHandler:say('I won\'t discuss any further with you for now.', cid)
		   talk_state = 0
		end
		
	elseif msgcontains(msg, 'yes') and talk_state == 2 then
		if getPlayerStorageValue(cid, 35700) == 1 then
			npcHandler:say('You chopped down the demon oak?!? Unbelievable!! Let\'s hope it doesn\'t come back. As long as evil is still existent in the soil of the plains, it won\'t be over. Still, the demons suffered a setback, that\'s for sure. ...', cid)
			npcHandler:say('For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name \'Yesim Adeit\' somewhere close by. ...', cid)
			npcHandler:say('It belongs to a Daramian nobleman named \'Teme Saiyid\'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I\'m sure this \'someone\' is you. Good luck in finding it!', cid)
			doPlayerSetStorageValue(cid, 35700, 2)
			talk_state = 0
		else
			npcHandler:say('Have you entered the infested area yet?', cid)
			talk_state = 0
		end
		
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 3) then
		npcHandler:say('Bye.', cid)
		talk_state = 0
	end
		    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	return true
end

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

 

Acho que arrumei. Testa ae

Postado
  • Autor
  Em 12/09/2017 em 19:58, Weslley Kiyo disse:
local keywordHandler = KeywordHandler:new()
		local npcHandler = NpcHandler:new(keywordHandler)
		NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
		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
		-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
		    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	if (not npcHandler:isFocused(cid)) then
		return false
	end

	if msgcontains(msg, "infested area") or msgcontains(msg, "demon oak") then
		if getPlayerStorageValue(cid, 35735) == 1 then
			npcHandler:say('Did you really defeat it?', cid)
			talk_state = 2
		else
			npcHandler:say('How do you know? Did you go into the infested area?', cid)
			talk_state = 1
		end
			   
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		if getPlayerStorageValue(cid, 35735) == 1 then
		   npcHandler:say('I have searched for dareful heroes like you. ...', cid)
		   npcHandler:say('Take this axe and bring that damn demon oak down, report back to me when you are done. The world depends on you now, kid. ...', cid)
		   npcHandler:say('Good luck, I mean it.', cid)
		   doPlayerSetStorageValue(cid, 35738, 1)
		   DoPlayerAddItem(cid, 8293, 1)
		   talk_state = 0
		else
		   npcHandler:say('I won\'t discuss any further with you for now.', cid)
		   talk_state = 0
		end
		
	elseif msgcontains(msg, 'yes') and talk_state == 2 then
		if getPlayerStorageValue(cid, 35700) == 1 then
			npcHandler:say('You chopped down the demon oak?!? Unbelievable!! Let\'s hope it doesn\'t come back. As long as evil is still existent in the soil of the plains, it won\'t be over. Still, the demons suffered a setback, that\'s for sure. ...', cid)
			npcHandler:say('For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name \'Yesim Adeit\' somewhere close by. ...', cid)
			npcHandler:say('It belongs to a Daramian nobleman named \'Teme Saiyid\'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I\'m sure this \'someone\' is you. Good luck in finding it!', cid)
			doPlayerSetStorageValue(cid, 35700, 2)
			talk_state = 0
		else
			npcHandler:say('Have you entered the infested area yet?', cid)
			talk_state = 0
		end
		
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 3) then
		npcHandler:say('Bye.', cid)
		talk_state = 0
	end
		    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	return true
end

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

 

Acho que arrumei. Testa ae

Mostrar conteúdo oculto



Não funcionou.

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo