Here you have a simple mana potion script that should work fine.
I've tried it and it works for me based on level,
was difficult to find this so thought I share with you now when I spend time to find it I might as well help those who are looking for it.
data/actions/actions.xml:
data/actions/scripts/manapotion.lua:
Hope i did help some one aut there.
And rep me if u want to :thumbup:
I've tried it and it works for me based on level,
was difficult to find this so thought I share with you now when I spend time to find it I might as well help those who are looking for it.
data/actions/actions.xml:
Code:
<action itemid="7488" event="script" value="manapotion.lua"/>
data/actions/scripts/manapotion.lua:
Code:
local MIN = 1.0
local MAX = 1.5
local EMPTY_POTION = 7488
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if doPlayerAddMana(itemEx.uid, math.random((getPlayerLevel(cid) * MIN), (getPlayerLevel(cid) * MAX))) == LUA_ERROR then
return FALSE
end
doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Mana Potion!", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, EMPTY_POTION)
return TRUE
end
Hope i did help some one aut there.
And rep me if u want to :thumbup: