kamus9629 8 Postado Março 10, 2020 Share Postado Março 10, 2020 (editado) Potion de Pokemon Certa quantidade de HP RESOLVIDO PELO @Yan18 Procure abaixo ? Editado Maio 2, 2020 por kamus9629 Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/ Compartilhar em outros sites More sharing options...
1 Yan Oliveira 214 Postado Abril 30, 2020 Share Postado Abril 30, 2020 Em 24/04/2020 em 23:19, kamus9629 disse: @Yan18 desculpe a dermora mano tipo vou explicar eu queria que cada item dava um HP diferente mais eu acho que esse serve mais vou ter que cria 50 item action diferente para mais vlw vou testar agora eu testei esse codigo agora 20:30 mais ele nao ta dando so a quantidade do HP ele ta enchendo HP TODO Expand 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. KaboFlow e kamus9629 reagiu a isso 1 1 Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759043 Compartilhar em outros sites More sharing options...
0 Yan Oliveira 214 Postado Março 26, 2020 Share Postado Março 26, 2020 Em 10/03/2020 em 23:05, kamus9629 disse: Versão do Servidor: Tipo de Script: actions Código: Mostrar conteúdo oculto 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 end Alguem poderia fazer esse codigo pramin para que o pokemon receba o HP por numero nao por porcentagem Expand 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. Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1758082 Compartilhar em outros sites More sharing options...
0 kamus9629 8 Postado Março 26, 2020 Autor Share Postado Março 26, 2020 vlw parceiro @Yan18 Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1758084 Compartilhar em outros sites More sharing options...
0 Yan Oliveira 214 Postado Março 26, 2020 Share Postado Março 26, 2020 Em 26/03/2020 em 18:51, kamus9629 disse: vlw parceiro @Yan18 Expand Mas testou? Deu certo? Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1758087 Compartilhar em outros sites More sharing options...
0 kamus9629 8 Postado Março 26, 2020 Autor Share Postado Março 26, 2020 Em 26/03/2020 em 19:54, Yan18 disse: Mas testou? Deu certo? Expand tentei ainda nao porque estou tentando copilar soucer otclient que ta fazendo distancia effect buga no game Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1758088 Compartilhar em outros sites More sharing options...
0 kamus9629 8 Postado Abril 24, 2020 Autor Share Postado Abril 24, 2020 (editado) @Yan18 desculpe a dermora mano tipo vou explicar eu queria que cada item dava um HP diferente mais eu acho que esse serve mais vou ter que cria 50 item action diferente para mais vlw vou testar agora eu testei esse codigo agora 20:30 mais ele nao ta dando so a quantidade do HP ele ta enchendo HP TODO Editado Abril 24, 2020 por kamus9629 Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1758925 Compartilhar em outros sites More sharing options...
0 kamus9629 8 Postado Maio 2, 2020 Autor Share Postado Maio 2, 2020 (editado) @Yan18 ae yan eu testei aqui ainda ta heal tudo Video Do heal heal item.rarFetching info... Editado Maio 2, 2020 por kamus9629 Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759113 Compartilhar em outros sites More sharing options...
0 Yan Oliveira 214 Postado Maio 2, 2020 Share Postado Maio 2, 2020 Em 02/05/2020 em 00:55, kamus9629 disse: @Yan18 ae yan eu testei aqui ainda ta heal tudo Expand Está healando tudo se não mudou o valor ali do hp que falei, deixei 50000 só de teste, pode ser que os monstros que está usando a potion tenham menos de 50000 de vida. Eu testei aqui e está curando pelo tanto que você define. Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759114 Compartilhar em outros sites More sharing options...
0 kamus9629 8 Postado Maio 2, 2020 Autor Share Postado Maio 2, 2020 (editado) Em 02/05/2020 em 01:02, Yan18 disse: Está healando tudo se não mudou o valor ali do hp que falei, deixei 50000 só de teste, pode ser que os monstros que está usando a potion tenham menos de 50000 de vida. Eu testei aqui e está curando pelo tanto que você define. Expand [384] = {effect = 12, hp = 550}, -- ultra potion eu tambem mandei o videoheal item.rar video Editado Maio 2, 2020 por kamus9629 Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759115 Compartilhar em outros sites More sharing options...
0 Yan Oliveira 214 Postado Maio 2, 2020 Share Postado Maio 2, 2020 Em 02/05/2020 em 01:08, kamus9629 disse: [384] = {effect = 12, hp = 550}, -- ultra potion eu tambem mandei o videoheal item.rar video Expand Eu vi o vídeo, mas você não está usando o script que eu fiz, pois quando usou a potion nem apareceu a mensagem que coloquei. Tirei até uma print do teste que fiz novamente aqui, olha como cura o tanto que eu coloco e exibe a mensagem; Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759116 Compartilhar em outros sites More sharing options...
0 kamus9629 8 Postado Maio 2, 2020 Autor Share Postado Maio 2, 2020 @Yan18 Primeiro me desculpe pelo tempo perdido segundo vlw me ajudou bastante Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759117 Compartilhar em outros sites More sharing options...
0 Yan Oliveira 214 Postado Maio 2, 2020 Share Postado Maio 2, 2020 Em 02/05/2020 em 02:16, kamus9629 disse: @Yan18 Primeiro me desculpe pelo tempo perdido segundo vlw me ajudou bastante Expand De nada, que isso! Você tinha esquecido de salvar o script que fiz? Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759118 Compartilhar em outros sites More sharing options...
0 kamus9629 8 Postado Maio 2, 2020 Autor Share Postado Maio 2, 2020 (editado) tinha esquecido de mudar no action.lua tinha replica de outro codigo la eu posso coloca o codigo La em cima na postagem com seus creditos ? ou voce cria um topico e eu posto la em cima Editado Maio 2, 2020 por kamus9629 Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759119 Compartilhar em outros sites More sharing options...
0 Yan Oliveira 214 Postado Maio 2, 2020 Share Postado Maio 2, 2020 Em 02/05/2020 em 02:20, kamus9629 disse: tinha esquecido de mudar no action.lua tinha replica de outro codigo la eu posso coloca o codigo La em cima na postagem com seus creditos ? Expand Acontece, tibia é tudo nos mínimos detalhes rsrs. Mas, você fala aqui no post? É melhor eleger como melhor resposta o post que postei o código, porque assim quem precisar futuramente já identifica facilmente. Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759120 Compartilhar em outros sites More sharing options...
0 kamus9629 8 Postado Maio 2, 2020 Autor Share Postado Maio 2, 2020 @Yan18 vlw ja dei reputação agora vou pro unique item ta quase tudo pronto graças a deus Link para o comentário https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/#findComment-1759121 Compartilhar em outros sites More sharing options...
Pergunta
kamus9629 8
Potion de Pokemon Certa quantidade de HP
RESOLVIDO PELO @Yan18 Procure abaixo ?
Editado por kamus9629Link para o comentário
https://xtibia.com/forum/topic/251184-potion-de-pokemon-certa-quantidade-de-hp-resolvido/Compartilhar em outros sites
19 respostass a esta questão
Posts Recomendados