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

manarune for othire o.o.3? :(

Sebastian Ching

New Member
Joined
Dec 26, 2007
Messages
314
Reaction score
4
Location
Rio grande, rs, Brazil
Greetings ppls, i m tryng add manarune to my server, but isnt work :(, im using othire 0.0.3 and i m using
this script

Code:
[LIST=1]
[*]local exhaust = createConditionObject(CONDITION_EXHAUST)
[*]setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
[*]

[*]function onUse(cid, item, fromPosition, itemEx, toPosition)
[*]    local level = getPlayerLevel(cid)
[*]    local mlevel = getPlayerMagLevel(cid)
[*]    local mana_minimum = (level * 1) + (mlevel * 1) - 50
[*]    local mana_maximum = (level * 1.2) + (mlevel * 1)
[*]    local mana_add = math.random(mana_minimum, mana_maximum)
[*]   
[*]    doPlayerAddMana(cid, mana_add)
[*]    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
[*]    doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
[*]    doRemoveitem(item.uid)
[*]    return TRUE
[*]end
[*]
[/LIST]
pls someone help me :(
 
Did you try to use this rune with a high-level character?
Looks like it's possible to get 0 or negative mana from the rune if (level + ml) < 50.
 
You should be getting console errors on server start, since CONDITION_EXHAUST and timeBetweenExActions don't exist.

You might like this formula more, else you change, try this:

Code:
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('minactionexinterval'))

function onUse(cid, item, fromPosition, itemEx, toPosition)

    if (hasCondition(cid, CONDITION_EXHAUSTED)) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
        return true
    end

    local level = getPlayerLevel(cid)
    local maglevel = getPlayerMagLevel(cid)
    local base = 40
    local variation = 10
    local min = math.max((base - variation), ((3 * maglevel + 2 * level) * (base - variation / 100)))
    local max = math.max((base + variation), ((3 * maglevel + 2 * level) * (base + variation / 100)))

    if(itemEx.uid == cid) then 
        doPlayerAddMana(cid, math.random(min, max))
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
        doRemoveItem(item.uid, 1)
        doAddCondition(cid, exhaust)
    else
        doPlayerSendCancel(cid,"Sorry, not possible.")
    end

    return true
end
 
peonso.png


now appear this error
 
Back
Top