WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Best way to determine how many of which tier pieces the player is wearing (https://www.wowinterface.com/forums/showthread.php?t=55940)

Layback_ 12-28-17 10:48 PM

Best way to determine how many of which tier pieces the player is wearing
 
Sorry for continuous spamming :o

Title says pretty much all.

What would be the best way to determine how many of which tier pieces the player is wearing?

Should I create a table with each gears' id and check if the player is wearing that gear or not?

Or is there any possible way to determine if the player's current gear is a tier piece or not?
(doesn't seem like there is a straightforward API for this :confused:)

Tim 12-28-17 11:03 PM

You could scan the tooltips of each item. Maybe search for (#/6) and or (4) Set and then do a required level is 110 check or ilvl check to make sure it's a current expansion tier item.

Ammako 12-28-17 11:04 PM

This may be relevant to your interests.

https://www.mmo-champion.com/threads...ck-hidden-aura

Might not do exactly what you're looking for, but if you are able to understand the code you may be able to adapt it to what you need (also, if that code still works in 7.3.)

Layback_ 12-28-17 11:28 PM

Wow... didn't expect I'd get replies this fast haha :banana:

Will have a go with both suggestions and see which matches well with my need!

Thank you Ammako and Tim!!

Layback_ 12-29-17 02:35 AM

One more question here :p

Would it be possible to get a tier data for each classes without hard coding it?

Not only the one that the player already owns, but in general.

Thank you!

-- EDIT #1

Guess I could use encounter journal APIs :banana:

-- EDIT #2

Ughhhhhh... encounter journal APIs do not seem to provide an ability to check items dropped by each boss :(

Gotta go back to research!!!!!

JDoubleU00 12-29-17 09:51 AM

Quote:

Originally Posted by Layback_ (Post 326284)
One more question here :p

Would it be possible to get a tier data for each classes without hard coding it?

Not only the one that the player already owns, but in general.

Thank you!

-- EDIT #1

Guess I could use encounter journal APIs :banana:

-- EDIT #2

Ughhhhhh... encounter journal APIs do not seem to provide an ability to check items dropped by each boss :(

Gotta go back to research!!!!!

Have you looked at Atlas Loot?

Tim 12-29-17 10:34 AM

Quote:

Originally Posted by Layback_ (Post 326284)
One more question here :p

Would it be possible to get a tier data for each classes without hard coding it?

Not only the one that the player already owns, but in general.

Thank you!

-- EDIT #1

Guess I could use encounter journal APIs :banana:

-- EDIT #2

Ughhhhhh... encounter journal APIs do not seem to provide an ability to check items dropped by each boss :(

Gotta go back to research!!!!!


I really don't think that data is readily available. I'm pretty sure you're going to have to hard code it.

You can definitely get items dropped from each boss from the EJ.
- https://wow.gamepedia.com/World_of_W...rnal_Functions

However, you're still going to have to have some kind of table with gear IDs to check against.


Code:

local name, icon, slot, armorType, itemID, link, encounterID = EJ_GetLootInfoByIndex(index)

Layback_ 12-29-17 05:09 PM

Quote:

Originally Posted by JDoubleU00 (Post 326285)
Have you looked at Atlas Loot?

I did :)

But, Atlas Loot is way too big for me to dig into...

Would need more time to understand how that works :o

Quote:

Originally Posted by Tim (Post 326286)
I really don't think that data is readily available. I'm pretty sure you're going to have to hard code it.

You can definitely get items dropped from each boss from the EJ.
- https://wow.gamepedia.com/World_of_W...rnal_Functions

However, you're still going to have to have some kind of table with gear IDs to check against.


Code:

local name, icon, slot, armorType, itemID, link, encounterID = EJ_GetLootInfoByIndex(index)

Does that function work even if you don't have a drop?

I mean, in order to use EJ_GetLootInfoByIndex(index), this requires to get a number of loots via EJ_GetNumLoot() which then requires EJ_LOOT_DATA_RECIEVED event to be fired :confused:

-- EDIT #1

I think I slightly got it :banana:

Here's what I've done so far.

Lua Code:
  1. local frame = CreateFrame("Frame");
  2. frame:RegisterEvent("PLAYER_LOGIN");
  3. frame:SetScript("OnEvent", function(self, event, ...)
  4.     if not IsAddOnLoaded("Blizzard_EncounterJournal") then
  5.         LoadAddOn("Blizzard_EncounterJournal");
  6.     end
  7.  
  8.     EJ_SelectTier(7);
  9.     EJ_SelectInstance(707);
  10.  
  11.     local i = 1;
  12.     while EJ_GetEncounterInfoByIndex(i) do
  13.         local _, _, encounterID = EJ_GetEncounterInfoByIndex(i);
  14.  
  15.         EJ_SelectEncounter(encounterID);
  16.  
  17.         print(EJ_GetNumLoot());
  18.  
  19.         i = i + 1;
  20.     end
  21. end);

This currently prints a number of loots available from each boss on Vault of the Wardens for player's current specialization.

The next thing would be another while loop after EJ_SelectEncounter(encounterID) for EJ_GetLootInfoByIndex(index) as Tim has pointed!!

-- EDIT #2

I'm an idiot...

Since you can get a number of loots with EJ_GetNumLoot(), you don't need to use another while loop and just use a for loop :p

Layback_ 12-29-17 08:58 PM

Another question!

Does items have different itemID per difficulties???

Kanegasi 12-29-17 09:05 PM

No. It's the same item, Blizzard uses an upgrade system to adjust item levels and the green text under the name. That's what all the numbers mean in the itemString past the itemID. More info here: https://wow.gamepedia.com/ItemString

Layback_ 12-29-17 09:15 PM

Quote:

Originally Posted by Kanegasi (Post 326296)
No. It's the same item, Blizzard uses an upgrade system to adjust item levels and the green text under the name. That's what all the numbers mean in the itemString past the itemID. More info here: https://wow.gamepedia.com/ItemString

This is what I was thinking :D!!

The reason that I asked this is because of the example here. If you see d87's usage example code, he has different tier id sets for each difficulties. Would that be only for old tiers?

Kanegasi 12-29-17 09:38 PM

Yea, most likely different tiers, which would be completely different items.

Ammako 12-29-17 09:47 PM

d87's example is for t15 (ToT), which uses different item IDs per difficulty.
Anything past MoP will be using the same item IDs for every difficulty, just with different bonuses. Keep in mind still, that older tier also tends to have two or three different variations depending on role.

Layback_ 12-30-17 01:30 AM

Quote:

Originally Posted by Kanegasi (Post 326298)
Yea, most likely different tiers, which would be completely different items.

Quote:

Originally Posted by Ammako (Post 326299)
d87's example is for t15 (ToT), which uses different item IDs per difficulty.
Anything past MoP will be using the same item IDs for every difficulty, just with different bonuses. Keep in mind still, that older tier also tends to have two or three different variations depending on role.

Thanks for confirmation :banana:!!


All times are GMT -6. The time now is 08:38 PM.

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