You are viewing a potentially older version of this package. View all versions.
ProfMags-HaldorOverhaul-1.0.0 icon

HaldorOverhaul

Transforms Haldor into a full merchant with buy/sell panels, 580+ items, recipe-based pricing, search filters, category tabs, and full controller support.

Date uploaded 7 months ago
Version 1.0.0
Download link ProfMags-HaldorOverhaul-1.0.0.zip
Downloads 58
Dependency string ProfMags-HaldorOverhaul-1.0.0

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2200 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.2200
ValheimModding-JsonDotNET-13.0.4 icon
ValheimModding-JsonDotNET

Shared version 13.0.3 of Json.NET from Newtonsoft, net45 package for use in Valheim mods. Maintained by the ValheimModding team.

Preferred version: 13.0.4

README

Haldor Trading Overhaul

A comprehensive Valheim mod that transforms Haldor the Trader into a full-featured merchant with configurable buy AND sell functionality, balanced progression-based pricing, and complete controller support.

GitHub


Table of Contents

  1. Features
  2. Requirements
  3. Installation
  4. Configuration
  5. Price Generator Script
  6. Pricing System
  7. Customization Guide
  8. Troubleshooting

Features

Core Functionality

  • Full Buy & Sell System - Trade both ways with Haldor using JSON-driven configs
  • Custom Sell Panel - Professional UI cloned from vanilla store, positioned alongside the buy panel
  • Progression Gating - Items unlock based on defeated bosses

Search & Filter

  • Search Boxes - Both buy and sell panels have search input fields
  • Real-time Filtering - Type to instantly filter items by name
  • Persistent Focus - Search boxes maintain proper input focus when navigating

Category Tabs

  • Organized Browsing - Items sorted into logical categories
  • Quick Navigation - Jump between Weapons, Armor, Materials, Food, and more
  • Visual Clarity - Easy to find what you're looking for

Controller Support

  • Full Gamepad Navigation - Complete controller support for the entire trader UI
  • Seamless Switching - Switch between keyboard/mouse and controller at any time
Button Action
LB / RB Switch between Buy and Sell panels
D-Pad / Left Stick Scroll through item lists and categories
X Open or close category menu
A Buy or Sell selected item
B Close trader UI

Technical Features

  • Reflection-based implementation for resilience across Valheim updates
  • No hard dependencies on internal UI types
  • Automatic config generation on first run
  • Hot-reloadable JSON configurations

Balanced Economy

  • 580+ items available for trading
  • Recipe-based pricing ensures fair values
  • Biome-tier progression (Meadows through Deep North)
  • Category and rarity multipliers for fine-tuned balance

Requirements

Requirement Version
Valheim Current PC version
BepInEx 5.4.2200 or newer

Recommended Mods

Mod Reason
CurrencyPocket Highly recommended! Late-game items can cost 50,000+ coins. CurrencyPocket removes the 999 stack limit on coins, letting you carry enough gold for expensive purchases.

Installation

Manual Installation

  1. Install BepInEx for Valheim
  2. Download the latest release
  3. Extract contents to BepInEx/plugins/HaldorOverhaul/
  4. Launch Valheim - default configs will generate automatically

File Structure

BepInEx/
├── plugins/
│   └── HaldorOverhaul/
│       ├── HaldorOverhaul.dll
│       ├── manifest.json
│       └── README.md
└── config/
    ├── HaldorOverhaul.haldor.buy.json
    └── HaldorOverhaul.haldor.sell.json

Configuration

Config File Locations

BepInEx/config/HaldorOverhaul.haldor.buy.json   - Items Haldor sells
BepInEx/config/HaldorOverhaul.haldor.sell.json  - Items Haldor buys from you

Entry Format

{
  "item_prefab": "SwordIron",
  "item_quantity": 1,
  "item_price": 4234,
  "must_defeated_boss": "defeated_gdking"
}
Field Description
item_prefab Internal item name (must match game exactly)
item_quantity Stack size per transaction
item_price Price in coins
must_defeated_boss Boss key required (empty = always available)

Boss Keys

Boss Key
Eikthyr defeated_eikthyr
The Elder defeated_gdking
Bonemass defeated_bonemass
Moder defeated_dragon
Yagluth defeated_goblinking
The Queen defeated_queen
Fader defeated_fader

Price Generator Script

