View Single Post
07/25/22, 09:26 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,971
Addons like Caro's Skill and Champion Points Saver should have code to do so, if you want to have a look. But maybe I'm wrong and it just assigns the already purchased skills to the action slots.


If I find the API functions (if they exist, maybe it's the SKILLS_DATA_MANAGER or similar with functions which is able to assign the points) I'll add them here.

Edit:
At the addon compatibility there exists this function, which uses the SKILLS_DATA_MANAGER
https://github.com/esoui/esoui/blob/...iases.lua#L680

Code:
function ZO_Skills_PurchaseAbility(skillType, skillLineIndex, skillIndex)
    local skillData = SKILLS_DATA_MANAGER:GetSkillDataByIndices(skillType, skillLineIndex, skillIndex)
    if skillData then
        skillData:GetPointAllocator():Purchase()
    end
end

function ZO_Skills_UpgradeAbility(skillType, skillLineIndex, skillIndex)
    local skillData = SKILLS_DATA_MANAGER:GetSkillDataByIndices(skillType, skillLineIndex, skillIndex)
    if skillData then
        skillData:GetPointAllocator():IncreaseRank()
    end
end

function ZO_Skills_MorphAbility(progressionIndex, morphSlot)
    local skillType, skillLineIndex, skillIndex = GetSkillAbilityIndicesFromProgressionIndex(progressionIndex)
    local skillData = SKILLS_DATA_MANAGER:GetSkillDataByIndices(skillType, skillLineIndex, skillIndex)
    if skillData then
        skillData:GetPointAllocator():Morph(morphSlot)
    end
end
Better use the SKILLS_DATA_MANAGER directly instead of using those ZO_Skills_* functions, maybe these addon compatibility aliases will be gone one day!

Last edited by Baertram : 07/25/22 at 09:31 AM.
  Reply With Quote