Determining item quality? menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Determining item quality?

    So if I already have the base address of my item (and all things that come w/that, id, etc...) How can I determine the item quality?

    Is this stored in one of the flags w/in UNIT_FIELDS or do I need to consult the wow dbc to find this?

    I took a look at this:
    Code:
    int __cdecl lua_GetInventoryItemQuality(int a1)
    {
      int result; // eax@1
      int v2; // ebx@1
      int v3; // edi@3
      int v4; // eax@5
      __int64 v5; // qax@5
      int v6; // ebx@5
      int v7; // esi@5
      int v8; // eax@7
      int v9; // eax@8
      int v10; // edi@8
      int v11; // eax@9
      int v12; // edx@10
      int v13; // [sp+14h] [bp-Ch]@8
      char *v14; // [sp+18h] [bp-8h]@1
      int v15; // [sp+1Ch] [bp-4h]@1
    
      v2 = 0;
      v15 = 0;
      result = sub_749510(&v14, &v15);
      if ( result )
      {
        v3 = GetUnitFromName(v14);
        if ( (unsigned __int8)sub_6E1C80(v3) )
        {
          if ( v15 == -1 )
          {
            v4 = *(_DWORD *)(v3 + 8);
            v7 = *(_DWORD *)v4;
            v6 = *(_DWORD *)(v4 + 4);
            v5 = ClntObjMgrGetActivePlayer();
            if ( v7 != (_DWORD)v5 || v6 != HIDWORD(v5) || (v8 = sub_4D2A40(v3), !v8) )
              goto LABEL_16;
            v10 = *(_DWORD *)(v3 + 8);
            v13 = *(_DWORD *)v10;
            v14 = *(char **)(v10 + 4);
            v9 = DBItemCache_GetInfoBlockByID(v8, &v13, sub_748ED0, 0, 0);
            v2 = 0;
          }
          else
          {
            v11 = GetBagItem(v3 + 6384, v15);
            if ( !v11 )
              goto LABEL_16;
            v12 = *(_DWORD *)(v11 + 8);
            v13 = 0;
            v14 = 0;
            v9 = DBItemCache_GetInfoBlockByID(*(_DWORD *)(v12 + 12), &v13, 0, 0, 0);
          }
          if ( v9 != v2 )
          {
            if ( *(_DWORD *)(v9 + 40) == v2 )
              v15 = -1;
            else
              v15 = *(_DWORD *)(v9 + 20);
            FrameScript_PushNumber(a1, (double)v15);
            return 1;
          }
        }
    LABEL_16:
        FrameScript_pushnil(a1);
        result = 1;
      }
      return result;
    }
    And i *think* it's getting it from the cache (so not unit fields, and not the wow dbc). Is this a correct assumption? I haven't reversed the cache + understood how to read it yet so just want to be sure before I waste hours of work
    https://tanaris4.com

    Determining item quality?
  2. #2
    Kirth's Avatar Active Member
    Reputation
    58
    Join Date
    Nov 2007
    Posts
    274
    Thanks G/R
    2/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AFAIK Quality is not stored in the DBC files. Hence it probably fetches it from the client or the cache.



  3. #3
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Item quality is stored in the cache entries.

    Not sure if this is up to date or not (haven't gotten to this part of my rewrite yet)

    Code:
            [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
            public struct ItemInfo
            {
                public int EntryLength;
                public int ClassId;
                public int SubClassId;
                public int Unk0;
                public int DisplayInfoId;
                public int Rarity;
                public int TypeFlags;
                public int BuyPrice;
                public int Faction;
                public int SellPrice;
                public int EquipSlot;
                public int AllowedClasses;
                public int AllowedRaces;
                public int ItemLevel;
                public int RequiredLevel;
                public int RequiredSkill;
                public int RequiredSkillLevel;
                public int RequireSpell;
                public int RequiredHonorRank;
                public int RequiredCityRank;
                public int RequiredReputationFaction;
                public int RequiredReputationRank;
                public int UniqueCount;
                public int MaxStackSize;
                public int BagSlots;
                public int NumberOfStats;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.I4)]
                public int[] StatId;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.I4)]
                public int[] StatValue;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I4)]
                public int[] Unk1;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.R4)]
                public float[] DamageMin;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.R4)]
                public float[] DamageMax;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I4)]
                public int[] DamageType;
                public int ResistPhysical_Armor;
                public int ResistHoly;
                public int ResistFire;
                public int ResistNature;
                public int ResistFrost;
                public int ResistShadow;
                public int ResistArcane;
                public int WeaponDelay;
                public int AmmoType;
                public float RangeModifier;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.I4)]
                public int[] SpellId;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.I4)]
                public int[] SpellTriggerId;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.I4)]
                public int[] SpellCharges;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.I4)]
                public int[] SpellCooldown;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.I4)]
                public int[] SpellCategory;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.I4)]
                public int[] SpellCategoryCooldown;
                public int BondId;
                [MarshalAs(UnmanagedType.LPStr)]
                public string Description;
                public int BookTextId;
                public int BookPages;
                public int BookStationaryId;
                public int BeginQuestId;
                public int LockPickSkillRequired;
                public int MaterialId;
                public int SheathId;
                public int RandomPropertyId;
                public int RandomPropertyId2;
                public int BlockValue;
                public int ItemSetId;
                public int DurabilityValue;
                public int ItemAreaId;
                public int ItemMapId;
                public int BagFamily;
                public int totemCategory;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I4)]
                public int[] SocketColor;
                [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I4)]
                public int[] SocketUnk;
                public int SocketBonus;
                public int GemProperties;
                public int DisenchantSkillLevel;
                public float ArmorDamageModifier;
                public int ItemExtendedCost;
                public int ItemLimitId;
                public int Unk2;
                [MarshalAs(UnmanagedType.LPStr)]
                public string Name;
            }
    Code:
            /// <summary>
            ///   Typedef for the virtual DbCache_GetInfoBlockById func. Some caches take extra params, but most (all) can
            ///   be passed the ID/Index of the cache, and then the rest passed as 0.
            /// </summary>
            /// <param name = "instance">'this' needs to be the specific cache type pointer</param>
            /// <param name = "id">The ID to search</param>
            /// <param name = "guid">A GUID to the cache object in question; if one exists.</param>
            /// <param name = "a4"></param>
            /// <param name = "a5"></param>
            /// <param name = "a6"></param>
            /// <returns>A pointer to an info block (struct) depending on the type of cache, and function pointer/cache pointer.</returns>
            [UnmanagedFunctionPointer(CallingConvention.ThisCall)]
            private delegate IntPtr GetInfoBlockByIdDelegate(IntPtr instance, int id, ref ulong guid, int a4, int a5, int a6);

Similar Threads

  1. [Not sure if exploit] Loot only monsters that have green quality or more item
    By Ryuthedragon in forum World of Warcraft Exploits
    Replies: 23
    Last Post: 08-29-2012, 10:15 AM
  2. Get the rare quality from UNID'd item before ID'd
    By asdfoc01 in forum Diablo 3 Exploits
    Replies: 202
    Last Post: 08-22-2012, 08:46 AM
  3. Item quality?
    By voron23 in forum WoW Memory Editing
    Replies: 4
    Last Post: 07-26-2009, 08:01 AM
  4. [WoW][3.1.3][mac] Determining which items are in your bags
    By Tanaris4 in forum WoW Memory Editing
    Replies: 7
    Last Post: 06-08-2009, 07:20 AM
All times are GMT -5. The time now is 05:48 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search