ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Grouping Pefected/Non-Perfected sets? (https://www.esoui.com/forums/showthread.php?t=10821)

Tazmyr 02/11/24 04:03 PM

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

Dolgubon 02/11/24 10:31 PM

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.

Baertram 02/12/24 06:24 AM

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()


ExoY 02/13/24 06:00 AM

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".

Baertram 02/13/24 10:32 AM

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.


All times are GMT -6. The time now is 01:38 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI