GameBalance ItemTypes.gam File
This section discusses the "\GameBalance\ItemTypes.gam" file in the "CoreData.mpq" file. MPQ Patches to this file are located in the "base" subdirectory of the Diablo 3 "MPQs" directory. Please see the MPQs section for general MPQ information and basic information about how GameBalance (*.gam) files are encoded.
ItemTypes Structure
The ItemTypes structure size is 0x140 bytes. Here are the details of this structure:
| struct ItemType | // sizeof 0x140 | |
| { | ||
| 0x000 | DWord unused1; | // always 0x00000000 (probably the runtime vtbl_ptr) |
| 0x004 | DWord itemTypeName[256]; | // non-NLS key name of the item type |
| 0x104 | DWord parentHash; | // hash of the parent item type |
| 0x108 | DWord unused2; | // always 0x00000000 |
| 0x10C | DWord classMask; | // class mask |
| 0x110 | DWord slot1; | // item slot 1 |
| 0x114 | DWord slot2; | // item slot 2 |
| 0x118 | DWord slot3; | // item slot 3 |
| 0x11C | DWord slot4; | // item slot 4 |
| 0x120 | DWord unused3[3]; | // always 0x00000000 |
| 0x12C | DWord affixGroupHash; | // affix group hash |
| 0x130 | DWord bitMask1; | // bit mask 1 |
| 0x134 | DWord bitMask2; | // bit mask 2 |
| 0x138 | DWord bitMask3; | // bit mask 3 |
| 0x13C | DWord bitMask4; | // bit mask 4 |
| } |
Additional ItemTypes Details
0x104: This DWord is the string hash of the parent. Please refer to the String Hashing guide for complete details on string hashing. This value is 0xFFFFFFFF for "root" item types such as "Weapon" and "Armor". All of the item types are defined with hierarchical relationships. Here is a snippet of the "Armor" tree:
| Item Type | Hash | Parent Hash |
|---|---|---|
| Armor | 071BAA81 | FFFFFFFF |
| ChestArmor | C2B86318 | 071BAA81 |
| GenericChestArmor | 315FC915 | C2B86318 |
| Cloak (DH only) | 073C97EA | C2B86318 |
0x10C: The classMask indicates which classes can use a given item type. The "FollowerSpecial" items (e.g., "TemplarRelic") have a classMask of 0x00002F02; the 0x2F00 would seem to inidicate that these items can be used by players, but I doubt this is the case. Perhaps the classMask does not apply to all item types. The masks for the five player classes are shown below. For example, a "Staff" has a classMask of 0x2600 which means that it can be used by a Wizard, a Witch Doctor, or a Monk.
- 0100 (bit 08): Barbarian
- 0200 (bit 09): Wizard
- 0400 (bit 10): Witch Doctor
- 0800 (bit 11): Demon Hunter
- 2000 (bit 13): Monk
The classMask is also used for other item type information as well. For example,
- 0001 (bit 00): set for most non-equipable item types
- 0002 (bit 01): set if the item is at least Magical (also applies to attuned Runes)
- 0008 (bit 03): set for Gems
- 0040 (bit 06): set for most non-equipable item types
- 0080 (bit 07): set for Socketable
- 1000 (bit 12): set for Elixir, some Potions, some Vials, and Calldown
0x110, 0x114, 0x118, 0x11C: These four DWords indicate the equipment slots that the item type can occupy. This includes the slots for Followers. Note that the Follower values were changed by 1 in Beta Patch 8296, and again in Patch 8610
- Character
- 03: Off-Hand
- 04: Main-Hand
- 01: Head
- 02: Torso
- 05: Hands
- 06: Belt
- 07: Feet
- 08: Shoulders
- 09: Legs
- 0A: Wrists
- 0B: Finger (1)
- 0C: Finger (2)
- 0D: Neck
- Follower
- 15: Off-Hand
- 16: Main-Hand
- 17: Follower Special
- 19: Finger (1)
- 1A: Finger (2)
- 18: Neck
0x12C: The affixGroupHash only seems to be used for item types that have a specific affix associated with them. See the hashing section for details on string hashing. For example, all Wizard Orbs have a "WizardD" affix; this affix "Adds X% More Damage to Wizards Only".
0x130, 0x134, 0x138, 0x13C: These four DWords are the bit masks that correspond to various attributes of an item including the item type, and whether it is a one or two-handed item. Together, these four fields provide 128 bits of mask. A few examples that use the bitMask1 field are shown below. These bitMask fields were also used in the "Treasure Class" files (which determine how loot is generated when a given mob is killed). Unfortunately, these files were removed from the Beta client as of version 7447 (since all loot is generated on the server).
- 0208: Axe -- The 0200 corresponds to 1-H, and the 0008 corresponds to an Axe
- 0408: Axe (2H) -- The 0400 corresponds to 2-H, and the 0008 corresponds to an Axe
- 0210: Sword -- The 0200 corresponds to 1-H, and the 0010 corresponds to a Sword
- 0410: Sword (2H) -- The 0400 corresponds to 2-H, and the 0010 corresponds to a Sword
- 0280: Dagger -- The 0200 corresponds to 1-H, and the 0080 corresponds to a Dagger
- 0500: Polearm (2H) -- The 0400 corresponds to 2-H, and the 0100 corresponds to a Polearm
I will be discussing the item files in more detail in an upcoming section.
In the coming week, I will be posting a full list of affixes, their mods, and the value ranges for each one.
