Quantcast
Download
(835 Kb)
Download
Updated: 10/12/19 10:49 AM
Compatibility:
Dragonhold (5.2.5)
Scalebreaker (5.1.5)
Elsweyr (5.0.5)
Updated:10/12/19 10:49 AM
Created:01/21/19 10:18 AM
Monthly downloads:25,870
Total downloads:163,437
Favorites:153
MD5:
5.2.5
LibSets  Popular! (More than 5000 hits)
Version: 0.1.1
by: Baertram [More]
LibSets
A library to help with item sets for the following "setTypes":
Code:
LIBSETS_SETTYPE_ARENA                           = 1 --"Arena"
LIBSETS_SETTYPE_BATTLEGROUND                    = 2 --"Battleground"
LIBSETS_SETTYPE_CRAFTED                         = 3 --"Crafted"
LIBSETS_SETTYPE_CYRODIIL                        = 4 --"Cyrodiil"
LIBSETS_SETTYPE_DAILYRANDOMDUNGEONANDICREWARD   = 5 --"DailyRandomDungeonAndICReward"
LIBSETS_SETTYPE_DUNGEON                         = 6 --"Dungeon"
LIBSETS_SETTYPE_IMPERIALCITY                    = 7 --"Imperial City"
LIBSETS_SETTYPE_MONSTER                         = 8 --"Monster"
LIBSETS_SETTYPE_OVERLAND                        = 9 --"Overland"
LIBSETS_SETTYPE_SPECIAL                         = 10 --"Special"
LIBSETS_SETTYPE_TRIAL                           = 11 --"Trial"
Global variable of the library to access it in your code:
LibSets

Please do NOT use LibStub with this library as it will not work!
Simply include the following tag into your addon's manifest txt file:
Code:
##DependsOn: LibSets
This library uses SavedVariables and thus needs it's own LibSets.txt manifest file!
You must not include this library into subfolders of your addon and you must not include it manually into your addon's manifest txt file like
Code:
/libs/LibSets/LibSets_Constants.Lua
/libs/LibSets/LibSets.Lua
...

Supported languages are:
German
English
French
-> If you want your language supported as well contact me via private message here on www.esoui.com please.

It contains:
-SetId of the set
-Set's itemIds for all set items (to build an itemlink from)
-Name of a set for the supported languages
-Tables which contain the setIds and setData for each setType
-Tables which contain a mapping between the wayshrines and their zoneIds
-Counters to check how many sets of a type exist
-Functions to get & check the set data, get set languages, teleport to craftable set's near wayshrines, open set drop zone on map, open and show wayshrine of set on map, etc.

@developers
Be sure to check if LibSets finished loading the sets properly before accessing it.
Lua Code:
  1. If not LibSets or not LibSets.checkIfSetsAreLoadedProperly() then
  2.      --LibSets is currentls scanning and/or not ready! Abort here
  3.      myAddon.libSetsReady = false
  4.    else
  5.      myAddon.libSetsReady = true
  6.    end
  7.  
  8.     --Wherever you use LibSets check:
  9.    if myAddon.libSetsReady then
  10.       ---do whatever you want with LibSets
  11.    end

Unique setId
The API provides an unique setId for items which belong to a set.
You need an itemLink of the item you would like to check and are able to use the following API function to get the setId and some other parameters as well.
Code:
* GetItemLinkSetInfo(*string* _itemLink_, *bool* _equipped_)
** _Returns:_ *bool* _hasSet_, *string* _setName_, *integer* _numBonuses_, *integer* _numEquipped_, *integer* _maxEquipped_, *integer* _setId_
Important: The data this API function GetItemLinkSetInfo(itemLink) provides is NOT stored redundantly inside the library LibSets!
So please be sure to get the parameters "numBonuses", "numEquipped", "maxEquipped" by help of this ESO API function.

If you need e.g. the "_numEquipped_" parameter info you need to build an itemLink of a set's itemId, like this:
You can use the function LibSets.BuildItemLink(LibSets.GetSetItemId(setId, equipType)) to build the itemLink and then use the API function GetItemLinkSetInfo(itemLink, false) to get this information.

What constants can be used?
The non-API version dependent constants are available within this library's file LibSets_Constants.lua.
-> Please check this file for the possible constants for:
-LibSet tableKeys
-LibSet setTypes & names
-LibSet Undaunted Chest Data & names

