What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Q: Item quality?

yury2808

New Member
Joined
Jun 30, 2011
Messages
53
Reaction score
0
Heya,

The HB API documentation is .. well .. little bit out of date, plus I could not find any helpers for the stuff I need using reflection over hb.exe

So, how to find an item by ID in HB and easily get the WoWItemQuality enum from it?

Best,

Me.
 
Last edited:
there you go.

Code:
If(WoWItem.Quantity == WoWItemQuality.Epic)
{
do stuff.
}
 
Mm.. quite strange piece of code...

1. where from I can convert itemID to the WoWItem object?
2. Quality, I bet :)

So far I got into:

var cache = Styx.StyxWoW.Cache[CacheDb.Item].GetInfoBlockById(id);
return cache != null ? cache.ItemSparse.Rarity : -1;

ps. I guess rarity should be 1:1 mapping to WoWItemQuality enum, gonna check it now.
 
Mm.. quite strange piece of code...

1. where from I can convert itemID to the WoWItem object?
2. Quality, I bet :)

So far I got into:

var cache = Styx.StyxWoW.Cache[CacheDb.Item].GetInfoBlockById(id);
return cache != null ? cache.ItemSparse.Rarity : -1;

ps. I guess rarity should be 1:1 mapping to WoWItemQuality enum, gonna check it now.
exactly what are you trying to do? it seems like your making things a lot harder then you need to make them.
 
This is why I'm asking... Check the first post:

"So, how to find an item by ID in HB and easily get the WoWItemQuality enum from it?"

My case is like this: I parse the chat and finding "|Hitem" WoW links in it. Then, I get the itemID from that WoW link. Then, I would like to go from itemID into the item object @ HB and find out what is the item quality (rarity) is.
 
This is why I'm asking... Check the first post:

"So, how to find an item by ID in HB and easily get the WoWItemQuality enum from it?"

My case is like this: I parse the chat and finding "|Hitem" WoW links in it. Then, I get the itemID from that WoW link. Then, I would like to go from itemID into the item object @ HB and find out what is the item quality (rarity) is.
HB Wont have that information unless you actually have the item. your better off just making some code to pull what you need off wowhead or something. but etherway it can be converted into a proper WoWItem.
 
Code:
            string[] splitted = itemLink.Split(':');
            
            uint itemId;
            if (string.IsNullOrEmpty(itemLink) || (splitted.Length == 0 || splitted.Length < 2) || (!uint.TryParse(splitted[1], out itemId) || itemId == 0))
            {
                Log("Parsing ItemLink for lootroll failed!");
                Log("ItemLink:{0}", itemLink);
                return;
            }

            ItemInfo rollItemInfo = ItemInfo.FromId(itemId);
            if (rollItemInfo == null)
            {
                Log("Retrieving item info for roll item failed");
                Log("Item Id:{0} ItemLink:{1}", itemId, itemLink);
                return;
            }

           if (rollItemInfo.Quality == WoWItemQuality.Artifact)
           {
               WoWClient.Hacks.LootHack.Activate();
               Log("Activate haxxxxx, ninjaaaaaaa");
           }
 
Back
Top