Ir para conteúdo

Posts Recomendados

Galera Eu Peguei O Seguinte NPC

http://www.xtibia.com/forum/topic/139262-armadilha-npc-com-enigma-para-quests/

Dei Uma Editada Nas Falas E Olhem Como Ficou (Como Funciona O NPC = Assim Ele Te Da Um Pergunta Se Você Erra Ele Cria Um Demon Para Você Matar Se Você Acertar Ele Poderá Passar Por Uma Porta Aqui Está Funcionando, Porém Quando O Player Acerta A Questão Ou Se Ele Escrever Qualquer Coisa o NPC Sumona Um Demon Mesmo Se O Player Ja Tiver Acertado A Resposta Alguem Me Ajuda A Como Arruma-lo. Quero Que Quando O Player Acerte E Escreva Outra Coisa Qualquer Depois O Npc Não Sumone O Demon)

 

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)
if(not npcHandler:isFocused(cid)) then
return false
end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'Ekitor') then

selfSay('to find it you must answer me say something: {now} or {never}.', cid)
talkState[talkUser] = 2


elseif talkState[talkUser] == 2 then

if msgcontains(msg, 'now') then 
selfSay('who is red has a very strong attack and is feared by all?', cid)
talkState[talkUser] = 3

elseif msgcontains(msg, 'never') then

selfSay('Ok, good-bye  {bye}.', cid)
talkState[talkUser] = 1

end

elseif talkState[talkUser] == 3 then

if msgcontains(msg, 'demon') then 
if getPlayerStorageValue(cid,52456) == -1 then
setPlayerStorageValue(cid,52456,1)
selfSay('you are smart to follow Blood City and look for him in the underground!', cid)
else	
selfSay('you already know where he is.', cid)
end

else
doSummonCreature("Demon",{x=118,y=111,z=6})
selfSay('missed you kill this monster, which is a hint and go back to talk to me!', cid)
end


end

end

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

Link para o comentário
https://xtibia.com/forum/topic/169176-npc/
Compartilhar em outros sites

×
×
  • Criar Novo...