Opa,aqui:elseif spell == "Heal Pulse" then
local min = (getCreatureMaxHealth(cid) * math.random(4,4)) / 100
local max = (getCreatureMaxHealth(cid) * math.random(4,4)) / 100
local function doHealArea(cid, minimo, maximo)
local amount = math.random(minimo, maximo)
if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
end
if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
doCreatureAddHealth(cid, amount)
doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
end
end
local pos = getPosfromArea(cid, heal)
local n = 0
doHealArea(cid, min, max)
while n < #pos do
n = n+1
thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
local pid = getThingFromPosWithProtect(thing)
doSendMagicEffect(pos[n], 12)
if isPlayer(pid) then
if isSummon(cid) then
if getCreatureMaster(cid) == pid then
doHealArea(pid, min, max)
end
end
end
if isCreature(pid) then
if isSummon(cid) and (isSummon(pid) or isPlayer(pid)) then
if canAttackOther(cid, pid) == "Cant" then
doHealArea(pid, min, max)
end
elseif ehMonstro(cid) and ehMonstro(pid) then
doHealArea(pid, min, max)
end
end
end