All other API-dependent constants are available in the file LibSets_Constants_<APIVersion>.lua (where <APIVersion> is the current game's APIVersion. There might be 2 files, one for the live and another for the PTS server!).
-> Please check this file for the possible constants for:
-LibSet DLCIds & names

Where is the data?
The setsData is stored inside the included excel document LibSets_SetData.xlsx. From this file the lua contents for the following files is created:
The setsData is stored in the file LibSets_Data_<APIVersion>.lua (where <APIVersion> is the current game's APIVersion. There might be 2 files, one for the live and another for the PTS server!)
Inside this file there is a table LibSets.setInfo which provides the set information from the included excel.
And there are 3 pre-loaded (scanned ingame multilingual, shrinked and stored in this lua file) tables for the set itemIds, set names /multi language) and wayshrineNodeIndices mapping to their zoneId.
Both are inside the table LibSets.setDataPreloaded:
-LibSets.setDataPreloaded.setItemIds
-LibSets.setDataPreloaded.setNames
-LibSets.setDataPreloaded.wayshrineNodeId2zoneId
-The file itsself got comments to describe how to get the data needed and what format is needed.

API functions of the library:
Here is a list of the LibSets API functions you are able to use:
Lua Code:
  1. --Global variable of the library to access it:
  2. LibSets
  3.  
  4. ------------------------------------------------------------------------
  5. --  Global helper functions
  6. ------------------------------------------------------------------------
  7. --Create an example itemlink of the setItem's itemId (level 50, CP160) using the itemQuality subtype.
  8. --Standard value for the qualitySubType is 366 which means "Normal" quality.
  9. --The following qualities are available:
  10. --357:  Trash
  11. --366:  Normal
  12. --367:  Magic
  13. --368:  Arcane
  14. --369:  Artifact
  15. --370:  Legendary
  16. --> Parameters: itemId number: The item's itemId
  17. -->             itemQualitySubType number: The itemquality number of ESO, described above (standard value: 366 -> Normal)
  18. --> Returns:    itemLink String: The generated itemLink for the item with the given quality
  19. function lib.buildItemLink(itemId, itemQualitySubType)
  20.  
  21.  
  22. --Open the worldmap and show the map of the zoneId
  23. --> Parameters: zoneId number: The zone's zoneId
  24. function lib.openMapOfZoneId(zoneId)
  25.  
  26. --Open the worldmap, get the zoneId of the wayshrine wayshrineNodeId and show the wayshrine wayshrineNodeId on the map
  27. --> Parameters: wayshrineNodeId number: The wayshrine's nodeIndex
  28. function lib.showWayshrineNodeIdOnMap(wayshrineNodeId)
  29.  
  30.  
  31. ------------------------------------------------------------------------
  32. --  Global set check functions
  33. ------------------------------------------------------------------------
  34. --Returns true if the setId provided is a craftable set
  35. --> Parameters: setId number: The set's setId
  36. --> Returns:    boolean isCraftedSet
  37. function lib.IsCraftedSet(setId)
  38.  
  39. --Returns true if the setId provided is a monster set
  40. --> Parameters: setId number: The set's setId
  41. --> Returns:    boolean isMonsterSet
  42. function lib.IsMonsterSet(setId)
  43.  
  44. --Returns true if the setId provided is a dungeon set
  45. --> Parameters: setId number: The set's setId
  46. --> Returns:    boolean isDungeonSet
  47. function lib.IsDungeonSet(setId)
  48.  
  49. --Returns true if the setId provided is a trial set
  50. --> Parameters: setId number: The set's setId
  51. --> Returns:    boolean isTrialSet, boolean isMultiTrialSet
  52. function lib.IsTrialSet(setId)
  53.  
  54. --Returns true if the setId provided is an arena set
  55. --> Parameters: setId number: The set's setId
  56. --> Returns:    boolean isArenaSet
  57. function lib.IsArenaSet(setId)
  58.  
  59. --Returns true if the setId provided is an overland set
  60. --> Parameters: setId number: The set's setId
  61. --> Returns:    boolean isOverlandSet
  62. function lib.IsOverlandSet(setId)
  63.  
  64. --Returns true if the setId provided is an cyrodiil set
  65. --> Parameters: setId number: The set's setId
  66. --> Returns:    boolean isCyrodiilSet
  67. function lib.IsCyrodiilSet(setId)
  68.  
  69. --Returns true if the setId provided is a battleground set
  70. --> Parameters: setId number: The set's setId
  71. --> Returns:    boolean isBattlegroundSet
  72. function lib.IsBattlegroundSet(setId)
  73.  
  74. --Returns true if the setId provided is an Imperial City set
  75. --> Parameters: setId number: The set's setId
  76. --> Returns:    boolean isImperialCitySet
  77. function lib.IsImperialCitySet(setId)
  78.  
  79. --Returns true if the setId provided is a special set
  80. --> Parameters: setId number: The set's setId
  81. --> Returns:    boolean isSpecialSet
  82. function lib.IsSpecialSet(setId)
  83.  
  84. --Returns true if the setId provided is a DailyRandomDungeonAndImperialCityRewardSet set
  85. --> Parameters: setId number: The set's setId
  86. --> Returns:    boolean isDailyRandomDungeonAndImperialCityRewardSet
  87. function lib.IsDailyRandomDungeonAndImperialCityRewardSet(setId)
  88.  
  89. --Returns true if the setId provided is a non ESO, own defined setId
  90. --See file LibSets_SetData_(APIVersion).lua, table LibSets.lib.noSetIdSets and description above it.
  91. --> Parameters: noESOSetId number: The set's setId
  92. --> Returns:    boolean isNonESOSet
  93. function lib.IsNoESOSet(noESOSetId)
  94.  
  95. --Returns information about the set if the itemId provides is a set item
  96. --> Parameters: itemId number: The item's itemId
  97. --> Returns:    isSet boolean, setName String, setId number, numBonuses number, numEquipped number, maxEquipped number
  98. function lib.IsSetByItemId(itemId)
  99.  
  100. --Returns information about the set if the itemlink provides is a set item
  101. --> Parameters: itemLink String/ESO ItemLink: The item's itemLink '|H1:item:itemId...|h|h'
  102. --> Returns:    isSet boolean, setName String, setId number, numBonuses number, numEquipped number, maxEquipped number
  103. function lib.IsSetByItemLink(itemLink)
  104.  
  105. --Returns true/false if the set must be obtained in a veteran mode dungeon/trial/arena.
  106. --If the veteran state is not a boolean value, but a table, then this table contains the equipType as key
  107. --and the boolean value for each of these equipTypes as value. e.g. the head is a veteran setItem but the shoulders aren't (monster set).
  108. --->To check the equiptype you need to specify the 2nd parameter itemlink in this case! Or the return value will be nil
  109. --> Parameters: setId number: The set's setId
  110. -->             itemLink String: An itemlink of a setItem -> only needed if the veteran data contains equipTypes and should be checked
  111. -->                              against these.
  112. --> Returns:    isVeteranSet boolean
  113. function lib.IsVeteranSet(setId, itemLink)
  114.  
  115.  
  116. ------------------------------------------------------------------------
  117. --  Global set get data functions
  118. ------------------------------------------------------------------------
  119. --Returns the wayshrines as table for the setId. The table contains up to 3 wayshrines for wayshrine nodes in the different factions,
  120. --e.g. wayshrines={382,382,382}. All entries can be the same, or even a negative value which means: No weayshrine is known
  121. --Else the order of the entries is 1=Admeri Dominion, 2=Daggerfall Covenant, 3=Ebonheart Pact
  122. --> Parameters: setId number: The set's setId
  123. -->             withRelatedZoneIds boolean: Also provide a mappingTable as 2nd return value which contains the wayshrine's zoneId
  124. -->             in this format: wayshrineNodsId2ZoneId = { [wayshrineNodeId1]= zoneId1, [wayshrineNodeId2]= zoneId2,... }
  125. --> Returns:    wayshrineNodeIds table
  126. function lib.GetWayshrineIds(setId, withRelatedZoneIds)
  127.  
  128. --Returns the wayshrineNodeIds's related zoneId, where this wayshrine is located
  129. --> Parameters: wayshrineNodeId number
  130. --> Returns:    zoneId number
  131. function lib.GetWayshrinesZoneId(wayshrineNodeId)
  132.  
  133. --Returns the drop zoneIds as table for the setId
  134. --> Parameters: setId number: The set's setId
  135. --> Returns:    zoneIds table
  136. function lib.GetZoneIds(setId)
  137.  
  138. --Returns the dlcId as number for the setId
  139. --> Parameters: setId number: The set's setId
  140. --> Returns:    dlcId number
  141. function lib.GetDLCId(setId)
  142.  
  143. --Returns the number of researched traits needed to craft this set. This will only check the craftable sets!
  144. --> Parameters: setId number: The set's setId
  145. --> Returns:    traitsNeededToCraft number
  146. function lib.GetTraitsNeeded(setId)
  147.  
  148. --Returns the type of the setId!
  149. --> Parameters: setId number: The set's setId
  150. --> Returns:    setType String
  151. ---> Possible values are the setTypes of LibSets one of the constants in LibSets.allowedSetTypes, see file LibSets_Constants.lua)
  152. function lib.GetSetType(setId)
  153.  
  154. --Returns the setType name as String
  155. --> Parameters: libSetsSetType number: The set's setType (one of the constants in LibSets.allowedSetTypes, see file LibSets_Constants.lua)
  156. -->             lang String the language for the setType name. Can be left nil -> The client language will be used then
  157. --> Returns:    String setTypeName
  158. function lib.GetSetTypeName(libSetsSetType, lang)
  159.  
  160. --Returns the table of setTypes of LibSets (the constants in LibSets.allowedSetTypes, see file LibSets_Constants.lua)
  161. function lib.GetSetTypes()
  162.  
  163. --Returns a sorted table of all set ids. Key is the setId, value is the boolean value true.
  164. --Attention: The table can have a gap in it's index as not all setIds are gap-less in ESO!
  165. --> Returns: setIds table
  166. function lib.GetAllSetIds()
  167.  
  168. --Returns all sets itemIds as table. Key is the setId, value is a subtable with the key=itemId and value = boolean value true.
  169. --> Returns: setItemIds table
  170. function lib.GetAllSetItemIds()
  171.  
  172. --Returns a table containing all itemIds of the setId provided. The setItemIds contents are non-sorted.
  173. --The key is the itemId and the value is the boolean value true
  174. --> Parameters: setId number: The set's setId
  175. -->             isSpecialSet boolean: Read the set's itemIds from the special sets table or the normal?
  176. --> Returns:    table setItemIds
  177. function lib.GetSetItemIds(setId, isNoESOSetId)
  178.  
  179. --If the setId only got 1 itemId this function returns this itemId of the setId provided.
  180. --If the setId got several itemIds this function returns one random itemId of the setId provided (depending on the 2nd parameter equipType)
  181. --If the 2nd parameter equipType is not specified: The first random itemId found will be returned
  182. --If the 2nd parameter equipType is specified:  Each itemId of the setId will be turned into an itemLink where the given equipType is checked against.
  183. --Only the itemId where the equipType fits will be returned. Else the return value will be nil
  184. --> Parameters: setId number: The set's setId
  185. -->             equipType number: The equipType to check the itemId against
  186. --> Returns:    number setItemId
  187. function lib.GetSetItemId(setId, equipType)
  188.  
  189. --Returns the name as String of the setId provided
  190. --> Parameters: setId number: The set's setId
  191. --> lang String: The language to return the setName in. Can be left empty and the client language will be used then
  192. --> Returns:    String setName
  193. function lib.GetSetName(setId, lang)
  194.  
  195. --Returns all names as String of the setId provided.
  196. --The table returned uses the key=language (2 characters String e.g. "en") and the value = name String, e.g.
  197. --{["fr"]="Les Vêtements du sorcier",["en"]="Vestments of the Warlock",["de"]="Gewänder des Hexers"}
  198. --> Parameters: setId number: The set's setId
  199. --> Returns:    table setNames
  200. ----> Contains a table with the different names of the set, for each scanned language (setNames = {["de"] = String nameDE, ["en"] = String nameEN})
  201. function lib.GetSetNames(setId)
  202.  
  203. --Returns the set info as a table
  204. --> Parameters: setId number: The set's setId
  205. --> Returns:    table setInfo
  206. ----> Contains:
  207. ----> number setId
  208. ----> number dlcId (the dlcId where the set was added, see file LibSets_Constants.lua, constants DLC_BASE_GAME to e.g. DLC_ELSWEYR)
  209. ----> tables LIBSETS_TABLEKEY_SETITEMIDS (="setItemIds") (which can be used with LibSets.buildItemLink(itemId) to create an itemLink of this set's item),
  210. ----> table names (="setNames") ([2 character String lang] = String name),
  211. ----> number traitsNeeded for the trait count needed to craft this set if it's a craftable one (else the value will be nil),
  212. ----> String setType which shows the setType via the LibSets setType constant values like LIBSETS_SETTYPE_ARENA, LIBSETS_SETTYPE_DUNGEON etc. Only 1 setType is possible for each set
  213. ----> isVeteran boolean value true if this set can be only obtained in veteran mode, or a table containing the key = equipType and value=boolean true/false if the equipType of the setId cen be only obtained in veteran mode (e.g. a monster set head is veteran, shoulders are normal)
  214. ----> isMultiTrial boolean, only if setType == LIBSETS_SETTYPE_TRIAL (setId can be obtained in multiple trials -> see zoneIds table)
  215. ----> table wayshrines containing the wayshrines to port to this setId using function LibSets.JumpToSetId(setId, factionIndex).
  216. ------>The table can contain 1 to 3 entries (one for each faction e.g.) and contains the wayshrineNodeId nearest to the set's crafting table/in the drop zone
  217. ----> table zoneIds containing the zoneIds (one to n) where this set drops, or can be obtained
  218. -------Example for setId 408
  219. --- ["setId"] = 408,
  220. --- ["dlcId"] = 12,    --DLC_MURKMIRE
  221. --  ["setType"] = LIBSETS_SETTYPE_CRAFTED,
  222. --  [LIBSETS_TABLEKEY_SETITEMIDS] = {
  223. --      table [#0,370]
  224. --  },
  225. --  [LIBSETS_TABLEKEY_SETNAMES] = {
  226. --      ["de"] = "Grabpflocksammler"
  227. --      ["en"] = "Grave-Stake Collector"
  228. --      ["fr"] = "Collectionneur de marqueurs funéraires"
  229. --  },
  230. --  ["traitsNeeded"] = 7,
  231. --  ["veteran"] = false,
  232. --  ["wayshrines"] = {
  233. --      [1] = 375
  234. --      [2] = 375
  235. --      [3] = 375
  236. --  },
  237. --  ["zoneIds"] = {
  238. --      [1] = 726,
  239. --  },
  240. --}
  241. function lib.GetSetInfo(setId)
  242.  
  243.  
  244. ------------------------------------------------------------------------
  245. --  Global set misc. functions
  246. ------------------------------------------------------------------------
  247. --Jump to a wayshrine of a set.
  248. --If it's a crafted set you can specify a faction ID in order to jump to the selected faction's zone
  249. --> Parameters: setId number: The set's setId
  250. -->             OPTIONAL factionIndex: The index of the faction (1=Admeri Dominion, 2=Daggerfall Covenant, 3=Ebonheart Pact)
  251. function lib.JumpToSetId(setId, factionIndex)
  252.  
  253.  
  254. ------------------------------------------------------------------------
  255. --  Global other get functions
  256. ------------------------------------------------------------------------
  257. --Returns the name of the DLC by help of the DLC id
  258. --> Parameters: dlcId number: The DLC id given in a set's info
  259. --> Returns:    name dlcName
  260. function lib.GetDLCName(dlcId)
  261.  
  262. --Returns the name of the DLC by help of the DLC id
  263. --> Parameters: undauntedChestId number: The undaunted chest id given in a set's info
  264. --> Returns:    name undauntedChestName
  265. function lib.GetUndauntedChestName(undauntedChestId, lang)
  266.  
  267. --Returns the name of the zone by help of the zoneId
  268. --> Parameters: zoneId number: The zone id given in a set's info
  269. -->             language String: ONLY possible to be used if additional library "LibZone" (https://www.esoui.com/downloads/info2171-LibZone.html) is activated
  270. --> Returns:    name zoneName
  271. function lib.GetZoneName(zoneId, lang)
  272.  
  273. --Returns the set data (setType number, setIds table, itemIds table, setNames table) for specified LibSets setType
  274. --> Returns:    table with key = setId, value = table which contains (as example for setType = LIBSETS_SETTYPE_CRAFTED)
  275. ---->             [LIBSETS_TABLEKEY_SETTYPE] = LIBSETS_SETTYPE_CRAFTED ("Crafted")
  276. ------>             1st subtable with key LIBSETS_TABLEKEY_SETITEMIDS ("setItemIds") containing a pair of [itemId]= true (e.g. [12345]=true,)
  277. ------>             2nd subtable with key LIBSETS_TABLEKEY_SETNAMES ("setNames") containing a pair of [language] = "Set name String" (e.g. ["en"]= Crafted set name 1",)
  278. ---             Example:
  279. ---             [setId] = {
  280. ---                 setType = LIBSETS_SETTYPE_CRAFTED,
  281. ---                 [LIBSETS_TABLEKEY_SETITEMIDS] = {
  282. ---                     [itemId1]=true,
  283. ---                     [itemId2]=true
  284. ---                 },
  285. ---                 [LIBSETS_TABLEKEY_SETNAMES] = {
  286. ---                     ["de"]="Set name German",
  287. ---                     ["en"]="Set name English",
  288. ---                     ["fr"]="Set name French",
  289. ---                 },
  290. ---             }
  291. --Returns the set data (setType number, setIds table, itemIds table, setNames table) for the specified LibSets setType
  292. --Parameters: setType number. Possible values are the setTypes of LibSets one of the constants in LibSets.allowedSetTypes, see file LibSets_Constants.lua)
  293. --> Returns:    table -> See lib.GetCraftedSetsData for details of the table contents
  294. function lib.GetSetTypeSetsData(setType)
  295.  
  296.  
  297. ------------------------------------------------------------------------
  298. --  Global library check functions
  299. ------------------------------------------------------------------------
  300. --Returns a boolean value, true if the sets of the game were already loaded/ false if not
  301. --> Returns:    boolean areSetsLoaded
  302. function lib.AreSetsLoaded()
  303.  
  304. --Returns a boolean value, true if the sets of the game are currently scanned and added/updated/ false if not
  305. --> Returns:    boolean isCurrentlySetsScanning
  306. function lib.IsSetsScanning()
  307.  
  308. --Returns a boolean value, true if the sets database is properly loaded yet and is not currently scanning
  309. --or false if not.
  310. --This functions combines the result values of the functions LibSets.AreSetsLoaded() and LibSets.IsSetsScanning()
  311. function lib.checkIfSetsAreLoadedProperly()

Updating the library with new PTS data:
If you want to know what is to do as the library needs an update with new PTS data, check file "LibSets.lua" at teh top and read + understand the steps needed please!

GitHub - If you want to contribute
LibSets on GitHub
0.1.1
Updated for PTS APIversion 100029 Dragonhold:
-Added new zones, wayhsrines, collectibleName, sets and constants for the library
-Renamed file with base constants to LibSets_ConstantsLibraryInternal.lua
-Changed loading of old data (no LibSets_data_$(APIVersion).lua needed anymore as one can update the current PTS version in file LibSets_Constants_All.lua in variable "APIVersions["PTS"]" and all data which is only meant to be loaded for this PTS version can be stored between a check function call:
if checkIfPTSAPIVersionIsLive() then ... end
-Moved packages and total a number of loop scans for the setItemIds to file LibSets_ConstantsLibraryInternal.lua, variables:
lib.debugNumItemIdPackages = 55 -- Increase this to find new added set itemIds after and update (last updated APIVersion 100029 Dragonhold)
lib.debugNumItemIdPackageSize = 5000 -- do not increase this or the client may crash!
-Fixed "miliseconds" typo in fileLibSets_Debug.lua, function scanAllSetData(). All setItemIds should be scanned properly now.
-Added "howto" information for an update of this library to file LibSets.lua (At the top)
-Added internal function checkIfSetExists(setId) which will check if a setId given in the preloaded setData tables really exists and will automatically skip the data fopr this set if it does not exist on the current game client (e.g. PTS setData on the live server)

0.1.0
-Removed API100027 files
-Changed data and constants files to use the ALL entry first and then try to find another API dependent filename
-Fixed LibZone debug functions

0.0.9
-Added a mapping table "wayshrineNodeIndex" to "zoneId" to be able to show the wayshrine of a set on the worldmap
-Added new API functions for the wayshrines
Code:
--Open the worldmap and show the map of the zoneId
--> Parameters: zoneId number: The zone's zoneId
function lib.openMapOfZoneId(zoneId)

--Open the worldmap, get the zoneId of the wayshrine wayshrineNodeId and show the wayshrine wayshrineNodeId on the map
--> Parameters: wayshrineNodeId number: The wayshrine's nodeIndex
function lib.showWayshrineNodeIdOnMap(wayshrineNodeId)

--Returns the wayshrineNodeIds's related zoneId, where this wayshrine is located
--> Parameters: wayshrineNodeId number
--> Returns:    zoneId number
function lib.GetWayshrinesZoneId(wayshrineNodeId)
-Changed parameters of the following API function. New 2nd parameter: withRelatedZoneIds boolean
Code:
--Returns the wayshrines as table for the setId. The table contains up to 3 wayshrines for wayshrine nodes in the different factions,
--e.g. wayshrines={382,382,382}. All entries can be the same, or even a negative value which means: No weayshrine is known
--Else the order of the entries is 1=Admeri Dominion, 2=Daggerfall Covenant, 3=Ebonheart Pact
--> Parameters: setId number: The set's setId
-->             withRelatedZoneIds boolean: Also provide a mappingTable as 2nd return value which contains the wayshrine's zoneId
-->             in this format: wayshrineNodsId2ZoneId = { [wayshrineNodeId1]= zoneId1, [wayshrineNodeId2]= zoneId2,... }
--> Returns:    wayshrineNodeIds table
function lib.GetWayshrineIds(setId, withRelatedZoneIds)
0.0.8
-Fixed wrong constants for 2 crafted sets (needed traits to craft), thanks Snow for the info.
-Changed Excel document to use the LibSets DLC_ID instead of plain numbers, for the generated setsData lua tables
-Moved redundant constants to a new file LibSets_Constants.lua, which will always be loaded.
All other API dependent constants remain in the LibSets_Constants_<APIVersion>.lua files

0.0.7
Fixed wrong constants in Scalebreaker set data.

0.0.6
-With version 0.0.6 the library got reworked totally.
Included you'll find an excel file LibSets_SetData.xlsx which contains the actual set data for the library.
The lua code neede dis created from this excel file.
-The SavedVariables ar enot needed anymore for this library (only if you the included debug functions).
All setsData is included, preloaded in the file LibSets_SetData_(APIVersion).lua (where APIVersion is the current game client's APIVersion e.g. 100027 for live's patch "Elsweyr" or 100028 for PTS's patch "Scalebraker").
-The library provides several API functions to get the set data, names, types, itemIds, etc.
-All itemIds of all setIds are included now, and not only 1 itemId (like in the past)
-SetNames for the supported languages come included
-Supported languages so far are: DE, EN, FR
If you want your language to be addded you can contact me via the private message system here on www.esoui.com.
You need to havbe the game client running on this new language and you need to run some debug functions and provide me some data from your SavedVariables afterwards.
-COmpatible with sets of API 100027 Elsweyr and 100028 Scalebreaker

---------------------------------------------------------------------------------
0.0.5
-Updated API to Elsweyr
-Added ##IsLibrary: true tag in manifest txt
-Fixed GetSetInfo function code
-Updated set itemIds with a preloaded table to speed up the scanning at new languages/APIVersions
-> Thanks to silvereyes for both changes!


0.0.4
Fixed "is scanning" and "is loaded" variables to prevent double scans at teh same time.
Added parameter "addonName" to function LibSets.LoadSets(override, addonName).
If you call the function you should specify the parameter "addonName" and pass your addon's name (String) in there so the chat output is able to show which addon called the LibSets.LoadSets function

0.0.3
Fixed lua error messages after sets were loaded.

0.0.2
Fixed:
-Loading of sets will show the updated counter for existing sets, where the localized name got updated, properly now.
-Loaded sets will be automatically scanned and added + saved to the SavedvAriables for each APIVersion + client language now
-After the sets were loaded (watch the chat for update messages during the set scan process) a dialog will ask you to do a reloadui now. If you click "no" the dialog will re-appear every 10 minutes until you click "Yes" or do a manual reloadui

Added:
API functions to check if sets are currently scanning or if the sets data was scanned and is provided (for other addons:
Check if the library is given and the sets were loaded like this
Code:
if LibSets and LibSets.AreSetsLoaded and LibSets.AreSetsLoaded() then --Sets are provided end
Code:
--Returns a boolean value, true if the sets of the game were already loaded/ false if not
--> Returns:    boolean areSetsLoaded
function LibSets.AreSetsLoaded()

--Returns a boolean value, true if the sets of the game are currently scanned and added/updated/ false if not
--> Returns:    boolean isCurrentlySetsScanning
function LibSets.IsSetsScanning()
Optional Files (0)


Archived Files (9)
File Name
Version
Size
Uploader
Date
0.1.0
780kB
Baertram
08/23/19 10:24 AM
0.0.9
936kB
Baertram
07/28/19 09:03 AM
0.0.8
924kB
Baertram
07/27/19 08:30 AM
0.0.6
911kB
Baertram
07/14/19 11:02 AM
0.0.5
14kB
Baertram
05/19/19 06:24 PM
0.0.4
8kB
Baertram
02/03/19 08:21 AM
0.0.3
7kB
Baertram
02/01/19 10:40 AM
0.0.2
7kB
Baertram
01/30/19 04:11 PM
0.0.1
5kB
01/21/19 10:18 AM


Post A Reply Comment Options
Unread 08/24/19, 01:01 PM  
Anceane
 
Anceane's Avatar

Forum posts: 233
File comments: 773
Uploads: 0
Re: Re: with last update, error LUA

Originally Posted by Baertram
The first error message says LibSets minor version is 0.1 which is outdated as... Hell.
Please deinstalled LibSets and install again manually with newest version. Maybe your zip archive was wrong.

Not at home can't test why you get the error message but it sounds a bit weird at it happens during initialization of the lib where I did not change anything.
Deleted the folder, reinstalled again and working fine now ..... the mystery total lol

Thank you
__________________
Report comment to moderator  
Reply With Quote
Unread 08/24/19, 12:27 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2429
File comments: 2710
Uploads: 57
Re: with last update, error LUA

The first error message says LibSets minor version is 0.1 which is outdated as... Hell.
Please deinstalled LibSets and install again manually with newest version. Maybe your zip archive was wrong.

Not at home can't test why you get the error message but it sounds a bit weird at it happens during initialization of the lib where I did not change anything.

Originally Posted by Anceane
Its happening each time i log in, Zone or reloadui.

For the time beeing i am reverting the libsets


Code:
user:/AddOns/LibSets/LibSets.lua:48: attempt to index a nil value
stack traceback:
user:/AddOns/LibSets/LibSets.lua:48: in function '(main chunk)'
|caaaaaa<Locals> lib = tbl, MAJOR = "LibSets", MINOR = 0.1, counterSuffix = "Counter" </Locals>|r

and

Code:
user:/AddOns/WritWorthy/WritWorthy_Util.lua:136: function expected instead of nil
stack traceback:
user:/AddOns/WritWorthy/WritWorthy_Util.lua:136: in function 'WritWorthy.LibSets'
user:/AddOns/WritWorthy/WritWorthy_Smithing.lua:625: in function 'Parser:GetSetBonus'
|caaaaaa<Locals> self = tbl, set_id = 226, r = tbl </Locals>|r
user:/AddOns/WritWorthy/WritWorthy_Smithing.lua:676: in function 'Parser:ParseItemLink'
|caaaaaa<Locals> self = tbl, item_link = "|H0:item:121527:6:1:0:0:0:6...", fields = tbl, item_num = 62, material_num = 188, quality_num = 5, set_num = 226, trait_num = 6, motif_num = 61 </Locals>|r
user:/AddOns/WritWorthy/WritWorthy.lua:309: in function 'WritWorthy:ScanInventoryForMasterWrits'
|caaaaaa<Locals> self = tbl, result_list = tbl, bag_list = tbl, save_mat_list_chat = "All", _ = 2, bag_id = 2, slot_ct = 240, slot_index = 131, item_link = "|H0:item:121527:6:1:0:0:0:6...", parser = tbl </Locals>|r
user:/AddOns/WritWorthy/WritWorthy_Window.lua:1542: in function 'WritWorthyInventoryList.RestoreFromSavedChariables'
user:/AddOns/WritWorthy/WritWorthy.lua:612: in function 'WritWorthy:Initialize'
|caaaaaa<Locals> self = tbl </Locals>|r
user:/AddOns/WritWorthy/WritWorthy.lua:569: in function 'WritWorthy.OnAddOnLoaded'
|caaaaaa<Locals> event = 65536, addonName = "WritWorthy" </Locals>|r
Report comment to moderator  
Reply With Quote
Unread 08/24/19, 10:28 AM  
Anceane
 
Anceane's Avatar

Forum posts: 233
File comments: 773
Uploads: 0
with last update, error LUA

Its happening each time i log in, Zone or reloadui.

For the time beeing i am reverting the libsets


Code:
user:/AddOns/LibSets/LibSets.lua:48: attempt to index a nil value
stack traceback:
user:/AddOns/LibSets/LibSets.lua:48: in function '(main chunk)'
|caaaaaa<Locals> lib = tbl, MAJOR = "LibSets", MINOR = 0.1, counterSuffix = "Counter" </Locals>|r

and

Code:
user:/AddOns/WritWorthy/WritWorthy_Util.lua:136: function expected instead of nil
stack traceback:
user:/AddOns/WritWorthy/WritWorthy_Util.lua:136: in function 'WritWorthy.LibSets'
user:/AddOns/WritWorthy/WritWorthy_Smithing.lua:625: in function 'Parser:GetSetBonus'
|caaaaaa<Locals> self = tbl, set_id = 226, r = tbl </Locals>|r
user:/AddOns/WritWorthy/WritWorthy_Smithing.lua:676: in function 'Parser:ParseItemLink'
|caaaaaa<Locals> self = tbl, item_link = "|H0:item:121527:6:1:0:0:0:6...", fields = tbl, item_num = 62, material_num = 188, quality_num = 5, set_num = 226, trait_num = 6, motif_num = 61 </Locals>|r
user:/AddOns/WritWorthy/WritWorthy.lua:309: in function 'WritWorthy:ScanInventoryForMasterWrits'
|caaaaaa<Locals> self = tbl, result_list = tbl, bag_list = tbl, save_mat_list_chat = "All", _ = 2, bag_id = 2, slot_ct = 240, slot_index = 131, item_link = "|H0:item:121527:6:1:0:0:0:6...", parser = tbl </Locals>|r
user:/AddOns/WritWorthy/WritWorthy_Window.lua:1542: in function 'WritWorthyInventoryList.RestoreFromSavedChariables'
user:/AddOns/WritWorthy/WritWorthy.lua:612: in function 'WritWorthy:Initialize'
|caaaaaa<Locals> self = tbl </Locals>|r
user:/AddOns/WritWorthy/WritWorthy.lua:569: in function 'WritWorthy.OnAddOnLoaded'
|caaaaaa<Locals> event = 65536, addonName = "WritWorthy" </Locals>|r
__________________
Last edited by Anceane : 08/24/19 at 10:57 AM.
Report comment to moderator  
Reply With Quote
Unread 07/26/19, 10:05 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2429
File comments: 2710
Uploads: 57
Originally Posted by Snow
Hi,

for the Sets 176 [Noble's Conquest] and Set 177 [Redistributor] the required researched Traits to craft this set values need to be swaped.
You have to research 7 traits for Redistributor and 5 traits for Noble's Conquest.

Snow
Thanks for the hint, will have a look and correct this.
Last edited by Baertram : 07/28/19 at 09:04 AM.
Report comment to moderator  
Reply With Quote
Unread 07/26/19, 09:09 AM  
Snow

Forum posts: 0
File comments: 42
Uploads: 0
Hi,

for the Sets 176 [Noble's Conquest] and Set 177 [Redistributor] the required researched Traits to craft this set values need to be swaped.
You have to research 7 traits for Redistributor and 5 traits for Noble's Conquest.

Snow
Report comment to moderator  
Reply With Quote
Unread 07/17/19, 11:20 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2429
File comments: 2710
Uploads: 57
Oh, thanks for the hint. This might be the new added sets for next patch.

Originally Posted by WildEra
There is a bunch of bad constants in the lib.setInfo from LibSets_Data_100028.lua (LIBSETS_TYPE_DUNGEON / LIBSETS_TYPE_MONSTER instead of LIBSETS_SETTYPE_DUNGEON / LIBSETS_SETTYPE_MONSTER) :
Code:
[452] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1122}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Hollowfang Thirst / Hohlzahndurst   [Moongrave Fane]
[453] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1122}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Dro'Zakar's Claws / Dro'Zakars Krallen   [Moongrave Fane]
[454] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1122}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Renald's Resolve / Renalds Entschlossenheit   [Moongrave Fane]
[455] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1123}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Z'en's Redress / Z'ens Wiedergutmachung   [Lair of Maarselok]
[456] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1123}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Azureblight Reaper / Azurfäuleschnitter   [Lair of Maarselok]
[457] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1123}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Dragon's Defilement / Drachenschändung   [Lair of Maarselok]
And :
Code:
[458] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1122}, veteran={[EQUIP_TYPE_HEAD]=true, [EQUIP_TYPE_SHOULDERS]=false}, setType=LIBSETS_TYPE_MONSTER},	 --Grundwulf / Grundwulf   [Moongrave Fane]
[459] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1123}, veteran={[EQUIP_TYPE_HEAD]=true, [EQUIP_TYPE_SHOULDERS]=false}, setType=LIBSETS_TYPE_MONSTER},	 --Maarselok / Maarselok   [Lair of Maarselok]
Report comment to moderator  
Reply With Quote
Unread 07/17/19, 09:37 AM  
WildEra
 
