Ir para conteúdo

Posts Recomendados

Estou criando um ot versão 8.60, onde você falará com um Npc e receberá a raça que escolher por ele.

 

Porém, quando ele pergunta se eu quero saber sobre alguma raça (sua primeira pergunta), e eu respondo o nome de alguma delas, ele não fala o que devia falar.

 

Vou passar o script aqui:

 

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,'raças'))then

selfSay('Eu vou lhe falar um pouco mais sobre as raças, qual você gostaria de conhecer melhor? {orc}, {dwarf}, {elf}',cid)

if(msgcontains(msg,'orc'))then

selfSay('Os orcs são uma raça muito forte, blá blaá blá',cid)

selfSay('Você deseja {ser um orc}?',cid)

if(msgcontains(msg,'ser um orc'))then

if (getPlayerVocation(cid)==0)then

doPlayerSetVocation(cid,1)

doPlayerAddOutfit(cid,5, 1)

doPlayerRemoveOutfit(cid,136, 1)

else

selfSay('Você já é de uma raça!',cid)

end

end

end

 

if(msgcontains(msg,'dwarf'))then

selfSay('Os dwarfs são uma raça muito forte, blá blaá blá',cid)

selfSay('Você deseja {ser um dwarf}?',cid)

if(msgcontains(msg,'ser um dwarf'))then

if (getPlayerVocation(cid)==0)then

doPlayerSetVocation(cid,2)

doPlayerAddOutfit(cid,69, 1)

doPlayerRemoveOutfit(cid,136, 1)

else

selfSay('Você já é de uma raça!',cid)

end

end

end

 

if(msgcontains(msg,'elf'))then

selfSay('Os dwarfs são uma raça muito forte, blá blaá blá',cid)

selfSay('Você deseja {ser um elf}?',cid)

if(msgcontains(msg,'ser um elf'))then

if (getPlayerVocation(cid)==0)then

doPlayerSetVocation(cid,3)

doPlayerAddOutfit(cid,63, 1)

doPlayerRemoveOutfit(cid,136, 1)

else

selfSay('Você já é de uma raça!',cid)

end

end

end

end

 

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Link para o comentário
https://xtibia.com/forum/topic/177975-ajuda-nesse-script/
Compartilhar em outros sites

×
×
  • Criar Novo...