Thread Tools Display Modes
12-28-17, 10:48 PM   #1
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Best way to determine how many of which tier pieces the player is wearing

Sorry for continuous spamming

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 )

Last edited by Layback_ : 12-28-17 at 10:52 PM.
  Reply With Quote
12-28-17, 11:03 PM   #2
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
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.
  Reply With Quote
12-28-17, 11:04 PM   #3
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
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.)
  Reply With Quote
12-28-17, 11:28 PM   #4
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Wow... didn't expect I'd get replies this fast haha

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

Thank you Ammako and Tim!!
  Reply With Quote
12-29-17, 02:35 AM   #5
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
One more question here

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

-- 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!!!!!

Last edited by Layback_ : 12-29-17 at 04:57 AM.
  Reply With Quote
12-29-17, 09:51 AM   #6
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
Originally Posted by Layback_ View Post
One more question here

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

-- 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?
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
12-29-17, 10:34 AM   #7
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Originally Posted by Layback_ View Post
One more question here

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

-- 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)
  Reply With Quote
12-29-17, 05:09 PM   #8
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by JDoubleU00 View Post
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

Originally Posted by Tim View Post
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

-- EDIT #1

I think I slightly got it

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

Last edited by Layback_ : 12-29-17 at 08:59 PM.
  Reply With Quote
12-29-17, 08:58 PM   #9
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Another question!

Does items have different itemID per difficulties???
  Reply With Quote
12-29-17, 09:05 PM   #10
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
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
  Reply With Quote
12-29-17, 09:15 PM   #11
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by Kanegasi View Post
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 !!

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?

Last edited by Layback_ : 12-29-17 at 09:29 PM.
  Reply With Quote
12-29-17, 09:38 PM   #12
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Yea, most likely different tiers, which would be completely different items.
  Reply With Quote
12-29-17, 09:47 PM   #13
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
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.

Last edited by Ammako : 12-29-17 at 09:53 PM.
  Reply With Quote
12-30-17, 01:30 AM   #14
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by Kanegasi View Post
Yea, most likely different tiers, which would be completely different items.
Originally Posted by Ammako View Post
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 !!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Best way to determine how many of which tier pieces the player is wearing

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