Ir para conteúdo

Featured Replies

Postado

Estou voltando com um projeto old de 2017 de wodbo, infelizmente perdi um script da senzu healando % de vida e mana.

 

Alguém da um help? não encontrei no forum

 

Versão TFS 0.4 - 8.60

 

actions/script/senzu bean.lua

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
ITEM = 12780
local storage = 50000
local wait = 1.0
local pos1 = {x = getPlayerPosition(cid).x + 1, y = getPlayerPosition(cid).y + 0, z = getPlayerPosition(cid).z}
if fromPosition.x ~= CONTAINER_POSITION and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = 200000
REG_MANA = 200000
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'Aaahhh! Bem Melhor!', TALKTYPE_ORANGE_1)
doSendMagicEffect(pos1, 80)
doRemoveItem(item.uid, 0)
exhaustion.set(cid, storage, wait)
elseif item.itemid == ITEM and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = 200000
REG_MANA = 200000
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'Aaahhh! Bem Melhor!', TALKTYPE_ORANGE_1)
doSendMagicEffect(pos1, 80)
doRemoveItem(item.uid, 0)
exhaustion.set(cid, storage, wait)
else
doPlayerSendCancel(cid, "You are exhausted.")
end
return TRUE
end

 

 

 

  • Respostas 8
  • Visualizações 393
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado
Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)
ITEM = 12780
local storage = 50000
local wait = 1.0
local pos1 = {x = getPlayerPosition(cid).x + 1, y = getPlayerPosition(cid).y + 0, z = getPlayerPosition(cid).z}
if fromPosition.x ~= CONTAINER_POSITION and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = getCreatureMaxHealth(cid) * 0.3 -- regenera 30% do hp
REG_MANA = getCreatureMaxMana(cid) * 0.3 -- regenera 30% da mana
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'Aaahhh! Bem Melhor!', TALKTYPE_ORANGE_1)
doSendMagicEffect(pos1, 80)
doRemoveItem(item.uid, 0)
exhaustion.set(cid, storage, wait)
elseif item.itemid == ITEM and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = getCreatureMaxHealth(cid) * 0.3 -- regenera 30% do hp
REG_MANA = getCreatureMaxMana(cid) * 0.3 -- regenera 30% da mana
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'Aaahhh! Bem Melhor!', TALKTYPE_ORANGE_1)
doSendMagicEffect(pos1, 80)
doRemoveItem(item.uid, 0)
exhaustion.set(cid, storage, wait)
else
doPlayerSendCancel(cid, "You are exhausted.")
end
return TRUE
end

@moleza

Editado por ernaix69 (veja o histórico de edições)

Postado
  • Diretor
Em 09/06/2023 em 17:25, moleza disse:

Estou voltando com um projeto old de 2017 de wodbo, infelizmente perdi um script da senzu healando % de vida e mana.

 

Alguém da um help? não encontrei no forum

 

Versão TFS 0.4 - 8.60

 

actions/script/senzu bean.lua

 


function onUse(cid, item, fromPosition, itemEx, toPosition)
ITEM = 12780
local storage = 50000
local wait = 1.0
local pos1 = {x = getPlayerPosition(cid).x + 1, y = getPlayerPosition(cid).y + 0, z = getPlayerPosition(cid).z}
if fromPosition.x ~= CONTAINER_POSITION and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = 200000
REG_MANA = 200000
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'Aaahhh! Bem Melhor!', TALKTYPE_ORANGE_1)
doSendMagicEffect(pos1, 80)
doRemoveItem(item.uid, 0)
exhaustion.set(cid, storage, wait)
elseif item.itemid == ITEM and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = 200000
REG_MANA = 200000
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'Aaahhh! Bem Melhor!', TALKTYPE_ORANGE_1)
doSendMagicEffect(pos1, 80)
doRemoveItem(item.uid, 0)
exhaustion.set(cid, storage, wait)
else
doPlayerSendCancel(cid, "You are exhausted.")
end
return TRUE
end

 

 

 

