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
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.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
Regards,
TibiaWR
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
-- 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