• 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!

Lua manarune by level

cooldodo

New Member
Joined
Jan 17, 2014
Messages
297
Reaction score
4
i need a script that make my manarune increase by lvl so lvl 8 heal 100 and lvl 1000 heal like 20k
tfs 0.3.6
 
.lua :

Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 2000))

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)
    local mana_minimum = (level * 2.9) + (mlevel * 1) - 50
    local mana_maximum = (level * 5.0) + (mlevel * 1)
    local mana_add = math.random(mana_minimum, mana_maximum)
   
    doPlayerAddMana(cid, mana_add)
    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_STUN)
    return TRUE
end

actions.xml :

Code:
<action itemid="2294" event="script" value="manarune1.lua" allowfaruse="1"/>

I use this one, it's kinda modified by me but you can adjust it yourself.
 
.lua :

Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 2000))

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)
    local mana_minimum = (level * 2.9) + (mlevel * 1) - 50
    local mana_maximum = (level * 5.0) + (mlevel * 1)
    local mana_add = math.random(mana_minimum, mana_maximum)
  
    doPlayerAddMana(cid, mana_add)
    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_STUN)
    return TRUE
end

actions.xml :

Code:
<action itemid="2294" event="script" value="manarune1.lua" allowfaruse="1"/>

I use this one, it's kinda modified by me but you can adjust it yourself.
Not used 'exhaust' code at start of code? Remove it. Keep posts of forum as clean as you can,
 
You can add this under function onUse so it uses that condition to make it have an exhasution like potions have.
Code:
if getCreatureCondition(cid, CONDITION_EXHAUST) then
     doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
     return true
end
timeBetweenExActions in config.lua is usually 1000 so you can make it like - 100 instead of - 2000 or just write the number it should have for exhaustion instead of using the timeBetweenExActions from config.lua.
 
.lua :

Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 2000))

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)
    local mana_minimum = (level * 2.9) + (mlevel * 1) - 50
    local mana_maximum = (level * 5.0) + (mlevel * 1)
    local mana_add = math.random(mana_minimum, mana_maximum)
  
    doPlayerAddMana(cid, mana_add)
    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_STUN)
    return TRUE
end

actions.xml :

Code:
<action itemid="2294" event="script" value="manarune1.lua" allowfaruse="1"/>

I use this one, it's kinda modified by me but you can adjust it yourself.
I love seeing this, getting help, helping back. <3, We need more of this in the community. :D
 
Same Tarek :p

I want to help back most of the people but I'm not really good with ots atm :D
 
Last edited by a moderator:
Back
Top