The included Python script (generate.py) automatically generates balanced buy/sell configurations by fetching live item and recipe data from Jotunn documentation.

Quick Start

# Basic usage - outputs to Steam Valheim config folder
python generate.py

# Custom output directory
python generate.py "C:\path\to\output"

# Using environment variable
set HALDOR_CONFIG_PATH=C:\custom\path
python generate.py

How It Works

┌─────────────────────────────────────────────────────────────────┐
│                      DATA SOURCES                               │
├─────────────────────────────────────────────────────────────────┤
│  Jotunn Item List ──────► Parse HTML ──────► Raw Items          │
│  Jotunn Recipe List ────► Parse HTML ──────► Recipes            │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                    ITEM DATABASE                                │
├─────────────────────────────────────────────────────────────────┤
│  Each item defined with:                                        │
│  • Biome tier (determines base multiplier & boss key)           │
│  • Base price (raw value before multipliers)                    │
│  • Stack size (quantity sold per purchase)                      │
│  • Sell-only flag (treasure items like Amber, Coins)            │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                   PRICE CALCULATION                             │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  For RAW materials (ores, wood, drops):                         │
│  ┌────────────────────────────────────────────────────────┐     │
│  │ Price = base_price x biome_mult x category_mult        │     │
│  │                    x rarity_mult                        │     │
│  └────────────────────────────────────────────────────────┘     │
│                                                                 │
│  For CRAFTABLE items (weapons, armor, food, ammo):              │
│  ┌────────────────────────────────────────────────────────┐     │
│  │ ingredient_cost = Sum(ingredient_base_price x qty)     │     │
│  │ recipe_price = ingredient_cost x CRAFTING_MARKUP       │     │
│  │              x biome_mult x category_mult x rarity_mult│     │
│  │                                                         │     │
│  │ Final Price = max(base_price, recipe_price)            │     │
│  └────────────────────────────────────────────────────────┘     │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                      OUTPUT FILES                               │
├─────────────────────────────────────────────────────────────────┤
│  HaldorOverhaul.haldor.buy.json   (579 buyable items)           │
│  HaldorOverhaul.haldor.sell.json  (593 sellable items)          │
└─────────────────────────────────────────────────────────────────┘

Output Locations (Priority Order)

  1. Command-line argument
  2. HALDOR_CONFIG_PATH environment variable
  3. Default Steam path: C:\Program Files (x86)\Steam\steamapps\common\Valheim\BepInEx\config
  4. Local ./output folder

Pricing System

Biome Multipliers

Items are assigned to biome tiers based on where they're obtained. Higher tiers = higher prices and later boss requirements.

Biome Multiplier Boss Required Example Items
Meadows 1.5x None Wood, Flint, Leather
Black Forest 2.75x Eikthyr Bronze, Core Wood, Troll Hide
Swamp 4.5x The Elder Iron, Chain, Guck
Mountain 7.5x Bonemass Silver, Wolf Pelt, Dragon Tears
Plains 12.0x Moder Black Metal, Lox Pelt, Barley
Mistlands 20.0x Yagluth Eitr, Black Core, Carapace
Ashlands 32.0x The Queen Flametal, Charred Bone, Sulfur
Deep North 50.0x Fader Future content

Category Multipliers

Different item types have value modifiers reflecting their utility and rarity.

Category Mult Examples
Weapons
weapon_2h 1.3x Battleaxes, Atgeirs, Sledges
weapon_1h 1.0x Swords, Maces, Knives
staff 1.35x All magic staves
crossbow 1.25x Crossbows
bow 1.1x Bows
Armor
armor_heavy 1.35x Padded, Iron, Bronze armor
armor_light 1.2x Leather, Troll, Root armor
cape 0.85x All capes (Hilda exclusive)
shield 0.9x All shields
Consumables
food_cooked 1.0x Cooked food, stews
food_raw 0.7x Raw meat, berries, mushrooms
food_mead 1.2x All meads
ammo 1.0x Arrows, Bolts
Materials
material_common 0.8x Basic crafting materials
material_rare 1.5x Chain, Surtling Core, Ectoplasm
material_boss 2.5x Boss drops (Dragon Tear, etc.)
Other
trophy_boss 3.0x Boss trophies
trophy_rare 1.3x Rare enemy trophies
trophy_common 0.9x Common enemy trophies
key 2.0x Dungeon/progression keys
tool 0.8x Pickaxes, Hammer, Hoe
cosmetic 0.7x Decorative items

