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

Solved by Andy my brother :D ty bro <333!! Close theard or remove!

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,287
Location
Sweden?
Solved by Andy my brother :D ty bro <333
 
Last edited:
It did work but when im lvl 9 my ml doesnt go up and a problem when i logg out and in i can get upp exprience then!
 
Last edited:
Lua:
local amount = {}
local levels = {
	[8] = 15,
	[9] = 25
}

function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL_MAGICLEVEL then
		local lastLevel = 0
		for level, mlvl in pairs(levels) do
			if(level > getPlayerLevel(cid)) then
				break
			end
			lastLevel = level
		end
		
		doPlayerAddSpentMana(cid, 0)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot gain more magic experience in your current level.")
	else
		doPlayerAddSpentMana(cid, amount)
	end
end
 
Lua:
local t = {
	[8] = { -- level
		max = 25 -- magic level
	},
	[9] = {
		max = 30
	},
}

function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__MAGLEVEL then
		for k, i in pairs(t) do
			if getPlayerLevel(cid) == k and getPlayerMagLevel(cid) >= i.max then
				doPlayerSetRate(cid, SKILL__MAGLEVEL, 0)
				return true
			end
		end
	end
end
No idea if it will work - thought I'd try though. If this does work, you will need another script to set the rate back to normal.

Regards,
TibiaWR

All you need to do is take this script and replace one line so that it now looks like this:
Lua:
local t = {
	[8] = { -- level
		max = 25 -- magic level
	},
	[9] = {
		max = 30
	},
}

function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__MAGLEVEL then
		for k, i in pairs(t) do
			if getPlayerLevel(cid) == k and getPlayerMagLevel(cid) >= i.max then
				doPlayerAddSpentMana(cid, 0)
				newLevel = oldLevel
				return true
			end
		end
	end
end

The onAdvance is called when someone advances a magic level, so when they advance, just set the new level back to the previous level. Then it will run everything normally and should do all the resets for you.
 
@up ;) make no sense

Lua:
-- ver. 2 2011-12-06
-- author tfs, otland.net/members/andypsylon
local c = {
-- {lvl, mlvl}
	{40, 25},
	{41, 30},
	{42, 35}
}
 
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__MAGLEVEL or skill == SKILL__LEVEL then
		for _, v in ipairs(c) do
			if(getPlayerLevel(cid) <= v[1]) and getPlayerMagLevel(cid) > v[2] then
				return doPlayerSetRate(cid, SKILL__MAGLEVEL, 0) and true
			else
				return doPlayerSetRate(cid, SKILL__MAGLEVEL, 1) and true
			end
		end
	end
end
tested on tfs0.4
 
Last edited:
andy it didnt work on tfs 0.3.6 :,( and please to make this sure can you post what i gone write on login and creature script xml please
 
Last edited:
Back
Top