Thread Tools Display Modes
02/11/24, 04:03 PM   #1
Tazmyr
AddOn Author - Click to view addons
Join Date: Aug 2020
Posts: 8
Grouping Pefected/Non-Perfected sets?

I believe the function GetItemLinkSetInfo() can retrieve a set name, but perfected and non-perfected sets are separate. Is there another function that sees perfected and non-perfected sets within the same set as one? Or would we need to find both, and parse out the Perfected part?
TIA
  Reply With Quote
02/11/24, 10:31 PM   #2
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 409
GetItemLinkSetInfo(string itemLink, boolean equipped)
* Returns: boolean hasSet, string setName, number numBonuses, number numNormalEquipped, number maxEquipped, number setId, number numPerfectedEquipped

Note the parameters numNormalEquipped and numPerfectedEquipped. So the function actually already does distinguish between normal and perfected.
  Reply With Quote
02/12/24, 06:24 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
If you do not wear any of the set items though it does not help.

If you want I can add something to LibSets that returns the setId of unperfected and perfected sets that belong together, as a table with maybe key = dunfeons zoneId (if that's the same for both).

But that's manual lookup tables, nothing in the API tells you what belongs together. One could maybe detect the same dungeon as drop zone, if the zoneIds for normal and vet do not differ, that's all afaik.

You can use GetItemLinkSetInfo(itemLink) to get the setId and via LibSets's API functions
(See here: https://www.esoui.com/downloads/info...xcelsheet.html -> Scroll down to "For developers")
return the itemIds, names, and now the IsPerfectedSet boolean info too.

Edit:
I've added some data to LibSets (Current test version can be found here:
https://github.com/Baertram/LibSets/tree/PTS


) which can connect the non perfected and perfected setIds and also added some API functions for that:

Code:
-Added API functions to determine non-/perfected setIds of the belonging setId (lookup tables like lib.perfectedSetsInfo
will be build "on usage of the API functions" so they are NOT always filled!!! Only use the API functions to properly access EACH LibSets data!!!):


--Returns boolean if the setId provided is a perfected or non perfected set from e.g. an Arena, Trial, etc.
--> Parameters: setId number: The set's setId
--> Returns:    boolean isAPerfectedOrNonPerfectedSetId
function lib.IsAPerfectedOrNonPerfectedSetId(setId)


--Returns true if the setId provided is a perfected set from e.g. an Arena, Trial, etc.
--> Parameters: setId number: The set's setId
--> Returns:    boolean isPerfectedSet
function lib.IsPerfectedSet(setId)

--Returns true if the setId provided is a non-perfected set from e.g. an Arena, Trial, etc.
--> Parameters: setId number: The set's setId
--> Returns:    boolean isNonPerfectedSet
function lib.IsNonPerfectedSet(setId)


--Returns table perfectedSetInfo about the setId provided if it's a perfected set, or a non perfected set
--> Parameters: setId number: The set's setId (non perfected or perfected)
---> Attention: Table returned is nil if setId provided is neither a perfected nor a non perfected set
--> Returns:    nilable:table perfectedSetInfo = {
-->                 nilable:boolean isPerfectedSet,
-->
-->                 nilable:number  nonPerfectedSetId=<setIdOfNonPerfectedSet>,
-->                 nilable:number  nonPerfectedSetZoneId=<zoneIdOfNonPerfectedSet>,
-->
-->                 nilable:number  perfectedSetId=<setIdOfPerfectedSet>,
-->                 nilable:number  perfectedSetZoneId=<zoneIdOfPerfectedSet>,
-->             }
function lib.GetPerfectedSetInfo(setId)


--Returns perfectedSetId and perfectedSetZoneId of the non perfected setId provided.
--Returned value will be nil if nonPerfectedSetId is no set with a matching perfected setId
--> Parameters: nonPerfectedSetId number: The set's setId
--> Returns:    nilable:number perfectedSetId
-->             nilable:number perfectedSetZoneId
function lib.GetPerfectedSetId(nonPerfectedSetId)


--Returns nonPerfectedSetId and nonPerfectedSetZoneId of the non perfected setId provided.
--Returned value will be nil if perfectedSetId is no set with a matching non perfected setId
--> Parameters: perfectedSetId number: The set's setId
--> Returns:    nilable:number nonPerfectedSetId
-->             nilable:number nonPerfectedSetZoneId
function lib.GetPerfectedSetId(perfectedSetId)


--Returns table with key = index and value = setId of perfected sets
function lib.GetAllPerfectedSetIds()


--Returns table with key = index and value = setId of nonPerfected sets
function lib.GetAllNonPerfectedSetIds()

Last edited by Baertram : 02/13/24 at 05:26 AM.
  Reply With Quote
02/13/24, 06:00 AM   #4
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 88
I have to double check but I think there is already. Function provided by zos to map set I'd of normal and perfected sets together.

Edit:

I kinda remembered correctly. There already exists the function "GetItemSetUnperfectedSetId(*setId*)".

I use it in my "LibSetDetection".

If you provide it with a setId of a perfected set, it will provide the Id of the normal version. Otherwise it returns "0".

Last edited by ExoY : 02/13/24 at 06:07 AM.
  Reply With Quote
02/13/24, 10:32 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Oh I missed that one, thanks ExoY!
I can use that as I'm scanning the set's itemIds, to detect the mapping.

And build the lookup tables dynamically that way on each update.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Grouping Pefected/Non-Perfected sets?


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