Ir para conteúdo
  • Cadastre-se

Posts Recomendados

function onSay(cid, words, param)

           if words =="!resetar" then

--[ Condições de Reset ] --
local coNdConf = {

needPz = true,                  -- Precisa estar em Pz pra resetar?               [true, false]
needPa = false,                 -- Precisa ser Premium Account Pra resetar?       [true, false]
withe = false,                  -- Players com Pk Withe podem resetar?            [true, false]
red = false,                    -- Players com Pk Red pode resetar?               [true, false]
battle = false,                 -- Players precisão estar sem battle pra resetar? [true, false]
teleport = true,                -- Teleportar Player para o templo após resetar?  [true, false]
look = false,                   -- Aparecer Resets no Look do Player?             [true, false]
pid = getPlayerGUID(cid),       -- Não Mexer.


--[ Configurações do Reset ] --
resetConf = {

Level = 350,                    -- Level Necessário para Resetar.                         [Valor]
backLvl = 10,                    -- Level que voltará após o Reset.                        [Valor]
time = 5,                       -- Tempo para o Player deslogar ao resetar, em segundos.  [Valor]

 },
}
         --[[>> STAGES <<]]--
x=true;X=true -- Não Mexer.
local stage = {Abilitar = {x}, Desabilitar = {},     --<< Abilitar Stages?? >>--            [{x};{}]

--      [RESETS]    |  [PREMMY]  |   [FREE]
stage1= {resets= 4,  premmy= 1330, free= 1350},
stage2= {resets= 9,  premmy= 1340, free= 1355},     -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}])
stage3= {resets= 14, premmy= 1355, free= 1360},     -- resets = Número de resets para o Stage;
stage4= {resets= 19, premmy= 1360, free= 1365},     -- premmy = Level necessário para Premium Accounts;
stage5= {resets= 24, premmy= 1370, free= 1380},     -- free    = Level necessário para Free Accounts;
stage6= {resets= 29, premmy= 1380, free= 1390},       -- Coloque em Ordem...
stage7= {resets= 35, premmy= 1400, free= 1410},     -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES]
stage8= {resets= 40, premmy= 1410, free= 1440},     -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x}
stage9= {resets= 45, premmy= 1450, free= 1450},
stage10={resets= 50, premmy= 1465, free= 1465},

}
       --[[>> FIM STAGES <<]]--

--=[Pega Valor de Resets]=--
function getPlayerReset(cid)
local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";")
rss = qr:getDataInt("reset", coNdConf.pid)
if rss < 0 then
rss = 0
end
return rss
end

local success = "                   ~~ Sucesso! ~~ \nVocê tem agora "..(getPlayerReset(cid)+1).." resets. \nVocê será deslogado em "..coNdConf.resetConf.time.." segundos." ;err = doPlayerSendTextMessage
local qrt = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";");rss_db = qrt:getDataInt("reset", coNdConf.pid)
local lvl_query = "UPDATE `players` SET `level` = "..(coNdConf.resetConf.backLvl)..", `experience` = 0 WHERE `id`= " .. coNdConf.pid .. ";"
local reset_query = "UPDATE `players` SET `reset` = "..(getPlayerReset(cid)+(1)).." WHERE `id`= " .. coNdConf.pid .. ";"
local nolook_query = "UPDATE `players` SET `description` = '' WHERE `players`.`id`= " .. coNdConf.pid .. ";"
local look_query = "UPDATE `players` SET `description` = ' [Reset "..(getPlayerReset(cid)+(1)).."]' WHERE `players`.`id`= " .. coNdConf.pid .. ";"

--=[Reseta]=--
function addValue(value)
if coNdConf.look == false then
 doRemoveCreature(cid)
db.query(lvl_query);db.query(reset_query);db.query(nolook_query)
else
 doRemoveCreature(cid)
  db.query(lvl_query);db.query(reset_query);db.query(look_query)
 return LUA_NO_ERROR
end
end

function nowReseting()
if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -")
 return true
end
if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then
     doPlayerPopupFYI(cid, success)
     addEvent(addValue, coNdConf.resetConf.time*1000, value)
   else
     doPlayerPopupFYI(cid, success)
     addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid)))
     addEvent(addValue, coNdConf.resetConf.time*1000, value)
 return true
end
end

--[sTAGES Nao mexer em nada.]--
function checkLevelStageReset(cid)

