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

Action More xx% exp for a time.

GSMaster

Why? for money
Joined
Oct 26, 2008
Messages
169
Solutions
1
Reaction score
10
Location
HKS <3
Players get more experience in percentages for some time, it works well if you logout and log back on.


(idea: http://otland.net/f28/exp-rate-box-20-a-159400/)

Make file: \data\actions\scripts\expBox.lua

paste:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
	if exhaustion.check(cid, configExp.storageExh) then
		doPlayerSendCancel(cid, 'Your bonus experience is still active. (Left: ' .. exhaustion.get(cid, configExp.storageExh) ..' seconds.)')
		return true
	end
 
 
	if configExp.work then
		local yourRates = getPlayerRates(cid)[SKILL__LEVEL]
		local bonusExpRate = yourRates + (configExp.rate * yourRates/100)
 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your old rates: " .. yourRates .. "x, now: " .. bonusExpRate .."x.")
		doPlayerSetRate(cid, SKILL__LEVEL, bonusExpRate)
 
		exhaustion.set(cid, configExp.storageExh, configExp.workTime * 60)
		addEvent(bonusExp, configExp.workTime * 60 * 1000, cid)
 
		local animText = math.random(1,200)
		doSendMagicEffect(fromPosition, 10) 
		doSendAnimatedText(fromPosition, '!Bonus Exp!', animText) 
 
	else
 
		doPlayerSendCancel(cid, 'Bonus experience is off.')
 
		return true
	end
 
return true
end

at end of file \data\lib\function.lua paste:

Lua:
configExp = 
	{
	work = true, -- true or false
	rate = 20, --  more % exp,
	storageExh = 43320,
	workTime = 3, -- time to work bonus exp,
	resetExp = 1.0 -- initial rate (do not change if you have not changed in vocations.xml)
	}
 
function bonusExp(cid)
	if isCreature(cid) == false then
		return true
	end
 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your bonus experience just ended.")
		doPlayerSetRate(cid, SKILL__LEVEL, configExp.resetExp)
 
	return true
end



at end of file \data\creaturescripts\scripts\login.lua (before) :

Lua:
	return true
end


paste:
Lua:
	if configExp.work then
 
		if exhaustion.check(cid, configExp.storageExh) then
 
		local yourRates = getPlayerRates(cid)[SKILL__LEVEL]
		local bonusExpRate = yourRates + (configExp.rate * yourRates/100)
		local lastTime = exhaustion.get(cid, configExp.storageExh)
 
			doPlayerSetRate(cid, SKILL__LEVEL, bonusExpRate)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your bonus experience is still active. (Left: ' .. lastTime ..' seconds.)')
			addEvent(bonusExp, lastTime * 1000, cid)
		end
 
	end
 
Nice, i can edit it for not waste time (infinity box) and put in in donations xd!
 
Back
Top