function onThink(interval, lastExecution, thinkInterval)
local players = getPlayersOnline()
for _, x in pairs(players) do
if isNone(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 1 + getPlayerMagLevel(x) * 1))
end
if isSorcerer(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 3 + getPlayerMagLevel(x) * 3))
end
elseif isDruid(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 3 + getPlayerMagLevel(x) * 3))
end
elseif isPaladin(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 1.5 + getPlayerMagLevel(x) * 3))
end
elseif isKnight(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 0.5 + getPlayerMagLevel(x) * 10))
end
elseif isMasterSorcerer(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 4 + getPlayerMagLevel(x) * 4))
end
elseif isElderDruid(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 4 + getPlayerMagLevel(x) * 4))
end
elseif isRoyalPaladin(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 2 + getPlayerMagLevel(x) * 4))
end
elseif isEliteKnight(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) + getPlayerMagLevel(x) * 2))
end
elseif isWizard(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 5 + getPlayerMagLevel(x) * 5))
end
elseif isShaman(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 5 + getPlayerMagLevel(x) * 5))
end
elseif isArcher(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) * 2.5 + getPlayerMagLevel(x) * 4.5))
end
elseif isWarrior(x) then
if getCreatureMana(x) < getCreatureMaxMana(x) then
doCreatureAddMana(x, (getPlayerLevel(x) + getPlayerMagLevel(x) * 2.5))
end
end
end
return true
end