Te ajuda?

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local ITEM_ID = 12780 -- ID do item Senzu Bean
    local STORAGE_ID = 50000 -- ID de armazenamento para controle de cooldown
    local COOLDOWN_TIME = 60 -- Tempo de recarga em segundos
    local HEAL_AMOUNT = 200000 -- Quantidade de vida e mana a ser curada
    local EFFECT_ID = 80 -- ID do efeito visual ao usar a Senzu Bean

    local pos = getPlayerPosition(cid)
    local newPos = {x = pos.x + 1, y = pos.y, z = pos.z}

    -- Verifica se o item usado é uma Senzu Bean
    if item.itemid ~= ITEM_ID then
        doPlayerSendCancel(cid, "You must use a Senzu Bean.")
        return TRUE
    end

    -- Verifica se o jogador está em cooldown
    if exhaustion.get(cid, STORAGE_ID) == TRUE then
        local cooldownTime = exhaustion.get(cid, STORAGE_ID) / 1000
        doPlayerSendCancel(cid, "You are still in cooldown for " .. cooldownTime .. " seconds.")
        return TRUE
    end

    -- Cura o jogador
    doPlayerAddMana(cid, HEAL_AMOUNT)
    doCreatureAddHealth(cid, HEAL_AMOUNT)

    -- Exibe a mensagem e o efeito visual
    doCreatureSay(cid, "Aaahhh! Bem melhor!", TALKTYPE_ORANGE_1)
    doSendMagicEffect(newPos, EFFECT_ID)

    -- Remove a Senzu Bean do inventário
    doRemoveItem(item.uid, 1)

    -- Define o tempo de cooldown
    exhaustion.set(cid, STORAGE_ID, COOLDOWN_TIME * 1000)

    return TRUE
end
 

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Postado
  • Autor
16 horas atrás, L3K0T disse:

Te ajuda?

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local ITEM_ID = 12780 -- ID do item Senzu Bean
    local STORAGE_ID = 50000 -- ID de armazenamento para controle de cooldown
    local COOLDOWN_TIME = 60 -- Tempo de recarga em segundos
    local HEAL_AMOUNT = 200000 -- Quantidade de vida e mana a ser curada
    local EFFECT_ID = 80 -- ID do efeito visual ao usar a Senzu Bean

    local pos = getPlayerPosition(cid)
    local newPos = {x = pos.x + 1, y = pos.y, z = pos.z}

    -- Verifica se o item usado é uma Senzu Bean
    if item.itemid ~= ITEM_ID then
        doPlayerSendCancel(cid, "You must use a Senzu Bean.")
        return TRUE
    end

    -- Verifica se o jogador está em cooldown
    if exhaustion.get(cid, STORAGE_ID) == TRUE then
        local cooldownTime = exhaustion.get(cid, STORAGE_ID) / 1000
        doPlayerSendCancel(cid, "You are still in cooldown for " .. cooldownTime .. " seconds.")
        return TRUE
    end

    -- Cura o jogador
    doPlayerAddMana(cid, HEAL_AMOUNT)
    doCreatureAddHealth(cid, HEAL_AMOUNT)

    -- Exibe a mensagem e o efeito visual
    doCreatureSay(cid, "Aaahhh! Bem melhor!", TALKTYPE_ORANGE_1)
    doSendMagicEffect(newPos, EFFECT_ID)

    -- Remove a Senzu Bean do inventário
    doRemoveItem(item.uid, 1)

    -- Define o tempo de cooldown
    exhaustion.set(cid, STORAGE_ID, COOLDOWN_TIME * 1000)

    return TRUE
end
 


 Boa noite tudo bem? então a ideia era healar % da vida maxima, por exemplo encher 20% da mana e da vida, esse script continua enchendo 200k 

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo