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

[request] Hope it's possible!

Serginov

Onkonkoronkonk
Joined
Jun 28, 2008
Messages
1,321
Reaction score
18
Location
Sweden - Dalarna
A guy on my server came up with a great idea!

Two things you should know before:
I use:
1.5x lootrate
and
Stages:
# [1-50] 80x
# [50-80] 65x
# [80-100] 45x
# [100-140] 30x
# [140-180] 15x
# [180-200] 9x
# [200+] 7x

So here comes my request:
Every friday I want it to be 2.5x lootrate
and
Every sunday I want it to be 50% more experience!
So if you have 80x exp it should be highered to 120x!
and if you have 65x exp it should be highered to 97.5x!

I hope you understand what I mean and I hope it's possible :)

Thanks in advance!


I use TFS 0.3.4pl2
 
For the "%" you can use this:
Lua:
local config = {
	prozent = 50 -- %
	exp = getConfigValue('rateExperience')
	newExp = config.exp / 100 * config.prozent
	}
	setPlayerExtraExpRate(cid, config.exp+config.newExp)
You can make this on a Login Script and you have 50% more exp.
Example:
Lua:
function onLogin(cid)
local config = {
	prozent = 50 -- %
	exp = getConfigValue('rateExperience')
	newExp = config.exp / 100 * config.prozent
	}
	--
	setPlayerExtraExpRate(cid, config.exp+config.newExp)
	return TRUE
end

I hope that help you :thumbup:.

Regards,
Shawak
 
Thank you(almost knew this xD)
the hardest part for me is: How to make it so this happens every friday and sunday? :S

EDIT;
Do you think this will work?:
Lua:
  function onLogin(cid)
local config = {
        prozent = 50 -- %
        exp = getConfigValue('rateExperience')
        newExp = config.exp / 100 * config.prozent
        }
        --
     if os.date('%A') == "Friday" then
            setPlayerExtraExpRate(cid, config.exp+config.newExp)
     end
     return TRUE
end

? can't test it now because I'm not home

EDIT2;
If I use Config.exp and in config.lua it's stages = yes will it go after the stage exp then?
 
Last edited:
@Edit 1: I don't know, I'm not so good in os.date functions.
@Edit 2: No.

But with this one, it change back to the old stages :thumbup:.

Lua:
function onLogin(cid)
local config = {
        prozent = 50 -- %
        exp = getConfigValue('rateExperience')
        newExp = config.exp / 100 * config.prozent
        }
        --
     if os.date('%A') == "Friday" then
            setPlayerExtraExpRate(cid, config.exp+config.newExp)
     else
            setPlayerExtraExpRate(cid, 1)
     end
     return TRUE
end

I hope I helped you^_^.

Regards,
Shawak
 
@up
What you mean?

EDIT;
@Shawak
But then I need to use Global Server save to make everyone logout, right? else you can just stay online 24/7 and your experience will not change back. am I right? xD
 
I think he mean this..
Lua:
     if os.date('%A') == "Friday" then
What's wrong on it?

@Slaktaren

You testet it yet?

Regards,
Shawak
 
@Shawak
Will test it soon


EDIT: I get this error:
Lua:
[03/06/2009 20:34:03] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/ExtraExpFriday.lua)
[03/06/2009 20:34:03] data/creaturescripts/scripts/ExtraExpFriday.lua:4: '}' expected (to close '{' at line 2) near 'exp'
Can't I use like
Lua:
exp = getExperienceStage(level)
instead of
Lua:
exp = getConfigValue('rateExperience')

wouldn't that check the exp rate for the level of the player and then set it +50% ? xD
 
Last edited:
@up
What you mean?

EDIT;
@Shawak
But then I need to use Global Server save to make everyone logout, right? else you can just stay online 24/7 and your experience will not change back. am I right? xD

@Edit

You can use a Global Sevrer save, or you make it so,

Goto data/globalevents/scripts/save.lua

Change..
Lua:
function onThink(interval, lastExecution)
	doSaveServer()
	return TRUE
end
to..
Lua:
function onThink(interval, lastExecution)
	doSaveServer()
	if os.date('%A') ~= "Friday" then
		for(getOnlinePayer()) do
			setPlayerExtraExpRate(cid,1)
		end
	end
	return TRUE
end

EDIT:
Error:
Lua:
[03/06/2009 20:34:03] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/ExtraExpFriday.lua)
[03/06/2009 20:34:03] data/creaturescripts/scripts/ExtraExpFriday.lua:4: '}' expected (to close '{' at line 2) near 'exp'

Script:
Lua:
function onLogin(cid)
local config = {
        prozent = 50, -- %
        exp = getExperienceStage(getPlayerLevel(cid)),
        newExp = config.exp / 100 * config.prozent
        }
        --
     if os.date('%A') == "Friday" then
            setPlayerExtraExpRate(cid, config.exp+config.newExp)
     else
            setPlayerExtraExpRate(cid, 1)
     end
     return TRUE
end

Regards,
Shawak
 
Last edited:
Gonna test it now.

btw, ain't it easier to just make everything a globalevent?
Like in your globalevent script it will check if the day is friday and then set the exp to 50% more, else setPlayerExtraExpRate(cid, 1) xd

EDIT; It's not working

Someone said the new TFS was STABLE! NO it isn't! everytime I remove a creaturescript and reload it the server fucking crashes
 
Last edited:
Back
Top Bottom