• 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 War Of Emperium, reward, double exp in 24 hours?

ohman

Member
Joined
Oct 24, 2008
Messages
294
Reaction score
8
Location
Sweden
Hi! Is there any way to give double exp in 24h for all winners?

for _, cid in ipairs(getPlayersOnline()) do
if infoLua[2] == getPlayerGuildId(cid) then
doPlayerAddMoney(cid, reward)
end
end


Thanks!
 
BUMP, anyone know how to make it work? Thanks :)

EDIT: Now I got a exp scroll that works like I want to. But I want it to be automatic. Is there a way to make it use the item direcly after they recieve it? Ty
 
Last edited:
You can use a storage and then to something like doPlayerAddExperience()
Post your scroll here, I can try to help. I'm a new scripter so if it doesn't work like that, sorry.
http://otland.net/threads/lua-understanding-storages.189075/
I know how storage ids work :)

http://otland.net/threads/mod-experience-scroll-with-time-expire.147551/

Maybe I just can set that storage id. I'll try! , WILL NOT WORK.


for _, cid in ipairs(getPlayersOnline()) do
if infoLua[2] == getPlayerGuildId(cid) then

local rates = getPlayerRates(cid)
setPlayerStorageValue(cid, config.expstorage, rates[SKILL__LEVEL])
setPlayerStorageValue(cid, config.register, 1)
doCreatureSay(cid, "Your extra experience rate has been activated! It has been enhanced with 25% and will last for 24 hours.", TALKTYPE_ORANGE_1, true, cid)
setPlayerStorageValue(cid, config.storage, os.time()+config.time)
doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*config.rate)
registerCreatureEvent(cid, "ExpStage")
end
return true
end
end

Do you think this will work? And have the config for experience scroll in my event config.
 
Last edited:
I know how storage ids work :)

http://otland.net/threads/mod-experience-scroll-with-time-expire.147551/

Maybe I just can set that storage id. I'll try!

Ok, so create a global script and instead of onUse put onThink()

Or create a creature script and use onLogin.

I think you can figure out the rest haha.



@edit
ACTUALLY, you don't need to even change it. Just transfer the code that multiplies the XP to the place where you give 2x automatically and keep the rest of the script.
 
The code at that link probably does everything you need.

It has three callbacks:

onUse() is called when the scroll is used. You don't want this unless you want to use an item.

onThink() is used to check if the time has been used up, and reset XP gain if it has.
You probably want this.

onLogin() is used to set the faster XP if the player logged out and back in within the duration of the buff.
You probably want this.


It registers the event callbacks dynamically (onUse() registers for onThink()). You might want to do that differently.
 
Back
Top