LibSkillsFactory is an ingame library which let you get access to Skills information that the current player cannot have access to.
The actual limitations of the API prevents you to get data of skills you don't know. This include :
- Get data of a passive skill at rank X-n or X+n (in that case n >1).
- Get data of a skillLine unlocked (Vampire, Werewolf, Legerdemain, other classes, other races).
LibSkillsFactory break those limitations and give you some functions to grab data from it.
How it works :
First, enable it with LibStub :
Lua Code:
local LSF = LibStub("LibSkillsFactory")
Then, init the factory.
It's necessary because the factory does not accept multi classes or multi races. But you can hack it if you want it. (please let me know, first).
Lua Code:
-- Init the factory like this :
-- Class is ClassID : 1,2,3,6
-- Races MUST be : 1 Breton, 2 Redguard, 3 Orc, 4 Altmer, 5 Bosmer, 6 Khajiit, 7 Dunmer, 8 Argonian, 9 Nordic, 10 Imperial
LibSkillsFactory:InitSkillFactory(GetUnitClassId("player"), 1)
Then use your functions :
LibSkillsFactory:GetAbilityType(skillType, skillLineIndex, abilityIndex)- Returns : abilityType, maxRank
- abilityType is 0 for Ultimates, 1 for active skills, 2 for passives skills
- maxRank is nil or 2+. If nil and abilityType is passive (2) consider 1. Ultimates and Active skills always returns nil.
LibSkillsFactory:GetAbilityInfo(skillType, skillLineIndex, abilityIndex, abilityLevel)- Returns : earnedAt, texturePath
- earnedAt is the skillLine level needed in order to learn the skill
- texturePath is the path of the skill texture
- Please note that for now, some Vampire passive and Legerdemain passives returns 69 for earnedAt, because I still don't get the info. See you soon.
LibSkillsFactory:GetSkillLineInfo(skillType, skillLineIndex)- Returns : name
- name is the name of the skillLine
LibSkillsFactory:GetAbilityId(skillType, skillLineIndex, abilityIndex, abilityLevel, rank)- Returns : abilityId
- abilityId is the ID of the skill.
Please note : abilityLevel is the rank of a passive skill. abilityLevel is for ultimates : 0 for base skill, 1 for upper morph, 2 for lower morph. rank is the active/ultimate rank of the skill (1/2/3/4).
LibSkillsFactory:GetNumSkillLines(skillType)- Returns : numSkillLines
- numSkillLines is the number of skillLines of a skillType
LibSkillsFactory:GetNumSkillAbilities(skillType, skillLineIndex)- Returns : numAbilities
- numSkillLines is the number of abilities of a skillType / skillLineIndex