local ultimateMana = RUNE ID
function onUse(cid, item, fromPosition, itemEx, toPosition)
local var = numberToVariant(cid)
local level = getPlayerLevel(cid)
local mag = getPlayerMagLevel(cid)
local manamin = (level/2.5)+(mag*2)
local manamax = (level/2)+(mag*2)
if itemEx.uid ~= cid or itemEx.itemid ~= 1 then
return TRUE
end
if(item.itemid == ultimateMana) then
if (getPlayerLevel(cid) < 150) or (getPlayerVocation(cid) ~= VOCATION_ID) then
doCreatureSay(cid, "This potion can only be consumed by players of level 150 or higher.", TALKTYPE_ORANGE_1)
return TRUE
end
if(doTargetCombatMana(0, cid, manamin, manamax, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
--doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, ultimateMana)
end
return TRUE
end