Permamently
New Member
- Joined
- Jul 23, 2015
- Messages
- 34
- Reaction score
- 3
Hello, is it possible to make summon which is healing his Boss(player who summoned him) ? If yes please tell me how : )
<event type="think" name="healer" event="script" value="healer.lua"/>
-- 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
}
function onThink(cid)
local master = getCreatureMaster(cid)
doSendMagicEffect(getThingPos(master), configHealer.magicEffect)
doSendDistanceShoot(getThingPos(cid), getThingPos(master), configHealer.distanceEffect)
doCreatureAddHealth(master, math.random(healMin,healMax))
return true
end
<script>
<event name="healer"/>
</script>
-- 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
Np. I was actually working on a very similar script in the moment when I saw your thread, so it was not a huge hassle to move around a few lines and get this going.Yea I did notice some errors in console moment ago but you were fasterThank you all is working good
@Shadowsong