Items

gems

Gem and rune stat tables; rune-name to rune-code mapping (Sol → r12).

Despite the name, the gems.txt table holds gems and runes both — every socketable that grants a stat when slotted. 69 rows total: 35 gems (7 families × 5 quality tiers), 33 runes (El through Zod), and 1 Expansion engine marker row that divides Classic from LoD entries in the source file.

This is also the canonical source of the rune-name → rune-code mapping (Sol → r12, Jah → r31, Zod → r33) that runes and cubemain reference.

What's in a row

ColumnMeaning
nameReference field for the gem/rune name (matches the in-game display for gems and runes).
letterString-table key for the letter shown in the item's tooltip when this is socketed. The engine resolves the key (e.g. r12L) to the display string ("Sol") and concatenates it into the item name. Blank for gems — only runes use this column.
transformColor change applied to the item after this is socketed. References the Index value in Colors.txt.
codeThe 3-char ID used to identify the gem/rune as an item. See Gem and rune codes below.
weaponMod1CodeweaponMod3MaxUp to 3 stats the socketable grants when slotted into an item with gemapplytype = 0 (weapons).
helmMod1CodehelmMod3MaxUp to 3 stats when slotted into an item with gemapplytype = 1 (helms or body armor).
shieldMod1CodeshieldMod3MaxUp to 3 stats when slotted into an item with gemapplytype = 2 (shields).

Each mod group follows the same Code / Param / Min / Max pattern used everywhere else in D2R's affix tables. Code is a property name from Properties.txt (which in turn composes one or more itemstatcost stats with display logic). Param is a stat-specific tuning value (often 0 or unused). Min/Max are the value bounds — which are equal for socketables, since gems and runes don't roll.

Three mod groups, one row

The three column blocks (weaponMod*, helmMod*, shieldMod*) are why a Topaz behaves differently in a sword (lightning damage) than in a helm (MF) than in a shield (lightning resist). The selector is the gemapplytype column on the socketed item (defined in armor, weapons, and misc.txt):

gemapplytypeMod block applied
0weaponMod*
1helmMod*
2shieldMod*

Note the asymmetry: helmMod* covers both helms and body armor — there is no separate bodyMod* block. This is why a Sol rune in a helm grants the same 7 damage reduced as Sol in body armor.

Gem and rune codes

Gems

Codes follow a g<quality><family> pattern for the six colored / clear gem families, and a separate sk<quality> pattern for skulls:

FamilyLetterChippedFlawedNormalFlawlessPerfect
Amethystvgcvgfvgsvgzvgpv
Topazygcygfygsyglygpy
Sapphirebgcbgfbgsbglbgpb
Emeraldggcggfggsgglggpg
Rubyrgcrgfrgsrglrgpr
Diamondwgcwgfwgswglwgpw
Skull(none)skcskfskusklskz

Two outliers in the quality letters: flawless Amethyst is gzv (not glv) and perfect Skull is skz (not skp). Engine quirks; ship as data.

Runes

Runes occupy 33 rows with codes r01 (El) through r33 (Zod). Their stats are a single mod per group — Sol gives +9 minimum damage in a weapon, +7 damage reduced in a helm or body, +7 damage reduced in a shield. No range, no roll.

Recipes and runeword definitions reference runes by their 3-char code, not by name. The full table:

#NameCode#NameCode
1Elr0118Kor18
2Eldr0219Falr19
3Tirr0320Lemr20
4Nefr0421Pulr21
5Ethr0522Umr22
6Ithr0623Malr23
7Talr0724Istr24
8Ralr0825Gulr25
9Ortr0926Vexr26
10Thulr1027Ohmr27
11Amnr1128Lor28
12Solr1229Surr29
13Shaelr1330Berr30
14Dolr1431Jahr31
15Helr1532Chamr32
16Ior1633Zodr33
17Lumr17

Multi-mod gems

Unlike runes, gems can grant up to 3 stats per socket-slot type. Most gems use 1 of the 3 available mod slots — multi-mod gems are rare. A Perfect Topaz in a weapon grants +1-249 lightning damage (one mod, one slot used); in a helm it grants +24% MF (one mod); in a shield it grants +40 lightning resist (one mod).

Cross-references

  • runes — runeword definitions reference these rune codes in Rune1Rune6.
  • cubemain — rune upgrade recipes (3 of rune X → 1 of rune X+1) reference these codes; gem-upgrade recipes (3 chipped → 1 flawed, etc.) similarly reference the gem codes here.
  • itemtypes — socket eligibility for gems/runes is gated by item-type flags here (MaxSockets1, gemapplytype defaults).
  • armor / weaponsgemapplytype and gemoffset on individual base-item rows determine which gem/rune mod block applies and which gem rows are eligible (filter by index).
  • Properties.txt — defines what each *Code resolves to (one or more itemstatcost stats with display logic).
  • Colors.txt — the transform column references the Index field here for the post-socket color change on items.