Changes

ADVERTISEMENT
From Diablo Wiki
Jump to: navigation, search

Item Generation Tutorial

5,759 bytes added, 13:34, 11 May 2008
no edit summary
==4.7. 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).
 
4.8. 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.<br>
2) Chance = (BaseChance - ((ilvl-qlvl)/Divisor)) * 128<br>
3) if (we check for unique, set or rare quality) EffectiveMF=MF*Factor/(MF+Factor)
else EffectiveMF=MF<br>
4) Chance= Chance* 100/(100+ EffectiveMF).<br>
5) if (Chance 6) FinalChance=Chance-(Chance*QualityFactor/1024)<br>
7) If (RND[ FinalChance ]<128) return Success<br>
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.
 
See chapter eight for more discussion of quality selection mechanics.
Administrators
2,378
edits