local spells = {
[1] = { --sorcerer
level = {
[10] = "1spell", "spell1",
[20] = "2spell", "spell2"
}
},
[2] = { --druid
level = {
[1] = "spell", "spell",
[5] = "spell", "spell"
}
},
[3] = { --paladin
level = {
[1] = "spell", "spell",
[5] = "spell", "spell"
}
},
[4] = { --knight
level = {
[1] = "1spell", "spell1",
[5] = "2spell", "spell2"
}
}
}
local array_sorc = {"Sorcerer", "Master Sorcerer"}
local array_druid = {"Druid", "Elder Druid"}
local array_paladin = {"Paladin", "Royal Paladin"}
local array_knight = {"Knight", "Elite Knight"}
local text = ""
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL__MAGLEVEL then
player = Player(cid)
if isInArray(array_sorc, player:getVocation()) then
CONFIG = spells[1]
elseif isInArray(array_druid, player:getVocation()) then
CONFIG = spells[2]
elseif isInArray(array_paladin, player:getVocation()) then
CONFIG = spells[3]
elseif isInArray(array_knight, player:getVocation()) then
CONFIG = spells[4]
end
if not CONFIG then return false end
EVENT = CONFIG.level[player:getMagLevel()]
if not EVENT then
return false
end
for i, v in ipairs(EVENT) do
text = text..""..i..", "
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "New spells: "..text.."")
end
return true
end