• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Mana Potion mlvl

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

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
 
Back
Top