Ir para conteúdo
  • Cadastre-se

(Resolvido)[Pedido] Npc Reborn / Reset


Ir para solução Resolvido por Cerberus,

Posts Recomendados

Eai galera!  ^^ 

 

 

Estou precisando de um npc que resete o player. Sendo mais específico preciso que tenha as seguintes funções se possível:

 

Level minimo para resetar: 250.

Level máximo: 600.

Preço: 7 esferas do dragão.

Manter skills, ml, life/mana e adicionar +25k de life/mana.

Resete para o level 1.

E por fim, troque a vocação do player (exemplo: se ele esta na vocação 2 , que vá para a 3).

Aah, vale lembrar, que irei configurar várias vocações e não somente uma.

 

Distro Utilizada: tfs 0.4 rev.3884

Versão Do Servidor: 8.60

 

Antes de mais nada vale lembrar que procurei em vários tópicos aqui no forum e os que encontrei não consegui modificá-los ao ponto que eu quero.

Link para o post
Compartilhar em outros sites

 

ta fazendo um wodbo? caso queria ajuda manda pm ai. também tava afim de criar um

 

 

Estou sim, comecei criando do zero, peguei um servidor de tibia e comecei aos poucos baseando no DBOBrasil, já está quase pronto, mas ainda faltam algumas coisas importantes :D

 

~~~

Ainda preciso do Npc alguém poderia me ajudar?

