View Single Post
03/03/16, 10:55 PM   #10
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
I tested that once, I'm not sure but if I remember correctly I think that you have to gain skill in it during that game session/reload before that API will work.

I'm guessing that your doing this just to save/load skills into the skill bar. You don't need skillType, skillLineIndex, LineAbilityIndex. Just use the abilityId to get the real abilityIndex and use it to load the skill:
Lua Code:
  1. local abilityId = GetSlotBoundId(slotNum)
  2. -- save it, then to reload:
  3. local hasProgression, progressionIndex = GetAbilityProgressionXPInfoFromAbilityId(abilityId)
  4. --[[ These two steps ensure you load the correct ability because the
  5. abilityId, progressionIndex, and ..a lot of things change every time
  6. an ability ranks up or is morphed. This way even if the saved abilityId
  7. is an "old" lower rank, unmorphed, or different morph the correct ability
  8. will still be loaded.
  9. --]]
  10. local unMorphedName, morphChoice, rank = GetAbilityProgressionInfo(progressionIndex)
  11. local morphedName, texture, abilityIndex = GetAbilityProgressionAbilityInfo(progressionIndex, morphChoice, rank)
  12. -- and note the above abilityIndex is NOT the same abilityIndex as this:
  13. -- local skillType, skillIndex, abilityIndex = GetSkillAbilityIndicesFromProgressionIndex(progressionIndex)
  14.  
  15.  
  16. CallSecureProtected("SelectSlotAbility", abilityIndex, slotNum)