optimize_item
Craft the theoretical best-in-slot rare for any gear slot, optimizing a single metric or a weighted blend of offense and defense. Respects affix pools, mod-group exclusivity, and slot limits.
Instructions
Craft the best-in-slot rare for a slot — one metric, or a weighted blend via goals.
Searches the slot's REAL craftable affix pool (from the base's mod restrictions) and greedily
fills prefixes/suffixes — respecting the 3/3 limits and mod-group exclusivity. Every candidate is
engine-computed. base defaults to the currently-equipped base in that slot (so a wand build
stays a wand); pass it to try a different base. rolls: "realistic" (default) or "max"
(idealized T1). thorough=true adds a swap pass. Returns the crafted item (equip with
equip_item), the before/after numbers, and a warning if it breaks a resistance cap.
For realistic gear, pass goals — a weight map like {"TotalDPS": 0.6, "TotalEHP": 0.4} —
and the craft balances offense AND defense in one piece (real endgame gear is blended). Without
goals it maximizes the single metric, which strips the other axis (a TotalDPS craft carries
no life/resists). A blended craft returns metricsBefore/metricsAfter per goal. Either way,
re-check get_defenses after equipping.
Each result also reports attainability (per chosen affix: required ilvl + tier depth, e.g. top
tier of 8) and a coarse craft effort rating — a realism check from tier depth, NOT a market
price (the data has no spawn-weights). The crafted item is a theoretical best-in-slot target;
verify price with get_prices. Bounded greedy search, not a global optimum.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slot | Yes | ||
| metric | No | TotalDPS | |
| base | No | ||
| ilvl | No | ||
| rolls | No | realistic | |
| thorough | No | ||
| keep_resists_capped | No | ||
| goals | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||