Em 10/03/2020 em 20:05, kamus9629 disse:Versão do Servidor:Tipo de Script: actionsCódigo:function doHealOverTime(cid, div, turn, effect) --alterado v1.6 peguem o script todo!! if not isCreature(cid) then return true end if turn <= 0 or (getCreatureHealth(cid) == getCreatureMaxHealth(cid)) or getPlayerStorageValue(cid, 173) <= 0 then setPlayerStorageValue(cid, 173, -1) return true end local d = div / 10000 local amount = math.floor(getCreatureMaxHealth(cid) * d) doCreatureAddHealth(cid, amount) if math.floor(turn/10) == turn/10 then doSendMagicEffect(getThingPos(cid), effect) end addEvent(doHealOverTime, 100, cid, div, turn - 1, effect) end local potions = { [1456] = {effect = 13, div = 235}, --super potion [1451] = {effect = 13, div = 330}, --great potion [384] = {effect = 12, div = 550}, --ultra potion [385] = {effect = 14, div = 750}, --hyper potion [392] = {effect = 14, div = 900}, --full restore [667] = {effect = 14, div = 1200}, --full restore [668] = {effect = 14, div = 1350}, --full restore [669] = {effect = 14, div = 1600}, --full restore [670] = {effect = 14, div = 1710}, --full restore [671] = {effect = 14, div = 2280}, --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 return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.") 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 rpotion 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.div, 100, a.effect) return true endAlguem poderia fazer esse codigo pramin para que o pokemon receba o HP por numero nao por porcentagem
Você não especificou a quantidade exata que quer, então substitua o código por esse:
local hp_quantidade = 50000 -- COLOQUEI AQUI A QUANTIDADE DE HP function doHealOverTime(cid, div, turn, effect) --alterado v1.6 peguem o script todo!! if not isCreature(cid) then return true end if turn <= 0 or (getCreatureHealth(cid) == getCreatureMaxHealth(cid)) or getPlayerStorageValue(cid, 173) <= 0 then setPlayerStorageValue(cid, 173, -1) return true end local hp = math.floor(hp_quantidade) doCreatureAddHealth(cid, hp) if math.floor(turn/10) == turn/10 then doSendMagicEffect(getThingPos(cid), effect) end addEvent(doHealOverTime, 100, cid, div, turn - 1, effect) end local potions = { [1456] = {effect = 13, div = 235}, --super potion [1451] = {effect = 13, div = 330}, --great potion [384] = {effect = 12, div = 550}, --ultra potion [385] = {effect = 14, div = 750}, --hyper potion [392] = {effect = 14, div = 900}, --full restore [667] = {effect = 14, div = 1200}, --full restore [668] = {effect = 14, div = 1350}, --full restore [669] = {effect = 14, div = 1600}, --full restore [670] = {effect = 14, div = 1710}, --full restore [671] = {effect = 14, div = 2280}, --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 return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.") 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 rpotion 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.div, 100, a.effect) return true end
E na primeira linha na variável hp_quantidade troque o valor pelo desejado.
Teste e me fale.




info
Grupo: Visconde
Registrado: 14/08/11
Posts: 291
Reputação: +8
Potion de Pokemon Certa quantidade de HP
RESOLVIDO PELO @Yan18 Procure abaixo ?
Editado Maio 1 por kamus9629