cubemain.txt defines every Horadric Cube recipe in the game: rune upgrades, gem combines, socket-creation recipes, crafted items, unique/rare item upgrades (Normal → Exceptional → Elite), the act-quest combines (Horadric Staff, Khalim's Will), the secret-portal recipes (Cow Level, Pandemonium, Uber Tristram), and the Token of Absolution. Each row is one recipe — a set of input items that, when transmuted in the Cube, yields one or more output items (or special effects like a portal).
227 rows, 106 columns. The schema is wide because each row supports up to 7 inputs, 3 outputs (each with a level-control block plus 5 property mods), and a conditional-gate function. Most live recipes use only the first output and one or two mod slots; the schema's full capacity is never reached in shipped data.
What's in a row
The 106 columns split into six functional groups.
Identity and gating
| Column | Meaning |
|---|---|
description | Plain-text recipe name. Reference-only — the engine doesn't read it; the .txt comment helps modders identify the row at a glance. |
enabled | 1 = recipe is live in the game; 0 = recipe exists in the table but is disabled (cut content, future content, debug). 5 rows are blank — a third state, neither enabled nor disabled; all 5 are scaffolding for an unfinished "Tempered" item-quality system that didn't ship. Counts: 157 enabled, 65 disabled, 5 blank. |
firstLadderSeason / lastLadderSeason | Restricts the recipe to a range of ladder seasons. Both blank = no ladder restriction. 4 rows are ladder-restricted (to seasons 1–2). |
min diff | Minimum game difficulty required: 0 = all difficulties, 1 = Nightmare and Hell, 2 = Hell only. Only 1 row sets a value here (min diff = 2); the other 226 are blank (= no restriction). |
version | 0 = Classic-mode recipe; 100 = Expansion-mode recipe. Counts: 55 Classic, 172 Expansion. |
class | Restricts the recipe to one player class (Code from PlayerClass.txt). 0 rows currently use this — all recipes are class-agnostic in shipped data. |
Conditional gate (op / param / value)
A recipe can require an arbitrary check beyond having the right items in the cube — for example, "this recipe only works if the player has reached this difficulty on this quest." That check is encoded by op (which function), param (the function's input, usually a stat ID from ItemStatCost.txt), and value (the comparison threshold).
The engine supports 28 op codes (1–28). They cover: real-world calendar checks (op 1, 2), player-stat comparisons (3–14, base/non-base/current variants of ≥ ≤ ≠ =), input-item-stat comparisons (15–26, same comparison family), an item Mod Class check (27), and the quest-item / quest-difficulty check (28).
Of the 227 rows, only 6 set an op — and all 6 use op = 28. Those six are the act-quest item combines (Horadric Staff, Khalim's Will, Mephisto/Diablo/Baal organ portal, etc.) — recipes that require the quest to be at the right stage. Op codes 1–27 are documented in the engine but unused in shipped data; modders can rely on them.
Inputs
| Column | Meaning |
|---|---|
numinputs | How many input items the recipe consumes. Range: 2–7. Distribution: most recipes use 3 (69) or 4 (141) inputs; a handful use 5–7. |
input 1 … input 7 | Each input slot specifies one required item. The value is either a base-item code from armor.txt / weapons.txt / misc.txt, or one of the predefined codes from the Input/output code reference below, or a comma-separated combination (fhl,mag,upg = a magic upgradable Full Helm; r07,qty=3 = three Tal runes). |
Output (the primary output block)
| Column | Meaning |
|---|---|
output | What the recipe produces. Same code grammar as input 1: a base-item code, or one of the predefined output codes (useitem, usetype, Cow Portal, Pandemonium Portal, Pandemonium Finale Portal, Red Portal, pre=#, suf=#, etc.), or a comma-separated combination. See Input/output code reference. |
lvl | Forces the output's item level to this absolute value. If set, overrides plvl and ilvl. |
plvl | Multiplier applied to the player's clvl; the result is added to the output's level requirement. |
ilvl | Multiplier applied to input 1's ilvl; the result is added to the output's level requirement. |
mod 1 … mod 5 | Up to five properties added to the output. Each value is a Code from Properties.txt (gethit-skill, thorns, ac, dmg-pois, etc.). |
mod N chance | Percent chance the property is rolled. 0 (or blank) = always applied (this is a deliberate convention — 0 here does not mean "never"). |
mod N param | Param value for the property. Meaning depends on the property's Function ID in Properties.txt (often a skill ID or stat ID). |
mod N min / mod N max | The min and max values rolled for the property. Meaning again depends on the property's function (could be damage range, skill level, percent, etc.). |
Output B and Output C (multi-output capacity)
The schema mirrors the entire Output block twice more — a full set of output b / b lvl / b plvl / b ilvl / b mod 1–b mod 5 columns, and again as output c / c lvl / etc. — supporting recipes that yield two or three distinct items in one transmute.
0 of the 227 shipped rows currently populate output b or output c. The capacity is in the engine but no live recipe uses it.
Row terminator
| Column | Meaning |
|---|---|
*eol | End-of-row marker, always 0. Common to most .txt tables; reference-only, no gameplay effect. |
Input/output code reference
Every input and output slot accepts either a base-item code (the 3- or 4-character code from armor.txt / weapons.txt / misc.txt) or one of these predefined codes. Codes can be combined with commas: fhl,mag,upg = a magic, upgradable Full Helm.
Quality and version codes (input or output)
| Code | Meaning |
|---|---|
low | Low Quality |
nor | Normal Quality |
hiq | High Quality (Superior) |
mag | Magic |
set | Set |
rar | Rare |
uni | Unique |
crf | Crafted |
tmp | Tempered |
bas | Basic (Normal item tier) |
exc | Exceptional (item tier) |
eli | Elite (item tier) |
Sockets and ethereal (input or output)
| Code | Meaning |
|---|---|
nos | No sockets (input only) |
sock=# | Has # sockets (input) / Add # sockets (output) |
noe | Not Ethereal (input only) |
eth | Ethereal |
upg | Allows Upgrades (input only) |
nru | Not a Rune Word (input only) |
Quantity (input or output)
| Code | Meaning |
|---|---|
qty=# | Quantity multiplier — r07,qty=3 = three Tal runes; on output, produces # of the item |
Output-only codes
| Code | Meaning |
|---|---|
usetype | Output uses input 1's item type |
useitem | Output is input 1 itself (with whatever modifications follow) |
mod | Carry over input 1's modifiers onto the output |
pre=# | Force the output to roll a specific MagicPrefix.txt prefix (# = row index) |
suf=# | Force the output to roll a specific MagicSuffix.txt suffix (# = row index) |
uns / rem | Unsocket / remove all gems, runes, and jewels from the item's sockets |
rep | Repair the item |
rch | Recharge all skill charges on the item |
reg | If the recipe uses usetype and the input is a Unique, reroll the Unique |
Cow Portal | Open the portal to the Secret Cow Level |
Pandemonium Portal | Open one of the three Pandemonium mini-uber portals (Matron's Den / Forgotten Sands / Furnace of Pain), avoiding duplicates within a game |
Pandemonium Finale Portal | Open the portal to Uber Tristram |
Red Portal | Open a permanent portal to a levels.txt ID; the destination is set inline (e.g. Red Portal,lvl=137,qty=1) |
Conditional ops at a glance
The first column is the op value the recipe sets; the second describes what the engine checks. Player and input-item stat ops come in three flavors: base (hard points only), non-base (from states/skills/gear), and current (base + non-base combined).
op | Check |
|---|---|
| (blank) | No condition (the default — used by 221 of 227 rows) |
| 1 | Calendar day-of-month: param ≤ today ≤ value must be false |
| 2 | Calendar day-of-week ≠ value (1=Sun … 7=Sat) |
| 3 / 4 / 5 / 6 | Player current stat param is ≥ / ≤ / ≠ / = value |
| 7 / 8 / 9 / 10 | Player base stat param is ≥ / ≤ / ≠ / = value |
| 11 / 12 / 13 / 14 | Player non-base stat param is ≥ / ≤ / ≠ / = value |
| 15 / 16 / 17 / 18 | Input item current stat param is ≥ / ≤ / ≠ / = value |
| 19 / 20 / 21 / 22 | Input item base stat param is ≥ / ≤ / ≠ / = value |
| 23 / 24 / 25 / 26 | Input item non-base stat param is ≥ / ≤ / ≠ / = value |
| 27 | Item's Mod Class (unique ID or quality type) ≠ value |
| 28 | Input is a quest item with QuestDiffCheck — quest-difficulty must be greater than current game difficulty (used by the act-quest combines: Horadric Staff, Khalim's Will, etc.) |
Worked example: Token of Absolution
The Token of Absolution is a one-respec consumable, crafted from the four difficulty-keyed essences dropped by the act bosses on Hell:
| Column | Value | Notes |
|---|---|---|
description | 1 Twisted Essence of Suffering + 1 Charged Essence of Hatred + 1 Burning Essence of Terror + 1 Festering Essence of Destruction -> Token of Absolution | Reference-only label. |
enabled | 1 | Live recipe. |
version | 100 | Expansion-only. |
numinputs | 4 | Four input slots used. |
input 1–input 4 | tes, ceh, bet, fed | Four hardcoded essence codes — Andariel/Duriel/Mephisto/Diablo/Baal essence drops in Hell. |
output | toa | The Token of Absolution misc-item code. |
op, param, value | (blank) | No conditional gate — having the four essences is the only requirement. |
lvl / plvl / ilvl | (blank) | The token's level is whatever its misc.txt row defines, with no input-driven scaling. |
mod 1–mod 5 | (blank) | The Token of Absolution carries no rolled properties — it's a fixed misc item. |
The engine validates: enabled=1 (live), version matches (Expansion game), numinputs=4 matches what's in the cube, the four input codes match, no op condition to check — recipe succeeds, the four essences are consumed, one Token of Absolution is created.
For comparison, the Hit Power crafting recipe (1 Magic Full Helm + 1 Jewel + 1 Ith Rune + 1 Perfect Sapphire → Crafted Hit Power Helm) demonstrates the mod block in action: output = usetype,crf (output is a Crafted-quality version of input 1's helm type), mod 1 = gethit-skill with param=44 / min=5 / max=4 (a chance-on-being-struck skill cast — param/min/max meanings come from Properties.txt's function for gethit-skill), mod 2 = thorns with min=3 / max=7 (3–7 Thorns damage rolled at craft time).
Cross-references
armor.txt,weapons.txt,misc.txt— base-item codes used in theinput Nandoutputcolumns (fhl,r07,gpr,tes,toa, etc.).MagicPrefix.txt—pre=#in an output forces a specific prefix;#is the row index.MagicSuffix.txt—suf=#in an output forces a specific suffix;#is the row index.Properties.txt—mod 1–mod 5reference property codes here;mod N param,mod N min, andmod N maxare interpreted per the property's function.ItemStatCost.txt—opcodes 3–26 reference stat IDs from this table via theparamcolumn.PlayerClass.txt— theclasscolumn references player-class codes here (currently unused).levels.txt—Red Portaloutputs reference area IDs from this table for the portal destination.