local stages = {
   {resets= stage.stage1.resets, premmy= stage.stage1.premmy, free= stage.stage1.free},
   {resets= stage.stage2.resets, premmy= stage.stage2.premmy, free= stage.stage2.free},
   {resets= stage.stage3.resets, premmy= stage.stage3.premmy, free= stage.stage3.free},
   {resets= stage.stage4.resets, premmy= stage.stage4.premmy, free= stage.stage4.free},
   {resets= stage.stage5.resets, premmy= stage.stage5.premmy, free= stage.stage5.free},
   {resets= stage.stage6.resets, premmy= stage.stage6.premmy, free= stage.stage6.free},
   {resets= stage.stage7.resets, premmy= stage.stage7.premmy, free= stage.stage7.free},
   {resets= stage.stage8.resets, premmy= stage.stage8.premmy, free= stage.stage8.free},
   {resets= stage.stage9.resets, premmy= stage.stage9.premmy, free= stage.stage9.free},
   {resets=stage.stage10.resets, premmy=stage.stage10.premmy, free=stage.stage10.free},
}
   local resets = getPlayerReset(cid)
       for i, tab in ipairs(stages) do
           if resets <= tab.resets then
               coNdConf.resetConf.Level = isPremium(cid) and tab.premmy or tab.free
               break
           end
       end
if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then
err(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -")
return TRUE
end

 if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then
    doPlayerPopupFYI(cid, success)
    addEvent(addValue, coNdConf.resetConf.time*1000, value)
  else
  doPlayerPopupFYI(cid, success)
  addEvent(addValue, coNdConf.resetConf.time*1000, value)
  addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid)))
   return true
 end
end
   function newReset(cid)
   if(coNdConf.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == LUA_ERROR) then
    err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar em Protection Zone Para Resetar. -") return TRUE end
   if(coNdConf.needPa == true) and not isPremium(cid) then
    err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa ser Premium Account para Resetar. -") return TRUE end
   if(coNdConf.withe == false) and (getCreatureSkullType(cid) == 3) then
    err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Withe. -") return TRUE end
   if(coNdConf.red == false) and (getCreatureSkullType(cid) == 4) then
    err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Red. -") return TRUE end
   if(coNdConf.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
    err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar sem Battle para Resetar. -") return TRUE end

local xy = {true,false}
table.insert(stage.Abilitar, false)
table.insert(stage.Desabilitar, false)
if stage.Abilitar[1] == xy[1] and stage.Desabilitar[1] == xy[2] then
checkLevelStageReset(cid)
elseif stage.Abilitar[1] == xy[2] and stage.Desabilitar[1] == xy[1] then
nowReseting()
else
doPlayerPopupFYI(cid, "LUA_ERROR; Configure corretamente o Sistema de STAGES!")
end
return true
end
   function tableResetInstall()
    print(not rss_db  and LUA_ERROR or "Tabela de Resets: Instalada ... [success] ")
    addEvent(newReset, 1000, cid)
    return false
    end
   if tableResetInstall() then
 end
end
   --=[install System]=--
      function installReset()
       if db.query("ALTER TABLE `players` ADD reset INT(11) NOT NULL DEFAULT 0;") then
               print("[MarcelloMkez] -= Advanced Reset System 2.0 por DataBase =- Instalado com sucesso!")
               return TRUE
       end
       print('[Advanced Reset System/MarcelloMkez] Não foi possível instalar o Sistema.')
       return FALSE
    end
       local tt = {
          "Preparando Instalação...",
          "Instalando: TableReset Db...",
          "Instalando: getPlayerReset()...",
          "Instalando: addValue()...",
          "Instalando: checkLevelStageReset()...",
          "Instalando: newReset() and nowReseting()...",
          "Finalizando Instalação...",
          "...",
          success = {
          "Iniciando...",
          "function: TableReset Db...    [success]",
          "function: getPlayerReset()...    [success]",
          "function: addValue(value)...       [success]",
          "function: checkLevelStageReset()... [success]",
          "function: newReset() and nowReseting()...     [success]",
          "Fim da Instalação.  ",
          "by: ~~ MarcelloMkez ~~              \nContato: [email protected]",
          inst = {"MarcelloMkez","Advanced Reset System 2.0 por DataBase"

          },

        },

       }
    if words == "/installreset" and getPlayerAccess(cid) >= 3 then
           function install()
           if installReset() then
               print(""..tt.success[7].."")
                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,""..tt.success[8].."")
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] -="..tt.success.inst[2].."=- Instalado com sucesso!")
          else
               print("["..tt.success.inst[1].."]  FALHA NA INSTALAÇÃO! [O sistema ja foi instalado].")
                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] FALHA NA INSTALAÇÃO! [O sistema ja foi instalado].")
           end
           return 1
       end
         function concl(cid)
           local typetx = MESSAGE_STATUS_CONSOLE_BLUE
               print(""..tt.success[7].."")
                print(""..tt[8].."")
               doPlayerSendTextMessage(cid, typetx,""..tt.success[7].."")
               doPlayerSendTextMessage(cid, typetx,""..tt[8].."")
               addEvent(install, 1000,cid)
           end
           function finall(cid)
               local typetx = MESSAGE_STATUS_CONSOLE_BLUE
               print(""..tt.success[6].."")
               print(""..tt[7].."")
               doPlayerSendTextMessage(cid, typetx,""..tt.success[6].."")
               doPlayerSendTextMessage(cid, typetx,""..tt[7].."")
               addEvent(concl, 3000,cid)
           end
            function installDd(cid)
              local typetx = MESSAGE_STATUS_CONSOLE_BLUE
               print(""..tt.success[5].."")
               print(""..tt[6].."")
               doPlayerSendTextMessage(cid, typetx,""..tt.success[5].."")
               doPlayerSendTextMessage(cid, typetx,""..tt[6].."")
               addEvent(finall, 1000,cid)
           end
           function installCc(cid)
              local typetx = MESSAGE_STATUS_CONSOLE_BLUE
               print(""..tt.success[4].."")
               print(""..tt[5].."")
               doPlayerSendTextMessage(cid, typetx,""..tt.success[4].."")
               doPlayerSendTextMessage(cid, typetx,""..tt[5].."")
             addEvent(installDd, 1000,cid)
           end
           function installBb(cid)
              local typetx = MESSAGE_STATUS_CONSOLE_BLUE
               print(""..tt.success[3].."")
               print(""..tt[4].."")
               doPlayerSendTextMessage(cid, typetx,""..tt.success[3].."")
             doPlayerSendTextMessage(cid, typetx,""..tt[4].."")
           addEvent(installCc, 1000,cid)
           end
           function installAa(cid)
             local typetx = MESSAGE_STATUS_CONSOLE_BLUE
               print(""..tt.success[2].."")
               print(""..tt[3].."")
               doPlayerSendTextMessage(cid, typetx,""..tt.success[2].."")
               doPlayerSendTextMessage(cid, typetx,""..tt[3].."")
               addEvent(installBb, 1000,cid)
           end
           function toInstall()
             local typetx = MESSAGE_STATUS_CONSOLE_BLUE
               print(""..tt.success[1].."")
               print(""..tt[2].."")
               doPlayerSendTextMessage(cid, typetx,""..tt.success[1].."")
               doPlayerSendTextMessage(cid, typetx,""..tt[2].."")
              addEvent(installAa, 1000,cid)
             end
           function preparation()
             local typetx = MESSAGE_STATUS_CONSOLE_BLUE
              print(""..tt[1].."")
            doPlayerSendTextMessage(cid, typetx,""..tt[1].."")
           addEvent(toInstall, 3000,cid)
       end
           if preparation() then
           end
       end
