local SKILLTYPES_IN_SKILLBUILDER = 8
local ABILITY_LEVEL_NONMORPHED = 0
function SuperStarSkills:GetAvailableSkillPoints()
local skillPoints = 0
-- SkillTypes (class, etc)
for skillType=1, SKILLTYPES_IN_SKILLBUILDER do
-- SkillLine (Bow, etc)
for skillLineIndex=1, GetNumSkillLines(skillType) do
for abilityIndex=1, GetNumSkillAbilities(skillType, skillLineIndex) do
skillPoints = skillPoints + SuperStarSkills:GetPointsSpentInAbility(skillType, skillLineIndex, abilityIndex)
end
end
end
SuperStarSkills.spentSkillPoints = skillPoints + GetAvailableSkillPoints()
return SuperStarSkills.spentSkillPoints
end
function SuperStarSkills:GetPointsSpentInAbility(skillType, skillLineIndex, abilityIndex)
local _, _, _, _, _, purchased, progressionIndex = GetSkillAbilityInfo(skillType, skillLineIndex, abilityIndex)
if not purchased then
return 0
elseif progressionIndex then
-- Active skills
-- Skill has been purchased
local _, morph = GetAbilityProgressionInfo(progressionIndex)
local skillLineName = GetSkillLineInfo(skillType, skillLineIndex)
if morph > ABILITY_LEVEL_NONMORPHED then
return (2 - SuperStarSkills:GetExceptionsPointsSpentInAbility(skillType, skillLineIndex, skillLineName, abilityIndex))
else
return (1 - SuperStarSkills:GetExceptionsPointsSpentInAbility(skillType, skillLineIndex, skillLineName, abilityIndex))
end
else
-- Passive skills
local currentUpgradeLevel = GetSkillAbilityUpgradeInfo(skillType, skillLineIndex, abilityIndex)
local skillLineName = GetSkillLineInfo(skillType, skillLineIndex)
if currentUpgradeLevel then
return (currentUpgradeLevel - SuperStarSkills:GetExceptionsPointsSpentInAbility(skillType, skillLineIndex, skillLineName, abilityIndex))
else
return (1 - SuperStarSkills:GetExceptionsPointsSpentInAbility(skillType, skillLineIndex, skillLineName, abilityIndex))
end
end
end
function SuperStarSkills:GetExceptionsPointsSpentInAbility(skillType, skillLineIndex, skillLineName, abilityIndex)
-- Using SkillLines because thoses skilllines can or cannot be unlocked
local exceptionList = {}
exceptionList[SKILL_TYPE_WORLD] = {}
exceptionList[SKILL_TYPE_WORLD][2] = {}
exceptionList[SKILL_TYPE_WORLD][2][2] = true -- Soul Magic SoulTrap
exceptionList[SKILL_TYPE_WORLD][4] = {}
exceptionList[SKILL_TYPE_WORLD][4][1] = true -- WW Ultimate
exceptionList[SKILL_TYPE_GUILD] = {}
exceptionList[SKILL_TYPE_GUILD][1] = {}
exceptionList[SKILL_TYPE_GUILD][1][1] = true -- Blade of Woe
exceptionList[SKILL_TYPE_GUILD][4] = {}
exceptionList[SKILL_TYPE_GUILD][4][1] = true -- Finders keepers
exceptionList[SKILL_TYPE_RACIAL] = {}
exceptionList[SKILL_TYPE_RACIAL][1] = {}
exceptionList[SKILL_TYPE_RACIAL][1][1] = true -- 1st Racial passive
exceptionList[SKILL_TYPE_TRADESKILL] = {}
exceptionList[SKILL_TYPE_TRADESKILL][1] = {}
exceptionList[SKILL_TYPE_TRADESKILL][1][1] = true -- 1st Alchemy passive
exceptionList[SKILL_TYPE_TRADESKILL][4] = {}
exceptionList[SKILL_TYPE_TRADESKILL][4][1] = true -- 1st Enchanting passive
exceptionList[SKILL_TYPE_TRADESKILL][4][2] = true -- 2nd Enchanting passive
exceptionList[SKILL_TYPE_TRADESKILL][6] = {}
exceptionList[SKILL_TYPE_TRADESKILL][6][1] = true -- 1st Woodworking passive
local _, blackSmithing = GetCraftingSkillLineIndices(CRAFTING_TYPE_BLACKSMITHING)
if blackSmithing == 5 then -- FR, DE
exceptionList[SKILL_TYPE_TRADESKILL][2] = {}
exceptionList[SKILL_TYPE_TRADESKILL][2][1] = true -- 1st Clothing passive
exceptionList[SKILL_TYPE_TRADESKILL][3] = {}
exceptionList[SKILL_TYPE_TRADESKILL][3][1] = true -- 1st Provisionning passive
exceptionList[SKILL_TYPE_TRADESKILL][3][2] = true -- 2nd Provisionning passive
exceptionList[SKILL_TYPE_TRADESKILL][5] = {}
exceptionList[SKILL_TYPE_TRADESKILL][5][1] = true -- 1st Blacksmithing passive
else
exceptionList[SKILL_TYPE_TRADESKILL][3] = {}
exceptionList[SKILL_TYPE_TRADESKILL][3][1] = true -- 1st Clothing passive
exceptionList[SKILL_TYPE_TRADESKILL][5] = {}
exceptionList[SKILL_TYPE_TRADESKILL][5][1] = true -- 1st Provisionning passive
exceptionList[SKILL_TYPE_TRADESKILL][5][2] = true -- 2nd Provisionning passive
exceptionList[SKILL_TYPE_TRADESKILL][2] = {}
exceptionList[SKILL_TYPE_TRADESKILL][2][1] = true -- 1st Blacksmithing passive
end
local skillLineConverter = {
[LSF:GetSkillLineInfo(SKILL_TYPE_WORLD, 2)] = 2,
[LSF:GetSkillLineInfo(SKILL_TYPE_WORLD, 4)] = 4,
[LSF:GetSkillLineInfo(SKILL_TYPE_GUILD, 1)] = 1,
[LSF:GetSkillLineInfo(SKILL_TYPE_GUILD, 4)] = 4,
}
if exceptionList[skillType] then
if skillType == SKILL_TYPE_GUILD or skillType == SKILL_TYPE_WORLD then
skillLineName = zo_strformat(SI_SKILLS_TREE_NAME_FORMAT, skillLineName)
if exceptionList[skillType][skillLineConverter[skillLineName]] then
if exceptionList[skillType][skillLineConverter[skillLineName]][abilityIndex] then
return 1
end
end
else
if exceptionList[skillType][skillLineIndex] then
if exceptionList[skillType][skillLineIndex][abilityIndex] then
return 1
end
end
end
end
return 0
end