Opa, foi bobeira minha, mas eu refiz o código, testei e agora está funcionando:
-- REFEITO POR YAN18 PARA RESTAURAR VIDA POR VALOR CONSTANTE --
function doHealOverTime(cid, hp, effect)
if not isCreature(cid) then
return true
end
doSendMagicEffect(getThingPos(cid), effect)
doCreatureAddHealth(cid, math.floor(hp))
end
local potions = {
[1456] = {effect = 13, hp = 50000}, -- super potion
[1451] = {effect = 13, hp = 50000}, -- great potion
[384] = {effect = 12, hp = 50000}, -- ultra potion
[385] = {effect = 14, hp = 50000}, -- hyper potion
[392] = {effect = 14, hp = 50000}, -- full restore
[667] = {effect = 14, hp = 50000}, -- full restore
[668] = {effect = 14, hp = 50000}, -- full restore
[669] = {effect = 14, hp = 50000}, -- full restore
[670] = {effect = 14, hp = 50000}, -- full restore
[671] = {effect = 14, hp = 50000}, -- full restore
}
function onUse(cid, item, frompos, item2, topos)
local pid = getThingFromPosWithProtect(topos)
if not isSummon(pid) or getCreatureMaster(pid) ~= cid then
return doPlayerSendCancel(cid, "You can only use potions on your own Pokemons!")
end
if getCreatureHealth(pid) == getCreatureMaxHealth(pid) then
return doPlayerSendCancel(cid, "This pokemon is already at full health.")
end
if getPlayerStorageValue(pid, 173) >= 1 then
setPlayerStorageValue(pid, 173, -1)
end
if getPlayerStorageValue(cid, 52481) >= 1 then
return doPlayerSendCancel(cid, "You can't do that while a duel.")
end
if getPlayerStorageValue(cid, 990) >= 1 then
doPlayerSendCancel(cid, "You can't use potion during gym battles.")
return true
end
doCreatureSay(cid, "".. getCreatureName(pid)..", take this potion!", TALKTYPE_MONSTER)
doSendMagicEffect(getThingPos(pid), 0)
setPlayerStorageValue(pid, 173, 1)
doRemoveItem(item.uid, 1)
local a = potions[item.itemid]
doHealOverTime(pid, a.hp, a.effect)
doPlayerSendCancel(cid, "Your monsters recovered " ..a.hp.. " of HP.")
return true
end
Ai para configurar o HP, você precisa mudar os valores na variável hp de cada potion (item) na tabela potions onde está 50000 para todos.