Histórico de Curtidas
-
oliverarrow deu reputação a andersonwill em NPC que troca nomeOla amigo boa noite, olhe este topico aqui e siga o passo a passo, Boa sorte!
http://www.tibiaking.com/forum/topic/38037-npc-que-muda-nome/
Te ajudei? REP+++
-
oliverarrow deu reputação a .HuRRiKaNe em NPC que troca nomeTenta:
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, "trocar nome") then if getPlayerItemCount(cid, 1010) < 30 then npcHandler:say("Você não tem a quantidade necessária para trocar seu nome!}", cid) return TRUE end doPlayerRemoveItem(cid, 1010, 30) npcHandler:releaseFocus(cid) doAddPlayerBanishment(getPlayerGUID(cid), PLAYERBAN_LOCK) doRemoveCreature(cid) return TRUE end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) <?xml version="1.0" encoding="UTF-8"?> <npc name="Trocar Nome" script="data/npc/scripts/name.lua" walkinterval="0" speed="0" floorchange="0"> <health now="100" max="100"/> <look type="240"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|, eu posso {trocar nome} por 30 pontos!" /> </parameters> </npc> -
oliverarrow deu reputação a Wakon em [PEDIDO] NPC tira redFiz um aqui, testa ai:
local t = { itemneed = 9971, count = {5, 10} -- Red/Black skull. } 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 msg = msg:lower(); local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local n = getItemNameById(t.itemneed) if msgcontains(msg, 'remove') then selfSay('Eu removo {black skull} por '.. t.count[2] ..' '.. n ..' e {red skull} por '.. t.count[1] ..' '.. n ..'.', cid) elseif msgcontains(msg, 'black skull') then if getCreatureSkullType(cid) == SKULL_BLACK then selfSay('Você deseja remover sua black skull por '.. t.count[2] ..' '.. n ..'?', cid) talkState[talkUser] = 1 else selfSay('Você não tem uma black skull.', cid) end elseif msgcontains(msg, 'red skull') then if getCreatureSkullType(cid) == SKULL_RED then selfSay('Você deseja remover sua red skull por '.. t.count[1] ..' '.. n ..'?', cid) talkState[talkUser] = 2 else selfSay('Você não tem uma red skull.', cid) end end if msgcontains(msg, 'yes') then if talkState[talkUser] == 1 then if doPlayerRemoveItem(cid, t.itemneed, t.count[2]) then db.executeQuery("UPDATE killers SET unjustified = '0' WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = "..getPlayerGUID(cid)..")") doCreatureSetSkullType(cid, 0) selfSay('Sua black skull foi removida.', cid) talkState[talkUser] = 0 else selfSay('Você não tem '.. t.count[2] ..' '.. n ..'.', cid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 2 then if doPlayerRemoveItem(cid, t.itemneed, t.count[1]) then db.executeQuery("UPDATE killers SET unjustified = '0' WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = "..getPlayerGUID(cid)..")") doCreatureSetSkullType(cid, 0) selfSay('Sua red skull foi removida.', cid) talkState[talkUser] = 0 else selfSay('Você não tem '.. t.count[1] ..' '.. n ..'.', cid) talkState[talkUser] = 0 end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -
oliverarrow deu reputação a Movie em [PEDIDO] NPC tira red
-
oliverarrow deu reputação a .HuRRiKaNe em [PEDIDO] NPC tira redAqui está:
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, "remover") then npcHandler:say("Voce quer remover seu red skull? {yes} ou {no}.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid) talkState[talkUser] = 0 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getCreatureSkullType(cid) < SKULL_RED then npcHandler:say("Voce nao esta red skull.", cid) else if doPlayerRemoveItem(cid, 1010, 5) then db.executeQuery("UPDATE killers SET unjustified = '0' WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = "..getPlayerGUID(cid)..")") doCreatureSetSkullType(cid, 0) npcHandler:say("Seu red skull foi removido.", cid) else npcHandler:say("Voce nao tem o necessario para remover seu red skull.", cid) end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -
oliverarrow deu reputação a Tricoder em [PEDIDO] Converter magias pra 8.6 (20 reps)No caso, os monstros que usarão essas magias e não os players?
-
oliverarrow deu reputação a elton123 em (Resolvido)Teleportar o player 2 sqm pra direita?+ou- assim?
function onStepIn(cid, item, pos, fromPos) local a = getCreaturePosition(cid) doTeleportThing(cid,{x=a.x+2,y=a.y,z=a.z}) return true end ou assim
function onStepIn(cid, item, pos, fromPos) doTeleportThing(cid, fromPos, true) return true end explique melhor se não for nenhum dos dois
-
oliverarrow deu reputação a xWhiteWolf em Magnus Challengernao sei dizer porque mas não dá pra adicionar ml, eu tentei de tudo e pelo menos no meu sv não foi...
-
oliverarrow deu reputação a Wakon em [AJUDA] Bug louco porta vira melão [10REPS]Abra o arquivo 000-constant.lua localizado em "Data/lib" e verifique as doors, basta pesquisar por "doors".
Ache o ID da porta em "doors" e veja se o ID está correto, exemplo [5125] = 5127.
-
oliverarrow deu reputação a SoulSarti em [AJUDA] Bug louco porta vira melão [10REPS]O problema não está no script. Acho que eu sei qual o problema (ja aconteceu comigo uma vez e.e') Vá em items.xml e lá procure o id da porta que se transforma em um melon. Quando você achar, procure a seguinte tag:
<attribute key="transformUseTo" value="id"/>
esse id provavelmente vai ser 5097. Se for, então substitua pelo id da porta correto(5127). Procure também pelo item 5097. Lá você provavelmente vai encontrar a seguinte tag :
<attribute key="decayTo" value="id"/>
<attribute key="duration" value="tempo"/> Se você de fato encontrar algo parecido com isso (claro que não vai estar escrito id, nem tempo, e sim a id do melao (provavelmente) e o tempo em segundos), então simplesmente apague essas duas linhas. Provavelmente é isso que está bugando suas portas. Voce disse que a porta 5125 deveria virar a 5127, mas ela vira a 5097 e esta, quando você a usa ou depois de um tempo, ela se transforma em um melon. Se esse for realmente o caso, então o problema está todo no items.xml. O script de doors seu retorna o valor de transformonuse das portas para transforma-las, para abrir ou fechar, e o fato da porta virar um melão, provavelmente vem de um decay, ou de um addevent que transforma o id 5097 depois de um tempo. Se você não encontrar nada do que eu falei no items.xml, então o erro ta em algum script que você pôs no seu sv. Espero ter ajudado. -
oliverarrow deu reputação a xWhiteWolf em Magnus ChallengerFala galera, hoje vim trazer o projeto pronto do Magnus Challenger pra vocês instalarem no servidor de vocês!
Pra quem não conhece é um sistema de Tasks baseado no Zezenia onde você pode escolher entre tasks de matar monstros ou de coletar certos items para o npc Magnus, um guerreiro famoso da cidade que está atolado de tarefas e precisa da sua ajuda!
Peguei os aspectos que eu julguei serem os principais do modelo do Zezenia e editei com algumas coisas que eu achei que ficariam melhores.
Quem quiser pode ver um vídeo comentado de como o sistema funciona:
Dito isso vou ensinar vocês como instalar isso no server:
Pra começar vá em data\creaturescripts\scripts e procure login.lua, agora vá até o final do arquivo e antes do último return true coloque essas linhas abaixo
ainda em creaturescripts procure creaturescripts.xml e adicione essa linha junto com as outras que já estão lá (seguindo o padrão)
<!-- TASK SYSTEM --> <event type="kill" name="tasksystem" script="tasksystem.lua"/> Agora crie um arquivo em creaturescripts\scripts com o nome de tasksystem.lua e adicione o seguinte à ele:
Terminada a parte da contagem de kill vamos ao NPC em si.
Crie um arquivo chamado Magnus.xml em data\npc e coloque isso dentro dele:
Agora em data\npc\scripts crie um arquivo chamado zezeniaa.lua e adicione esse conteúdo dentro do arquivo:
~~~~~~~~~~~~~~~~ FEITO ISSO ESTÁ TERMINADO ~~~~~~~~~~~~~~~~~~
Agora aprendendo a configurar:
No tasksystem vc pode editar isso daqui:
Eu fiz um sistema onde se vc estiver em party com alguém e a pessoa matar os bixos conta como se você tivesse matado; Assim incentiva o pessoal a ir numa cave de Dragon e ao invés de matar quem está lá pra ficar sozinho na cave, eles vão chamar party pra fazerem a task juntos.. assim fazer amigos fica mais fácil e com maiores laços é maior a chance do povo não abandonar o seu server.
Apenas digite "true" ou "false" pra ativar/desativar esse sistema e em baixo temos a distancia máxima pro monstro estar do cara que está fazendo a task pra contar o kill. Se a distancia entre o monstro e a pessoa for maior que 7 não vai contar pra ele a kill.
No zezeniaa.lua as coisas que dão pra configurar são maiores mas são igualmente simples:
Toda vez que vc pedir uma task short (curta) vc vai ter de 100 a 400 monstros pra matar, ele gera um número de 0 a 6 e multiplica por 5 e soma com os 100 iniciais.. o mesmo vale pra todos os outros valores.
levelcollect é o level mínimo pra fazer tasks do tipo collect.
time é o tempo em segundos que você vai ficar sem poder falar com o npc caso desista de alguma task, o padrão é 8 * 60 * 60 (8 horas)
bonus é por quanto vai multiplicar caso vc permita que o npc escolha aleatoriamente entre todas as opções.. o padrão é 20% de bonus (1.2)
multiplicador é uma coisa que eu adicionei pra ficar mais fácil mexer na fórmula sem cometer cagadas, se vc tá ganhando 10% de exp e quer ganhar 80% é só colocar 8 no multiplicador.
Isso daqui é o banco de dados principal do sistema de kill, toda vez que vc escolher uma task do tipo fácil, médio, dificil ele vai acessar essas tabelas contendo o nome das criaturas.. vc pode facilmente adicionar novos nomes, o npc já está programado pra lidar com isso, apenas siga o padrão e mantenha sempre o último sem vírgula!
Ex: adicionando Morgaroth na tabela de hard
local hard = { [1] = "Giant Spider", [2] = "Dragon Lord", [3] = "Grim Reaper", [4] = "Demon", [5] = "Crystal Spider", [6] = "Demon Skeleton", [7] = "Juggernaut", [8] = "Destroyer", [9] = "Hand of Cursed Fate", [10] = "Morgaroth" } atente-se também pra não repetir o número no index.. se o anterior era [9] use [10].
O restante das tabelas são separadas para o banco de dados das tasks de collect:
segue a mesma lógica da de kill só que aqui você tem o id dos itens que serão usados... aquela count não tem nada a ver com o item pois ele vai gerar tanto o item aleatoriamente quanto à count;
Ex:
[1] = {id = 5880, count = 20}, -- iron ore isso não significa que se cair iron ore (id 5880) irá cair sempre 20.. até porque eu poderia escolher uma task long e easy e pegar a task de trazer até 50 iron ores, apenas tente manter os padrões que são os intervalos definidos.
No easy ele varia de 10 a 20, no medium ele varia de 20 a 35 e no hard de 40 a 50.
Espero que vocês tenham curtido, é um sistema grande mas bem simples de se mexer... se tiverem quaisquer problemas podem comentar aqui. Deu trabalho fazer isso então se você gostou deixe o seu comentário aí e o seu "Gostei" que vai me incentivar a trazer mais coisas desse tipo pra cá. Abraços do lobo.
PS: Pra sumonar o npc digite com o GOD: /n Magnus ou coloque ele pelo map editor.
-
oliverarrow deu reputação a SoulSarti em [AJUDA] Bug louco porta vira melão [10REPS]procura no seu script de actions chamado doors.lua a id do melão. Provavelmente se voce achar ela lá, é só substituir pelo id correto da porta. Caso tenha duvidas sobre como fazer isso, posta o script aki q a gente arruma pra voce.
-
oliverarrow deu reputação a grafit em [AJUDA] Bug louco porta vira melão [10REPS]Provavelmente é um erro de ID do seu servidor.
Procura o ID do melão e de tudo que ele se transforma de maneira errada.
Feito isso é só procurar os IDS no script e alterar para os IDS das portas corretas.
-
oliverarrow deu reputação a LoadingGo em [AJUDA] Bug louco porta vira melão [10REPS]NÃO SEI SE VAI AJUDAR, OBRIGADO
Olha não Sou Muito Bom com Isso Mas Ocorreu Um Bug Semelhante
Eu Clicava Na Arvore Era pra ela somente mudar de cor, mas ela virava outra arvore diferente
eu fui nessa arvore pelo Object Build Peguei a Arvore que eu queria o somente coloquei no lugar da outro funciono 100%
não sei se você vai usar o melão, Mas pode tentar antes de tudo Faz BACKUP Caso de ERRO.
Versão Suportada
7.10 - 10.41
Adobe Air: http://get.adobe.com/air/
Object Builder: https://github.com/Mignari/ObjectBuilder/releases/download/v0.3.4/ObjectBuilder0.3.4.air
Scan: https://www.virustotal.com/en/file/fc06f08301deea2eb7d819f3690da53226480f6827847d46c6be8b265e6ebd17/analysis/1420147768/
1° TÓPICO SE AJUDEI REP+ ORIGATO
-
oliverarrow deu reputação a Fir3element em [9.86] The Forgotten Server 1.1 (x32 & x64)Apenas peguei a versão atual do TFS 1.1 (10.41) e dei downgrade para 9.86. Utilizei esta rev como base.
Qualquer bug que acontecer poste aqui no tópico.
Imagem
Links
Server: server-1.1_9.86.rar Source: source-1.1_9.86.rar Server (link 2): http://www.mediafire.com/download/el4rwk8p2kdeney/server-1.1_9.86.rar Source (link 2): http://www.mediafire.com/download/bkm6748mwkphcwf/source-1.1_9.86.rar Scan (server): https://www.virustotal.com/pt/file/e439ca648dcab08cae795e43a761a9505ff258c73909a0d34f63d10d4c3df51a/analysis/1427515177/ Scan (source): https://www.virustotal.com/pt/file/ba9f50e7b9eb2d7917d6bc1fdb7b4b7694e62ef1f88db50b9bf33bac665bc8e5/analysis/1427515071/ -
oliverarrow deu reputação a Fir3element em [talkaction] Sistema de reset com stages (sem logout)Nome: Sistema de reset Versão testada: TFS 0.3.6pl1 / 0.4 / 0.3.7 / 1.1 Créditos: fireelement Imagem:
Vá em data/talkactions/talkactions.xml e adicione essa tag:
Para TFS 0.3/0.4:
Para TFS 1.1/1.0:
Agora vá em data/talkactions/scripts/ e crie um arquivo com o nome reset.lua e cole isso nele:
Para TFS 0.3/0.4:
Para TFS 1.1:
Para TFS 1.0:
-
oliverarrow deu reputação a Fir3element em [0.3.6pl1] Atacar e usar runa ao mesmo tempo & usar runa enquanto corre1. Atacar com a arma e usar runa ao mesmo tempo.
Em player.cpp, procure por:
else if((!weapon->hasExhaustion() || !hasCondition(CONDITION_EXHAUST, EXHAUST_COMBAT)) && weapon->useWeapon(this, tool, attackedCreature)) Troque por:
else if(!weapon->hasExhaustion() && weapon->useWeapon(this, tool, attackedCreature)) 2. Usar runa enquanto corre.
Em player.cpp, remova essa linha:
setNextAction(OTSYS_TIME() + getStepDuration(dir)); Créditos: Xellath
-
oliverarrow deu reputação a Fir3element em (Resolvido)[DUVIDA/PEDIDO] Esse lugar WTF ankraRecortei: http://www.mediafire.com/download/tdk6ea9r383in6d/ankrahmun.rar
-
oliverarrow deu reputação a Ceos em (Resolvido)[DUVIDA/PEDIDO] Esse lugar WTF ankraEssa e a tumba que convence os bicho que tem la, e muito usada para fazer os cara pegar red.
-
oliverarrow deu reputação a Panicat em GTA V - Esperando para PC e PS4Quem ai já viu a grande diferencia que ocorrera do GTA V PS3 e Xbox 360 para o, PS4, PC e Xbox One?
Estou no aguardo kk quem ta também?
kkk tive que compra um notebook novo com
4° Geração do Intel i7
8 GB Ram
Placa de vídeo 2 GB Nvidia Geforce
1 Tera de HD << só o mapa é 64GB no HD
2 Coler para resfriar o not kk
Tudo isso para roda os gráficos no MÉDIO kkk
-
oliverarrow deu reputação a MaTTch em (Resolvido)O que eu fiz de errado? NPC simplesVerdade. Tinha me esquecido que minha libs é modificada.
@Topic
Tenta usar o script que eu editei logo antes do post do Garou, mas deixa como função o callback.
-
oliverarrow deu reputação a MaTTch em (Resolvido)O que eu fiz de errado? NPC simpleslocal keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local config = { strg1 = 200201, -- storage começando a task strg2 = 91001, -- storage finalizou a task (ganha qnd matar os monstros) idiom = 8971 } 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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false end if(msgcontains(msg:lower(), "task")) then if(getPlayerStorageValue(cid, config.strg2) < 1) then if(getPlayerStorageValue(cid, config.strg1) < 1) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("That good, one more soul coming from the {portal}! Welcome, I hope you can help.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Que bom, mais uma alma vinda do {portal}! Seja bem vindo, espero que possa nos ajudar.", cid) end talkState[talkUser] = 1 else if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("you have to finish the task.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Você tem que terminar a missão.", cid) end talkState[talkUser] = 0 end else if(getPlayerStorageValue(cid, config.strg2) == 1) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("You have finished the mission! Take it a Sabre, use it until you reach on level 8 and talk with Oracle in the temple.", cid) selfSay("He will send you to Aurea, there talk with !", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Você concluiu a missão! Tome aqui um Sabre, use ele ate chegar no nivel 8 e fale com o Oraculo no templo.", cid) selfSay("Ele ira te mandar para Aurea, la fale com !", cid) end doPlayerAddItem(cid, 2385, 1) else if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("You already finished this task.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Você já terminou essa task.", cid) end end talkState[talkUser] = 0 end elseif(msgcontains(msg:lower(), "portal") and talkState[talkUser] == 1) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("Crystal, a angel come down here and in Aurea and opened a portal of humans who comes from another dimension for us {save}.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Crystal, uma anja desceu até aqui e em Aurea e abriu um portal de humanos que vem de outra dimensão para nos {salvar}.", cid) end talkState[talkUser] = 2 elseif(msgcontains(msg:lower(), "salvar") or msgcontains(msg:lower(), "save") and talkState[talkUser] == 2) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("We are in an apocalyptic world, at war with several races. And you can be {the chosen}!", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Estamos em um mundo apocalíptico, em guerra com varias raças. E você pode ser o {escolhido}!", cid) end talkState[talkUser] = 3 elseif(msgcontains(msg:lower(), "escolhido") or msgcontains(msg:lower(), "the chosen") and talkState[talkUser] == 3) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("Calm down, first we need to train, you have to help us with simple things until you are trained!", cid) selfSay("As for example our plague of {rats} in the city that are rising by storm drains!", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Calma, primeiro precisamos treinar, você deve nos ajudar com coisas simples, até estar bem treinado!", cid) selfSay("Como por exemplo a nossa praga de {rats} na cidade que estão subindo pelos bueiros!", cid) end talkState[talkUser] = 4 elseif(msgcontains(msg:lower(), "rats") and talkState[talkUser] == 4) then if(getPlayerStorageValue(cid, config.idiom) == 1) then selfSay("Okay, so help us get this over with and kill 10 rats in the storm drain in front here.", cid) elseif(getPlayerStorageValue(cid, config.idiom) == 2) then selfSay("Ok, então ajude-nos a acabar com isso e mate 10 ratos no bueiro aqui na frente.", cid) end setPlayerStorageValue(cid, strg1, 1) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, "creatureSayCallback") npcHandler:addModule(FocusModule:new()) Não testei.
-
oliverarrow deu reputação a Summ em (Resolvido)O que eu fiz de errado? NPC simpleso player que fala tem a storage idiom = 8971 ?
-
oliverarrow deu reputação a Summ em (Resolvido)O que eu fiz de errado? NPC simpleseditei lá em cima ;S
-
oliverarrow deu reputação a Summ em (Resolvido)O que eu fiz de errado? NPC simpleslocal 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 if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { strg1 = 200201, -- storage começando a task strg2 = 91001, -- storage finalizou a task (ganha qnd matar os monstros) idiom = 8971 } if msgcontains(msg:lower(),'task') then if getPlayerStorageValue(cid, config.strg2) < 1 then if getPlayerStorageValue(cid, config.strg1) < 1 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Good one more coming soul of {portal}! Welcome, I hope you can help!', cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Que bom mais uma alma vinda do {portal}! Seja bem vindo, espero que possa nos ajudar!.', cid) talkState[talkUser] = 1 end else selfSay('you have to finish the task', cid) talkState[talkUser] = 0 end else selfSay('Voce concluiu a missao, tome aqui um Sabre, use ele ate chegar no nivel 8 e fale com o Oraculo no templo!', cid) selfSay('Ele ira te mandar para Aurea, la fale com !', cid) doPlayerAddItem(cid, 2385, 1) talkState[talkUser] = 0 end elseif msgcontains(msg:lower(), 'portal') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Crystal angel one came down here and Aurea and opened a portal of humans who comes from another dimension for us {save}.', cid) talkState[talkUser] = 2 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Crystal uma anja desceu até aqui e em Aurea e abriu um portal de humanos que vem de outra dimensão para nós {salvar}.', cid) talkState[talkUser] = 2 end elseif msgcontains(msg:lower(), 'salvar') or msgcontains(msg:lower(), 'save') and talkState[talkUser] == 2 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('We are in an apocalyptic world, at war with several races. And you can be! {the chosen}', cid) talkState[talkUser] = 3 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Estamos em um mundo apocalíptico, em guerra com varias raças. E voce pode ser o {escolhido}!', cid) talkState[talkUser] = 3 end elseif msgcontains(msg:lower(), 'escolhido') or msgcontains(msg:lower(), 'the chosen') and talkState[talkUser] == 3 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Congratulations, now with permission.', cid) selfSay('Such as our plague of {rats} in the city that are climbing down the drain!', cid) talkState[talkUser] = 4 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Calma primeiro precisamos treinar, voce deve nos ajudar com coisas {simples}, ate estar bem treinado!', cid) selfSay('Como por exemplo a nossa praga de {rats} na cidade que estão subindo pelos bueiros!', cid) talkState[talkUser] = 4 end elseif msgcontains(msg:lower(), 'rats') and talkState[talkUser] == 4 then if getPlayerStorageValue(cid, config.idiom) == 1 then selfSay('Okay, so help us get this over with and kill 10 rats in the gutter in front here.', cid) setPlayerStorageValue(cid, strg1, 1) talkState[talkUser] = 0 elseif getPlayerStorageValue(cid, config.idiom) == 2 then selfSay('Ok, então ajuda-nos a acabar com isso e mate 10 ratos no bueiro aqui na frente.', cid) setPlayerStorageValue(cid, strg1, 1) talkState[talkUser] = 0 end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())