return 1
end

Queria umas alterações nesse script...
Gostaria que a cada resete o player ganhasse "100" de vida e "100" de mana.
E que a cada stage que ele fosse subindo ele ganhasse "X" Storage, para eu utilizar elas para passagens etc.

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 braianlomas
      Como faço para corrigir esse problema para meu cliente, eu uso o tfs 0.3.6  
      Quero resolver esse problema que tenho no meu cliente, como e onde posso resolver?  
      Eu uso o tfs 0.3.6, não tenho as fontes do cliente, se você puder me dar eu vou amá-las para sempre  
       

       
    • Por A.Mokk
      Ola pessoal, estou tentando compilar o TFS 1.5 Downgrade para 8.60 atraves do MSVC 2022, ao tentar compilar da o seguinte erro:
       
       
      Fiz o download do MSVC, GitDash, TFS-SDK-3.2, e de varios boosts que tentei, ao fazer o seguinte procedimento no GitDash:
       
      Ao chegar em ./bootstrap-vcpkg.bat o GitDash nao consegue realizar o procedimento corretamente, alguem poderia me ajudar ?

      Tentei de diversas formas mas o mesmo erro sempre persiste, atualmente meu servidor utiliza TFS 0.4, consigo compilar sem nenhum problema no MSVC 2010, porem, as limitações do TFS 0.4 estão me fazendo precisar atualizar, se alguem souber como corrigir esses erros eu agradeço !

      Tutoriais utilizados :
      Compiling on Windows (vcpkg) · otland/forgottenserver Wiki · GitHub
      Compiling on Windows · otland/forgottenserver Wiki · GitHub
      Compilando TFS 1.3 com vídeo-aula - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
      Compilar TFS 1.3 Vcpkg - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
       
      O que acontece no Powershell:
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary 2.3.6
      Qual o motivo deste tópico? 
      Queria fazer com que os players não pudessem mexer no aleta sio, pois, agora os mesmos estão conseguindo mexer nos itens
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      canary para o cliente 13.16
      Qual o motivo deste tópico? 
      Não consigo encontrar onde ajusta
      to com o problema no 13.16  o exausted, por exemplo os kinas era pra combar exori, erori gran e exori min, porém não ta indo ta dando exausted o char ta soltando magia ou runa e não consegue usar as potions
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por Andersontatuador
      Olá galera da TK, me chamo Anderson estou procurando alguém profissional em otservs e site.
      Já tenho um servidor o site e o cliente preciso só de uma pessoal competente, que esteja empenhado a trabalhar,
      não quero nada de graça, pois nessa onda fui mais roubado do quer eu pagar um profissional.
      caso alguém se interesse entrar em contato comigo através do whatsapp
      82 9 9304-9462
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo