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

scroll of increase exp

Mummrik

Hey!
Joined
Oct 22, 2007
Messages
707
Solutions
28
Reaction score
126
Location
Sweden
In some rpg games you can buy (rlcash) some scrolls that make your exp increase from 1x exp to 2x exp, this might need an source edit. if so can some one make an code/script for me?
This should be an nice feature if you pay the right fee to an npc or something likethat.

it should have the same looktype as this
Scroll.gif
or like this
Parchment.gif


13:50 You see a scroll of experience, it will increase your experience by 2x for 24 hours.

I can not make a script like this since i dont know anything about lua or c++ (i can only edit).

your's
Mummrik
 
doPlayerSetExtraExpRate(cid, rate)
getPlayerExtraExpRate(cid)

- Already in TFS 0.3
removing the extra exp rate can be done with addEvent, storage with os.clock and onLogin check.
 
PHP:
macroUsed    = 1967    -- Used scroll ID.
macroTime    = 1       -- Days.
    
    

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local currentExp    = getExperienceForLevel(getPlayerLevel(cid))
    local duplicateExp  = currentExp * 2
    doPlayerAddExp(cid, duplicateExp)
    addEvent(duplicateExp, 1000 * 60 * 60 * 24 * macroTime, {playerExp = duplicateExp})
    doTransformItem(item.uid, macroUsed)
end

function duplicateExp(parameters)
    doPlayerAddExp(cid, -(parameters.playerExp))
end
Normally that would work, however the doPlayerAddExp does not support removing experience, atleast not in TFS.
 
PHP:
macroUsed    = 1967    -- Used scroll ID.
macroTime    = 1       -- Days.
    
    

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local currentExp    = getExperienceForLevel(getPlayerLevel(cid))
    local duplicateExp  = currentExp * 2
    doPlayerAddExp(cid, duplicateExp)
    addEvent(duplicateExp, 1000 * 60 * 60 * 24 * macroTime, {playerExp = duplicateExp})
    doTransformItem(item.uid, macroUsed)
end

function duplicateExp(parameters)
    doPlayerAddExp(cid, -(parameters.playerExp))
end
Normally that would work, however the doPlayerAddExp does not support removing experience, atleast not in TFS.

Thats not what he wanted o.o
PHP:
macroUsed    = 1967    -- Used scroll ID.
macroTime = 1       -- Days.
macroExp = 2
    
function onUse(cid, item, fromPosition, itemEx, toPosition)
    parameters = { cid = cid, rate = 1 }
    doPlayerSetExtraExpRate(cid, macroExp)
    addEvent(doPlayerSetExtraExpRate, 1000 * 60 * 60 * 24 * macroTime, parameters)
    doRemoveItem(item.uid)
end

I can say now, that it wont work as u wanted, cos I suck at addEvents.

@Also, TFS 0.3 is required.
 
Oh, my bad. Sorry lmao. Thought he wanted the players current experience points to increase with the same amout for 24 hours.
 
Thats not what he wanted o.o
PHP:
macroUsed    = 1967    -- Used scroll ID.
macroTime = 1       -- Days.
macroExp = 2
    
function onUse(cid, item, fromPosition, itemEx, toPosition)
    parameters = { cid = cid, rate = 1 }
    doPlayerSetExtraExpRate(cid, macroExp)
    addEvent(doPlayerSetExtraExpRate, 1000 * 60 * 60 * 24 * macroTime, parameters)
    doRemoveItem(item.uid)
end

I can say now, that it wont work as u wanted, cos I suck at addEvents.

@Also, TFS 0.3 is required.

ok thx so this was possible i will try to fix it (im noob at scripting)

edit: where should i add this?

Oh, my bad. Sorry lmao. Thought he wanted the players current experience points to increase with the same amout for 24 hours.

hehe you atleast try to help me out and im thankfull? for that :)

and the 24hours thing will be like 1 month as i can see at Marcinek Paladinek script you can change the days to 30, 90 etc
 
function onUse() goes to actions.

data/actions/scripts/other

and to make it work you have to add itemid to:
data/actions/actions.xml

btw, Ive used Macromans delay, complaints to him.
 
function onUse() goes to actions.

data/actions/scripts/other

and to make it work you have to add itemid to:
data/actions/actions.xml

btw, Ive used Macromans delay, complaints to him.

I'm not sure he was complaining mate, I think it was a good thing. :p

no i did not complain this is so fucking awsome, i will test it out right now :) if it work as it should i will post an "how to setup" the script some ppls (like me) dont know where to put everything but i does now :p



Edit:
Code:
[24/10/2008  15:09:19] Lua Script Error: [Action Interface] 
[24/10/2008  15:09:19] data/actions/scripts/other/exp_scroll.lua:onUse

[24/10/2008  15:09:19] data/actions/scripts/other/exp_scroll.lua:7: attempt to call global 'doPlayerSetExtraExpRate' (a nil value)
[24/10/2008  15:09:19] stack traceback:
[24/10/2008  15:09:19] 	data/actions/scripts/other/exp_scroll.lua:7: in function <data/actions/scripts/other/exp_scroll.lua:5>

this happen to me im useing TFS v0.3 alpha 3
it looks like i need "doPlayerSetExtraExpRate" in global.lua
 
Last edited:
no i did not complain this is so fucking awsome, i will test it out right now :) if it work as it should i will post an "how to setup" the script some ppls (like me) dont know where to put everything but i does now :p



Edit:
Code:
[24/10/2008  15:09:19] Lua Script Error: [Action Interface] 
[24/10/2008  15:09:19] data/actions/scripts/other/exp_scroll.lua:onUse

[24/10/2008  15:09:19] data/actions/scripts/other/exp_scroll.lua:7: attempt to call global 'doPlayerSetExtraExpRate' (a nil value)
[24/10/2008  15:09:19] stack traceback:
[24/10/2008  15:09:19] 	data/actions/scripts/other/exp_scroll.lua:7: in function <data/actions/scripts/other/exp_scroll.lua:5>

this happen to me im useing TFS v0.3 alpha 3
it looks like i need "doPlayerSetExtraExpRate" in global.lua

change doPlayerSetExtraExpRate to setPlayerExtraExpRate

for me work fine
 
Back
Top