Use at your own risk. Everything here is shared by the community and is not tested or security-checked by rA Vault. Always try it on a sandbox / test server first.Not security-checked. Test on a sandbox server first. Read the disclaimer

Automatic Random Option Assignment by Equipment Type v1.0.1

This source modification automatically applies a Random Option Group to equipment when it is added to the player's inventory. Instead of assigning random options individually through drops or…

by Hyllok · listed Oct 29, 2026

Screenshot of Automatic Random Option Assignment by Equipment Type

This source modification automatically applies a Random Option Group to equipment when it is added to the player's inventory.

Instead of assigning random options individually through drops or scripts, this approach centralizes the logic in the source and resolves the group based on equipment category:

- Weapons (by weapon subtype)
- Armors (by equip location: headgear, armor, shield, garment, shoes, accessories)

When pc_additem is executed, the system:

- Resolves a Random Option Group ID based on the item’s type
- Applies the group automatically if a valid ID is returned

The group resolution is handled by a custom function:

static int pc_resolve_random_group(struct item_data* id)

The actual random options remain configured normally in:

/db/(pre)re/item_randomopt_group.yml

Known issues

No known issues yet.

Having trouble with Automatic Random Option Assignment by Equipment Type? Ask about it →