The Diablo 2 Wiki
The Diablo 2 Wiki archive is available for anyone looking for information on Diablo 2. All information here is pre-D2R but contains a lot of useful information that is still relevant. Updated sections for new D2R features can be found on the PureDiablo Diablo 2 section

Item Generation Tutorial

From Diablo 2 Wiki
Revision as of 12:33, 11 May 2008 by 82.41.176.69 (talk)

This massive article explains item generation in great detail; far more detail than casual gamers are likely to be interested in. Skim this item generation encyclopedia by the chapter headings if you want one specific question answered. Read it cover to cover if you really want to understand how the game works.

For a similar article discussing item generation in earlier versions of the game, check out the v1.09 Item Generation Tutorial.


Item Generation Tutorial for Patch 1.11 v1.0

The Table of Contents

1. Basics 2. Terminology 3. Short Explanation of Drop Process 4. Game data files 4.1. TreasureClassEx.txt 4.2. Monstats.txt 4.3. MagicPrefix.txt and MagicSuffix.txt 4.4. Weapons.txt 4.5. Armor.txt 4.6. Misc.txt 4.7. ItemTypes.txt 4.8. Itemratio.txt 5. Area, monster and item levels 6. TC selection and number of dropped items 7. Item type selection 8. Item quality selection 9. Set and unique item selection 10. Sockets' number selection 11. Affix selection 12. Item generation at shops 13. Gambling 14. Ethereal items 15. Rune and charm generation 16. Quest drop and Andariel bug 17. Object drops 18. Countess 19. Crafting 20. Imbue 21. Cubing 22. Circlets and Magic Level 23. Runes in Hell Forge 24. Magic Find 25. 1.11 Drop Changes 26. Thanks

1. Basics

The goal of most players in Diablo II is to kill enemies while staying alive. There are three things that largely determine how effective your character is at this goal:

  1. Your tactics.
  2. The build of your character.
  3. The items used by your character.

All three have a great impact on gameplay -- characters die quickly on Hell difficulty if they play without wise tactics and kill slowly with poor skill distribution, but most players find that the essential element is proper use of items. A magic using character will see her effectiveness increase dramatically if she doubles her skill levels, and the effectiveness of a melee fighter or bow user is a direct reflection of the quality of their weapon. As a result, most players spend hours seeking top quality items, and then hours more trying to improve their gear further. At the highest end, most truly dedicated players spend virtually all their game time item hunting.

This guide explains how best to find the items you seek, and explains why this task often seems so difficult.


2. Terminology

  • Item Type: The kind of item; a cap, a gem, a short sword, a ring, etc.
  • Item Quality: Different qualities of the same item type. These are, in order of increasing scarcity: low quality > normal > superior > magic > rare > set > unique.
  • Affixes The magical modifiers on an item; prefixes and suffixes. (Not all item properties are affixes. For example: stuffmods, pre—defined properties of crafted items and some special mods of set and unique items. E.g. "+60 to Mana" on magic ring is affix, "+20% crushing blow" isn't affix.
  • Qlvl: Quality level. 1) A level of item type. All these levels are stored in the weapons.txt, armor.txt and misc.txt data files. 2) A level of set or unique item. All this levels are stored in UniqueItems.txt and SetItems.txt data files.
  • Ilvl: Item Level. All items in the game have levels. 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 30 weapon adn 30 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.
  • SP:Single Player mode.

3. 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.
    1. 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.
    2. 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.
  3. 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.
  4. For every selected item an ilvl is calculated.
  5. 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.
  6. 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

4.Game Data Files

This section discusses the data files that are used in item generation process.

Many parameters of drops are stored in txt files, that are packed to MPQ files when Diablo II is installed. If you have installed ATMA you may find that files unpacked in its data folder. These files are stored in CSV format, a plain text format that may be viewed with Excel or OpenOffice.org. You do not need to know everything about these complicated files to be effective in item hunting, but it will help if you know something about their structure. Truly dedicated item hunters will want to dig deeper into the files, and will find the D2 file guides posted at the Phrozen Keep, of value.