local config = {
playerCheck = "yes",
summonCheck = "yes"
}
config.playerCheck = getBooleanFromString(config.playerCheck)
config.summonCheck = getBooleanFromString(config.summonCheck)
function onThink(interval, lastExecution, thinkInterval)
if(config.playerCheck) then
for _, pid in ipairs(getPlayersOnline()) do
if(getCreatureHealth(pid) <= 30) then
doSendMagicEffect(getThingPosition(pid), CONST_ME_SLEEP)
end
end
end
if(config.summonCheck) then
for _, pid in ipairs(getPlayersOnline()) do
for _, sid in ipairs(getCreatureSummons(pid)) do
if(getCreatureHealth(sid) <= 30) then
doSendMagicEffect(getThingPosition(sid), CONST_ME_STUN)
end
end
end
end
return true
end