Rarity Overrides

Special multipliers for particularly rare or valuable items:

Item Mult Reason
Boss Drops
HardAntler 2.0x Eikthyr drop
CryptKey 2.2x The Elder drop (Swamp Key)
Wishbone 2.0x Bonemass drop
DragonTear 2.0x Moder drop
Rare Materials
Chain 1.8x Rare dungeon drop
SurtlingCore 1.6x Essential for smelting
Ectoplasm 1.4x Rare ghost drop
BlackCore 1.7x Rare Mistlands material
Eitr 1.8x Magic fuel
Special Items
DragonEgg 2.5x Boss summoning item
DvergrKey 1.8x Mistlands progression
Dyrnwyn Fragments 2.5x Legendary weapon pieces

Key Constants

SELL_MULTIPLIER = 0.30      # Sell price = 30% of buy price
CRAFTING_MARKUP = 1.15      # 15% markup on crafted items
MIN_PRICE = 5               # Minimum item price
MAX_PRICE = 99999           # Maximum item price

Example Price Calculations

Raw Material: Iron Ore

Base price: 18
x Biome (Swamp 4.5x)
x Category (material_common 0.8x)
= 18 x 4.5 x 0.8 = 64 coins

Crafted: Bronze Bar

Recipe: 2 Copper + 1 Tin
Ingredient costs: (2 x 14) + (1 x 14) = 42
x Markup (1.15x) = 48.3
x Biome (Black Forest 2.75x) = 132.8
x Category (material_common 0.8x) = 106 coins

Crafted: Iron Sword

Recipe: 2 Wood + 4 Iron + 3 Leather Scraps
Ingredient costs: (2x2) + (4x40) + (3x5) = 179
x Markup (1.15x) = 205.85
x Biome (Swamp 4.5x) = 926.3
x Category (weapon_1h 1.0x) = 926+ coins

Ammo: Iron Arrows (Stack of 20)

Recipe: 8 Wood + 1 Iron + 2 Feathers -> 20 arrows
Ingredient costs: (8x2) + (1x40) + (2x3) = 62
x Markup (1.15x) = 71.3
x Biome (Swamp 4.5x) = 320.85
x Category (ammo 1.0x) = 320 coins for 20 arrows

Sample Prices

Materials by Tier

Material Buy Sell Biome
Wood 5 1 Meadows
Bronze 105 31 Black Forest
Iron 144 43 Swamp
Silver 180 54 Mountain
Black Metal 336 100 Plains
Eitr 3,510 1,053 Mistlands
Flametal 972 291 Ashlands

Weapons Progression

Weapon Buy Price Tier
Flint Axe 54 Meadows
Bronze Sword 676 Black Forest
Iron Sword 4,234 Swamp
Silver Sword 12,232 Mountain
Blackmetal Sword 10,920 Plains
Mistwalker 31,220 Mistlands
THSwordSlayer 67,891 Ashlands

Boss Drops

Item Price Unlocks After
Hard Antler 600 Always
Swamp Key 1,331 Eikthyr
Wishbone 3,375 The Elder
Dragon Tear 4,500 Bonemass

Customization Guide

Adding New Items

  1. Open generate.py
  2. Find ITEM_DATABASE section
  3. Add entry in format:
'ItemPrefab': (Biome.TIER, base_price, stack_size, sell_only),

Adjusting Prices

Modify the multipliers in generate.py:

# Global adjustments
SELL_MULTIPLIER = 0.30      # Change sell ratio
CRAFTING_MARKUP = 1.15      # Change crafting fee

# Biome multipliers in Biome enum
MEADOWS = ("Meadows", 1.5, "", 1)  # (name, mult, boss_key, order)

# Category multipliers in CATEGORY_MULTIPLIERS dict
'weapon_2h': 1.3,  # Adjust weapon values

# Rarity overrides in RARITY_OVERRIDES dict
'Chain': 1.8,  # Adjust specific item values

Excluding Items

Add patterns to exclusion lists:

# Hilda-exclusive items (capes, dresses)
HILDA_EXCLUSIVES = {'CapeDeerHide', 'CapeTrollHide', ...}

# Pattern exclusions
EXCLUDED_PATTERNS = [r'^Bow_projectile', r'^fx_', ...]

