Ir para conteúdo
  • Cadastre-se

Suporte POTION HEALTH/MANA 70K+


Ir para solução Resolvido por 139,

Posts Recomendados

.Qual servidor ou website você utiliza como base? 

8.60

Qual o motivo deste tópico? 

Potion não funciona se usar mais de 10k HEALTH\MANA

 

Você tem o código disponível? Se tiver publique-o aqui: 

usableOnTarget = getBooleanFromString(usableOnTarget) 

local potion = {
    [11609] = {health = {5700, 6600}, msg = "I feel the better", storage = 10020, cooldown = 6, effect = 13},
    [11610] = {mana = {5700, 6600}, msg = "I feel the better", storage = 10020, cooldown = 6, effect = 5}, 
    [7618] = {health = {2700, 3600}, mana = {2700, 3600}, msg = "I feel better", storage = 10020, cooldown = 3, effect = 13},
    [7620] = {health = {1700, 2600}, mana = {2700, 3600}, msg = "I feel better", storage = 10020, cooldown = 3, effect = 13},
    [2150] = {health = {600, 700}, mana = {2700, 3600}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 13},
    [7520] = {mana = {700, 1200}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
    [2151] = {mana = {600, 700}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
    [2144] = {mana = {600, 700}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
}
    
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    
        local hp = potion[item.itemid] 
        if(not hp) then 
                return false 
        end 
        
        if not(getCreatureStorage(cid, hp.storage) <= os.time()) then
            doPlayerSendTextMessage(cid, 27,"Espere [".. exhaustion.get(cid, hp.storage).."] Segundo(s)")
        return false
        end
        
        if(not isPlayer(itemEx.uid) or (not usableOnTarget and cid ~= itemEx.uid)) then 
            if(not splashable) then 
               return false 
            end
        end    
        local health = hp.health 
        if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * 1.0))) then 
                return false 
        end 
        local mana = hp.mana  
        if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * 1.0))) then 
                return false 
        end
        
        doCreatureSay(cid, hp.msg, TALKTYPE_ORANGE_1)
        doSendMagicEffect(getPlayerPosition(cid), hp.effect)
        doRemoveItem(item.uid, 1) 
        exhaustion.set(cid, hp.storage, hp.cooldown)
        return true 
end

 



Boa noite, eu queria que alguém me ajudasse a colocar pra POTION de ID 7618 Healar de 70000 a 60000. Quando eu coloco 9999, a Potion ainda funciona, porém se eu colocar 10000+ ela não funciona mais. Alguém da uma força ai, tmj <3

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

usableOnTarget = getBooleanFromString(usableOnTarget) 

local potion = {
    [11609] = {health = {5700, 6600}, msg = "I feel the better", storage = 10020, cooldown = 6, effect = 13},
    [11610] = {mana = {5700, 6600}, msg = "I feel the better", storage = 10020, cooldown = 6, effect = 5}, 
    [7618] = {health = {60000, 70000}, mana = {60000, 70000}, msg = "I feel better", storage = 10020, cooldown = 3, effect = 13},
    [7620] = {health = {1700, 2600}, mana = {2700, 3600}, msg = "I feel better", storage = 10020, cooldown = 3, effect = 13},
    [2150] = {health = {600, 700}, mana = {2700, 3600}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 13},
    [7520] = {mana = {700, 1200}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
    [2151] = {mana = {600, 700}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
    [2144] = {mana = {600, 700}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
}
    
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    
    local hp = potion[item.itemid] 
    if(not hp) then 
            return false 
    end 
    
    if not(getCreatureStorage(cid, hp.storage) <= os.time()) then
        doPlayerSendTextMessage(cid, 27,"Espere [".. exhaustion.get(cid, hp.storage).."] Segundo(s)")
    return false
    end
    
    if(not isPlayer(itemEx.uid) or (not usableOnTarget and cid ~= itemEx.uid)) then 
        if(not splashable) then 
           return false 
        end
    end    
    
    local health = hp.health 
    if health then
        doCreatureAddHealth(itemEx.uid, math.random(health[1], health[2]))
    end 
    
    local mana = hp.mana  
    if mana then
        doPlayerAddMana(itemEx.uid, math.random(mana[1], mana[2]))
    end
    
    doCreatureSay(cid, hp.msg, TALKTYPE_ORANGE_1)
    doSendMagicEffect(getPlayerPosition(cid), hp.effect)
    doRemoveItem(item.uid, 1) 
    exhaustion.set(cid, hp.storage, hp.cooldown)
    return true 
end

 

Link para o post
Compartilhar em outros sites
20 horas atrás, 139 disse:
  Ocultar conteúdo

usableOnTarget = getBooleanFromString(usableOnTarget) 

local potion = {
    [11609] = {health = {5700, 6600}, msg = "I feel the better", storage = 10020, cooldown = 6, effect = 13},
    [11610] = {mana = {5700, 6600}, msg = "I feel the better", storage = 10020, cooldown = 6, effect = 5}, 
    [7618] = {health = {60000, 70000}, mana = {60000, 70000}, msg = "I feel better", storage = 10020, cooldown = 3, effect = 13},
    [7620] = {health = {1700, 2600}, mana = {2700, 3600}, msg = "I feel better", storage = 10020, cooldown = 3, effect = 13},
    [2150] = {health = {600, 700}, mana = {2700, 3600}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 13},
    [7520] = {mana = {700, 1200}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
    [2151] = {mana = {600, 700}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
    [2144] = {mana = {600, 700}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
}
    
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    
    local hp = potion[item.itemid] 
    if(not hp) then 
            return false 
    end 
    
    if not(getCreatureStorage(cid, hp.storage) <= os.time()) then
        doPlayerSendTextMessage(cid, 27,"Espere [".. exhaustion.get(cid, hp.storage).."] Segundo(s)")
    return false
    end
    
    if(not isPlayer(itemEx.uid) or (not usableOnTarget and cid ~= itemEx.uid)) then 
        if(not splashable) then 
           return false 
        end
    end    
    
    local health = hp.health 
    if health then
        doCreatureAddHealth(itemEx.uid, math.random(health[1], health[2]))
    end 
    
    local mana = hp.mana  
    if mana then
        doPlayerAddMana(itemEx.uid, math.random(mana[1], mana[2]))
    end
    
    doCreatureSay(cid, hp.msg, TALKTYPE_ORANGE_1)
    doSendMagicEffect(getPlayerPosition(cid), hp.effect)
    doRemoveItem(item.uid, 1) 
    exhaustion.set(cid, hp.storage, hp.cooldown)
    return true 
end

 

Irmão funcionou certinho, muito obrigado!


Mas nesse Script esqueci de falar que toda hora que ele tenta usar a Potion dentro do CD dela, aparece no chat "21:05 Espere [3] Segundo(s)"
Eu queria que aparecesse em cima do chatzinho "Você está exausto"

Obrigado desde já mano! REP+

Link para o post
Compartilhar em outros sites
Em 11/02/2021 em 21:26, raphadoidera disse:

.Qual servidor ou website você utiliza como base? 

8.60

Qual o motivo deste tópico? 

Potion não funciona se usar mais de 10k HEALTH\MANA

 

Você tem o código disponível? Se tiver publique-o aqui: 

usableOnTarget = getBooleanFromString(usableOnTarget) 

local potion = {
    [11609] = {health = {5700, 6600}, msg = "I feel the better", storage = 10020, cooldown = 6, effect = 13},
    [11610] = {mana = {5700, 6600}, msg = "I feel the better", storage = 10020, cooldown = 6, effect = 5}, 
    [7618] = {health = {2700, 3600}, mana = {2700, 3600}, msg = "I feel better", storage = 10020, cooldown = 3, effect = 13},
    [7620] = {health = {1700, 2600}, mana = {2700, 3600}, msg = "I feel better", storage = 10020, cooldown = 3, effect = 13},
    [2150] = {health = {600, 700}, mana = {2700, 3600}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 13},
    [7520] = {mana = {700, 1200}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
    [2151] = {mana = {600, 700}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
    [2144] = {mana = {600, 700}, msg = "I feel the best", storage = 10021,cooldown = 3, effect = 5},
}
    
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    
        local hp = potion[item.itemid] 
        if(not hp) then 
                return false 
        end 
        
        if not(getCreatureStorage(cid, hp.storage) <= os.time()) then
            doPlayerSendTextMessage(cid, 27,"Espere [".. exhaustion.get(cid, hp.storage).."] Segundo(s)")
        return false
        end
        
        if(not isPlayer(itemEx.uid) or (not usableOnTarget and cid ~= itemEx.uid)) then 
            if(not splashable) then 
               return false 
            end
        end    
        local health = hp.health 
        if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * 1.0))) then 
                return false 
        end 
        local mana = hp.mana  
        if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * 1.0))) then 
                return false 
        end
        
        doCreatureSay(cid, hp.msg, TALKTYPE_ORANGE_1)
        doSendMagicEffect(getPlayerPosition(cid), hp.effect)
        doRemoveItem(item.uid, 1) 
        exhaustion.set(cid, hp.storage, hp.cooldown)
        return true 
end

 



Boa noite, eu queria que alguém me ajudasse a colocar pra POTION de ID 7618 Healar de 70000 a 60000. Quando eu coloco 9999, a Potion ainda funciona, porém se eu colocar 10000+ ela não funciona mais. Alguém da uma força ai, tmj <3

 

 

local ITEM = IDDOITEM
local storagepotion = 8000
local wait = 1
local REG_HEALTH = 70000
local REG_MANA = 70000

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.get(cid, storagepotion) then
        doPlayerSendCancel(cid, "You are exhausted.")
        return true
    end
    if fromPosition.x ~= CONTAINER_POSITION then
        doPlayerAddMana(cid, REG_MANA)
        doCreatureAddHealth(cid, REG_HEALTH)
        exhaustion.set(cid, storagepotion, wait)
    elseif item.itemid == ITEM then
        doPlayerAddMana(cid, REG_MANA)
        doCreatureAddHealth(cid, REG_HEALTH)
        exhaustion.set(cid, storagepotion, wait)
    end
    return true
end

 

Editado por Celulose (veja o histórico de edições)
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