Ir para conteúdo

IGlanot

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    IGlanot deu reputação a jadsonj65 em Descompilador Tibia Unbinder v0.3   
    https://tibiaking.com/applications/core/interface/file/attachment.php?id=41106
     
    Aí galera
  2. Gostei
    IGlanot deu reputação a Nolangg em Global 8.6 com varias atualizações do 12   
    é só escrever isso no GNU//terminal: "sudo apt install libcrypto++-dev"
  3. Gostei
    IGlanot deu reputação a Damatio em Global 8.6 com varias atualizações do 12   
    Isso mesmo!!
     
     
     
     

  4. Curtir
    IGlanot deu reputação a Yan Liima em Script de recuperar stamina em zona protegida   
    Utilizei o script que eu ja tinha feito, apenas editei.
     
    Bom não entendi aquele 0.5, mas vamos la...
     
    em movements/scripts/ crie um arquivo.lua e cole isso dentro:
    local config = { addStamina = 1, -- quantos de stamina irá adicionar delay = 1, -- tempo para adicionar a stamina em minutos msg = 0.5, -- Só pra exibição de valor mesmo... } stamina = {} local function staminadd(cid) if not isPlayer(cid) then stamina[cid] = nil return true end doPlayerSetStamina(cid, getPlayerStamina(cid) + config.addStamina) stamina[cid] = addEvent(staminadd, config.delay*60*1000, cid) end function onStepIn(cid) if isPlayer(cid) then if getTileInfo(getThingPos(cid)).protection then if getPlayerStorageValue(cid, sta) < os.time() then doPlayerSendTextMessage(cid, 20, "{Stamina Recovery} Sua stamina começou a se recuperar, o fator de recuperação é de "..config.msg.." em relação as condições normais.") setPlayerStorageValue(cid, sta, os.time() + 300) end stamina[cid] = addEvent(staminadd, config.delay*60*1000, cid) end end return true end function onStepOut(cid) if isPlayer(cid) then stopEvent(stamina[cid]) stamina[cid] = nil end return true end No seu movements.xml coloque isso:
    <movevent type="StepIn" itemid="7351" event="script" value="arquivo.lua"/> <movevent type="StepOut" itemid="7351" event="script" value="arquivo.lua"/> Troque: 7351 pelo ID do seu tile(piso). Caso em outras zonas protegida o piso seja diferente só por assim, Ex: 7351-7352...
    O delay da mensagem está setado para 5 minutos.
  5. Curtir
    IGlanot deu reputação a Lurk em Countdown horário dos próximos eventos   
    Peço desculpas caso esteja postando na área errada, por favor movam o tópico. Isso é um tutorial
    O script já existe na base que o @WooX postou aqui mas quando tentei passar pro meu sv 0.4 ficava dando debug dai eu desisti na época. Dai eu tava tentando ajudar nesse tópico, tentei mais uma vez e consegui fazer funcionar. Exemplo de como fica ingame
     

     
    Vamos a instalação
    em data/globalevents/scripts crie um arquivo chamado eventcheck.lua e cole isso dentro
    local EventsListalist = {         {time = "01:00", name = "Snowball Event"},                 {time = "02:00", name = "DesertWar Event"},         {time = "03:00", name = "Capture The Flag"},         {time = "04:00", name = "FireStorm Event"},         {time = "09:00", name = "Defend The Tower"},         {time = "10:00", name = "Snowball Event"},         {time = "11:00", name = "DesertWar Event"},         {time = "12:00", name = "Capture The Flag"},         {time = "13:00", name = "FireStorm Event"},         {time = "15:00", name = "Battlefield Event"},         {time = "16:00", name = "Defend The Tower"},         {time = "17:00", name = "Snowball Event"},         {time = "18:00", name = "DesertWar Event",},         {time = "19:00", name = "Capture The Flag",},         {time = "20:00", name = "FireStorm Event"},         {time = "21:00", name = "Real Castle"},         {time = "22:00", name = "Battlefield Event"},         {time = "23:00", name = "Defend The Tower"} }      local position = {x = 129, y = 58, z = 7} -- posição do mapa onde o efeito vai sair function onThink(interval, lastExecution)  local people = getPlayersOnline() if #people == 0 then     return true end      local Count = 0 for _, t in ipairs(EventsListalist) do     local eventTime = hourToNumber(t.time)     local realTime = hourToNumber(os.date("%H:%M:%S"))     if eventTime >= realTime then         doCreatureSay(people[1], "Proximo evento as {"..t.time.."h} "..t.name..", faltam "..timeString(eventTime - realTime)..".", TALKTYPE_ORANGE_1, false, 0, position) -- não use acentos aqui ou eles serão alterados por simbolos ingame         return true     end     Count = Count + 1 end return true end Em data/globalevents/globalevents.xml adicione
    <globalevent name="eventos" interval="10000" event="script" value="eventcheck.lua"/> Depois adicione no fim de data/lib/050-function.lua
    function hourToNumber(str) -- By Killua     local hour = (tonumber(str:sub(1,2))*3600) + (tonumber(str:sub(4,5)) * 60)     if #str > 5 then         hour = hour + tonumber(str:sub(7,8))     end     return hour end function timeString(timeDiff,english) -- créditos: Killua     local dateFormat = {}     if english then         dateFormat = {             {"day", timeDiff / 60 / 60 / 24},             {"hour", timeDiff / 60 / 60 % 24},             {"minute", timeDiff / 60 % 60},             {"second", timeDiff % 60}         }     else         dateFormat = {             {"dia", timeDiff / 60 / 60 / 24},             {"hora", timeDiff / 60 / 60 % 24},             {"minuto", timeDiff / 60 % 60},             {"segundo", timeDiff % 60}         }              end     local out = {}     for k, t in ipairs(dateFormat) do         local v = math.floor(t[2])         if(v > 0) then             table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' e ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))         end     end          return table.concat(out) end Créditos:
    @WooX que postou a base onde eu peguei o script
    Aparentemente o Killua que criou a função hourToNumber
    Seja lá quem criou o script, tem o nome de um tal "Henrique" no arquivo original, talvez tenha sido ele
    E eu por algumas pequenas alterações pra fazer o script funcionar em tfs 0.4
    CASO VOCÊ QUEIRA O MESMO SISTEMA PARA OTX 2 PROVAVELMENTE O DA BASE POSTADO PELO WOOX VAI FUNCIONAR desde que você adicione o hourToNumber na lib
     

Informação Importante

Confirmação de Termo