WildEra's Avatar
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 1
Uploads: 1
There is a bunch of bad constants in the lib.setInfo from LibSets_Data_100028.lua (LIBSETS_TYPE_DUNGEON / LIBSETS_TYPE_MONSTER instead of LIBSETS_SETTYPE_DUNGEON / LIBSETS_SETTYPE_MONSTER) :
Code:
[452] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1122}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Hollowfang Thirst / Hohlzahndurst   [Moongrave Fane]
[453] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1122}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Dro'Zakar's Claws / Dro'Zakars Krallen   [Moongrave Fane]
[454] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1122}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Renald's Resolve / Renalds Entschlossenheit   [Moongrave Fane]
[455] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1123}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Z'en's Redress / Z'ens Wiedergutmachung   [Lair of Maarselok]
[456] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1123}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Azureblight Reaper / Azurfäuleschnitter   [Lair of Maarselok]
[457] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1123}, veteran=false, setType=LIBSETS_TYPE_DUNGEON},	 --Dragon's Defilement / Drachenschändung   [Lair of Maarselok]
And :
Code:
[458] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1122}, veteran={[EQUIP_TYPE_HEAD]=true, [EQUIP_TYPE_SHOULDERS]=false}, setType=LIBSETS_TYPE_MONSTER},	 --Grundwulf / Grundwulf   [Moongrave Fane]
[459] = {wayshrines={-1,-1,-1,}, dlcId=15, zoneIds={1123}, veteran={[EQUIP_TYPE_HEAD]=true, [EQUIP_TYPE_SHOULDERS]=false}, setType=LIBSETS_TYPE_MONSTER},	 --Maarselok / Maarselok   [Lair of Maarselok]
Last edited by WildEra : 07/17/19 at 10:57 AM.
Report comment to moderator  
Reply With Quote
Unread 07/15/19, 04:50 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2429
File comments: 2710
Uploads: 57
Update to version 0.0.6 - 2019-07-14
-With version 0.0.6 the library got reworked totally
Included you'll find an excel file LibSets_SetData.xlsx which contains the actual set data for the library.
The lua code neede dis created from this excel file.
-The SavedVariables ar enot needed anymore for this library (only if you the included debug functions).
All setsData is included, preloaded in the file LibSets_SetData_(APIVersion).lua (where APIVersion is the current game client's APIVersion e.g. 100027 for live's patch "Elsweyr" or 100028 for PTS's patch "Scalebraker").
-The library provides several API functions to get the set data, names, types, itemIds, etc.
-All itemIds of all setIds are included now, and not only 1 itemId (like in the past)
-SetNames for the supported languages come included
-Supported languages so far are: DE, EN, FR
If you want your language to be addded you can contact me via the private message system here on www.esoui.com.
You need to havbe the game client running on this new language and you need to run some debug functions and provide me some data from your SavedVariables afterwards.
-Compatible with sets of API 100027 Elsweyr and 100028 Scalebreaker
Last edited by Baertram : 07/15/19 at 05:14 AM.
Report comment to moderator  
Reply With Quote
Unread 06/18/19, 04:44 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2429
File comments: 2710
Uploads: 57
Originally Posted by kadeer
Originally Posted by code65536
Why are the saved variables not stored machine-wide? It's storing a separate batch of data per server (NA/EU) and per account. Should only have to scan once and store once and have it work for all accounts/servers.
agreed, seems a bit redundant to have more than 1 of the same data, particularly if you have multiple accounts and play on both na and eu

nice library btw
Having different data for the servers is NEEDED as PTS and live could have different sets which would fail the addon to work properly if used on both servers (copy & paste or simlinked).
But I'll change it to use the non-account dependent -> InstallationWide savedvars for sure.
Report comment to moderator  
Reply With Quote
Unread 05/30/19, 12:20 AM  
kadeer
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 39
Uploads: 3
Originally Posted by code65536
Why are the saved variables not stored machine-wide? It's storing a separate batch of data per server (NA/EU) and per account. Should only have to scan once and store once and have it work for all accounts/servers.
agreed, seems a bit redundant to have more than 1 of the same data, particularly if you have multiple accounts and play on both na and eu

nice library btw
Report comment to moderator  
Reply With Quote
Unread 05/20/19, 08:47 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2429
File comments: 2710
Uploads: 57
The global variable was known to me but the account parameter chosen not, thanks for the hint.

Originally Posted by code65536
Oops, didn't notice you had replied.

Yes, as Kyoma said, you can access saved variables directly.

Alternatively, if you want to use the ZOS functions, you can use the final field of ZO_SavedVars:NewAccountWide which lets you specify an account name.

For example, in my addon, I do the following, where I manually set the account name to a string of my choosing--in this case, "$InstallationWide".
Code:
CombatAlerts.vars = ZO_SavedVars:NewAccountWide("CombatAlertsSavedVariables", 1, nil, CombatAlerts.defaults, nil, "$InstallationWide")
Report comment to moderator  
Reply With Quote
Unread 05/20/19, 07:58 AM  
code65536
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 113
Uploads: 18
Oops, didn't notice you had replied.

Yes, as Kyoma said, you can access saved variables directly.

Alternatively, if you want to use the ZOS functions, you can use the final field of ZO_SavedVars:NewAccountWide which lets you specify an account name.

For example, in my addon, I do the following, where I manually set the account name to a string of my choosing--in this case, "$InstallationWide".
Code:
CombatAlerts.vars = ZO_SavedVars:NewAccountWide("CombatAlertsSavedVariables", 1, nil, CombatAlerts.defaults, nil, "$InstallationWide")
Report comment to moderator  
Reply With Quote
Unread 05/15/19, 05:26 AM  
Kyoma
AddOn Author - Click to view AddOns

Forum posts: 96
File comments: 237
Uploads: 10
Originally Posted by Baertram
Originally Posted by code65536
Why are the saved variables not stored machine-wide? It's storing a separate batch of data per server (NA/EU) and per account. Should only have to scan once and store once and have it work for all accounts/servers.
Any problems occuring due to this? The filesize is not that big and I think the scanning doesn't take ages (1-2 Minutes) and is just done once per API change (which will happen every x months only).
-> A newer version will even speed up the scan a lot or rather preload the data without a scan.

The SVs are stored for each server and for each account as I need to differ them for tests on live and PTS and do not want to copy and duplicate my whole SavedVariables folders.

And there is no such option to store it "machine-wide" for all accounts provided by ZOs, so I'm using what is given
Actually that's not true, you can just access it directly. In LoreBooks the miner uses something like that
Code:
## SavedVariables: LBooks_SavedVariables COLLAB DATAMINED_DATA
Then in the code it just accesses COLLAB and DATAMINED_DATA directly as tables.

Code:
LBooks_SavedVariables =
{
    ["Default"] = 
    {
        ["@Kyoma"] = 
        {
            ...
        }
    }
}
COLLAB =
{
...
}
DATAMINED_DATA =
{
...
}
Last edited by Kyoma : 05/15/19 at 05:28 AM.
Report comment to moderator  
Reply With Quote
Unread 05/15/19, 03:37 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2429
File comments: 2710
Uploads: 57
Originally Posted by code65536
Why are the saved variables not stored machine-wide? It's storing a separate batch of data per server (NA/EU) and per account. Should only have to scan once and store once and have it work for all accounts/servers.
Any problems occuring due to this? The filesize is not that big and I think the scanning doesn't take ages (1-2 Minutes) and is just done once per API change (which will happen every x months only).
-> A newer version will even speed up the scan a lot or rather preload the data without a scan.

The SVs are stored for each server and for each account as I need to differ them for tests on live and PTS and do not want to copy and duplicate my whole SavedVariables folders.

And there is no such option to store it "machine-wide" for all accounts provided by ZOs, so I'm using what is given
Last edited by Baertram : 05/15/19 at 03:37 AM.
Report comment to moderator  
Reply With Quote
Unread 05/14/19, 12:28 PM  
code65536
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 113
Uploads: 18
Why are the saved variables not stored machine-wide? It's storing a separate batch of data per server (NA/EU) and per account. Should only have to scan once and store once and have it work for all accounts/servers.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: