luigilc
Lua Learner
A few days ago in the support board Darkhaos came up with this script for a sub-class system npc, but I have no clue how to edit to make it work properly, what it should do is: When I have X vocation I can choose which 'sub-class' I want.
Here is the script he posted(with my edited vocations):
If anyone can make the full script I'll appreciatte it big time, thanks!
Here is the script he posted(with my edited vocations):
Lua:
local vocations =
{
--[Apprentice] = {Mage, Ranger, Warrior}
[0] = {1, 2, 3}
-----[Mage Sub-Classes]-----
--[Mage] = {Elementalist, Wizard}
[1] = {4, 5},
--[Elementalist] = {Pyromancer, Stormcaller}
[4] = {10, 11},
--[Wizard] = {warlock, necromancer}
[5] = {12, 13},
--[Pyromancer] = {Fiery lord, pyro maniac}
[10] = {22, 23},
--[Stormcaller] = {Arcano, Cold Conjurer}
[11] = {24, 25}
--[Warlock] = {Archwizard, Overlord}
[10] = {26, 27},
--[Necromancer] = {Cultist, Lich}
[11] = {248, 29}
-----[Ranger Sub-Classes]-----
--[Ranger] = {Archer, Outlaw}
[2] = {6, 7},
--[Archer] = {Shooter, Lancer}
[6] = {14, 15},
--[Outlaw] = {rogue, bard}
[7] = {16, 17},
--[Shooter] = {Sharpshooter, Tactician}
[14] = {30, 31},
--[Lancer] = {Hunter, Saboteur}
[15] = {32, 33}
--[Rogue] = {Assassin, Nightblader}
[16] = {34, 35},
--[Bard] = {Composer, Orchestral Maestro}
[17] = {36, 37}
-----[Warrior Sub-Classes]-----
--[Warrior] = {Sentinel, Warlord}
[3] = {8, 9},
--[Sentinel] = {Champion, Inquisitor}
[8] = {18, 19},
--[Warlord] = {blader, barbarian}
[9] = {20, 21},
--[Champion] = {Paragon, Guardian}
[18] = {38, 39},
--[Inquisitor] = {Templar, Justicar}
[19] = {40, 41}
--[Blader] = {Blade Dancer, Blade Conjurer}
[20] = {42, 43},
--[Barbarian] = {Void Knight, Avenger}
[21] = {44, 45}
}
if msg:lower() == "promotion" then
if not vocations[getPlayerVocation(cid)] and getPlayerVocation(cid) > 0 then
return npcHandler:say("You already have the highest promotion.", cid)
end
local vocs = vocations[getPlayerVocation(cid)]
local sep = ", "
local i = 0
local text = ""
for _, id in pairs(vocs) do
i = i + 1
if i == #vocs - 1 then
sep = " and "
elseif i == #vocs then
sep = "."
end
text = text .. "{" .. getVocationInfo(id).name .. "}" .. sep
end
npcHandler:say("You can choose " .. (#vocs > 1 and "one between" or "") .. " the following promotion" .. (#vocs > 1 and "s" or "") .. ": " .. text .. ". Wich will you select?", cid)
talkState[talkUser] = 1
elseif --blablabla