Meone101201-RarityWeightMod icon

RarityWeightMod

Configure cosmetic box spawn count and rarity weights per level. Set how many boxes spawn and control the chance of each rarity tier.

Last updated an hour ago
Total downloads 84
Total rating 0 
Categories Mods Server-side Cosmetics AI Generated
Dependency string Meone101201-RarityWeightMod-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2305

README

RarityWeightMod

📖 About

RarityWeightMod is a R.E.P.O. mod that controls how many cosmetic boxes spawn per level and the rarity weight of each tier.

✨ Features

  • Enable/Disable toggle: turn the mod on or off without uninstalling
  • Two spawn modes: Volume (respects level spawn volumes) or All (forces target count using compensation loop)
  • Configurable box count: 1–20 boxes per level
  • Rarity weights: control spawn chance of Common, Uncommon, Rare, and UltraRare independently
  • Level-only: patches apply only during actual levels — not in shop, lobby, or arena
  • BepInEx config: edit BepInEx/config/com.yourname.rarityweightmod.cfg to change settings

⚙️ How It Works

Volume mode sets the spawn loop to run up to BoxCount times, then stops naturally when no spawn volumes remain. The actual number of boxes may be lower than BoxCount if the level does not have enough available cosmetic spawn volumes.

All mode uses a compensation window of up to BoxCount × 3 - 1 attempts to retry when an internal spawn fails, similar to how CosmeticBoxConfig by khalil works. This makes it more likely to reach the configured target even on smaller levels.

Rarity is selected using a weighted random roll across all four tiers. The weight values are ratios — 60:25:12:3 and 6:2.5:1.2:0.3 produce identical results. Setting all four to the same value gives equal 25% chance per tier.


🔧 Configuration

After running the mod once, edit:

BepInEx/config/com.yourname.rarityweightmod.cfg
[General]
## Enable or disable the mod entirely.
## false = vanilla behavior, no patches applied.
# Default: true
Enabled = true

## Spawn mode:
##   Volume - spawn up to BoxCount boxes, limited by available spawn volumes in the level
##   All    - force BoxCount boxes using compensation loop (BoxCount × 3 - 1 attempts)
## Changes apply on the next level load.
# Setting type: SpawnMode
# Default: Volume
Mode = Volume

## Number of cosmetic boxes to target per level.
##   1-20 = target box count
## Changes apply on the next level load.
# Acceptable values: 1-20
# Default: 3
BoxCount = 3

[RarityWeights]
## Rarity weights are ratios, not percentages.
## Example: 60:25:12:3 gives ~60% Common, ~25% Uncommon, ~12% Rare, ~3% UltraRare.
## Setting all four to the same value gives equal 25% chance per tier.

# Acceptable values: 0-100
# Default: 60
CommonWeight = 60

# Acceptable values: 0-100
# Default: 25
UncommonWeight = 25

# Acceptable values: 0-100
# Default: 12
RareWeight = 12

# Acceptable values: 0-100
# Default: 3
UltraRareWeight = 3

📦 Installation

  1. Install BepInExPack REPO
  2. Place RarityWeightMod.dll in your BepInEx/plugins/ folder
  3. Launch the game

📜 Changelog

v1.0.0

  • Initial release
  • Enable/disable toggle
  • Volume/All dual spawn mode
  • Configurable 1–20 box count per level
  • Weighted rarity system for Common, Uncommon, Rare, UltraRare
  • Level-only guard using SemiFunc.RunIsLevel()

📄 Dependencies

  • BepInExPack_REPO >= 5.4.23

🧩 Compatibility

This mod patches ValuableDirector.SpawnCosmeticWorldObject, CosmeticWorldObjectLevelLoopsClampedGet, and CosmeticWorldObjectLevelLoopsGet. It does not modify EnemyDirector, LevelGenerator, or any other system. Monster counts and other level generation logic are unaffected.