• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Advanced Mana rune

Elaney

Member
Joined
Jan 1, 2009
Messages
1,561
Reaction score
12
Location
Sweden
PHP:
local config = {
funnyEffect = "YES", -- Effect  (YES/NO) 
minimumLevel = 20,
maximumLevel = math.huge, -- for infinite type math.huge
}
local addMana = {
[{config.minimumLevel, 40}] = 500,
[{40, 80}] = 500,
[{80, 90}] = 500,
[{90, 100}] = 600,
[{100, 120}] = 700,
[{120, 199}] = 800,
[{200, config.maximumLevel}] = 1000,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
    local effect = CONST_ME_MAGIC_GREEN

    if level < config.minimumLevel then
        doPlayerSendCancel(cid, "You need to be at least "..config.minimumLevel.." to use a manarune.")
        return FALSE 
    end
    
    if level >= config.maximumLevel then
        doPlayerSendCancel(cid, "Your way to high level for this rune.")
        return FALSE 
    end

    for k, v in pairs(addMana) do 
        if level >= k[1] and level < k[2] then 
            doPlayerAddMana(cid, v)
			doRemoveItem(item.uid, 1)
            break 
        end 
    end  

        if config.funnyEffect == "YES" then
        local pos = getPlayerPosition(cid)
        local positions = {
                {x=pos.x,y=pos.y,z=pos.z},
        }

        for i = 1, table.getn(positions) do
            doSendMagicEffect(positions[i],effect)
        end
    end
    return TRUE 
end
 
Last edited:
lol, why do u people say its well done if you havent even tested it, I guess...
Its not working xd
 
Back
Top