WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (http://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Current maximum Artifact power (http://www.wowinterface.com/forums/showthread.php?t=55608)

yoshimo 07-29-17 04:29 AM

Current maximum Artifact power
 
I want to avoid showing a button to use Artifact power items when the character is capped and all that would happen after the cast is the red error "your artifact has maximum power".
The question is how to do this?
I could go for ranks purchased/learned from GetArtifactInfo, QuestCheck (maybe attack on the broken shore by Khadgar?), but i am unsure if this would be dynamic enough compared across classes.

lightspark 07-29-17 04:41 AM

Quote:

Originally Posted by yoshimo (Post 324418)
I want to avoid showing a button to use Artifact power items when the character is capped and all that would happen after the cast is the red error "your artifact has maximum power".
The question is how to do this?
I could go for ranks purchased/learned from GetArtifactInfo, QuestCheck (maybe attack on the broken shore by Khadgar?), but i am unsure if this would be dynamic enough compared across classes.

Eh? It's kinda impossible to hit the cap. Why don't you just empower your artefact?

-- edit #1

The only dynamic aspect of this thingy is artefact empowerment quest, IIRC, it's different for each spec, so I'd just check if this quest was completed, if not, I'd check if artefact had all 54 traits, if yes, I'd disable the button.

yoshimo 07-29-17 06:56 AM

Do all artifacts have the exact same amount of treats except maybe the fishing pole?
It is possible to hit that error, now if you don't do broken shore, later in the game maybe completely

lightspark 07-29-17 08:19 AM

Quote:

Originally Posted by yoshimo (Post 324423)
Do all artifacts have the exact same amount of treats except maybe the fishing pole?
It is possible to hit that error, now if you don't do broken shore, later in the game maybe completely

Yes, all artefacts have the same number of traits and amount of AP that's required to purchase all traits.

Kanegasi 07-29-17 11:31 AM

Maximum AP a 7.2 weapon can hold is 865,842,644,766,330. The final 50th rank of Concordance costs exactly 200 trillion. It is literally impossible for anyone to reach that point, at least now on live servers. We're getting more AK in 7.3, so new calculations for farming will be needed. If you would like to treat the first rank of Concordance as the max (which is 52 traits purchased), total AP at that point is 2,228,766,330 with the 52nd trait costing 520,000,000.

CC_WOW 08-01-17 04:10 PM

I have this exact functionality in my addon (assuming you are talking about non-empowered artifacts only). You can simply use the "artifact tier" available through the regular Artifact API in combination with the number of purchased traits (54 for tier 1, unlimited for tier 2 as mentioned by others).

Tier = 1 means it hasn't been empowered, tier = 2 is what you get after completing the quest. Presumably, the new ranks are going to turn it into a tier 3 artifact in future patches.

yoshimo 08-08-17 01:07 PM

Code:

print("--")
local a=C_ArtifactUI.GetPowers()
--print(a[18])

local data = C_ArtifactUI.GetPowerInfo(a[18]);

print(data.isFinal)

for i, j in pairs( C_ArtifactUI.GetPowerInfo(a[18]) ) do
  --  print(i,j)
end
if C_ArtifactUI.GetPowerInfo(a[18]).maxRank > 1 then
  print('Not unlocked')
end

Was quite intresting in ArtifactPowerHelper.
Now (as asked there), i am looking for the trigger that tells items apart that can be used with the empowered Weapon and those items that are "too old and weak" and will trigger the "your weapon is too powerful" barrier.
Is it encoded in the itemlink like the AK multiplier maybe?

myrroddin 10-22-17 02:10 AM

Sorry for the thread necro, but it seemed appropriate.

What I'd like to do is get the currently equipped weapon's spent AP and the AP for the next level. For my weapon, it would be 20,021,044,100 and 45.1 billion (although I need the exact number).

The reason I need the exact numbers for both is that I want to divide currentAP by nextRankAP so I can get it into a 0-1 range. I have been looking at the FrameXML code to see what's there, but something is eluding me.

What I have is thus:
Lua Code:
  1. local _, _, _, _, totalAP, pointsSpent, _, _, _, _, _, _, artifactTier = C_ArtifactUI.GetEquippedArtifactInfo()
  2. local _, ap, apForNextPoint = MainMenuBar_GetNumArtifactTraitsPurchasableFromXP(pointsSpent, totalAP, artifactTier)
However, I am getting a nil error for artifactAP (Blizzard defines it as artifactXP, but that's nonsense! :p ).
Lua Code:
  1. 16x FrameXML\MainMenuBar.lua:126: attempt to compare number with nil
  2. FrameXML\MainMenuBar.lua:126: in function `MainMenuBar_GetNumArtifactTraitsPurchasableFromXP'
  3. ElvUI_ProgressiveDataBarsColors\Artifact.lua:15: in function <ElvUI_ProgressiveDataBarsColors\Artifact.lua:5>
  4. (tail call): ?
  5. [C]: in function `UpdateArtifact'
  6. ElvUI_ProgressiveDataBarsColors\Artifact.lua:37: in function `HookArtifactBar'
  7. ...faceElvUI_ProgressiveDataBarsColors\Core.lua:64: in function `EnableDisable'
  8. ...faceElvUI_ProgressiveDataBarsColors\Core.lua:44: in function `Initialize'
  9. ...faceElvUI_ProgressiveDataBarsColors\Core.lua:38: in function <...faceElvUI_ProgressiveDataBarsColors\Core.lua:37>
  10. ...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:155: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:155>
  11. [string "safecall Dispatcher[1]"]:4: in function <[string "safecall Dispatcher[1]"]:4>
  12. [C]: ?
  13. [string "safecall Dispatcher[1]"]:13: in function `?'
  14. ...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:90: in function `Fire'
  15. ElvUI\core\core.lua:1299: in function `InitializeModules'
  16. ElvUI\core\core.lua:1467: in function `Initialize'
  17. ElvUI\init.lua:139: in function <ElvUI\init.lua:138>
  18.  
  19. Locals:
  20. pointsSpent = 68
  21. artifactXP = nil
  22. artifactTier = 2
  23. numPoints = 0
  24. xpForNextPoint = 45104000000
  25. (*temporary) = 68
  26. (*temporary) = 2
  27. (*temporary) = 45104000000
  28. (*temporary) = "attempt to compare number with nil"

Yukyuk 10-22-17 02:44 AM

There is a new addon, TotalAP, maybe in that code you can find what you want.
Looks like the solution is in there.

myrroddin 10-22-17 03:35 AM

Cool, I will check out its code.

myrroddin 10-22-17 04:53 AM

Huzzah!
Lua Code:
  1. local current = select(5, C_ArtifactUI.GetEquippedArtifactInfo())
  2. local numTraits = select(6, C_ArtifactUI.GetEquippedArtifactInfo())
  3. local tier = select(13, C_ArtifactUI.GetEquippedArtifactInfo())
  4. local nextCost = C_ArtifactUI.GetCostForPointAtRank(numTraits, tier)

Yukyuk 10-22-17 10:50 PM

These forums work :)

Quote:

Originally Posted by myrroddin (Post 325626)
Huzzah!
Lua Code:
  1. local current = select(5, C_ArtifactUI.GetEquippedArtifactInfo())
  2. local numTraits = select(6, C_ArtifactUI.GetEquippedArtifactInfo())
  3. local tier = select(13, C_ArtifactUI.GetEquippedArtifactInfo())
  4. local nextCost = C_ArtifactUI.GetCostForPointAtRank(numTraits, tier)



All times are GMT -6. The time now is 01:44 PM.

vBulletin © 2018, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI