Thread Tools Display Modes
12-16-17, 10:14 PM   #1
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Relic tier information

Is there a way to get tier information without being at the crucible forge?

Basically what I'm trying to do is get the additional item level bonuses.

Code:
C_ArtifactUI.GetItemLevelIncreaseProvidedByRelic
Only provides the non-crucible item level increases.


Code:
local SCANNER = CreateFrame("GameTooltip", "TooltipScanner", nil, "GameTooltipTemplate")
local relicLink = select(4, C_ArtifactUI.GetEquippedArtifactRelicInfo(1))

SCANNER:SetOwner(UIParent, "ANCHOR_NONE")
SCANNER:SetHyperlink(relicLink)

for i = 1, SCANNER:NumLines() do
   local line = _G[SCANNER:GetName().."TextLeft"..i]:GetText()
   print("Line "..i..":", line)
end
I've tried doing a tooltip scan but, iterating through all the lines it only returns the relics basic information.
  Reply With Quote
12-16-17, 11:39 PM   #2
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
I'm guessing what you want to do, is capture the extra +5 item levels you get by selecting the first tier from the crucible?

If that is what you are trying to do, C_ArtifactUI.GetRelicSlotRankInfo(relicSlotIndex) can kind of sort of give you what you want indirectly. The first return of that call gives you the number of ranks you purchased from the crucible, so basically if the first return shows a 1, 2 or 3, you can conclude that you are getting the extra +5 from the relic.

So I would suggest grabbing the base ilvl using C_ArtifactUI.GetItemLevelIncreaseProvidedByRelic(), then doing a check on the first return of C_ArtifactUI.GetRelicSlotRankInfo(relicSlotIndex) to see if it is greater or equal to 1, and if it does then you can just +5 to the return from the first ilvl lookup.
__________________
My Addons: Convert Ratings Honor Track
  Reply With Quote
12-17-17, 12:21 AM   #3
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Yeah that's what I'm trying to do, grab the +5 item levels line.

However, what you said I already tried which is why I said grab the info without being at the forge / having artifact window open as that's the only time that information is available.

With that all in mind I just remembered about forcing the artifact window open through SocketInventoryItem(16) and then with a quick google search I found my solution.

Code:
UIParent:UnregisterEvent("ARTIFACT_UPDATE")
SocketInventoryItem(16)

for i = 1, C_ArtifactUI.GetNumRelicSlots() do

   local isLocked = C_ArtifactUI.GetRelicLockedReason(i)
   if isLocked then C_ArtifactUI.Clear() end

   local name = C_ArtifactUI.GetRelicInfo(i)
   local rank = C_ArtifactUI.GetRelicSlotRankInfo(i)

   print("Relic ["..i.."] = "..name..", Rank ["..rank.."]")

end

C_ArtifactUI.Clear()
UIParent:RegisterEvent("ARTIFACT_UPDATE")
  Reply With Quote
12-17-17, 01:06 AM   #4
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Well still running into an issue...

Code:
local rank = C_ArtifactUI.GetRelicSlotRankInfo(1)
This will show rank 1 even if the 1st passive wasn't taken in the crucible so... have to figure out a way to determine if the 1st passive was taken in the crucible.
  Reply With Quote
12-17-17, 08:40 AM   #5
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
Okay, try this:

Grab the second return of C_ArtifactUI.GetRelicSlotRankInfo(1) also. The second return is a true/false boolean that lets you know if you can purchase the different tiers at the crucible.

If the first return is 1 and the second return is true, then the relic has not yet be given the bonus +5 ilvls, add that check to your code also and you should be good.

I just tested the output of the call on a character that I had yet to visit the crucible on and the second return on a rank 1 relic going from true to false after taking the passive at the forge does happen.

I was not able to test to see if the user had a high enough artifact weapon with more than one relic tier available and none of them being chosen, so you may run into a slight issue if you are socketing a new relic with enough points to immediately unlock more than 1 tier, but I'm not sure. That would require more testing that I can not do. For example, I'm not sure how the outputs progress when you socket a fresh relic. When you first put in a new relic into slot 1 on a say level 70 artifact, does the first output return 1 or 3?
__________________
My Addons: Convert Ratings Honor Track

Last edited by briskman3000 : 12-17-17 at 08:50 AM.
  Reply With Quote
12-17-17, 05:12 PM   #6
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
I did have the 2nd return value before but, really didn't know what it was telling me so I removed it. Thanks for explaining. I can't check fresh relics atm as I don't have any on my toon that has the crucible unlocked and there's no relic rewards for the specs I don't use atm so, I'll have to do further testing next time one's available.

Thanks again.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Relic tier information

Thread Tools
Display Modes

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