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
| Column | Meaning |
|---|---|
name | Reference field for the gem/rune name (matches the in-game display for gems and runes). |
letter | String-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. |
transform | Color change applied to the item after this is socketed. References the Index value in Colors.txt. |
code | The 3-char ID used to identify the gem/rune as an item. See Gem and rune codes below. |
weaponMod1Code … weaponMod3Max | Up to 3 stats the socketable grants when slotted into an item with gemapplytype = 0 (weapons). |
helmMod1Code … helmMod3Max | Up to 3 stats when slotted into an item with gemapplytype = 1 (helms or body armor). |
shieldMod1Code … shieldMod3Max | Up 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):
gemapplytype | Mod block applied |
|---|---|
0 | weaponMod* |
1 | helmMod* |
2 | shieldMod* |
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:
| Family | Letter | Chipped | Flawed | Normal | Flawless | Perfect |
|---|---|---|---|---|---|---|
| Amethyst | v | gcv | gfv | gsv | gzv | gpv |
| Topaz | y | gcy | gfy | gsy | gly | gpy |
| Sapphire | b | gcb | gfb | gsb | glb | gpb |
| Emerald | g | gcg | gfg | gsg | glg | gpg |
| Ruby | r | gcr | gfr | gsr | glr | gpr |
| Diamond | w | gcw | gfw | gsw | glw | gpw |
| Skull | (none) | skc | skf | sku | skl | skz |
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:
| # | Name | Code | # | Name | Code | |
|---|---|---|---|---|---|---|
| 1 | El | r01 | 18 | Ko | r18 | |
| 2 | Eld | r02 | 19 | Fal | r19 | |
| 3 | Tir | r03 | 20 | Lem | r20 | |
| 4 | Nef | r04 | 21 | Pul | r21 | |
| 5 | Eth | r05 | 22 | Um | r22 | |
| 6 | Ith | r06 | 23 | Mal | r23 | |
| 7 | Tal | r07 | 24 | Ist | r24 | |
| 8 | Ral | r08 | 25 | Gul | r25 | |
| 9 | Ort | r09 | 26 | Vex | r26 | |
| 10 | Thul | r10 | 27 | Ohm | r27 | |
| 11 | Amn | r11 | 28 | Lo | r28 | |
| 12 | Sol | r12 | 29 | Sur | r29 | |
| 13 | Shael | r13 | 30 | Ber | r30 | |
| 14 | Dol | r14 | 31 | Jah | r31 | |
| 15 | Hel | r15 | 32 | Cham | r32 | |
| 16 | Io | r16 | 33 | Zod | r33 | |
| 17 | Lum | r17 |
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 inRune1–Rune6.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,gemapplytypedefaults).armor/weapons—gemapplytypeandgemoffseton 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*Coderesolves to (one or moreitemstatcoststats with display logic).Colors.txt— thetransformcolumn references theIndexfield here for the post-socket color change on items.