D3Inferno

GameBalance Items*.gam Files

This section discusses the "\GameBalance\Items*.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.

Item Structure

In Beta version 8815, this structure size was increased to 0x5F0 (up from 0x5D0 since patch 7728). A new DWord was also added after "cLvl"; the values also look like some kind of level. It's hard to know which levels correspond to what. The "unknown10A" array was increased by one DWord. These unknown structures are used when items are populated in-memory. The "unknown14" area at the end of the structure is now 7 DWords.

In Beta version 7728, this structure size was increased to 0x5D0 (up from 0x5B0 since patch 7318). The extra 0x20 bytes were added at the end. Also, weapons no longer have ModCodes that alter the min/max damage range; instead this capability has been moved to two new float values located at offsets 0x328 and 0x32C.

This Item structure is used for all the items (weapons, armor, potions, etc). The same structure is used for items of all rarities (common, magic, etc).

struct Item// sizeof 0x5F0
{
0x000DWord unknown1;// always 0x00000000
0x000DWord itemName[256];// non-NLS key name of the item
0x104DWord actorId;// Actor MPQ Id
0x108DWord itemTypeHash;// hash of the ItemType
0x10CDWord unknown2;// possibly related to Act level
0x110DWord unknown3;// ???
0x114DWord iLevel;// item level
0x118DWord unknown4;// ???
0x11CDWord unknown5;// ???
0x120DWord numRandomAffixes;// number of random affixes
0x124DWord numSockets;// number of sockets the item can have
0x128DWord stackSize;// stack size
0x12CDWord goldPrice;// gold buy price (sell price is 15% of buy)
0x130DWord unknown6;// related to level?
0x134DWord cLevel;// character level required to use the item
0x138DWord unknown15;// related to level?
0x13CDWord durabilityMin;// min durability
0x140DWord durabilityMax;// max durability (offset from min)
0x144DWord baseItemHash;// hash of the base item
0x148DWord setItemBonuses;// set item bonuses
0x14CDWord salvageCommon;// salvage common TreasureClass
0x150DWord salvageMagic;// salvage magic TreasureClass
0x154DWord salvageRare;// salvage rare TreasureClass
0x158DWord rareGroupPrefixId;// MPQ Id of RareNameStrings_Prefix_*.stl file
0x15CDWord rareGroupSuffixId;// MPQ Id of RareNameStrings_Suffix_*.stl file
0x160DWord unknown7[26];// ???
0x1C8float minDamage;// weapon min damage
0x1CCfloat maxDamage;// weapon max damage (offset from min)
0x1D0DWord unknown8[21];// ???
0x224float minArmor;// min armor
0x228float maxArmor;// max armor (offset from min)
0x22CDWord unknown9[42];// ???
0x2D4float weaponSpeed;// weapon speed
0x2D8DWord unknown10[21];// ???
0x32Cfloat minDamageMod;// weapon min damage modifier
0x330float maxDamageMod;// weapon max damage modifier (offset from min)
0x334DWord unknown10A[26];// ???
0x39CDWord unknown11;// ???
0x3A0DWord unknown12[18];// ???
0x3E8ModCode mods[16];// see ModCode structure below
0x568DWord itemQuality;// -1: invalid, 3: magic, 6: rare, 9: lgd.
0x56CDWord teaches1;// recipe hash (in Recipes*.gam)
0x570DWord teaches2;// recipe hash (in Recipes*.gam)
0x574DWord teaches3;// recipe hash (in Recipes*.gam)
0x578DWord teaches4;// recipe hash (in Recipes*.gam)
0x57CDWord teaches5;// recipe hash (in Recipes*.gam)
0x580DWord teaches6;// recipe hash (in Recipes*.gam)
0x584DWord teaches7;// recipe hash (in Recipes*.gam)
0x588DWord unknown13[3];// 0x00000000 (added in Beta 7728)
0x594DWord enchants;// recipe hash (in ItemEnhancements.gam)
0x598DWord affixGroupHash[6];// hash of the Affix Group
0x5B0DWord affixLevel[6];// level of the Affix
0x5C8DWord gemType;// gem type: 1=Amethyst, 2=Emerald, 3=Ruby, 4=Topaz
0x5CCDWord craftingMatTier;// crafting material tier
0x5D0DWord craftingMatRarity;// crafting material rarity
0x5D4DWord unknown14[7];// always 0x00000000
}

ModCode Structure

The ModCode (sometimes called Attribute) structure is shown below. The NLS (enUS) string descriptions for the various ModCodes can be found here. Unfortunately, I have not found a mapping between the non-NLS string keys (e.g., "Attack_Rating") and the ModCode ids.

struct ModCode// sizeof 0x18
{
0x00DWord modCode;// modCode (id)
0x04DWord modParam1;// param used for elemental dmg and resists
0x08DWord modParam2;// param
0x0CDWord modParam3;// param
0x10DWord varDataOffset;// variable data offset (from the start of the data section)
0x14DWord varDataLength;// variable data length
}

Please see the Affixes and ModCodes for more information on Affixes and ModCodes.

Please see the ModCode Variable Data section for information on decoding the variable data.

The "itemQuality" value is only set for crafting plans and some special items (e.g., "StoneOfRecall").

The "affixGroupHash" and "affixLevel" arrays are only used for Unique items in the client game files. If this same structure is used at runtime, I expect that all items with affixes (e.g., magical and rares) will have these values populated accordingly. Note that rare items can have at most 6 affixes, as was the case in Diablo 2.

The value at 0x160 (part of unknown7[26]) is only used for three items:

All of the other unknown values listed above have a value of either 0x00000000 or 0xFFFFFFFF. Rather than storing these values individually, I am storing only their crc32 value to be able to detect changes between versions.

The "teaches" value is the hash of the Recipe from the Recipes*.gam files Blacksmith, Jeweler, and Mystic training-only). Prior to patch 7728, there was only a single value for this. In patch 7728, this was changed to 7 values to accommodate "set" recipes that allow for the creation of all items in the set.

The "enchants" value was moved to offset 0x58C in Patch 7728. This value is the hash of the recipe from the ItemEnhancements.gam files (Mystic non-training).

Please check out the String Hashing section for more details on Diablo 3 hashing.

Email Contact:

contact_email