tibia held
New Member
can somebody make me a script , that if i use the uhp that it recovers 85% of your maxhealth?
thanks , Rep ^^
thanks , Rep ^^
<action itemid="7588-7591;8472-8473;7618;7620;8704" event="script" value="liquids/potions.lua"/>
<action itemid="7588-7591;8472;7618;7620;8704" event="script" value="liquids/potions.lua"/>
<action itemid="8473" event="script" value="other/healthpot.lua"/>
[8473] = {empty = 7635, splash = 2, health = {610, 800}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion
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