KE

Potion Igual Ao Po

Por kevinloko, 06 de nov. de 2010 em Scripts

script
5
2k
kevinlokoK
06 de novembro de 2010 às 11:55

Gente tipow peguei um script do draky lucas que é uma potion igual ou + ou - igual ao do PO e ele só explicou como coloca para healar em % e nao explicou como heala em quantidade =/ eu queria que healasse em quantidade o script ta ai

function onUse(cid, item, frompos, item2, topos)

if (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then

doPlayerSendCancel(cid,"Desculpe, nao pode estar em battle")

return TRUE

end

 

if not isCreature(item2.uid) and not isPlayer(item2.uid) then

return doPlayerSendCancel(cid,"Please use on you or in you summon.")

end

doRemoveItem(item.uid, 1)

local i = 2000

local v = (getCreatureMaxHealth(item2.uid)/100) * 7

 

local max = 10000

while i <= max do

addEvent(doCreatureAddHealth,i,item2.uid,v)

i = i + 2000

end

Ajuda ai plx dou +rep =D

EskyloE
06 de novembro de 2010 às 12:38
function onUse(cid, item, frompos, item2, topos)

if (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid,"Desculpe, nao pode estar em battle")
return TRUE
end

if not isCreature(item2.uid) and not isPlayer(item2.uid) then
return doPlayerSendCancel(cid,"Please use on you or in you summon.")
end

doRemoveItem(item.uid, 1)
local minheal = 100 --minimo q vai healar
local maxheal = 200 --maximo q pode healar
doCreatureAddHealth(item2.uid, math.random(minheal, maxheal))
end

Editado Novembro 6 por Eskylo

kevinlokoK
06 de novembro de 2010 às 12:53

function onUse(cid, item, frompos, item2, topos)

if (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid,"Desculpe, nao pode estar em battle")
return TRUE
end

if not isCreature(item2.uid) and not isPlayer(item2.uid) then
return doPlayerSendCancel(cid,"Please use on you or in you summon.")
end

doRemoveItem(item.uid, 1)
local minheal = 100 --minimo q vai healar
local maxheal = 200 --maximo q pode healar
doCreatureAddHealth(item2.uid, math.random(minheal, maxheal))
end

Ei mais tipow assim eu queria que fosse igual ao outro script que tivesse um tempo para ficar healando tipo era 10 segundos o tempo e a cada 2 segundos ele healasse 200 se puder fazer isso =D

EskyloE
06 de novembro de 2010 às 13:05

function onUse(cid, item, frompos, item2, topos)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid,"Desculpe, nao pode estar em battle")
return TRUE
end

if not isCreature(item2.uid) and not isPlayer(item2.uid) then
return doPlayerSendCancel(cid,"Please use on you or in you summon.")
end
doRemoveItem(item.uid, 1)
local minheal = 1000 --minimo q a pot vai curar a cada intervalo
local maxheal = 1500 --maximo q a pot vai curar  a cada intervalo
local heal = math.random(minheal, maxheal) --n mexa
local intervalo = 2 --tempo entre intervalos em segundos
local intervalo2 = intervalo*1000 --n mexa
local tempo = 10 --tempo total
local tempo2 = tempo*1000 --n mexa

while intervalo2 <= tempo2 do
addEvent(doCreatureAddHealth, intervalo2, item2.uid, heal)
intervalo2 = intervalo2 + 2000
end

 

fiz uma gambiarra '-' tentai

Editado Novembro 6 por Eskylo

kevinlokoK
06 de novembro de 2010 às 13:09

Mano deu certo vlw =D +rep