function onUse(cid, item, frompos, item2, topos)
-- Config
local magiclveq = 1
local levelreq = 8
local effect = 12
-- Config
if isPlayer(item2.uid) then
if getPlayerMagLevel(item2.uid) >= magiclveq then
if getPlayerLevel(item2.uid) >= leveleq then
-- Formula
local level = getPlayerLevel(item2.uid)
local magic = getPlayerMagLevel(item2.uid)
local min = (level * 7.33) + (magic * 4) - 50
local max = (level * 9.33) + (magic * 5) - 10
local addMana = doPlayerAddMana(math.round(min,max))
-- Formula
doPlayerAddMana(item2.uid, math.Round(addMana))
doSendMagicEffect(getCreaturePosition(item2.uid), effect)
doSendAnimatedText(getCreaturePosition(item2.uid), ""..mathRound(addMana).."")
doRemoveItem(item.uid, 1)
end
else
doPlayerSendCancel(cid, "Sorry, not enough level.")
end
else
doPlayerSendCancel(cid, "Sorry, not enough magic level.")
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return true
end