-- Configure the healing here:
configHealer = {
healMin = 20, -- Minimum heal
healMax = 30, -- Maximum heal
distanceEffect = 9, -- Shoots this effect to the player it heals
magicEffect = 5, -- This effect is displayed at the healed unit's pos
storage = 50251, -- Some free storage value
speed = 6 -- The lesser the number, the faster the healing
}
function onThink(cid)
local counter = getPlayerStorageValue(cid, configHealer.storage)
if counter % configHealer.speed == 0 then
local master = getCreatureMaster(cid)
doSendMagicEffect(getThingPos(master), configHealer.magicEffect)
doSendDistanceShoot(getThingPos(cid), getThingPos(master), configHealer.distanceEffect)
doCreatureAddHealth(master, math.random(configHealer.healMin,configHealer.healMax))
end
setPlayerStorageValue(cid, configHealer.storage, counter+1)
return true
end