Thread Tools Display Modes
03/20/16, 02:37 PM   #1
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Possible to check if player have DLC access?

I wonder if there is a function I missed that can tell me if a player have access to a specific DLC.
I need it to hide/show certain quests.

Lets say each DLC was given a number value, like this:
1 = Imperial City
2 = Orsinium
3 = Thieves Guild

and the function was like this:
isDLCAvailable(DLC number)
Returns true/false depending on if the player has access to that DLC.

Then I could do something like this:

Lua Code:
  1. If isDLCAvailable(2) then
  2. -- show quests in the Orsinium dlc zone and subzones
  3. end
  Reply With Quote
03/20/16, 02:46 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
The collections menu shows exactly what you ask for. Take a look at collections/keyboard/dlcbook_keyboard.lua and you will find that the function you are looking for is called GetCollectibleUnlockStateById and returns a CollectibleUnlockState.
The ESOUIDocumentation.txt shows that CollectibleUnlockState can be one of these three values:
  • COLLECTIBLE_UNLOCK_STATE_LOCKED
  • COLLECTIBLE_UNLOCK_STATE_UNLOCKED_OWNED
  • COLLECTIBLE_UNLOCK_STATE_UNLOCKED_SUBSCRIPTION

Now you just need to figure out how to get the collectibleIds for the DLCs.
  Reply With Quote
03/20/16, 03:11 PM   #3
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
254 - Thieves Guild
215 - Orsinium
154 - Imperial City

For the list :
Lua Code:
  1. local name, _, numCollectibles, unlockedCollectibles, _, _, collectibleCategoryType = GetCollectibleCategoryInfo(COLLECTIBLE_CATEGORY_TYPE_DLC)
  2.  
  3. for i=1, numCollectibles do
  4.     local collectibleId = GetCollectibleId(COLLECTIBLE_CATEGORY_TYPE_DLC, nil, i)
  5.     local collectibleName, _, _, _, unlocked = GetCollectibleInfo(collectibleId) -- Will return true or false. If the user unlocked throught ESO+ without buying DLC it will return true.
  6.     d("DLC ".. collectibleName .. "( ".. collectibleId .. ") unlocked : " .. tostring(unlocked))
  7. end
  Reply With Quote
03/21/16, 02:00 AM   #4
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Thanks for your replies
Didn't think about checking the collectibles functions

Now I just need to find out how to get the Thieves Guild Skill Line level...

Last edited by SnowmanDK : 03/21/16 at 04:11 AM.
  Reply With Quote
03/21/16, 09:37 AM   #5
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
Lua Code:
  1. for i=1, GetNumSkillLines(SKILL_TYPE_GUILD) do
  2.     local skillLineName = GetSkillLineInfo(SKILL_TYPE_GUILD, i)
  3.     if skillLineName == GetString(DESTINATIONS_DLC_SKILLLINE) then
  4.         local GetNumSkillAbilities(SKILL_TYPE_GUILD, i)
  5.         -- etc.
  6.         break
  7.     end
  8. end


DESTINATIONS_DLC_SKILLLINE =

de = "Diebesgilde"
fr = "Guilde des voleurs"
en = "Thieves Guild"
  Reply With Quote
03/21/16, 10:58 AM   #6
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Wouldn't it be better to check the first abilityId in each skill line? That way you are independent of translations.
  Reply With Quote
03/21/16, 11:22 AM   #7
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
It can change too.

They changed skills in IC (Racial passives).
They deleted the skillLine 2 in IC (Emperor) make the 3rd become the 2nd (Assistance moved from 3rd to the 2nd).
And they added a skillline in the 3rd position instead of the 4th with TG.
And for World it can change depending of skillline unlocking.
And for Tradeskills, skilllines are not even sames if you are starting game in EN , DE or FR.

And with a revamp, they can add skills too.

Plus, for 1 skill, you can have 12 abilityId. Per exemple here are abilityId of DK Skill 1 of Draconic Skillline (1st skill line).
Lua Code:
  1. [SKILL_TYPE_CLASS] = {
  2.     ["Draconic"] = {
  3.     [1] = {["skillPool"] = {
  4.     [0] = {[1] = {["id"] = 29012,},[2] = {["id"] = 33652,},[3] = {["id"] = 33655,},[4] = {["id"] = 33658,},},
  5.     [1] = {[1] = {["id"] = 32719,},[2] = {["id"] = 33662,},[3] = {["id"] = 33665,},[4] = {["id"] = 33668,},},
  6.     [2] = {[1] = {["id"] = 32715,},[2] = {["id"] = 33671,},[3] = {["id"] = 33675,},[4] = {["id"] = 33679,},},
  7.     },["at"] = ABILITY_TYPE_ULTIMATE,},


And with passive they can add unlimited #amount of passives ranks.

So yes, there is not real proper way to do it, you'll need to check at each new DLC.

Last edited by Ayantir : 03/21/16 at 11:26 AM.
  Reply With Quote
03/22/16, 02:02 PM   #8
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by Ayantir View Post
Lua Code:
  1. for i=1, GetNumSkillLines(SKILL_TYPE_GUILD) do
  2.     local skillLineName = GetSkillLineInfo(SKILL_TYPE_GUILD, i)
  3.     if skillLineName == GetString(DESTINATIONS_DLC_SKILLLINE) then
  4.         local GetNumSkillAbilities(SKILL_TYPE_GUILD, i)
  5.         -- etc.
  6.         break
  7.     end
  8. end


DESTINATIONS_DLC_SKILLLINE =

de = "Diebesgilde"
fr = "Guilde des voleurs"
en = "Thieves Guild"
You code returns the number of abilities in a skill line, not the level
But it got me started, and I ended up with this:

Lua Code:
  1. local skillLineLevel, DLC_TG_SkillLine = nil, nil
  2. if localLanguage == "de" then
  3.     DLC_TG_SkillLine = "Diebesgilde"
  4. elseif localLanguage == "fr" then
  5.     DLC_TG_SkillLine =  "Guilde des voleurs"
  6. else
  7.     DLC_TG_SkillLine = "Thieves Guild"
  8. end
  9. for i=1, GetNumSkillLines(SKILL_TYPE_GUILD) do
  10.     local skillLineName = GetSkillLineInfo(SKILL_TYPE_GUILD, i)
  11.     if skillLineName == DLC_TG_SkillLine then
  12.         _, skillLineLevel = GetSkillLineInfo(SKILL_TYPE_GUILD, i)
  13.         break
  14.     end
  15. end
Thanks for the tips. Case closed
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Possible to check if player have DLC access?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off