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

"Level scroll"

Azcarer

HEJJJJ!! :D
Joined
Nov 3, 2008
Messages
871
Reaction score
3
Location
r u Pedobear
I want to have a level scroll on my server so if ppl right click the scroll gives them like 50 levels or something.:p
 
There are like 20 threads about it..

But he means levels, not exp.

If you want a more advanced script here is one:

http://otland.net/f81/advanced-exp-scroll-21554/#post217773

PHP:
-- OTcentrum.pl - Polskie Centrum OpenTibii  
local config = { 
funnyEffect = "YES", -- effects fireworks & Animated Text  (YES/NO)  
minimumLevel = 1, 
addExp = {[60] = 1000, [80] = 2000, [100] = 3000, [120] = 4000, [math.huge] = 5000} 
} 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
    local expTable = config.addExp 
    local effect = math.random(CONST_ME_FIREWORK_YELLOW,CONST_ME_FIREWORK_BLUE)  

    if getPlayerLevel(cid) < config.minimumLevel then 
        doPlayerSendCancel(cid, "You need to be at least "..config.minimumLevel.." to use a scroll.") 
        return FALSE  
    end  

    for k, v in pairs(expTable) do  
        if getPlayerLevel(cid) <= k then  
            doPlayerAddExp(cid, v) 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "k: "..k.." // v: "..v.."") 
            doRemoveItem(item.uid, 1)  
            break 
        else 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "k: "..k.." // v: "..v.."") 
        end  
    end   

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

        for i = 1, table.getn(positions) do 
            doSendAnimatedText(getThingPos(cid), "Yeah! Exp!", TEXTCOLOR_RED)  
            doSendMagicEffect(positions[i],effect) 
        end 
    end 
    return TRUE  
end


Cheers~
Leiken.
 
Last edited:
IF you would want to let it always give players 50 levels, then here's another script:
Save it in actions/scripts/YOUR_PREFERED_FOLDER_HERE/levelscroll.lua

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerAddLevel(cid, 50)
	doPlayerSendTextMessage(cid, "You've gained 50 levels.")
	return TRUE
end


function doPlayerAddLevel(cid, amount)
	local newExp = 0
	local currentLevel = getPlayerLevel(cid)
	if(amount > 0) then
		newExp = getExperienceForLevel(currentLevel + amount) - getExperienceForLevel(currentLevel)
	else
		newExp = getExperienceForLevel(currentLevel) - getExperienceForLevel(currentLevel + amount)
	end
	return doPlayerAddExp(cid, newExp)
end


Not sure if it works, probably it would, made it in a few seconds though.

Add this in your actions.xml:

PHP:
<action itemid="SCROLL_ID_HERE" event="script" value="/DIRECTORY_HERE/levelscroll.lua"/>

I'm kinda tired so it might not work :p
 
Back
Top