1. #1
    Deleted

    Lua: How do I get each equipped gear's item level?

    Hi, I have a problem. I can get the item level for each equipped piece of gear on my character and print it using the itemID. However the itemID only takes into consideration the actual item in the database and not the one on my character which might be of a higher difficultly (heroic/mythic etc..) so it may have higher item level.

    So for each piece of gear it tells me the item level is 655 for example when actually it is 685 because it is Mythic.

    I have no clue what API function I need to be using to get the stats of a piece of gear on my character to find out its actual item level. Does anyone have any idea on this?

    Thank you for reading!

    - - - Updated - - -

    Never mind I fixed it
    Last edited by mmoc2c0e080e79; 2015-03-26 at 08:03 PM.

  2. #2
    Please post some information about the solution, so that other people with the same problem can benefit from what you learned.

  3. #3
    Deleted
    Quote Originally Posted by SlippyCheeze View Post
    Please post some information about the solution, so that other people with the same problem can benefit from what you learned.
    Sure!

    This is what I made after learning how to do it:


    Basically you need to use the item Link and NOT the item ID. If you use the link, it contains the hyperlink full of information which tells the program what enchants, gems, and raid difficulty the actual item has rather than just using the item ID which just gets the basic, generic item from the database.

    Here is the solution:

    Code:
    local slotID = GetInventorySlotInfo(slotName)
    local itemLink = GetInventoryItemLink("player", slotID)
    local _, _, _, ilvl = GetItemInfo(itemLink)
    where slotName is just each one of these with "Slot" concatenated at the end of the String:
    Code:
    local slots = {"Head", "Neck", "Shoulder", "Back", "Chest", "Shirt", "Tabard", "Wrist", "Waist", "Legs", "Feet", "Hands", "Finger0", "Finger1", "Trinket0", "Trinket1", "MainHand", "SecondaryHand"}
    Happy programming!

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •