Ir para conteúdo

AidanNarutoHellDust

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Obrigado
    que estranho, no meu server funcionou, testei num baiak 8.6...
     
    pode ser que a função seja diferente, tenta colocar 2 desse jeito para ver se aumenta a taxa de up
     
     
    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes"> <config name="exppotion"><![CDATA[ Potions_Rates = { [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 2}, [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 2}, [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 2} } function convertTime(a) if(type(tonumber(a)) == "number" and a > 0) then if (a <= 3599) then local minute = math.floor(a/60) local second = a - (60 * minute) if(second == 0) then return ((minute)..((minute > 1) and " minutos" or " minuto")) else return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo")) end else local hour = math.floor(a/3600) local minute = math.floor((a - (hour * 3600))/60) local second = (a - (3600 * hour) - (minute * 60)) if (minute == 0 and second > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo")) elseif (second == 0 and minute > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto")) elseif (second == 0 and minute == 0) then return (hour..((hour > 1) and " horas" or " hora")) end return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo")) end end end ]]></config> <event type="login" name="ExpPotionLogin" event="script"><![CDATA[ domodlib('exppotion') function onLogin(cid) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then registerCreatureEvent(cid, "ExpPotionThink") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".") if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, ret.new_rate) else doPlayerSetRate(cid, ret.skill, ret.new_rate) end setPlayerStorageValue(cid, ret.storages[2], 1) -- registro end end return true end]]></event> <event type="think" name="ExpPotionThink" event="script"><![CDATA[ domodlib('exppotion') function onThink(cid, interval) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!") if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, 1) else doPlayerSetRate(cid, ret.skill, 1) end setPlayerStorageValue(cid, ret.storages[2], 0) -- registro end end return true end]]></event> <talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[ domodlib('exppotion') local str ="# POTIONS INFO #\n\n" for _, ret in pairs(Potions_Rates) do str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n" end return doPlayerPopupFYI(cid, str) ]]></talkaction> <action itemid="14562;14565;14566" event="script"><![CDATA[ domodlib('exppotion') function onUse(cid, item, fromPosition, itemEx, toPosition) if not Potions_Rates[item.itemid] then return true end local ret = Potions_Rates[item.itemid] if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true end local rates = 1 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60) setPlayerStorageValue(cid, ret.storages[2], 1) if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, ret.new_rate) else doPlayerSetRate(cid, ret.skill, ret.new_rate) end registerCreatureEvent(cid, "ExpPotionThink") doRemoveItem(item.uid) return true end]]></action> </mod>  
     
  2. Obrigado
    @AidanNarutoHellDust
     
    testa assim
     
     
     
    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes"> <config name="exppotion"><![CDATA[ Potions_Rates = { [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 0.5}, -- 50% [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 0.5}, -- 50% [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 0.5} -- 50% } function convertTime(a) if(type(tonumber(a)) == "number" and a > 0) then if (a <= 3599) then local minute = math.floor(a/60) local second = a - (60 * minute) if(second == 0) then return ((minute)..((minute > 1) and " minutos" or " minuto")) else return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo")) end else local hour = math.floor(a/3600) local minute = math.floor((a - (hour * 3600))/60) local second = (a - (3600 * hour) - (minute * 60)) if (minute == 0 and second > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo")) elseif (second == 0 and minute > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto")) elseif (second == 0 and minute == 0) then return (hour..((hour > 1) and " horas" or " hora")) end return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo")) end end end ]]></config> <event type="login" name="ExpPotionLogin" event="script"><![CDATA[ domodlib('exppotion') function onLogin(cid) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then registerCreatureEvent(cid, "ExpPotionThink") local rates = 1 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".") if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates + ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates + ret.new_rate) end setPlayerStorageValue(cid, ret.storages[2], 1) -- registro end end return true end]]></event> <event type="think" name="ExpPotionThink" event="script"><![CDATA[ domodlib('exppotion') function onThink(cid, interval) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!") local rates = 1 if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates - ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates - ret.new_rate) end setPlayerStorageValue(cid, ret.storages[2], 0) -- registro end end return true end]]></event> <talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[ domodlib('exppotion') local str ="# POTIONS INFO #\n\n" for _, ret in pairs(Potions_Rates) do str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n" end return doPlayerPopupFYI(cid, str) ]]></talkaction> <action itemid="14562;14565;14566" event="script"><![CDATA[ domodlib('exppotion') function onUse(cid, item, fromPosition, itemEx, toPosition) if not Potions_Rates[item.itemid] then return true end local ret = Potions_Rates[item.itemid] if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true end local rates = 1 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60) setPlayerStorageValue(cid, ret.storages[2], 1) if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates + ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates + ret.new_rate) end registerCreatureEvent(cid, "ExpPotionThink") doRemoveItem(item.uid) return true end]]></action> </mod>  
  3. Obrigado
    n testei
     
    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes"> <config name="exppotion"><![CDATA[ Potions_Rates = { [2152] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 0.2}, [2124] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 0.1}, -- 10% [12609] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 0.1} -- 10% } function convertTime(a) if(type(tonumber(a)) == "number" and a > 0) then if (a <= 3599) then local minute = math.floor(a/60) local second = a - (60 * minute) if(second == 0) then return ((minute)..((minute > 1) and " minutos" or " minuto")) else return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo")) end else local hour = math.floor(a/3600) local minute = math.floor((a - (hour * 3600))/60) local second = (a - (3600 * hour) - (minute * 60)) if (minute == 0 and second > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo")) elseif (second == 0 and minute > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto")) elseif (second == 0 and minute == 0) then return (hour..((hour > 1) and " horas" or " hora")) end return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo")) end end end ]]></config> <event type="login" name="ExpPotionLogin" event="script"><![CDATA[ domodlib('exppotion') function onLogin(cid) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then registerCreatureEvent(cid, "ExpPotionThink") local rates = getPlayerRates(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".") if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL] + ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates[ret.skill] + ret.new_rate) end setPlayerStorageValue(cid, ret.storages[2], 1) -- registro end end return true end]]></event> <event type="think" name="ExpPotionThink" event="script"><![CDATA[ domodlib('exppotion') function onThink(cid, interval) for _, ret in pairs(Potions_Rates) do if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!") local rates = getPlayerRates(cid) if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]- ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates[ret.skill] - ret.new_rate) end setPlayerStorageValue(cid, ret.storages[2], 0) -- registro end end return true end]]></event> <talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[ domodlib('exppotion') local str ="# POTIONS INFO #\n\n" for _, ret in pairs(Potions_Rates) do str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n" end return doPlayerPopupFYI(cid, str) ]]></talkaction> <action itemid="2152;2124;12609" event="script"><![CDATA[ domodlib('exppotion') function onUse(cid, item, fromPosition, itemEx, toPosition) if not Potions_Rates[item.itemid] then return true end local ret = Potions_Rates[item.itemid] if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true end local rates = getPlayerRates(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60) setPlayerStorageValue(cid, ret.storages[2], 1) if ret.skill == SKILL__LEVEL then doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+ret.new_rate) else doPlayerSetRate(cid, ret.skill, rates[ret.skill] + ret.new_rate) end registerCreatureEvent(cid, "ExpPotionThink") doRemoveItem(item.uid) return true end]]></action> </mod>  
  4. Obrigado
    AidanNarutoHellDust deu reputação a KotZletY em [8.60] TFS 0.4 Rev3996 War & Cast   
    Parabéns, seu tópico de conteúdo foi aprovado!
    Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
    Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.
     
  5. Obrigado
    AidanNarutoHellDust deu reputação a Yan Liima em [8.60] TFS 0.4 Rev3996 War & Cast   
    Salve salve pessoal, no inicio desse ano estava dando uma estudada e mexendo com a TFS 0.4 rev3884, e vi que havia alguns bugs e que não tinha Cast incluso. Com base nisso decidi atualizar e otimizar a source, já que ainda ela é uma das mais utilizadas no mundo de Otserv.  Decidi compartilhar esse meu trabalho com vocês! Acredito que possa ser uma das melhores REV atualmente.
     
    Conto com o seu feedback, caso haja algum bug, algo que tenha que mudar/optimizar, não exite em avisar aqui no tópico. Toda ajuda será bem vinda xD
     
    The Forgotten Server, Tibia Versão: 8.60
    O que contém nela?
     
    Dentro da pasta contém o config.lua com todas as tag já adicionadas.
     
    Não esquecam de executar a Query do Cast na sua DB:
     
    Downloads uint8(Effects até 255)
    Distro: TheForgottenServer.exe
    Src + datapack: Source & Data
    Recentes atualizações: GitHub
    Downloads uint8 sem o CAST incluso
    Distro: TheForgottenServer.exe
    Src + datapack: Source & Data
    -------------------------------------------------------
    Downloads uint16(Effects até 65534)
    Distro: TheForgottenServer.exe
    Src + datapack: Source & Data
    É necessário fazer a modificação do Hexadecimal no cliente. Aqui tem um já pronto: Cliente.exe(com mc) ou Cliente.exe(sem mc) (só será necessario se utilizar a src com o uint 16.)
    Lembrado também que precisa utilizar a lib 000-constant.lua deste datapack.
    -------------------------------------------------------
    Scans:
    Distro(uint8) & Distro(uint16)
    Source
    Cliente
     
    Obs: Os virus detectado é um falso positivo, então não se preocupem!
     
    A distro foi testada em Windows e em Linux Ubuntu 12.04, 14.04, em
    ambos funcionaram muito bem!
    É compatível com 16 também e o 18.04 é necessário fazer uma alteração que é possível encontrar no post desse tópico. 
     
    É possível compilar em Dev Cpp e Visual-Studio. 
     
    E para quem se interessa em saber onde se localiza os code do Cast, aqui está uma imagem. Você pode achar procurando por "//CAST"
     
    Façam um ótimo aproveito ?
  6. Obrigado
    Creio que se editar essa parte da skill resulte:
    doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate)
    SKILL__LEVEL para a skill desejada, confere se está adicionando uma skill existente.
    troque todos.
  7. Obrigado
    AidanNarutoHellDust deu reputação a Caronte em (Resolvido)[SPELL] Trap   
    Eu já fiz isso, só que ele ta reclamando agora que falta o FAIL, que ele não explicou direito como era...
    já testei o script até no tibia...

  8. Obrigado
    Olá pessoal, resolvi criar um sistema de recompensa parecido com o sistema do tibia global para a versão 8.60, mas tie que fazer varias "gambiarras" para ele funcionar nesta versão.

    Para quem não conhece: http://www.tibiawiki.com.br/wiki/Loot#Sistema_de_Recompensas

    Basicamente meu sistema funciona da seguinte forma:
    • você determina as criaturas que irão funcionar com esse sistema (normalmente bosses).
    • durante a batalha com a criatura o sistema conta pontos aos jogadores por ataque, bloqueio e suporte ("healar" quem esta na batalha).
    • quando a criatura é morta o sistema cria um "loot" de acordo com os pontos e envia-o ao depot do jogador em uma bag determinada nas configurações.

    Primeiramente vamos criar o arquivo das configurações gerais, crie uma pasta dentro do "data" com o nome de sistemas e dentro cria um arquivo rewardchest.lua: 

    Depois em creaturescript crie dois arquivos:
    rewardchest_boss.lua:

    e rewardchest_pontos.lua: 

    Lembrando que em todas as criaturas que forem adicionadas ao sistema além de coloca-las no rewarchest.lua você deve add isso no xml do monstro: 
    <script> <event name="RewardChestDeath"/> <event name="RewardChestMonster"/> </script> E isso no creaturescript.xml: 
    <!-- Sistema de recompensa criado por luanluciano93 --> <event type="login" name="RewardChestLogin" event="script" value="rewardchest_pontos.lua"/> <event type="statschange" name="RewardChestStats" event="script" value="rewardchest_pontos.lua"/> <event type="death" name="RewardChestDeath" event="script" value="rewardchest_boss.lua"/> <event type="statschange" name="RewardChestMonster" event="script" value="rewardchest_boss.lua"/>
    Basicamente é isso, qualquer dúvida postem aqui ... abraços!

    LINK DO SCRIPT NO GITHUB: https://github.com/luanluciano93/ESTUDOS/tree/master/LUA/REWARD_SYSTEM_860

Informação Importante

Confirmação de Termo