Troubleshooting

Common Issues

Items not appearing in trader:

  • Verify item_prefab matches the game's internal name exactly
  • Check that required boss has been defeated
  • Ensure JSON syntax is valid

Prices seem wrong:

  • Re-run generate.py to regenerate configs
  • Check for missing ingredients in NAME_TO_PREFAB mapping
  • Verify item is in ITEM_DATABASE

Script errors:

  • Ensure Python 3.x is installed
  • Check internet connection (script fetches from Jotunn docs)
  • Try running with custom output path

Validation Warnings

The generator script automatically warns about:

  • Price inversions: Higher-tier items cheaper than lower-tier
  • Suspiciously cheap: High-tier items under 10 coins
  • Very expensive: Items over 50,000 coins

Version History

Version Changes
1.0 Initial release - Full buy/sell system, recipe-based pricing, biome progression, category/rarity multipliers

Credits

  • HaldorOverhaul Mod - Custom trader overhaul for Valheim
  • Price Generator - Python script using Jotunn documentation data
  • Jotunn - Valheim modding library (data source)

License

This mod is provided as-is for personal use with Valheim.

CHANGELOG

Changelog

1.0.19

  • Added shared bank balance sync with HildirOverhaul (both traders now read/write the same bank balance)
  • Internal bank persistence now migrates and mirrors legacy Haldor/Hildir keys into a shared key

1.0.18

  • Fixed custom trader UI so it only applies to Haldor
  • Other traders (Hildir and modded NPCs) now use the vanilla StoreGui
  • Improved compatibility with mods that add their own traders

1.0.17

  • Improved trader UI layout and visual polish

1.0.16

  • Removed boss progression gates from treasure sell items (Amber, AmberPearl, Ruby, SilverNecklace, GoldRuby)
  • Players can now sell treasure to Haldor at any point in progression

1.0.15

  • Added custom UI sprites for search bar and category buttons (SearchBarBackground.png, CategoryBackground.png)
  • Fixed item category classification to use enum comparison instead of string matching
  • Fixed panel tinting so panels use a clean grey tint instead of brownish sprite-based coloring
  • Fixed TMP font warnings by deferring TextMeshProUGUI initialization until a font is assigned
  • Updated category button icons (bronze axe, troll leather helmet, wooden shield, stamina mead, bronze)
  • Added a grey tint overlay on the Buy/Sell action button to match panel styling

1.0.14

  • Added BowsBeforeHoes mod support
  • Added 10 BowsBeforeHoes items to buy/sell configs (3 bows, 4 quivers, 3 arrows) with recipe-based pricing
  • Doubled list panel scroll speed

1.0.13

  • Fixed standalone bank UI cursor being locked when opened with the Z key
  • Fixed bank UI registration so it behaves as a store UI (camera and input now work correctly)
  • Removed Z key shortcut for bank; bank access now happens through the trader UI
  • Added full controller support to the standalone bank panel

1.0.12

  • Bug fixes and stability improvements

1.0.11

  • Removed CurrencyPocket dependency requirement

1.0.10

  • Bug fixes and internal maintenance updates

1.0.9

  • Added Haldor's Bank system; bank balance funds purchases and selling deposits directly into the bank
  • Added Bank tab to the trader UI and a standalone bank panel (Z key)
  • Added setbankbalance console command (fixed registration so it now works in-game)
  • Reverted bank panel to a clean text layout
  • Additional bug fixes and performance improvements

1.0.8

  • Fixed controller navigation issues with item list scrolling and selection highlighting
  • Fixed controller inability to select category headers for expand/collapse
  • Fixed scroll position not resetting when switching tabs
  • Fixed multiple UI bugs and layout issues
  • Suppressed Haldor talk bubbles while the trading UI is open
  • Added setcoins console command for testing
  • Updated UI design

1.0.7

  • Updated trader UI visuals
  • Bug fixes and interaction improvements

1.0.6

  • Updated UI design
  • Updated price generator script
  • Updated config files
  • Various bug fixes

1.0.5

  • Added JsonDotNET and CurrencyPocket as required dependencies

1.0.4

  • Updated dependency configuration and packaging metadata

1.0.3

  • Added capes to the buy menu

1.0.2

  • Documentation updates in README.md

1.0.1

  • Documentation updates in README.md

1.0.0

  • Initial release