Ir para conteúdo

runa que heala life por por porcentagem


notle2012

Posts Recomendados

Primeiro vá em / data / actions/ scripts

cria um arquivo.lua

function onUse(cid, item, frompos, item2, topos)
exhaust,lifemax,porce = 1100,math.max((getPlayerLevel(cid)*10)),9 -- 9%
if getPlayerStorageValue(cid, 14725) >= os.time() then return true end						
if getPlayerLevel(cid) > (lifemax/10-1) then
doCreatureAddHealth(item2.uid, math.random(math.floor(getCreatureMaxHealth(cid)/100*porce/1.4),math.ceil(getCreatureMaxHealth(cid)/100*porce)))
doSendMagicEffect(topos, CONST_ME_MAGIC_BLUE)
doCreatureSay(item2.uid, "Aaaah...", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 14725, os.time() + exhaust / 1000)
return true
end
end

actions.xml

<action itemid="iddoitem" script="arquivo.lua"/>

para alterar quantos porcentos quer que heala altera aqui o red

exhaust,lifemax,porce = 1100,math.max((getPlayerLevel(cid)*10)),9 -- 9%

Editado por notle2012
Link para o comentário
Compartilhar em outros sites

  • 6 years later...
  • 3 years later...
Em 26/02/2020 em 14:57, marciosoliano disse:

teria como fazer esse mesmo pra mana ?! sou bem iniciante. se conseguir me ajuda muito!!!

function onUse(cid, item, frompos, item2, topos)
exhaust,manamax,porce = 1100,math.max((getPlayerLevel(cid)*10)),5 -- 9%
if getPlayerStorageValue(cid, 14725) >= os.time() then return true end                        
if getPlayerLevel(cid) > (manamax/10-1) then
doCreatureAddMana(item2.uid, math.random(math.floor(getCreatureMaxMana(cid)/100*porce/1.4),math.ceil(getCreatureMaxMana(cid)/100*porce)))
doSendMagicEffect(topos, CONST_ME_MAGIC_BLUE)
doCreatureSay(item2.uid, "Mana Ha...", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 14725, os.time() + exhaust / 1000)
return true
end
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...