Hekili Priority Helper

Hekili Priority Helper

44M Downloads

Hekili_GetRecommendedAbility not returning a valid ID for Trinkets

Snoogey opened this issue · 9 comments

commented

Describe the Bug/Issue
When calling Hekili_GetRecommendedAbility, it doesn't provide a valid ID for trinkets.
For instance, Sinful Aspirant's Badge of Ferocity returns -166, while Macabre Sheet Music returns -215.

To Reproduce
Steps to reproduce the behavior:
/dump Hekili_GetRecommendedAbility("Primary",1)

Expected behavior
I was expecting the trinket's to return their ID as presentend in the Trinkets.lua.

Screenshots
N/A

PUT ISSUE REPORT LINK HERE:
https://pastebin.com/Sudfrjup

2.  If reporting a disagreement with the addon's recommendations, please take a snapshot when you observe the issue and provide the snapshot.  This is not a screenshot.  A snapshot can be generated by binding the Pause feature on the Toggles tab.  When you press Pause, a snapshot of how the addon decided on its CURRENT recommendations is generated and saved to the Snapshots tab.  Copy and paste this to pastebin.com and provide the link here.
 
PUT SNAPSHOT LINK HERE:
https://pastebin.com/d2i3WvzR

commented

For e.g Macabre Sheet Music I would expect to get back 184024, which I assume is the itemID.
I also assume these are unique and don’t conflict with a spell ID, so returning it shouldn’t be an issue, right?

The purpose is essentially me fetching this information into another addon and translating the ID into a string (I.e of the Ability/Spell/Item attached to said ID) to see what Hekili has suggested and if it aligns with what another addon is suggesting, essentially putting them head to head to find out what the discrepancies are between them after e.g a dungeon run.

commented

I also assume these are unique and don’t conflict with a spell ID, so returning it shouldn’t be an issue, right?

That is not a safe assumption.

commented

I’m not sure how I could verify that, so in that case there’s not much that can be done.
What are the current returned values based on, like -215 for Macabre Sheet Music?

commented

-215 is a unique ID created for addon purposes.

commented

-215 is a unique ID created for addon purposes.

Do all the trinkets have unique IDs assigned, or was it merely a coincidence that the two I tried were unique?

commented

All items and "fake" actions (like call_action_list, variable, etc.) have auto-generated negative IDs.

commented

All items and "fake" actions (like call_action_list, variable, etc.) have auto-generated negative IDs.

Ok, thanks a lot for all the responses mate, I appreciate it. I will close this here as we cannot proceed with the suggestion from my side which turns out to not be a bug.
Thank you! :)

commented

You could make use of this information, regardless.

local id = Hekili_GetRecommendedAbility( "Primary" )
local isItem = false

if id < 0 then
    local ability = Hekili.Class.abilities[ id ]

    if ability and ability.item then
        isItem = true
        id = ability.item
    end
end

-- if isItem == true, id is an item ID.
-- if isItem == false, id is a spell ID.
-- do whatever else you were gonna do.
commented

Which spell ID would you expect to get back for items?

I could provide the item ID, but then I'd have to give you a way to differentiate the item ID from a spell ID.

I could provide the ID of the item's spell, but that may or may not be as useful as you need. What's your use case?