You are viewing a potentially older version of this package. View all versions.
RustyMods-TreasureChestTweaks-1.0.3 icon

TreasureChestTweaks

Adds Configurations to modify Container prefabs and allows for respawnability of contained items.

Date uploaded a year ago
Version 1.0.3
Download link RustyMods-TreasureChestTweaks-1.0.3.zip
Downloads 644
Dependency string RustyMods-TreasureChestTweaks-1.0.3

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2105 icon
denikson-BepInExPack_Valheim

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

Preferred version: 5.4.2105

README

Treasure Chest Tweaks

Adds the ability to easily configure treasure chests.

Features

  • Configurable loot tables for treasure chests
  • Configurable timer to respawn items in treasure chests
  • Configurable prefab names affected by patch

Changelog

1.0.0 - official release
1.0.1 - added fallbacks and fixes thanks to Azumatt
1.0.2 - added message log toggle and cleaned up solution
1.0.3 - Latest valheim update patch and YAML configuration option

Affected Prefab Names

Targetted prefab names can be configured by a string list seperated by commas:

Example: "TreasureChest_blackforest,TreasureChest_meadows,TreasureChest_dvergrtower"

or simply use "TreasureChest" to target all prefabs that contains treasure chest

Treasure Chest Configurations

Input value can be configured by a string list seperated by colons for each item and commas seperating item data: "prefabName,minStack,maxStack,weight"

YAML Configurations

Select YAML option and load up the game to generate the file. Once generated, go to your config folder to find the list of tweakable treasure chests.

Example: "Feathers,1,3,1:Coins,5,15,1:Amber,1,1,1:ArrowFlint,10,20,1"

On Empty vs On Repeat

If you toggle OnEmpty, the treasure chests will set a timer as soon as container is empty

if (__instance.m_inventory.m_inventory.Count == 0)
{
    DateTime currentTime = DateTime.Now;
    view.GetZDO().Set(Hash.chestRespawn, currentTime.Ticks);
}

If you toggle OnRepeat, the treasure chests will set a timer as soon as container has been changed.

else
{
    DateTime currentTime = DateTime.Now;
    view.GetZDO().Set(Hash.chestRespawn, currentTime.Ticks);
}

Debug Messaging

Currently I have it set to log a message on the console whenever a treasure chest respawns any items. Let me know if it becomes a nuasance then I will add a toggle.

Contact information

For Questions or Comments, find Rusty in the Odin Plus Team Discord

https://i.imgur.com/XXP6HCU.png

If you enjoy this mod and want to support me: Donate via Buy Me a Coffee