function onUse(cid, item, fromPosition, itemEx, toPosition)
-- Config --
config = {
formula = (getCreatureMaxHealth(cid) / 100) * 85, -- Change the 85 in any percent you want to heal it --
storage = 81543, -- Dont change this only if use this storage already --
effect = CONST_ME_MAGIC_BLUE, -- Effect on use --
text = "Aaaah...", -- Text on use --
vocations = {4, 8}, -- Vocations --
level = 130 -- Level requirment --
}
-- Config ends --
if exhaustion.check(cid, config.storage) == TRUE then
doPlayerSendCancel(cid, "You are exhausted.")
elseif(((getPlayerLevel(cid) < config.level) or (not isInArray(config.vocations, getPlayerVocation(cid)))) and
not getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges))
then
doCreatureSay(itemEx.uid, "Only knights of level 130 or above may drink this fluid.", TALKTYPE_ORANGE_1)
else
doCreatureAddHealth(cid, config.formula)
exhaustion.set(cid, config.storage, 1)
doSendMagicEffect(getThingPos(cid),config.effect)
doTransformItem(item.uid, 7635)
doCreatureSay(cid, config.text, TALKTYPE_ORANGE_1)
end
return TRUE
end