Editado por bhelliip (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Veja meu tópico e veja se te ajuda, porem ele so necessita do LEVEL. Depois faço algumas modificações pra ajudar você.

http://www.tibiaking.com/forum/topic/42613-npc-reborn/

I helped you ? REP +.

 

Att: Abreu

Link para o post
Compartilhar em outros sites

 

Veja meu tópico e veja se te ajuda, porem ele so necessita do LEVEL. Depois faço algumas modificações pra ajudar você.

http://www.tibiaking.com/forum/topic/42613-npc-reborn/

 

Infelizmente não deu certo, creio que seja por causa das diferentes versões, o meu server é 8.60 mas vai ganhar um REP+ pela intenção de ajudar!  ^^

Link para o post
Compartilhar em outros sites

Da algum erro quando tu tentou usar o script do amigo ali?

 

Sim, funciona normalmente até o momento que digo "yes" para rebornar, olha o erro: 

http://prntscr.com/4pl0hc

Link para o post
Compartilhar em outros sites

e so mudar a tag (doReborn) para getPromotedVocation(voc)

 

Então ficaria assim?

 

elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 300 and getPlayerVocation(cid) == 8 then
setPlayerStorageValue(cid,30023,1)
getPromotedVocation(voc)(cid, 1, 42, 9)
talk_state = 0
 
Se for assim deu o seguinte erro:

http://prntscr.com/4qd7nm

Link para o post
Compartilhar em outros sites

para funcionar o script dele ele tem que pegar na lib essa função 

 

doReborn

 

foi criada na lib dele o npc so funciona se tiver essa função da lib dele.


procurei na net  não sei bem se vc vai saber configurar mais e so por ela na sua lib.

 

nesse lib/050-function

function doReborn(cid, level, looktype, vocation)
db.executeQuery("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
db.executeQuery("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
db.executeQuery("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
doRemoveCreature(cid)
return TRUE

end

Editado por kbpaulo (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

para funcionar o script dele ele tem que pegar na lib essa função 

 

doReborn

 

foi criada na lib dele o npc so funciona se tiver essa função da lib dele.

procurei na net  não sei bem se vc vai saber configurar mais e so por ela na sua lib.

 

nesse lib/050-function

function doReborn(cid, level, looktype, vocation)
db.executeQuery("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
db.executeQuery("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
db.executeQuery("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
doRemoveCreature(cid)
return TRUE

end

 

Adicionei certinho, porém ainda assim quando eu digo "yes" para rebornar ocorre o seguinte erro:

http://prntscr.com/4qdl5e

 

~~ EDIT ~~

Creio que o erro se encontra nesse "db.executeQuery" então alterei para "db.query" e não da erro, porém só faz o char deslogar e nada acontece, não reseta, nem da vocação nem nada rsrs...

Editado por bhelliip (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

ve ae lek

 

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('?????.')
focus = 0
talk_start = 0
end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello. If you ready I can "Reborn" you.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! Hey!.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30023) == 4 then
selfSay('Sorry, but you are after reborn.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) < 250 and getPlayerStorageValue(cid,30023) ~= 4 then
selfSay('Hehe, I say If you READY. You do not have 250 lvl.')
elseif msgcontains(msg, 'reborn') then
selfSay('Are you sure?')
talk_state = 2
--_GOKU_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 1 then
doReborn(cid,1,152,109)
talk_state = 0
--_VEGETA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 7 then
doReborn(cid,1,129,118)
talk_state = 0
--_GOHAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 13 then
doReborn(cid,1,147,127)
talk_state = 0
--_TRUNKS_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 19 then
doReborn(cid,1,131,136)
talk_state = 0
--_CELL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 25 then
doReborn(cid,1,127,145)
talk_state = 0
--_FREEZA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 31 then
doReborn(cid,1,9,154)
talk_state = 0
--_UUB_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 37 then
doReborn(cid,1,233,163)
talk_state = 0
--_C17_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 43 then
doReborn(cid,1,100,172)
talk_state = 0
--_C18_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 49 then
doReborn(cid,1,292,181)
talk_state = 0
--_PICOLLO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 55 then
doReborn(cid,1,262,190)
talk_state = 0
--_DENDE_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 61 then
doReborn(cid,1,225,199)
talk_state = 0
--_TSUFUL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 67 then
doReborn(cid,1,81,208)
talk_state = 0
--_BARDOCK_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 73 then
doReborn(cid,1,319,217)
talk_state = 0
--_BROLLY_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 79 then
doReborn(cid,1,263,226)
talk_state = 0
--_C16_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 85 then
doReborn(cid,1,301,235)
talk_state = 0
--_COOLER_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 91 then
doReborn(cid,1,242,244)
talk_state = 0
--_JANEMBA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 97 then
doReborn(cid,1,551,253)
talk_state = 0
--_TAPION_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 103 then
doReborn(cid,1,577,262)
talk_state = 0

elseif msgcontains(msg, 'yes') and talk_state == 2 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! You must revert.')


elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye.')
focus = 0
talk_start = 0
end
end
end

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end

 

function doReborn(cid, level, looktype, vocation)
setGlobalStorageValue(1000,getPlayerGUID(cid))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
db.executeQuery("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
db.executeQuery("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
return TRUE
end

 

tenta ae peguei de 1 site ja pronto se não der vo olhar serio e vo fazer ele do 0..

Link para o post
Compartilhar em outros sites

ve ae lek

 

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('?????.')
focus = 0
talk_start = 0
end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello. If you ready I can "Reborn" you.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! Hey!.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30023) == 4 then
selfSay('Sorry, but you are after reborn.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) < 250 and getPlayerStorageValue(cid,30023) ~= 4 then
selfSay('Hehe, I say If you READY. You do not have 250 lvl.')
elseif msgcontains(msg, 'reborn') then
selfSay('Are you sure?')
talk_state = 2
--_GOKU_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 1 then
doReborn(cid,1,152,109)
talk_state = 0
--_VEGETA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 7 then
doReborn(cid,1,129,118)
talk_state = 0
--_GOHAN_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 13 then
doReborn(cid,1,147,127)
talk_state = 0
--_TRUNKS_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 19 then
doReborn(cid,1,131,136)
talk_state = 0
--_CELL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 25 then
doReborn(cid,1,127,145)
talk_state = 0
--_FREEZA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 31 then
doReborn(cid,1,9,154)
talk_state = 0
--_UUB_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 37 then
doReborn(cid,1,233,163)
talk_state = 0
--_C17_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 43 then
doReborn(cid,1,100,172)
talk_state = 0
--_C18_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 49 then
doReborn(cid,1,292,181)
talk_state = 0
--_PICOLLO_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 55 then
doReborn(cid,1,262,190)
talk_state = 0
--_DENDE_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 61 then
doReborn(cid,1,225,199)
talk_state = 0
--_TSUFUL_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 67 then
doReborn(cid,1,81,208)
talk_state = 0
--_BARDOCK_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 73 then
doReborn(cid,1,319,217)
talk_state = 0
--_BROLLY_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 79 then
doReborn(cid,1,263,226)
talk_state = 0
--_C16_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 85 then
doReborn(cid,1,301,235)
talk_state = 0
--_COOLER_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 91 then
doReborn(cid,1,242,244)
talk_state = 0
--_JANEMBA_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 97 then
doReborn(cid,1,551,253)
talk_state = 0
--_TAPION_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 250 and getPlayerLevel(cid) <= 1400 and getPlayerVocation(cid) == 103 then
doReborn(cid,1,577,262)
talk_state = 0

elseif msgcontains(msg, 'yes') and talk_state == 2 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! You must revert.')


elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye.')
focus = 0
talk_start = 0
end
end
end

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end

 

function doReborn(cid, level, looktype, vocation)
setGlobalStorageValue(1000,getPlayerGUID(cid))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
db.executeQuery("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
db.executeQuery("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")
return TRUE
end

 

tenta ae peguei de 1 site ja pronto se não der vo olhar serio e vo fazer ele do 0..

FUNCIONOOOUUU CARAAA! MUIITO OBRIGADOOO VEYY! Nem to acreditando rsrs

a única coisa que eu tive que mudar foi esse comando "db.executeQuery" para "db.query" fora isso funcionou perfeitamente!

REP +++++

Link para o post
Compartilhar em outros sites

se resolveu ta blz então xd.. so reportar para fecharem xD.

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 ambrozii0
      Gostaria de fazer um pedido de um NPC de Task progressiva,

      Ele iniciaria dando missões para level 8 para caçar Troll, Rotworm e Ghoul.
       
      No level 30 liberaria: Cyclops, Dragon e Wyrm... e assim em diante se puder deixar comentado eu faço as criaturas na sequencia dos leveis seguintes.
       
      O jogador pode fazer as tasks dos leveis anteriores mesmo que já tenha ultrapassado o level do próximo nível de task.
       
      E o jogador ao terminar a missão poderia escolher a recompensa em gold ou experiência. As tasks podem se repetir sem problema, mas apenas pode pegar uma de cada vez.
       
      Ao finalizar todas as tasks o jogador ganha uma montaria.
       
      Minha versão de cliente é 12.91
      Versão da Canary 2.6.1
      Não sei qual o TFS do meu servidor.
    • Por Thony D. Serv
      tfs 0.4 (não testei em outras apenas na 0.4)
      Esse script eu fiz pois, meu servidor sempre que reiniciava todos os players voltavam sem bless, então para sanar isso eu fiz um check de bless pela database para poder sempre que cair o servidor os players não morressem sem bless e dropassem os itens
      vamos lá!

      Primeiro Execute Este Comando Em Sua Db:
       

      Va No Fim E Adicione
      050-function.lua 
       

      Agora vá no seu comando de Bless ou Npc e ponha cada um no seu devido lugar
       
       
      Agora Em Creaturescript/scripts Crie Uma Pasta Chamada Bless E Ponha La Dentro:

      blessingdeath.lua
       

      blessinglogin.lua
       

      Adicione Ambas No Login.lua
       
       
      Creaturescript.xml
       

      -- Creditos A Mim Mesmo hahaha. Espero Ajudar Vocês ?
    • Por Imperius
      Tinha visto isso no servidor do MegaTibia / Kaldrox e achei bem interessante.
       
      Todos os tópicos que encontrei sobre o assunto de alterar a cor das mensagens dos GMs, CMs e ADM no channel Help para vermelho, falavam que tinham que fazer uma configuração na própria source do servidor.
       
      Fiz uma gambiarra que funciona, sem a necessidade de mexer na source do servidor e de utilizar comandos para isso. Testei somente em TFS 0.4 e funciona tranquilamente.
       
      segue abaixo como configurar em seu otserver:
       
      data > talkactions > scripts > crie um arquivo chamado gmsayred.lua e cole o código abaixo:
       
      function onSay(cid, words, param, channel) if channel == CHANNEL_HELP then for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', "".. getCreatureName(cid) .. ": ".. words, TALKTYPE_CHANNEL_R1, CHANNEL_HELP) end return true end end  
      em talkactions.xml cole a tag abaixo:

       
      <!-- Gamemasters --> <talkaction default="yes" filter="quotation" logged="no" access="3" event="script" value="gmsayred.lua"/>    
      e pronto! Agora é só enviar alguma mensagem no Help que a mensagem ficará em vermelho.
       

       
    • Por Fir3element
      Reporte qualquer bug encontrado.
       
      - Mudanças:
      * opcode adicionado
      * Monstros andando em cima de corpos
      * War system arrumado
      * Anti-divulgação melhorado
      * Cast system arrumado
      * Crash bugs arrumados
      * Adicionado exhaust ao comprar/vender items
      * Account manager com opção para cidades
      * /ghost stacking arrumado
      * !disband arrumado
      * Erros no linux arrumado
      * Aleta som arrumado
      * Bug nos rings arrumado
      * Adicionado suporte para Visual Studio
      * Remover battle ao entrar em PZ
      * Não pode jogar lixo em casas
      * Salt removido
       
      - Downloads:
      * Distro (x32): https://github.com/Fir3element/binaries/raw/master/x32-windows.zip
      * Distro (x64): https://github.com/Fir3element/binaries/raw/master/x64-windows.zip
      * Requisitos: Microsoft Visual C++ Redistributable Package
      * Source + datapack: https://github.com/Fir3element/3777/archive/refs/heads/main.zip
       
      - Scans:
      * Distro (x32): https://virustotal.com/pt/file/6683a91273b848a39ac21288da9d3abde341436744d6846e35a477c8e7c8f5f7/analysis/1480675335/
      * Distro (x64): https://virustotal.com/pt/file/21028857bb1124f19e0353e7f5775c8f66afc4f87f29df9cf4ab8ca1a046b816/analysis/1480675394/
      * Source + datapack: https://virustotal.com/pt/file/3761b48ee19f3f540d4c4a48c35c73c89a85615876307073494b1dcfed464d36/analysis/1480675473/
    • Por Garou
      QUIZ







      Fala, grande reino! Tudo beleza?

      Eu estava aqui a deriva, sem nada para fazer, quando um colega me chamou no msn e pediu para eu revisar um código que ele havia feito para um NPC. A função era bem simples, o tal NPC iria fazer perguntas ao jogador que devia responder-las corretamente, caso errasse, duas criaturas configuráveis iriam aparecer.

      Quando eu dei uma olhada no código, tomei um grande susto, era algo caótico, tudo embaralhado. Se você quer dar uma olhada, tenha certeza de ter um coração forte.



      --[[ NPC de Perguntas e Respostas Criado por Bruno Lopes / Lpz &#169; 2011 TibiaKing ]]-- local focuses = {} local talk_start = 0 local topic = {} local var = 0 local quiz = { [1] = {"What is the ring of mana?", "energy ring"}, [2] = {"Who sells addons?", "raphael"} } local monster = {"Orc", 2} local prize = { question = 100, all = 10000 } function onCreatureSay(cid, type, msg) local msg = msg:lower() or "" if getNpcDistanceTo(cid) > 3 then return false end if doMessageCheck(msg, {"hi", "hello"}) and not(isFocused(cid, focuses)) then selfSay("Hello, ".. getCreatureName(cid) ..". Can you answer my questions? heh...", cid) addFocus(cid, focuses) selfFocus(cid) topic[cid] = 100 talk_start = os.clock() elseif doMessageCheck(msg, {"hi", "hello"}) and #focuses ~= 0 then selfSay("Sorry, ".. getCreatureName(cid) ..". I am talking with another person, wait!", cid) end if doMessageCheck(msg, {"bye", "farewell", "goodbye"}) and isFocused(cid, focuses) then selfSay("Bye-bye, hehe!", cid) removeFocus(cid, focuses) end if topic[cid] == 100 then if doMessageCheck(msg, "yes") then selfSay("To start my challenge, just say {ready}. I will ask you some questions.", cid) topic[cid] = 1 elseif doMessageCheck(msg, "no") then selfSay("Huh? Why are you here then?", cid) removeFocus(cid, focuses) topic[cid] = 0 end elseif topic[cid] == 1 then if var == 0 then if doMessageCheck(msg, "ready") then var = 1 selfSay(quiz[var][1], cid) end elseif var >= 1 then if var <= #quiz then if doMessageCheck(msg, quiz[var][2]) then selfSay("CORRECT!", cid) doPlayerAddMoney(cid, prize.question) var = var+1 if var > #quiz then selfSay("CONGRATULATIONS! YOU HAVE FINISHED ALL QUESTIONS!", cid) doPlayerAddMoney(cid, prize.all) else selfSay(quiz[var][1], cid) end else selfSay("YOU HAVE WRONG MY QUESTION! GUARDS, COME HERE!", cid) var = 0 topic[cid] = 0 removeFocus(cid, focuses) for i = 1, monster[2] do doCreateMonster(monster[1], getNpcPos()) end end end end end return true end function onThink() for _, cid in ipairs(focuses) do if isPlayer(cid) and isFocused(cid, focuses) then if os.clock() > (talk_start + 180) then talk_start = 0 selfSay("Hmph!") closeShopWindow(cid) removeFocus(cid, focuses) elseif getNpcDistanceTo(cid) > 3 then talk_start = 0 selfSay("How Rude!") closeShopWindow(cid) removeFocus(cid, focuses) end end end lookAtFocus(focuses) end Bom, eu fiz o arquivo .lua que você iria associar a algum npc de seu servidor, deixo o arquivo .xml por sua conta. Como é um NPC que faz perguntas, você pode configurar o seu NPC do jeito que você quiser, com as perguntas que você quiser. Veja abaixo como proceder: local quiz = { [1] = {"What is the ring of mana?", "energy ring"}, [2] = {"Who sells addons?", "raphael"} } Para adicionar novas perguntas, basta você colocar uma vírgula na última linha e criar uma nova linha conforme o modelo: local quiz = { [1] = {"What is the ring of mana?", "energy ring"}, [2] = {"Who sells addons?", "raphael"}, [3] = {"PERGUNTA", "RESPOSTA"}, [4] = {"PERGUNTA", "RESPOSTA"} } Há também algumas outras configurações básicas para você fazer, as criaturas que irão aparecer caso o jogador erre a pergunta e a quantidade. Também você pode configurar a quantidade de dinheiro que o jogador ganha quando acerta uma pergunta e a quantidade de dinheiro do prêmio final. local monster = {"Orc", 2} local prize = { question = 100, all = 10000 } OBSERVAÇÕES Para evitar quaisquer erros no script, substitua o conteúdo de npc.lua em data/npc/lib por este que estou passando abaixo:



      É isso aê, galerinha do tibiaKing!

      Até o próximo tópico.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo