Item Base from Rack seems to be based on map’s seed

I was playing on single player. My sorceress is in Nightmare and I was farming NM Countess repeatedly.

On the way to Countess, on Tower Lv 2 or Lv 3, there is a weapon and armor rack that I’d like to ‘pop’ for a chance to get socketed items. I noticed that more than half the time, the item ‘base’ I get from these same weapon/armor rack are same.

I kept getting Giant Axe from the weapon rack and Circlet from the Armor rack. In some games, they drop different bases but more than half the time, I keep getting the same base type.

If I reroll the map, then it seems to change the bases dropped from the racks.

Do racks not have the same RNG system as monster drops? Seems they are tied to the map. I could abuse this by rerolling the map until the racks start dropping the kind of bases I want and keep running until they drop the right number of sockets for me.

Maybe this always existed but I just haven’t noticed it because I rarely play Single Player…

Terminology

  • Item Type: Each item is assigned an item type through the type column in armor.txt, weapons.txt, and misc.txt. All item types are defined in itemtypes.txt, and examples are Swords, Staves, Wands, Jewels and Misc. An item has one specified item type, although other item types may have an effect on it, eg. a Grim Wand is of the Wand type, which is part of the Rod item type group, which is part of the Blunt item type group, then Melee item type group, and finally the Weapon item type group. Because it’s also part of the Blunt item type group a Grim Wand receives the +50% damage to undead bonus.
  • Item Quality: Different qualities of the same item type. These are, in order of increasing scarcity: low quality > normal > superior > magic > rare > set > unique. Crafts are also considered an item quality.
  • Affixes The magical modifiers on a magic, rare or crafted item; prefixes and suffixes. These can be found in MagicPrefix.txt and MagicSuffix.txt. It should be noted that not all item properties are called affixes, only those found in MagicPrefix/Suffix.txt, the others are either simply called properties, or follow a different naming scheme such as staffmods and automods. Crafted items have both pre-defined properties that always appear and affixes.
  • Qlvl: Quality level. 1) A level of an item type. These levels are stored in the weapons.txt, armor.txt and misc.txt data files. 2) A level of a set or unique item, which are stored in UniqueItems.txt and SetItems.txt data files.
  • Ilvl: Item Level. All items in the game have a level. These levels are generated when the item is created. This value is not displayed in the game, so identical items can have very different ilvls, depending on which monster dropped them. Be sure not to confuse Item Level with the item’s level requirement – they are different things.
  • Mlvl: Monster Level. All monsters in the game have levels as well as players. These are determined largely by the level upon which a monster spawns. (The same monster type found on different levels will have different mlvls.)
  • Area Level: Area Level. All areas in the game also have levels. These determine or at least factor into mlvl, ilvl, and more.
  • Alvl: Affix Level. It is a level of prefix or suffix. They are stored in MagicPrefix.txt and MagicSuffix.txt in “Level” column. The name “Affix Level” is used to differ them from other “Levels”.
  • TC: Treasure Class. All item types in the game are organized into treasure classes. In v1.10 there are 29 weapon and 29 armor Treasure Classes , with additional TCs covering all the smaller, miscellaneous items such as runes, charms, gems, potions, etc. All TCs are recursive: this means that one treasure class may include another treasure class. E.c. Hell Baal drop all his items from “Baal (H)” treasure class, which consists of “Act 5 (H) Equip B”, “Act 5 (H) Junk” and “Act 5 (H) Good” treasure classes. Each of them consists of several other treasure classes, each containing fewer entries and growing more specific.
  • Clvl: Character Level. It is one of few levels, that you can actually see in the game.
  • **Rarity:**Rarity is a value assigned to every set and unique item in the game. This comes into play largely when there are more than one unique or set item of the same type, and makes some such items much more common than others. For example, the unique ring Stone of Jordan has a Rarity of 1, while the far more common unique ring Manald Heal has a Rarity of 15. Thus, a Manald Heal is 15 times as likely to drop than a Stone of Jordan.
  • **SP:**Single Player mode.

Short Explanation of Drop Process

When you kill a monster or open a chest the game may generate items to reward you. The properties of these items are generated at that moment, even though the item may be unidentified. The game creates dropped items with algorithm of such kind:

  1. At the beginning it finds treasure class (TC), that describes all drops of the monster you killed, a chest you opened, a hidden stash you found, etc. All drop sources have treasure classes.
  2. The game then makes one or several iterations, that are called “Picks”, when it selects one choice from several possibilities.
  3. One of the possibilities is “NoDrop”, which does what it sounds like. Many monsters have multiple “picks,” so even if one of them is NoDrop, the other picks may overrule it. Most normal monsters have only one pick, though.
  4. If nothing is selected from the first TC, the next one down the list will be consulted, then the next, then the next, until an item or NoDrop is selected.
  5. Once an item is selected, the item properties are determined. Since most items have numerous possible types, game’s algorithm of quality determination is highly complicated. Items such as keys, runes, and potions are only found in normal quality, but items like rings, short swords, helms, and bucklers have different qualities like magic or unique. Note that Magic Find is checked during this step.
  6. For every selected item an ilvl is calculated.
  7. If the rarity check hits upon an item of unique or set quality, the game creates the list of all valid item types (determined by their ilvl) and randomly selects one to drop. If there is not a unique of that type, a rare item with triple durability will generate. If there is no set item of the selected type, a magical item with double durability will appear.
  8. After the game selects item type and item quality, it generates item affixes if needed. It also generates all other properties of an item, if there are such properties. Items like Runes, mana potions, and identify scrolls doesn’t have variable properties, but magic rings, rare kite shields, cracked sashes needs property generation.

A simplified example in action: Mephisto is killed! What does the game do to determine your reward?

  1. calculates the number of items to drop
  2. selects item types
  3. selects item qualities
  4. selects certain unique or set items if needed
  5. selects item properties

TreasureClassEx.txt

This is the most important file. It organizes all droppable items into a system of Treasure Classes. Since each source of items in the game (except NPCs) drop items from Treasure Classes, this is crucial to understand.

We’ll start with description of all fields of TreasureClassEx.txt table.

  • Treasure Class: The name of a TC, one the game usually refers to.
  • Group: An identification number of similar TCs. This is used in TC upgrade process according to Mlvl.
  • Level: The level of a given TC. It is also used in TC upgrade process.
  • Picks: A quantity of iterations of the selection process.
    • Unique: A modification number for chance to drop unique item from given TC (more is better).
    • Set: A modification number for set chance.
    • Rare: A modification number for rare chance.
    • Magic: A modification number for magic chance.
  • NoDrop: A rate of skipping drops from the TC (the higher NoDrop, the less items the TC will generate).
  • Item1-Item10: A code of item to drop or a name of TC to drop from (item codes are stored in weapons.txt, armor.txt and misc.txt data files).
  • Prob1-Prob10: A rate of selecting respective Item1-Item10 (more is better).
  • SumItems, TotalProb, DropChance, Term Unimportant fields for item drop routine.

TreasureClassEx.txt file doesn’t contains all treasure classes. At run time the game adds quite a few additional TCs. Their names are ArmoXX and WeapXX, where XX is two digit number. The game creates them from the armor.txt and weapons.txt files, by looking at quality levels. The first TC of armors, Armo03, contains all armor items with levels from 1 to 3: Cap, Quilted Armor, Leather Armor, Buckler, Gloves, Boots and Sash. The next armor TC, Armo06 contains all armor items with levels from 4 to 6, and so on. The last armor TC, Armo87, contains all armor items with levels from 85 to 87. Weapons are organized in their TCs, Weap03-Weap87 by the same manner.

In this TCs Prob1-Prob10 values determine how likely the given items in those TCs are to drop. Some items have penalties and are therefore seen less frequently. A few of these, for illustrative purposes:

  • Normal items: 3
  • Assassin claws: 2
  • All other class-specific items: 1
  • Wands/Staves/Scepters: 1

These values interact with how many items are found in a given TC to create item shortages and abundances. The given items in a TC with 12 items will be comparatively less common than the items in a TC with 7 items. And if those 7 items include several wands and claws, the normal items in that TC will be highly overrepresented. Breast Plates, for instance.

To further demonstrate, let’s look at the process of item selection from a given TC.

All monsters have treasure classes, written in monstats.txt file. When you kill a monster in normal difficulty the game simply uses its TC to drop items. However in Nightmare and Hell difficulty the given TC may be upgraded. When determining the TC for a monster, the game selects the highest level TC in the group that is equal to or less than the Mlvl. If there is no group for TC of this monster, than it doesn’t upgrade TC. Treasure classes that are included in the selected TC aren’t upgraded.

Selecting from a TC the game makes one or several attempts of dropping according to Picks field. Each pick choses from several possibilities, including NoDrop, and each non-empty entry from Item1-Item10 fields. The chance of every choice is equal to X/Sum, where X is respective value from Prob1-Prob10 fields for Item1-Item10, or NoDrop value for NoDrop choice, and Sum is the sum of all that values (NoDrop+Prob1+Prob2+…+Prob10).

If the game selects another TC during this process it will initiates the same cycle for it, then another cycle for newly selected TC, then another and another until it selects an item or NoDrop.

In multilayer game NoDrop value is reduced.

NewNoDrop=int( ProbSum/(1/((NoDrop/(NoDrop+ProbSum))^N)-1) ), where N=int (1+AdditionalPlayers/2+ClosePartiedPlayers/2), AdditionalPlayers — the number of all additional players in the game, where the monster is killed, ClosePartiedPlayers — the number of players in your party near you (not far than two screens away), ProbSum=Prob1+Prob2+Prob3+…+Prob10, int — operation of truncating fractional part of a number.

In SP the sets the number of NON-partied players, e.g. /players8 command sets N=4.

For example: a character kills a non-boss Devilkin in The Pit level 1 in Hell in /players8 mode (or in a full game on Battle.net). The Devilkin has Mlvl=85. In monstats.txt file Devilkin is figured under “fallen3” name. Non-unique fallen3 drop items from “Act 1 (H) H2H B” TC in Hell difficulty. In TreasureClassEx.txt file “Act 1 (H) H2H B” TC has group=7 and level=66. Because Mlvl=85 the TC is upgraded to “Act 5 (H) H2H C” TC, which has level=85 (less or equal to mlvl). So Devilkins in The Pit drop items from “Act 5 (H) H2H C” TC.

It has 1 pick from following possibilities:

  • NoDrop (100);
  • gld (21);
  • Act 5 (H) Equip C (16);
  • Act 1 (H) Junk (21);
  • Act 5 (H) Good (2).

The numbers in (parenthesis) are probabilities.

Lets calculate NewNoDrop:

  • ProbSum=21+16+21+2=60.
  • NoDrop=100.
  • N=4.
  • NewNoDrop=int( 60/(1/((100/(100+60))^4)-1) )=11.

So The Pit Devilkin has fallowing chances:

  • 11/71 for dropping nothing
  • 21/71 for dropping gold
  • 16/71 for dropping from Act 5 (H) Equip C
  • 21/71 for dropping from Act 1 (H) Junk
  • 2/71 for dropping from Act 5 (H) Good

Lets assume, that the game decided to drop from “Act 5 (H) Equip C” TC. Here it is: Picks=1, NoDrop=0, Item1=“weap81”, Prob1=2, Item2=“armo81”, Prob2=1, Item3=“weap84”, Prob3=6, Item4=“armo84”, Prob4=3, Item5=“weap87”, Prob5=14, Item6=“armo87”, Prob6=7, Item7=“weap87”, Prob7=1, Item8=“armo87”, Prob8=1, Item9=“Act 5 (H) Equip B”, Prob9=1530. Note, that weap87 and armo87 TCs are mentioned twice, it is not a error.

So this TC has fallowing chances:

  • 2/1565 for dropping from weap81;
  • 1/1565 for dropping from armo81;
  • 6/1565 for dropping from weap84;
  • 3/1565 for dropping from armo84;
  • 15/1565 for dropping from weap87;
  • 8/1565 for dropping from armo87;
  • 1530/1565 for dropping from “Act 5 (H) Equip B”.

Lets assume, that the game decided to drop from armo87. This TC has picks=1, NoDrop=0, Item1=“Diadem”, Prob1=3, Item2=“Corona”, Prob2=3, Item3=“Sacred Armor”, Prob3=3, Item4=“Ogre Gauntlets”, Prob4=3, Item5=“Myrmidon Greaves”, Prob5=3, Item6=“Colossus Girdle”, Prob6=3, Item7=“Dream Spirit”, Prob7=1, Item8=“Guardian Crown”, Prob8=1, Item9=“Vortex Shield”, Prob9=1, Item10=“Bloodlord Skull”, Prob10=1.

So armo87 has fallowing chances:

  • 3/22 for Diadem;
  • 3/22 for Corona;
  • 3/22 for Sacred Armor;
  • 3/22 for Ogre Gauntlets;
  • 3/22 for Myrmidon Greaves;
  • 3/22 for Colossus Girdle;
  • 1/22 for Dream Spirit;
  • 1/22 for Guardian Crown;
  • 1/22 for Vortex Shield;
  • 1/22 for Bloodlord Skull.

Monstats.txt

This file holds a lot of information about monsters. The fields in this file are as follows:

  • Id: Internal name of a monster type, the game refer to a monster using this field.
  • NameStr: OIt is either the actual name of the monster or a reference to name table for names with spaces.
  • rangedtype: 1 for monsters with ranged attack, blank for others.
  • minion1 and minion2: Type of minions for the monster, e.g. normal fallen shamans usually have normal fallens as minions.
  • PartyMin-PartyMax: The range for quantity of minions.
  • MinGrp-MaxGrp: The range for quantity of normal monsters in one grope.
  • Velocity: Movement speed, walking, flying, etc.
  • Run: Run speed. Only a few monsters can run at a different speed than they walk.
  • Level: Monster level in Normal difficulty.
  • Level (N): Only for bosses. Monster level in Nightmare difficulty
  • Level (H): Only for bosses. Monster level in Hell difficulty.
  • lUndead: 1 for melee undeads.
  • hUndead: 1 for ranged undeads.
  • demon: 1 for demons.
  • boss: 1 for bosses. They save their mlvl in Nightmare and Hell difficulties.
  • **Drain, Drain(N), Drain(H):**Life and mana leech effectiveness in Normal, Nightmare and Hell difficulties (percents).
  • coldeffect, coldeffect(N), coldeffect(H): Chill and freeze effectiveness in Normal, Nightmare and Hell difficulties (listed in percentages).
  • ResDm, ResDm(N), ResDm(H): Damage resistance in Normal, Nightmare and Hell difficulties (percents).
  • ResMa, ResMa(N), ResMa(H): Magic resistance.
  • ResFi, ResFi(N), ResFi(H): Fire resistance.
  • ResLi, ResLi(N), ResLi(H): Lightning resistance.
  • ResCo, ResCo(N), ResCo(H): Cold resistance.
  • ResPo, ResPo(N), ResPo(H): Poison resistance.
  • ToBlock, ToBlock(N), ToBlock(H): Chance to block. The creature must either have a shield or NoShldBlock enabled in order to block. In both cases the creature needs a blocking animation.
  • Crit: Critical hit chance (5% for every monsters as of now).
  • TreasureClass1: TC of normal monster in Normal difficulty.
  • TreasureClass2: TC of champion monster in Normal difficulty.
  • TreasureClass3: TC of unique monster in Normal difficulty (non-quest drop).
  • TreasureClass4: TC of unique monster in Normal difficulty (quest drop).
  • TreasureClass1(N): TC of normal monster in Nightmare difficulty.
  • TreasureClass2(N): TC of champion monster in Nightmare difficulty.
  • TreasureClass3(N): TC of unique monster in Nightmare difficulty (non-quest drop).
  • TreasureClass4(N): TC of unique monster in Nightmare difficulty (quest drop).
  • TreasureClass1(H): TC of normal monster in Hell difficulty.
  • TreasureClass2(H): TC of champion monster in Hell difficulty.
  • TreasureClass3(H): TC of unique monster in Hell difficulty (non-quest drop).
  • TreasureClass4(H): TC of unique monster in Hell difficulty (quest drop).
  • TCQuestId and TCQuestCP: Values for special quest drops like Mephisto’s Soulstone.

The most important part for item drops is Treasure Classes of the monster and his level.

Magicprefix.txt and Magicsuffix.txt

These two files contains all affixes available in the game. They have almost the same field, so they’re covered in the same section in this guide.

  • Name: The name of the affix as it appears in the game.
  • version: 0 for Classic, 100 for LoD.
  • spawnable: 1 for available affixes, 0 for affixes, that cannot appear in the game.
  • rare: 1 for affixes, that can appear on rare items, 0 for magic only affixes.
  • level: Minimum Affix Level of an item that may spawn with this affix.
  • **maxlevel:**Maximum Affix Level of an itemthat may spawn with this affix.
  • levelreq: Minimum required character level for using item with this affix.
  • classspecific: The class for which this affix will work, — ama, sor, nec, pal, bar, dru. (ArchAngel’s prefix will only add skills for sorceress, for instance.)
  • classlevelreq: Minimum required character level for using item with this affix. Although it usually is overrules by levelreq.
  • frequency: The rate of appearance in the game of this affix (0 for items that cannot be selected at all).
  • group: Group Id for selecting affixes for rare and crafted items. They cannot have more than one affix per group.
  • mod1code, mod2code, mod3code: The codes of effects of this affix. This codes refer to internal game functions, however all of them are quite self-explanation, e.c. “ac%” is Armor Class increase, “dmg%” is Damage increase, “res-all” is resist all.
  • mod1param, mod2param, mod3param: Parameters for the affix function. E.c. poison duration in frames, skill index, cold duration in frames. (Diablo II runs at an internal clock speed of 25 frames per second.)
  • mod1min, mod2min, mod3min: Minimum parameters for affix function such as minimum of life range given by +life affix
  • mod1max, mod2max, mod3max: Maximum parameters for affix function such as maximum of life range given by +life affix.
  • transform: 1 for affixes that do palette shift on base item.
  • transformcolor: Color code for affixes that do color shift on base item; “dgld” is dark gold, “lpur” is light purple, edtc.
  • itype1, itype2, itype3, itype4, itype5, itype6, itype7: Include Type, item type codes of items, on which this affix may occur. These codes are stored in armor.txt, weapon.txt, misc.txt and ItemTypes.txt files.
  • etype1, etype2, etype3, etype4, etype5, etype6, etype7: Exclude Type, item type codes of items, on which this affix may NOT occur.
  • **divide, multiply, add:**Values for modifying item price.

The usage of these files is explained in more detail in chapter 11, when affix generation is covered.

Weapons.txt

This file is used to store information about weapon item types.

  • name: The name of the weapon as it appears in the game.
  • type, type2: Item type code, the index of respective raw in itemtypes.txt file.
  • code: Internal item name.
  • alternateGfx: Item code for choosing animation. Unimportant for item generation.
  • namestr: Reference to the table. Contained correct name of the item.
  • version: 0 for Classic, 100 for Lod.
  • **compactsave:**Empty. Unimportant for item generation.
  • rarity: The rate of dropping the weapon from weapon racks.
  • **spawnable:**0 for items, that cannot be generated (except special cases like quests), 1 for others.
  • mindam-maxdam: One-handed damage.
  • 1or2handed: 1 for two-handed weapons that may be held in one hand by the Barbarian.
  • 2handed: 1 for two-handed weapons.
  • 2handmindam-2handmaxdam: Two-handed damage.
  • minmisdam-maxmisdam: Ranged damage.
  • rangeadder: Weapon range adder. Weapon range=1+rangeadder.
  • speed: Base weapon attack speed.
  • StrBonus: Strange bonus for weapon damage. Enhanced damage percent=Strength*StrBonus/100.
  • DexBonus: Dexterity bonus for weapon damage. Enhanced damage percent=Dexterity*DexBonus/100.
  • reqstr: Strength required.
  • reqdex: Dexterity required.
  • durability: Base durability.
  • nodurability: 1 for indestructible weapons.
  • level: Quality Level.
  • levelreq: Character level required.
  • cost: base weapon cost.
  • gamble cost: gambling cost.
  • magic lvl: Magic Level (see chapter 11 and chapter 22).
  • auto prefix: The code number of prefix, that always occurs on the weapon (like +mana on orbs).
  • OpenBetaGfx: Unimportant for item generation.
  • normcode: Code of normal version of the weapon.
  • ubercode: Code of exceptional version of the weapon.
  • ultracode: Code of elite version of the weapon.
  • wclass, 2handedwclass: Weapon class for animation. Unimportant for item generation.
  • component: Unimportant for item generation.
  • hit class: Unimportant for item generation.
  • invwidth: Width of the item in the inventory.
  • invheight: Height of the item in the inventory.
  • stackable: 1 for stackable weapons (throwing).
  • minstack-maxstack: The range of quantity of items of this type in on stack.
  • spawnstack: Quantity of items of this type in on stack upon founding.
  • flippyfile, invfile, uniqueinvfile, setinvfile: Graphics files for the weapon.
  • hasinv: 1 for socketable weapons.
  • gemsockets: Maximum possible number of sockets in the weapon.
  • gemapplytype: Item class for gems and runes. 0 for all weapons.
  • special: Unimportant for item generation.
  • useable: 1 for items, that you may use (e.c. town portal scroll). 0 for all weapons.
  • dropsound, dropsfxframe, usesound: Sound-related information. Unimportant for item generation.
  • unique: 1 for special quest items.
  • transparent, transtbl: Not used.
  • quivered: 1 for weapons, that need ammo.
  • lightradius, belt, quest, questdiffcheck, missiletype: Unimportant for item generation.
  • durwarning: Id of low durability warning icon.
  • qntwarning: Id of low quantity warning icon.
  • gemoffset: Unimportant for item generation.
  • bitfield1: Weapon material code (is used in golem creation and rack drop checks).
  • *CharsiMin (and all other Min fields): Should be minimal quantity of the item in vendor’s price list, but isn’t used (see chapter 12).
  • *CharsiMax (and all other Max fields): If CharsiMax>0 then she can sell this item (see chapter 12).
  • *CharsiMagicMin (and all other MagicMin fields): Should be minimal quantity of the item in vendor’s price list, but isn’t used (see chapter 12).
  • *CharsiMagicMax (and all other MagicMax fields): If CharsiMagicMax>0 then she can sell this item (see chapter 12).
  • *CharsiMagicLvl (and all other MagicLvl fields): If ilvl>=CharsiMagicLvl then she can sell this item (see chapter 12).

Source Art, Game Art, Transform, InvTrans, SkipName: Unimportant for item generation.

  • NightmareUpgrade: Item code for selling by Nightmare difficulty vendors, “xxx” for items, that don’t get upgrade (see Chapter 12).
  • HellUpgrade: Item code for selling by Hell difficulty vendors, “xxx” for items, that don’t get upgrade (see Chapter 12).
  • Nameable: 1 for items that may be personalized by Anya’s quest reward.
  • PermStoreItem: Unimportant for item generation.

armor.txt

This is a file similar to weapons.txt.

  • name: The name of the weapon as it appear in the game.
  • version: 0 for Classic, 100 for Lod.
  • compactsave: Unimportant for item generation.
  • rarity: The rate of dropping the armor from weapon racks.
  • spawnable: 0 for items, that cannot be generated (except special cases like quests), 1 for others.
  • minac-maxac: Defence range.
  • absorbs: Not used. Unimportant for item generation.
  • speed: Run/walk speed penalty.
  • reqstr: Strength required.
  • block: Base chance to block.
  • durability: Base durability.
  • nodurability: 1 for indestructible armors.
  • level: Quality Level.
  • levelreq: Character level required.
  • cost: Base weapon cost.
  • gamble cost: Gambling cost.
  • code: Internal item name.
  • namestr: Reference to the table, contained correct name of the item.
  • magic lvl: Magic Level (see chapter 11 and chapter 22).
  • auto prefix: The code number of prefix, that always occurs on the armor (like poison damage on heads).
  • alternategfx, OpenBetaGfx: Unimportant for item generation.
  • normcode: Code of normal version of the armor.
  • ubercode: Code of exceptional version of the armor.
  • ultracode: Code of elite version of the armor.
  • spelloffset, component: Unimportant for item generation.
  • invwidth: Width of the item in the inventory.
  • invheight: Height of the item in the inventory.
  • hasinv: 1 for socketable armors.
  • gemsockets: Maximum possible number of sockets in the armor.
  • gemapplytype: Item class for gems and runes. 1 for headgear and body armor, 2 for shields.
  • flippyfile, invfile, uniqueinvfile, setinvfile: Graphics files for the armor.
  • rArm, lArm, Torso, Legs, rSPad, lSPad: Types of used graphics files.
  • useable: 1 for items, that you may use (e.c. Town portal scroll). 0 for all armors.
  • throwable: Not used.
  • stackable: 1 for stackable items (not used for armors).
  • minstack-maxstack: The range of quantity of items of this type in on stack (not used for armors).
  • type, type2: Item type code, the index of respective raw in itemtypes.txt file.
  • dropsound, dropsfxframe, usesound: Sound-related information. Unimportant for item generation.
  • unique: 1 for special quest items.
  • transparent, transtbl: Not used.
  • quivered: 1 for weapons that need ammo (not used for armors).
  • lightradius, belt, quest, questdiffcheck, missiletype: Unimportant for item generation.
  • durwarning: Id of low durability warning icon.
  • qntwarning: Id of low quantity warning icon (not used for armors).
  • mindam-maxdam: Damage range for smite or kick.
  • StrBonus: Strength bonus for kick damage. Enhanced damage percent=Strength*StrBonus/100.
  • DexBonus: Dexterity bonus for kick damage. Enhanced damage percent=Dexterity*DexBonus/100.
  • gemoffset: Unimportant for item generation.
  • bitfield1: Armor material code (is used in golem creation and rack drop checks).
  • *CharsiMin (and all other Min fields): Should be minimal quantity of the item in vendor’s price list, but isn’t used (see chapter 12).
  • *CharsiMax (and all other Max fields): If CharsiMax>0 then she can sell this item (see chapter 12).
  • *CharsiMagicMin (and all other MagicMin fields): Should be minimal quantity of the item in vendor’s price list, but isn’t used (see chapter 12).
  • *CharsiMagicMax (and all other MagicMax fields): If CharsiMagicMax>0 then she can sell this item (see chapter 12).
  • *CharsiMagicLvl (and all other MagicLvl fields): If ilvl>=CharsiMagicLvl then she can sell this item (see chapter 12).
  • Source Art, Game Art, Transform, InvTrans, SkipName: Unimportant for item generation.
  • NightmareUpgrade: Item code for selling by Nightmare difficulty vendors, “xxx” for items, that don’t get upgrade (see Chapter 12).
  • HellUpgrade: Item code for selling by Hell difficulty vendors, “xxx” for items, that don’t get upgrade (see Chapter 12).
  • mindam, maxdam: Not used.
  • Nameable: 1 for items that may be personalized by Anya’s quest reward.

Misc.txt

This file is similar to weapons.txt and armor.txt, but contains information about all items, that are neither weapon nor armor.

  • *name, name: The name of the item as it appears in the game.
  • szFlavorText, compactsave: Unimportant for item generation.
  • version: 0 for Classic, 100 for Lod.
  • level: Quality Level.
  • levelreq: Character level required.
  • rarity: The rate of dropping the item from different objects (e.c. book shelves).
  • spawnable: 0 for items, that cannot be generated (except special cases like quests), 1 for others.
  • speed: Not used for misc items.
  • nodurability: 1 for indestructible items.
  • cost: Base item cost.
  • gamble cost: Gambling cost.
  • code: Internal item name.
  • alternategfx: Unimportant for item generation.
  • namestr: Reference to the table, contained correct name of the item.
  • component: Unimportant for item generation.
  • invwidth: Width of the item in the inventory.
  • invheight: Height of the item in the inventory.
  • hasinv: 1 for socketable items.
  • gemsockets: Maximum possible number of sockets in the item (not used for misc items).
  • gemapplytype: Item class for gems and runes (not used for misc items).
  • flippyfile, invfile, uniqueinvfile: Graphics files for the item.
  • special: Not used.
  • Transmogrify, TMogType, TMogMin, TMogMax: Unimportant for item generation.
  • useable: 1 for items, that you may use (e.c. Town portal scroll). 0 for all others.
  • throwable: Not used.
  • type, type2: Item type code, the index of respective raw in itemtypes.txt file.
  • dropsound, dropsfxframe, usesound: Sound-related information. Unimportant for item generation.
  • unique: 1 for special quest items.
  • transparent, transtbl: Not used.
  • lightradius, belt: Unimportant for item generation.
  • autobelt: 1 for items that automatically get placed on the belt.
  • stackable: 1 for stackable items.
  • minstack-maxstack: The range of quantity of items of this type in on stack.
  • spawnstack: Quantity of items of this type in on stack upon founding.
  • quest: >0 for quest items. Unimportant for item generation.
  • questdiffcheck: Unimportant for item generation.
  • missiletype, spellicon: Not used.
  • pSpell, state, cstate1, cstate2, len: Unimportant for item generation.
  • stat1, stat2, stat3: Effect of usable item. E.c. life restore for life potion.
  • calc1, calc2, calc3: The value for effect of usable item. E.e. 100% life and mana for full * rejuvenation potion.
  • spelldesc, spelldescstr, spelldesccalc: Used to refer to description of item effect.
  • durwarning: Id of low durability warning icon.
  • qntwarning: Id of low quantity warning icon.
  • gemoffset: Unimportant for item generation.
  • BetterGem: The code of gem for upgrade with cube or shrine.
  • bitfield1: Item material code (is used in golem creation and rack drop checks).
  • *CharsiMin (and all other Min fields): Should be minimal quantity of the item in vendor’s price list, but isn’t used (see chapter 12).
  • *CharsiMax (and all other Max fields): If CharsiMax>0 then she can sell this item (see chapter 12).
  • *CharsiMagicMin (and all other MagicMin fields): Should be minimal quantity of the item in vendor’s price list, but isn’t used (see chapter 12).
  • *CharsiMagicMax (and all other MagicMax fields): If CharsiMagicMax>0 then she can sell this item (see chapter 12).
  • *CharsiMagicLvl (and all other MagicLvl fields): If ilvl>=CharsiMagicLvl then she can sell this item (see chapter 12).
  • Source Art, Game Art, Transform, InvTrans, SkipName: Unimportant for item generation.
  • NightmareUpgrade: Item code for selling by Nightmare difficulty vendors, “xxx” for items, that don’t get upgrade (see Chapter 12).
  • HellUpgrade: Item code for selling by Hell difficulty vendors, “xxx” for items, that don’t get upgrade (see Chapter 12).
  • mindam, maxdam: Not used.
  • PermStoreItem: 1 for items, that always available in stores.
  • multibuy: 1 for items, that may be bought with Shift+Click (Multiple Buy function).
  • Nameable: 1 for items that may be personalized by Anya’s quest reward.
  • *eol: Not used (however “eol” is usually End Of Line in programming).

ItemTypes.txt

This file describes basic item types, like a ring, a melee weapon, a bow.

  • ItemType: The name of the item type for users.
  • Code: The name of the item type for references from other files.
  • Equiv1, Equiv2: Equivalent item types, i.e. codes of types, that include this item type. Eg. Throwing Knife is included in Knife item type.
  • Repair: 1 for types, whose items may be repaired.
  • Body, BodyLoc1, BodyLoc2: Location on player body. Unimportant.
  • Shoots: Ammo type for weapons, that need them.
  • Quiver: Type of ammo for item types, that are ammo.
  • Throwable: 1 for throwable item types.
  • Reload: 1 for item types, that reloads ammo from inventory (like crossbows and bows).
  • ReEquip: 1 for item types, that are automatically equipped from inventory after running out (like throwing potions).
  • AutoStack: 1 for stackable items that are automatically organized in stacks when you pick them (like keys).
  • Magic: 1 for items that can be magic.
  • Rare: 1 for items that can be rare.
  • Normal: 1 for items that can be normal quality.
  • Charm: 1 for charms.
  • Gem: 1 for gems.
  • Beltable: 1 for items, that you may put on your belt.
  • MaxSock1: Maximum socket number for Ilvl<=25.
  • MaxSock25: Maximum socket number for Ilvl<=40.
  • MaxSock40: Maximum socket number for Ilvl>40.
  • TreasureClass: 1 for item types, that gets automatic Treasure Classes. E.e. Weap87, Armo03.
  • Rarity: Item drop probability. It is used for automatic Treasure Classes (see TreasureClassEx.txt description in chapter 4.1).
  • StaffMods: The type of sfaffmods, that are generated on the item type (see chapter 11 for description of stuffmods).
  • CostFormula: Unimportant.
  • Class: Class requirement.
  • VarInvGfx, InvGfx1, InvGfx2, InvGfx3, InvGfx4, InvGfx5, InvGfx6: Some unimportant graphics information.
  • StorePage: The type of page in stores for selling this item type.
  • *eol: Not used (however “eol” is usually End Of Line).

ItemRatio.txt

This is the most important file for determining quality of item. First, coverage of the fields, then an explanation of the quality calculation mechanics.

  • Function: The description of the line.
  • Version: 0 for Classic, 1 for Lod.
  • Uber: 1 for exceptional and elite items, 0 for normal items.
  • Class Specific: 1 for class specific items, 0 for all others.
  • Unique: Basic chance for unique items (1:Unique).
  • UniqueDivisor: The value for modifying basic chance for unique items (see description below).
  • UniqueMin: Minimum value in calculating unique chance.
  • Rare: Basic chance for rare items.
  • RareDivisor: The value for modifying basic chance for rare items.
  • RareMin: Minimum value in calculating rare chance.
  • Set: Basic chance for set items.
  • SetDivisor: The value for modifying basic chance for set items.
  • SetMin: Minimum value in calculating set chance.
  • Magic: Basic chance for magic items.
  • MagicDivisor: The value for modifying basic chance for magic items.
  • MagicMin: Minimum value in calculating magic chance.
  • HiQuality: Basic chance for high quality items.
  • HiQualityDivisor: The value for modifying basic chance for high quality items.
  • Normal: Basic chance for normal quality items.
  • NormalDivisor: — the value for modifying basic chance for normal quality items.

As you see the itemratio.txt file contains two rows for Classic mode and four rows for LoD mode. The two rows for Classic mode include the raw for normal and the raw for exceptional items in this order. The four rows for LoD mode include: 1) the raw for non-class specific normal items, 2) the raw for non-class specific exceptional and elite items, 3) the raw for class specific normal items and 4) he raw for class specific exceptional and elite items in this order.

The game selects correct raw using Version, Uber and Class Specific fields before starting the calculations.

The game selects quality for an item only when it already knows its item level and item type. It does the check for unique quality first. If it is successful it stops the algorithm and generates unique item or triple durability rare (or magic/normal item if this item type cannot be rare). If unique check is failed, the game makes set check by the same manner, then rare check, then magic check, then normal check, until some check will show success. If all checks fall it will generate low quality item.

Here is quality check algorithm:

  1. Find proper line in itemratio.txt.
  2. Chance = (BaseChance - ((ilvl-qlvl)/Divisor)) * 128
  3. if (we check for unique, set or rare quality) EffectiveMF=MF*Factor/(MF+Factor) else EffectiveMF=MF
  4. Chance= Chance* 100/(100+ EffectiveMF).
  5. if (Chance 6) FinalChance=Chance-(Chance*QualityFactor/1024)
  6. If (RND[ FinalChance ]<128) return Success
    else return Fail
  • BaseChance: The value from Unique, Rare, Set, Magic, HiQuality and Normal fields of itemratio.txt.
  • ilvl: Item Level, usually ilvl=mlvl.
  • qlvl: Quality level of item type.
  • Divisor: The value from UniqueDivisor, RareDivisor, SetDivisor, MagicDivisor, HiQualityDivisor and NormalDivisor fields of itemratio.txt.
  • MinChance: The value from UniqueMin, RareMin, SetMin, MagicMin fields of itemratio.txt. For high quality and Normal items MinChance=0.
  • 'QualityFactor: The value from Unique, Set, Rare, Magic fields of TreasureClassEx.txt file for TC of the monster, that dropped this item.

TC Selection and Number of Dropped Items

This is covered in detail in chapter 4.1. Here’s a more text-based explanation, by Thrugg.

First is to know what TC a creature is supposed to drop from. For that you need to look up monstats.txt. This lists every monster in the game. Find the one you want (can be non trivial because they use tags which are not the same as the display names in game). Moon Lords are bloodlord5, as it happens. Scroll way over to the right end of the row, and you will see a whole bunch of TCs listed. These are, respectively, the TCs dropped by regular, champion and unique versions of the monster in each of normal, NM and Hell.

That’s step 1 :slight_smile: Next, back to TreasureClassEx.txt we go. In normal you just look up directly the TC and off you go, but in NM and Hell we have “TC upgrades”. This is what the two columns that I haven’t explained yet are for - “group” and “level”. In NM or Hell, if a monster’s level is higher than the level of his base TC, and there is another TC in the same group which is higher level but still equal to or less than his monster level, it will upgrade to that TC.

After you found the line in TreasureClassEx.txt file, that describe the drops of that monster you may calculate the number of his drops and types of dropped items. The game takes several picks from given TC. The number of picks stored in Picks column of TreasureClassEx.txt file. Typically all normal monsters have one pick. Every pick has chance for no dropping item at all.

When you play a multiplayer game, you have the total number of people in the game, say N.

All monsters get HP and exp multiplied by (N+1)/2. This is well known and also doesn’t matter whether the players are partied, close by, whatever.

If you are playing off-realm you can also use /players X to raise the number of players to X > N. Then the HP and exp will scale up further to (X+1)/2 as you would expect.

Drops, however, are not the same. When you kill a monster in a multiplayer game, the game calculates a number to use as the nodrop exponent. This is not simply N.

  • It counts 1 for you, the killing player.
  • It counts 1 more for each player that is (a) partied with you and (b) within two screens of you.
  • It counts 0.5 for each other player, either unpartied or far away.
  • It rounds the final total down.

So, if you sneak into a full public game on the realms and don’t party up but go MFing on your own, you actually only get a nodrop exponent of 4 (1 for you, 3 for the 7 unpartied players rounded down), while the other partied guys are getting an exponent of 7 (7 people in their party, and you rounded down to 0). Even though all of you are killing p8 monsters with their 4.5x HP. It is one of Blizzard’s many measures to encourage party play.

You have your nodrop number (e.g. for Meph, this is 15) and your total of other drops (for Meph this is 65). This means the total ratio of nodrops in solo play is 15/(15+65) = 15/80 = ~19%.

You then apply your nodrop exponent (call it n) like this:

  • new nodrop rate = (base nodrop rate)^n
  • new nodrop number = new nodrop rate / (1 - new nodrop rate) * total drops, rounded down.

For example, Meph, nodrop exponent = 1

  • new nodrop rate = (15/80)^1 = 15/80
  • new nodrop number = 15/80 / (1 - 15/80) * 65 = 15/65 * 65 = 15 (just showing you that it works even for n=1)

Meph, nodrop exp = 2

  • new nodrop rate = (15/80)^2 = 0.03515625
  • new nodrop number = 0.03515625 / (1 - 0.03515625) * 65 = 0.036437 * 65 = 2 after rounding.

So with exponent = 2, Meph is already only missing drops 2/67 of the time.

Meph, nodrop exp = 3

  • new nodrop rate = (15/80)^3 = 0.00659
  • new nodrop number = 0.00659 / (1 - 0.00659) * 65 = 0.00664 * 65 = 0 after rounding.

So with exponent = 3, Meph is always dropping in full.

It is unfortunately extremely hard to test this empirically. Enough weird stuff happens that also seem to hide drops, plus Meph gets 7 drop chances and only 6 items can drop, that it is too hard to tell 2/67 apart from 0. So it could actually be that all this time we’ve been running Meph at players3 in SP to get full drops when really we are just getting exp=2 drops — you’d need to run him at players5 to get guaranteed full drops.

Extra players added using the /players command only count as unpartied players. This makes no difference to what we already knew for monster HP and XP. It does change what we thought was happening with drops. Unpartied players count as halves rounded down. So, when using the Atma drop calculator, you need to translate your /players setting into the number you put into the Players field:

  • 1 or 2 → 1
  • 3 or 4 → 2
  • 5 or 6 → 3
  • 7 or 8 → 4

This affects all monsters, not just Mephisto, although for unique monsters like Pindle and random bosses that have fixed drops, it won’t actually change any numbers.

It should also be noted that the things you “know” are still mostly true. You can keep running Meph on p3. In retrospect I always wondered why people ran him on p3 instead of p2, when the difference in drops is so tiny. Well, it turns out that running at p3 is actually what I thought was p2, and p2 is no different than p1, so now it makes sense. You may still see a 5 drop every now and then at p3, but not often enough that it is worth going higher.

Ultimately, if you are MFing, there is rarely a reason to use an even number setting. The only difference between an even number and the number one lower is slightly more exp, but only one-for-one with the increased HP. So your drops per HP are lower and exp per HP is the same. For fast levelling, when all you care about is the most exp per monster you can get, p8 is still worthwhile.

Item type selection

This was covered in Chapter 4.1 in technical fashion. Here it’s described in more vernacular terms, by Thrugg.

The Treasure Classes are like a giant tree, and all are defined in TreasureClassEx.txt. Each row in that file defines a TC, and lists the sub TCs it can drop from. When an item is dropped, the game rolls to determine from which sub TC it will come, then looks at that row and rolls again, and so on until an individual item is selected.

Each sub TC is not equal. For example, Hell Mephisto’s TC is:

  • Mephisto (H) 7 983 983 983 1024 15 “gld,mul=2048” 5 “Act 4 (H) Equip A” 52 “Act 4 (H) Junk” 5 “Act 4 (H) Good” 3

This says he gets 7 drops, bonuses of 983 to U/S/R, 1024 bonus to Magic which is why he always drops at least magic.

  • Next is 15 no-drop.
  • Then 5 gold with a 2048 multiplier (means decent sized stacks).
  • Then 52 Act 4 (H) Equip A, which contains equipment items appropriate for the early part of Act 4 Hell.
  • Then 5 Act 4 (H) Junk, which contains a bunch of crap.
  • Then 3 Act 4 (H) Good, which contains good non-equipment items appropriate for Act 4 Hell. This is gems, runes, jewels, charms, rings, amulets.

The numbers (15, 5, 52, 5, 3) are the chances of going to each subTC with each drop. They add up to 80. So you have a 15/80 chance of going to no-drop and getting nothing — but that is with each drop. You can go there once and still get your full 6 drops (he gets 7 chances but every monster can drop at most 6 items). 52/80 equipment is why he drops quite so much of that. 3/80 good is kind of low, which is why bosses aren’t much good for runes.

For another example, let’s have a look at Act 4 (H) Equip A:

  • Act 4 (H) Equip A 1 weap69 2 armo69 1 weap72 6 armo72 3 weap75 14 armo75 7 weap78 2 armo78 1 Act 3 (H) Equip B 1530

This means you get 1 item, with 2 chances of weap69 and 1 chance of armo69, etc. You also have 1530 chances (!) of dropping down to Act 3 (H) Equip B. Several things to note here.

First, weapons are always twice as common as armour. Also, while this is why Mephisto can drop from TC78, he really isn’t likely to (especially armour in TC78). Only 1/1566 of Meph’s equipment drops will be from armo78, while he is 7 times more likely to drop from armo75.

It looks like he is unlikely to drop from TC69 also, however he drops down to A3(H)EqB almost all the time, and that has a similar TC window shifted one back, i.e. TC66 up to TC75. So he actually gets quite a few chances to drop TC69 further down the tree.

The main reason why TC3s are so rare is that this rolling window stops when it hits the bottom, so you just get that one very last chance at TC3s.

Suppose you are lucky and you get your 1/1566 chance of armo78 from Meph. This is called an “atomic TC” and it is not defined in TCEx.txt. Instead, it is defined by armor.txt, also in your Atma directory. It contains all armours which have level (often called qlvl) 76, 77 or 78. You can also see base item qlvls Armo78 contains Balrog Skin, Hellforge Plate, Troll Nest, Crusader Gauntlets and Earth Spirit in 1.10. As always when D2 makes a list, it has rarities associated too. Rarities at this level are pretty simple. All items have rarity 3 except class-specific items have rarity 1, assassin claws have rarity 2, and wands, staves and sceptres (rods) have rarity 1. Armo78 has total rarity 3+3+3+3+1=13, so you have a 3/13 chance of getting a Balrog Skin, and a 1/13 chance of getting an Earth Spirit. Meph is not your ideal source for a Spirit Keeper.

You’ll note we split off from runes and rings and amulets a long way back. The game decides if you are getting an equipment item or something else very early on. Once the item type is selected, the Magic Find process starts, and determined what quality it will be.

Item quality selection

The explanation here is given for monster drops. Most chests and other objects use the same algorithm of quality determination, however special chests have also fixed chances for unique, set, rare and magic items (see chapter 17). The exact mechanics of quality determination can be found in the chapter 4.8, itemratio.txt. Here the process is described in more detail, with examples.

After the game has calculated item level and selected an item type to drop, it selects item quality. It is done by performing a row of test for unique, set, rare, magic, high and normal quality. If some test returns success it will cancel all other tests, if all tests return fail it will generate a low quality item.

The test is calculating a Value and generates random number in 0-(Value-1) range. If this random number is less than 128 then the test will return success. So we have 128/Value chance to get that quality.

Here is quality check algorithm:

  1. Find proper line in itemratio.txt.
  2. Chance = (BaseChance - ((ilvl-qlvl)/Divisor)) * 128
  3. if (we check for unique, set or rare quality) EffectiveMF=MF*Factor/(MF+Factor) else EffectiveMF=MF
  4. Chance= Chance* 100/(100+ EffectiveMF).
  5. if (Chance 6) FinalChance=Chance-(Chance*QualityFactor/1024)
  6. If (RND[ FinalChance ])<128 return Success
    else return Fail
  • BaseChance: The value from Unique, Rare, Set, Magic, HiQuality and Normal fields of itemratio.txt.
  • ilvl: Item Level, usually ilvl=mlvl.
  • qlvl: quality level of item type.
  • Divisor: The value from UniqueDivisor, RareDivisor, SetDivisor, MagicDivisor, HiQualityDivisor and NormalDivisor fields of itemratio.txt.
  • MinChance: The value from UniqueMin, RareMin, SetMin, MagicMin fields of itemratio.txt. For high quality and Normal items MinChance=0.
  • QualityFactor: The value from Unique, Set, Rare, Magic fields of TreasureClassEx.txt file for TC of the monster, that dropped this item.

In more detail:

At the first step the game finds suitable line in itemratio.txt. As you know, there are separate lines for Classic/LoD games, class specific/non-class specific items and normal/exceptional and elite items. After finding proper line it has all values, that it needs for calculations: item level, quality level, base quality chance, quality divisor, minimum quality chance, MF%, MF diminishing returns factor and monster quality factor.

Lets repeat again where the game takes them.

Item level is just equal to monster level. Quality level is the level of item type. MF% are taken from players equipment. MF diminishing returns factor is 250 for unique, 500 for set and 600 for rare qualities. All other values are taken from itemratio.txt file, except monster quality factor. The last is maximum value from Unique, Set, Rare, Magic fields of TreasureClassEx.txt file for all TCs, that the game have scanned, searching for this item type.

At the last step we just have 128/FinalChance chance to get Success.

Let’s take an example, Hell Baal drops an Unearthed Wand for a character who has 200% Magic Find. The check for unique:

  1. Use line #5, “Uber”.
  2. ilvl=99 (from monstats.txt), qlvl=86 (from weapons.txt), BaseChance=400 (for unique from itemratio.txt), Divisor=1.
    Chance = (BaseChance - ((ilvl-qlvl)/Divisor)) * 128=49536.
  3. Factor=250 for unique quality.
    EffectiveMF=MF*Factor/(MF+Factor)=111.
  4. Chance= Chance* 100/(100+ EffectiveMF)=23476
  5. Chance< MinChance (false, because 23476>6400).
  6. QualityFactor=983 for Hell Baal (from TreasureClassEx.txt).
    FinalChance=Chance-(Chance*QualityFactor/1024)=939.

If the game generates random number in 0-(FinalChance-1) range (rnd[FinalChance] function), that will be less then 128, it will generate unique Unearthed Wand. So you have 128:939 chance per Unearthed Wand pick to get unique. If the game failed to generate unique Unearthed Wand it will try to generate set, then rare and so on.

For some item types and if the monster level is less than quality level of unique or set item, the game will generate a high durability item.

So if you find Bramble Mitts, the game will check to see if they are Unique (whether or not there is a Unique of a given item type doesn’t matter at this point), if that fails then Set, if that fails then Rare, and so on. If the roll for Unique or Set succeeds and there is not one of that base item (which happens quite often with Elite Uniques, and can happen with Elite, Excep, or normal sets) a lower quality item with bonus durability will be generated. Details:

  • If you roll a Unique when one of that type does not exist or from a monster not high enough to drop it, you’ll get a Rare of that type item with 3x the normal durability.
  • If you roll a Set when one of that type does not exist or from a monster not high enough to drop it, you’ll get a Magical of that type item with 2x the normal durability.
  • Both of these can also happen when monsters aren’t high enough to drop the given set or unique.
  • This also happens with Uniques, if the same one is selected to drop more than once in a game. Since it can only drop once, the 2nd, 3rd, etc times it will drop to a 3x durability Rare.

Set and unique items selection

Lets assume that after the previous steps the game has selected a certain item type and determined it will be of unique or set item quality. After that it completes the list of all possible items with this type and quality, that has quality level less or equal to Ilvl of the item. After that it has several possibilities:

  1. If there is no any item in that list the game generate high durability item.
  2. If there is only one item of that type it just selects it for dropping.
  3. If there are several items in the list, it selects one of them randomly according to their rarity. The chance for an item to be dropped in this case is ItemRarity/TotalRarity, where TotalRarity is the sum of rarities of all items in the list.

Three examples, one for every case:

Example #1. Hell Pindleskin decides to drop Spiderweb Sash. The unique item quality is checked next. The game creates the list of all unique Spiderweb Sashes, that has Qlvl less or equal to Ilvl (Qlvl<=86). The resulted list will be empty, because there is no such items is game files, only unique Spiderweb Sash, Arachnid Mesh, has Qlvl=87, so it cannot be dropped by Mlvl=86 monster. So the list is empty, the game drops 3x durability rare Spiderweb Sash, and poor player starts pulling hair from his back, blaming Pindleskin, The Game and Blizzard entirely. :slight_smile:

Example #2. Hell Pindleskin decides to drop Sacred Armor. Then he rolls for unique item quality. The game creates the list of all unique Sacred Armors, that has Qlvl<=86. The result list will contain just one item, that meets all that restrictions. It is Templar’s Might, another unique Sacred Armor, Tyrael’s Might, cannot be dropped because it has higher Qlvl (87). So the list contain just one item, the game drops Templar’s Might just to confuse player a bit before he realises that he is running Pindle, not Baal. :slight_smile:

Example #3. Hell Pindleskin decides to drop a Ring. Then he rolls for unique item quality. The game creates the list of all unique Rings, that have Qlvl<=86. The result list will contain nine items, all unique rings have Qlvl<=86. So he needs to select one of them. He summarises rarities of all items in the list: 15+15+1+1+10+10+3+1+3=59 and generates random number to select one of them. So Nature’s Peace has 3/59 chance to drop, and SoJ has only 1/59. Our poor player more likely will get another Nagel, Manald’s, Raven’s or Dwarf’s ring (they are 50/59 of all Pindle’s unique rings).

Sockets Number Selection

If the game creates a socketed item it must determine how many sockets the item will boast. You may find all information about sockets in armor.txt, weapons.txt and ItemTypes.txt data files. Misc items cannot have sockets.

The game first checks if the item may have sockets at all. These items are:

  • Any weapon except throwing weapons.
  • Any body armor.
  • Any shields.
  • Any headgear.

Other items cannot have sockets.

The most interesting information about socketed items is how many sockets they can have.

Most Unique and Set items do not have sockets, originally. (The use of the term “originally” in this section refers to items as they are generated, before being “socketed” by The number of sockets in the few unique or set items that have sockets is fixed or randomly selected from fixed range with equal probability. The information about their sockets are stored in UniqueItems.txt and SetItems.txt data files. For example Griswold’s Heart (Set Ornate Plate) always have three sockets, Crown of Ages (Unique Corona) has one or two sockets with 1/2 chance of each.

Original Rare items in v1.10 and later (rare items never had sockets in earlier versions of D2) have one or two sockets with 1/2 chance of each when they have Mechanist’s affix. See chapter 11 about affix selection mechanics if you want to know how frequently this affix may appear. Note that not all rare items may have two sockets. If maximum sockets cap for its base item is one, that Mechanist’s rare item will always have one socket. The example of such item is rare buckler.

Original Magic items have sockets only if they have one of the following prefixes: Mechanics’ (1 or 2 sockets with 1/2 chance of each), Artisan’s (3 sockets) and Jeweler’s (4 sockets). Socketed magic items cannot have more sockets than is allowed by its base item type.

1/3 of all normal and superior items are socketed. The number of sockets is generated randomly from the range, with the number effected by item type and item level. Minimum possible sockets number are always 1. Maximum sockets number can be found in armor.txt, weapon.txt and ItemTypes.txt data files for every item type. For example let me take Long Battle Bow. You can find “6” in “gemsockets” column and “bow” in “type” column of weapon.txt in its line. For “bow” type ItemTypes.txt has “3”, “4” and “6” in “MaxSock1”, “MaxSock25” and “MaxSock40” columns. That means that Long Battle Bow has maximum 3 sockets before Ilvl<=25, 4 sockets before Ilvl<=40 and 6 sockets after Ilvl=40.

Low quality items cannot originally have sockets.

Adding Sockets

If you are not happy with the number of sockets in your item you have several possibilities to change it.

Normal Items

With normal items (grey colored), there are 3 basic methods to get normal socketed items:

  1. Find it
  2. Use the socketing quest
  3. Use cube recipes

Each character can earn three socketing quest rewards, one on each difficulty level. Typically one uses this quest on a normal item when they wish to use runewords. Runewords do not replace staffmods or superior affixes on an item, so having these affixes appear on a white item will encourage you to socket the item for using a runeword.

The quest always gives the maximum sockets allowed on a normal item. If the desired runeword has fewer runes than the maximum sockets possible in a given item type, Larzuk’s quest reward is useless in that instance. Instead, a cube recipe should be used to obtain a semi-random number of sockets.

  1. Tal, Thul, Ptopaz, normal body armor
  2. Ral, Amn, PAmethyst normal weapon
  3. Ral, Thul, PSaphire, normal Helm
  4. Tal, Amn, PRuby, normal shield

Low quality to normal quality:

  1. Eld, chippy, low quality weapon
  2. El, Chippy, low quality armor

Using the low quality to normal quality recipes changes the ilvl of the item to 1. From the above comment about maximum sockets and how they are related to ilvl, one could use this to their advantage. They could get an elite item, such as a phase blade, and use the recipe to make it a normal item then socket it to only have 3 sockets. One would want to do this in order to create runewords needing smaller number of sockets. “Malice” IthElEth would be an example of one such runeword that may be desired in a phaseblade, but 3 socketed phaseblades may be hard to come by. By finding a low quality one, using the recipe and then socketing with the quest someone could create the 3 socketed phase blade.

The socketing recipes for normal items give a random amount of potential sockets, which works out to a semi-random number in most items. The number is semi-random because the recipe rolls from 1-6 sockets in every item. If an item can not have up to six sockets though, any number higher than the item can contain will yield the maximum. For example, claws can get up to 3 sockets so with this recipe a claw would have:

  • 1/6 chance to get 1 socket.
  • 1/6 chance to get 2 sockets
  • 4/6 chance to get 3 sockets

Rares

There are 4 methods to get rares with sockets:

  1. Find a rare with mechanic’s prefix
  2. Use socketing quests
  3. Use recipes
  4. Reroll (replace the affixes of the item, using a cube recipe)

Using quest is the same as above. Socketing rares using recipes is much more costly than socketing normal items using any method, using the quest here may be a wiser move. The quest will always give 1 socket to rare items. Unique items and set items will also only get 1 socket with the quest reward. Also unique items and set items can only be socketed by using this quest.

There is one recipe for socketing rares. It always adds one socket, just like the quest:

  1. 3xPskulls, SOJ, rare item

Rerolling is like getting another item with completely different affixes, but it shares the same item type and quality. This is not of much use to most players, since it destroys the stats on the item, and simply rolls a new rare of the same item type. The odds of getting sockets on that one are low, and the odds of getting good stats + sockets is “struck by lightning” low.

Magical

Magical Items:

  1. Find them
  2. Use quest
  3. Reroll (replace the affixes of the item, using a cube recipe)

Using the quest on magical items will give that item 1-2 sockets, with equal chance of getting 1 or 2 sockets. This method can be used when desired affixes appear on magical items. Some affixes only appear on magical items and socketing such items will allow them to get more affixes from runes, gems, jewels. One such prefix is the +3 skill tree affixes.

Rerolling is like getting another item with completely different affixes, but it shares the same item type and quality. The magical rerolling recipes are kind of interesting and can be used creatively. You may socket originally unsocketed unique and set items using Socketing Quests. It always adds just one socket.

Affix selection

Magic, rare and crafted items have randomly generated affixes. At the beginning of affix generation process the game must decide how many affixes will have the given item.

When Magic Items are created the chances are:

  • Both Prefix and Suffix: 25%
  • Only a Prefix: 25%
  • Only a Suffix: 50%.

Rare Items are really just Magic Items with more than two Magical Prefix/Suffix with a special name. The names of Rare Items are not connected to their stats, so their name is not helpful in describing what stats might be on a Rare Item. The names are randomly generated, however, some names will not appear with some prefixes and suffixes. Rare Items have 3 to 6 magical properties or Magic Prefixes or Magic Suffixes. There is 1/4 chance for every affix number to be generated.

Each magical property picked will have a 1/2 chance of being a Prefix or a Suffix, but there will never be more than 3 Prefixes or 3 Suffixes on the same Rare Item. A Prefix or Suffix will never be picked more than once. Only one Prefix or Suffix will be picked per Prefix or Suffix group. This means for example, if the Prefix Wyrm (+41-60 Mana) is chosen, Dragon’s (+31-40 Mana) will not also be chosen since it belongs to the same Prefix +Mana group. Prefixes and Suffixes of the same types (such as Magic Find, Light Radius, Attack Rating) can be chosen. Only members of the same group cannot be chosen.

Crafted Items have 1-4 Random Magical Prefixes/Suffixes On top of those fixed properties, a Crafted Item can have from 1-4 standard Rare and Magic Prefix and Suffixes. These are generated pretty much the same way as a Rare item.

  • At ilvls 1-30, there’s a 40% chance of 1 affix and a 20% chance each of 2, 3 or 4 affixes.
  • At ilvls 31-50, there’s a 60% chance of 2 affixes and a 20% chance each of 3 or 4 affixes.
  • At ilvls 51-70, there’s an 80% chance of 3 affixes and a 20% chance of 4 affixes.
  • At ilvls 71+, there’s a 100% chance of 4 affixes.

When an item is generated that has prefixes the alvl is calculated* from ilvl and qlvl as follows:

If (ilvl>99) then {ilvl=99}
if (qlvl>ilvl) then {ilvl=qlvl} ;** see note below
if (magic_lvl>0) then {alvl=ilvl+magic_lvl}
else
{
if (ilvl<(99-qlvl/2))
then {alvl=ilvl-qlvl/2}
else {alvl=2*ilvl-99}
}
If (alvl>99) then {alvl=99}

  • *all calculations use integers so there are no fractions at any step.
  • ** this new ilvl value is only used for the duration of this calculation. The ilvl value that is stored in the items data file will remain unchanged.

Now that the game has decided which prefixes are available for allocation, they will have to select their prefix from the multiple choices in the given group. These are done by the frequency column.

Frequency determines the probability that an prefix is selected, a higher frequency = a greater probability.

Assuming: Mod1freq=5, Mod2freq=3, Mod3freq=2, Mod4freq=1

and you can get only Mod1 & Mod2, then your probabilities would be:

  • chance to get Mod1 = 5 / (5+3) = 5/8 = 62.5%
  • chance to get Mod2 = 3 / (5+3) = 3/8 = 37.5%

and if you could get all four,

  • chance to get Mod1 = 5 / (5+3+2+1) = 5/11 = 45.5%
  • chance to get Mod2 = 3 / (5+3+2+1) = 3/11 = 27.3%
  • chance to get Mod3 = 2 / (5+3+2+1) = 2/11 = 18.2%
  • chance to get Mod4 = 1 / (5+3+2+1) = 1/11 = 9.1%

You can also use maxlevel to filter out the ‘lower quality’ prefixes at the higher level. By setting the maxlevel so that there is an overlap, you will always have that type of prefix available at all levels, while effectively keeping the prefix pool powerful.

For example, imagine that Normal difficulty Pindleskin has dropped Small Charm with a suffix only. What probabilities of what suffixes you have?

Set Ilvl=45 /* (Normal Pindleskin) /
Set Qlvl=28 /
(Small Charm) /
/

Ilvl>Qlvl
Ilvl<99-Qlvl/2 (45<85)

  • /

Alvl=Ilvl-Qlvl/2 /* Alvl=31 */
Select * from MagicSuffix.txt where itype1=scha, spawnable=1, level<=31

Here is the query result list (number in brackets is frequency):
of Dexterity (4),
of Dexterity (4),
of Greed (4),
of Fortune (3),
of Life (4),
of Substinence (4),
of Strength (4),
of Strength (4),
of Blight (2),
of Venom (1),
of Frost (2),
of the Icicle (1),
of Flame (2),
of Fire (1),
of Shock (2),
of Lightning (1).

There is two entries “of Dexterity” because they are different suffixes with the same name. One of them is “+1 dexterity”, another – “+2 dexterity”. “of Strength” suffixes have the same particularity.

Total frequency is 43. It means that our charm has 4/43 chance to have “of Dexterity +1” suffix and 1/43 – “of Venom”.

Another interesting properties of items that gives you bonuses to a skill or even to a skill tree is called “Staffmods”. They are neither prefixes no suffixes. They are basic item properties like durability.

Claws with staffmods are (itemtype=h2h2)

  • Hand Scythe
  • Greater Claws
  • Greater Talons
  • Scissors Quhab
  • Suwayyah
  • Wrist Sword
  • War Fist
  • Battle Cestus
  • Feral Claws
  • Runic Talons
  • Scissors Suwayyah

1st tier skills

  • Fire Trauma (read fire blast: Uzziah)
  • Claw Mastery
  • Psychic Hammer
  • Tiger Strike
  • Dragon Talon

2nd tier skills

  • Shock Field (shockweb)
  • Blade Sentinel
  • Quickness (Boost of Speed)
  • Fists of Fire
  • Dragon Claw

3rd tier skills

  • Charged Bolt Sentry
  • Wake of Fire Sentry
  • Weapon Block
  • Cloak of Shadows
  • Cobra Strike

4th tier skills

  • Blade Fury
  • Fade
  • Shadow Warrior
  • Claws of Thunder
  • Dragon Tail

5th tier skills

  • Lightning Sentry
  • Inferno Sentry
  • Mind Blast
  • Blades of Ice
  • Dragon Flight

6th tier skills

  • Death Sentry
  • Blade Shield
  • Venom
  • Shadow Master
  • Royal Strike (read Pheonix Strike: Uzziah)

Base tier to use for an item is determined by the ilvl as tier: ilvl range

  • 1: 1-11
  • 2: 12-18
  • 3: 19-24
  • 4: 25-36
  • 5: 37+

then there is a random adjustment made for which tier to actually use when selecting the actual skill:

  • 20% chance to add 1
  • 50% chance to stay unmodified
  • 20% chance to subtract 1
  • 10% chance to subtract 2

Low quality items have their max tier capped at 4.

The game will then randomly select among the 5 skills at that tier.

The +X bonus is set by a RND[100] (this will give a range of values from 0 to 99) and if the item is an imbue it will add ilvl/2 (drop fractions).
If 90 or above, +3
Between 60 and 89: +2
Lower than 60: +1

The total skills on the item will have been set by a RND[100] and if an imbue add ilvl to that random number.
If 91 or above: 3 skills
Between 71 and 90: 2 skills
Between 31 and 70: 1 skill

Staffmods are broken into tiers. Each tier is typically all skills available at a given level. All staffmods are randomly created by a function of RND[100]. Basically a number is generated between 0-99, and certain rules apply to determine if and when +skills are given. Then another RND[100] is run to determine the magnitude of the +skills given. When imbuing an item the ilvl of the item is added to the RND[100], therefore increasing the chance of getting 3 staffmods.

The following item types can get staffmods:

  • wands
  • scepters
  • staves
  • claws (only as listed above, lower claws can not have staffmods)
  • class-specific items (claws separated because not all of them can have staffmods)

Of these items all but druid pelts, barb helms, paladin shields, necro heads appear on weapons. This will intuitively make one think I can reroll using the chippy and such recipes. You can and it will set your ilvl to 25 or 30 respectively that means a base tier of 4. This means that the item could only have tier 2 staffmods from the subtract 2 clause. But what about the tier 1 staffmods like tiger strike?

Before I mentioned that some staffmods are extremely hard to get. Low level assassin staffmods are the prime example. You can not get a low ilvl/qlvl claw to drop with low level staffmods, you also can not drop the ilvl low enough with magical rerolls. But you can get the rare reroll to drop your item down to ilvl 1 using a character level 1 muling character.

Note this means that you can not get these staffmods as an untwinked character.

Item Generation at Shops

Almost all trading information are stored in weapons.txt and armor.txt files. Remember the long chapter 4 in the beginning of the guide? It is there for a reason!

All items at shops have ilvl=clvl+5. In normal difficulty there is ilvl caps for every Act:

  • 12 for act 1
  • 20 for act 2
  • 28 for act 3
  • 36 for act 4
  • 45 for act 5.

In Nightmare and Hell item levels are not capped.

After the game has calculated ilvl it selects item types to spawn using fallowing algorithm. All ilvl>=25 items will spawn with magic quality.

Normal difficulty:

  1. Create item type list with all normal items, that have positive number in *Max field or in *MagicMax field of respective vendor in wepons.txt, armor.txt and misc.txt files (e.c. CharsiMax, GheedMax, CharsiMagicMax), except items, that have qlvl higher than ilvl.
  2. Exclude all magic items, that have ilvl<*MagicLvl (e.c. CharsiMagicLvl).

Nightmare difficulty:

  1. Create item type list with all normal items, that have positive number in *Max field or in *MagicMax field of respective vendor and NightmareUpgrade=“xxx”, except items, that have qlvl higher than ilvl.
  2. For all items, that have positive number in *Max field or in MagicMax field and NightmareUpgrade=“xxx”, there is (ilvl64+4000)/100000 chance to be upgraded to exceptional and be added to the list.
  3. For all normal items, that have positive number in *Max field or in *MagicMax field of respective vendor, add to the list items, whose codes are in NightmareUpgrade field, except those with NightmareUpgrade=“xxx”.
  4. Exclude all magic items, that have ilvl<*MagicLvl (e.c. CharsiMagicLvl).

Hell difficulty:

  1. Create item type list with all normal items, that have positive number in *Max field or in *MagicMax field of respective vendor and HellUpgrade=“xxx”, except items, that have qlvl higher than ilvl.
  2. For all items, that have positive number in *Max field or in MagicMax field and HellUpgrade=“xxx”, there is (ilvl128+5000)/100000 chance to be upgraded to exceptional and be added to the list.
  3. For all items, that have positive number in *Max field or in MagicMax field and HellUpgrade=“xxx”, there is (ilvl16+1000)/100000 chance to be upgraded to elite and be added to the list.
  4. For all normal items, that have positive number in *Max field or in *MagicMax field of respective vendor, add to the list items, whose codes are in HellUpgrade field, except those with HellUpgrade=“xxx”.
  5. Exclude all magic items, that have ilvl<*MagicLvl (e.c. CharsiMagicLvl).

The game will not spawn exceptional or elite items if clvl<25.

  • Note 1. In nightmare and hell you will not see items, that have item type code in NightmareUpgrade and HellUpgrade fields, e.c. Large Axe, Club, Wand.
  • Note 2. After clvl>=20 all items will spawn with with magic quality. However most vendors have MagicLvl=255 for many items. So that items will not be spawned.

Here is nice algorithm of game’s mechanic:

Pseudocode for determining whether a vendor/item combination is available:

__if vendorMax > 0 and qlvl <= 24 and ilvl_cap >= qlvl
____Normal range = qlvl → 24

__if (vendorMax > 0 or vendorMagicMax > 0) and vendorMagicLvl is not 255
____if vendorMagicMax > 0
______Magic range = max(qlvl,vendorMagicLvl) → 99
____else
______Magic range = max(qlvl,vendorMagicLvl,25) → 99

__if normal range and magic range both exist
____if ilvl is in either range
______item is available
____else
______item not available because we’re too low level, highlight it

__if only a normal range exists
____if ilvl is in range
______item is available
____else
______item not available, maybe because we’re too low level, maybe because we’re too high level, highlight it appropriately

__if only a magic range exists
____if ilvl is in either range
______item is available
____else
______item not available because we’re too low level, highlight it

__if neither range exists
____item not available, don’t even list it
The calculation of magic affixes in shops is the same as when an item is dropped by monster. Look at previous chapter.

Gambling

Item levels are determined by an equation:
ilvl = clvl + rnd[10] - 5
(i.e. from clvl-5 to clvl+4)

The chances for every quality are:

  • Unique: 1/2000
  • Set: 1/1000
  • Rare: 1/10
  • Magical: 1797/2000

Here are the equations used to determine whether or not the item will become exceptional or elite:

  • exceptional = 1 + (ilvl - excep qlvl) * 90 / 100
  • elite = 1 + (ilvl - elite qlvl) * 33 / 100

Magic Find in no way affects gambling.

Affixes are generated as always. See chapter 11 for details.

Ethereal Items

This is quite simple. Armor or weapons have 5% chance to be ethereal. Indestructible items (bows, xbows, phase blades) cannot spawn ethereal. The exception to this rule is an ethereal item socketed by a Zod rune, or some unique items that are always ethereal and indestructible.

Set items cannot be ethereal. Shopped, imbued and cubed items cannot be ethereal either.

Runes and charms generation

These items are covered here since they are much asked about. They are not special in their properties or creation though, and follow the same rules explained elsewhere. All information about their odds are stored in our favorite TreasureClassEx.txt file.

The reason of the fact that jewelry, runes and gems are a bit “special” is that all that items usually combined together into one treasure class, for example Hell Baal drops all his rings, amulets, jewels, runes, charms and gems from “Act 5 (H) Good” TC.

This chapter is organized into several examples about rune, charm and gem generation.

These items are covered here since they are much asked about. They are not special in their properties or creation though, and follow the same rules explained elsewhere. All information about their odds are stored in our favorite TreasureClassEx.txt file.

The reason of the fact that jewelry, runes and gems are a bit “special” is that all that items usually combined together into one treasure class, for example Hell Baal drops all his rings, amulets, jewels, runes, charms and gems from “Act 5 (H) Good” TC.

This chapter is organized into several examples about rune, charm and gem generation.

Common Mistakes

Using the wrong recipe - often people can not get the recipe for the item type correct. Make sure that you look up or memorizes recipes before you use them. The crafting recipes always follow this form: 1 Pgem, 1 Jewel, 1 rune, 1 magical item.

Using an item type other than magical - I see this all the time “why won’t this rare chain glove work in this recipe?” You need to use blue items known as magical items when crafting that is a specific factor in crafting.

Using the wrong character to craft and getting upset at the results - In crafting character level is important as it gives the affix levels (alvl) possible with that craft. Using the character level you can control crafts to give a specific required level or less, chance at specific affixes, and # of affixes on the craft.

Expecting a craft to retain affixes - simply put some people expect a craft to just gain affixes. Like a reroll (see later section) crafts get rid of the affixes on an item and roll new affixes, a craft is specific in that it contains certain affixes and adds additional ones.

Looking for Ethereal crafted items - Many as of late have been asking about getting Ethereal crafted items. As I have been informed they do not exist. If you use an ethereal item in a craft it loses its etherealness.

Character Level and affixes dealing with crafts.

Clvl effect how many affixes can spawn with a craft. This chart explains what chance you have of getting what number of affixes:

  • At ilvls 1-30, there’s a 40% chance of 1 affix and a 20% chance each of 2, 3 or 4 affixes.
  • At ilvls 31-50, there’s a 60% chance of 2 affixes and a 20% chance each of 3 or 4 affixes.
  • At ilvls 51-70, there’s an 80% chance of 3 affixes and a 20% chance of 4 affixes.
  • At ilvls 71+, there’s a 100% chance of 4 affixes.

clvl and ilvl control alvl of crafts by controlling the final ilvl that the craft receives. It follows this formula. ilvl = int(.5 * clvl) + int(.5 * ilvl). The int() means that you round down before plugging through the equation. Affixes control the required level of the craft. The formula is rlvl = rlvl(of highest affix) +10 +3x (#of affixes). So if you have a craft with 4 affixes and the highest affix has a required level (rlvl) of 12 your required level for that craft is 12 + 10 + 3*4 = 34. Since character level controls affix level and the # of affixes that can spawn it also controls the rlvl of the craft.

Magic Finding

What is MF?
It is “+% Better Chance of Getting Magic Item” property, that can be found on many items in the game, topazes are most popular of them.

What MF do?
It increases your chances at magic, rare, set and unique items. 100% MF doesn’t means that all items, that you find will be magic. It means, that the chance of item to be magic will be doubled. MF have diminishing returns for finding rare, set and unique items.

What is MF diminishing returns?
Effective MF=(MFFactor)/(MF+Factor), where Factor=250 for unique items, 500 for set items and 600 for rare items.
Is there a cap on MF?
Yes, implicitly. When you stack up your MF your increase your chance to find unique, set, rare and magic items. There is a cap on this chances. For example the cap in unique item chances for Act bosses is 50% (calculates from itemratio.txt as 128/(6400-(6400
983/1024))). Practically you’ll never reach this cap, so don’t afraid to increase your MF.

Will MF work on Runes?
No. MF works only when item type is already selected. So with more MF you will NOT get more weapons and armors and less runes.

Will MF help getting better Items from Gambling?
No.

Will MF work with Minions and Hirelings?
Yes. When you make a kill, you get the MF% of yourself only. When a Hireling gets a kill, it uses the combined MF of the Hireling and you.

Does number of players in the game increase the chances for an item to be unique?
No, it just increases number of dropped items and thus the number of unique items found. Only MF increases the chances for an item to be unique.

Does MF work on chests?
Yes, MF DOES work on every objects: chests, rocks, dead bodies, urns, etc. See chapter 17 for exact description of object drops. Special chest have fixed quality chances, though.

How exactly MF works?
It increases the chances for item to be unique/set/rare/magic by EffectiveMF/100 times. For example, Baal dropping an Unearthed Wand has 128/1984 chance to generate unique when you have 0% MF and 128/992 chance, when you have 167% MF.