josesaucedo
New Member
- Joined
- Jun 21, 2013
- Messages
- 21
- Reaction score
- 0
Could you help me with a script for mana potion that its regeneration depends on level and magic level
this is my script
this is my script
LUA:
local MIN = 2.72
local MAX = 2.78
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), 13)
doCreatureSay(itemEx.uid, "", TALKTYPE_ORANGE_1)
return TRUE
end