Skip to content

M3TO/Valheim.DropThat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drop That!

This mod enables configuration of any mob loot table.

This solution is set up to easily (well, somewhat) configure any "character" drop table in the game. It can either add or replace existing drops.

See the Valheim wiki to get a list of item names which can be used.

A pretty comprehensive guide for prefabs can be found here

Table of content:

Features

  • Override any existing potential drop of a mob, by specifying the index (0 based) of the item you want changed.
  • Add as many additional drops with their own drop chance or drop range as you want
  • Discard all existing drop tables
  • Discard all existing drop tables for entities modified.
  • Configuration templates, for easy extension.
  • Add conditions for when a mob should drop an item
  • Server-side configs
  • Adds mod specific options for:
  • Performance improvements
    • Drop stacks instead of individual items. Want to have a stack of coins, that isn't a massive lag tower of individual coins?
    • Limit max amount to avoid those pesky world-crashing level 10 trolls.

Manual Installation:

  1. Install the BepInExPack Valheim
  2. Download the latest zip
  3. Extract it in the <GameDirectory>\Bepinex\plugins\folder.

Client / Server

Drop That needs to be installed on all clients and on server to work.

From v1.4.0 clients will request the configurations currently loaded by the server, and use those without affecting the clients config files. This means you should be able to have server-specific configurations, and the client can have its own setup for singleplayer.

Configuration

Attempting to work with the BepInEx configuration system, but is set up to manage "arrays" of drops. The configuration file 'drop_that.tables.cfg' is expected (and generated if not present) in the BepInEx config folder. It will be empty by default, and the user is expected to add in the changes desired.

If files are not present, start the game and they will be generated. Restart to apply changes.

Default drop tables and other helper info, can be generated by setting toggles in the main configuration file 'drop_that.cfg'. Pre-generated version can be found here:

General

'drop_that.cfg'

General configurations. Contains predefined configurations, which includes rules for how the 'drop_that.tables.cfg' entries will be applied.

[General]

## Enable debug logging.
EnableDebug = false

## Loads drop table configurations from supplemental files.
## Eg. drop_that.supplemental.my_drops.cfg will be included on load.
LoadSupplementalDropTables = true

[DropTables]

## When enabled, all existing items in drop tables gets removed.
ClearAllExisting = false

## When enabled, all existing items in drop tables are removed when a configuration for that entity exist. 
## Eg. if "Deer" is present in configuration table, the configured drops will be the only drops for "Deer".
ClearAllExistingWhenModified = false

## When enabled, drop configurations will not override existing items if their indexes match.
AlwaysAppend = false

## When enabled, drop conditions are checked at time of death, instead of at time of spawn.
ApplyConditionsOnDeath = false

[Debug]

## Enables in-depth logging. Note, this might generate a LOT of log entries.
EnableTraceLogging = false

## When enabled, creates a file on world start, in the plugin folder containing the default mob drop tables.
WriteDefaultDropTableToFile = false

## When enabled, creates a file on world start, in the plugin folder containing items of mobs that have drop tables.
WriteCreatureItemsToFile = false

## When enables, creates a file on world start in the plugin folder, containing the name of each location in the game.
WriteLocationsToFile = false

[Performance]

## When enabled, will always attempt to create stacks of items when dropping, instead of creating items one by one.
## Eg. 35 coin stack, instead of 35 individual 1 coin drops.
AlwaysAutoStack = false

## When greater than 0, will limit the maximum number of items dropped at a time. This is intended for guarding against multipliers.
## Eg. if limit is 100, and attempting to drop 200 coins, only 100 will be dropped.
DropLimit = -1

Drop Tables

'drop_that.tables.cfg'

Main file for inserting drop configurations. Drop tables are configured by creating a section as follows:

[<EntityPrepfabName>.<DropIndex>]
ItemName = <ItemPrefabName>
AmountMin = <integer>
AmountMax = <integer>
Chance = <DropChance> //0 disables it, 0.5 is 50% chance, 1 is 100% chance.
OnePerPlayer = <bool>
LevelMultiplier = <bool>
Enabled = <bool> //Disables this entry from being applied.

The DropIndex is used to either override an existing item drop, or simply to add to the list. Multiple drops for a mob can be modified by copying the above multiple times, using the same entity name and a different index.

Conditions can be added to each index as follows:

Setting Type Default Example Description
ConditionMinLevel int -1 1 Minimum level of mob for which item drops
ConditionMaxLevel int -1 5 Maximum level of mob for which item drops
ConditionNotDay bool false true If true, will not drop during daytime
ConditionNotAfternoon bool false true If true, will not drop during afternoon
ConditionNotNight bool false true If true, will not drop during afternoon
ConditionEnvironments string Misty, Thunderstorm Array of environment names that allow the item to drop while they are active. Leave empty to always allow
ConditionGlobalKeys string defeated_eikthyr, defeated_gdking Array of global keys names that allow the item to drop while they are active. Leave empty to always allow
ConditionBiomes string Meadows, Swamp Array of biome names that allow the item to drop while they are active. Leave empty to always allow
ConditionCreatureStates string Tamed, Event Array of creature states for which the item drop. If empty, allows all
ConditionNotCreatureStates string Tamed, Event Array of creature states for which the item will not drop. If empty, allows all
ConditionHasItem string skeleton_bow Array of items (prefab names) that will enable this drop. If empty, allows all
ConditionFaction string Undead, Boss Array of factions that will enable this drop. If empty, allows all
ConditionNotFaction string Undead, Boss Array of factions that will disable this drop. If empty, this condition is ignored
ConditionLocation string Runestone_Boars, FireHole Array of location names. When mob spawned in one of the listed locations, this drop is enabled
ConditionKilledByDamageType string Blunt, Fire Array of damage types that will enable this drop, if they were part of the final killing blow. If empty, allows all
ConditionKilledWithStatus string Burning, Smoked Array of statuses that mob had any of while dying, to enable this drop. If empty, allows all
ConditionKilledWithStatuses string Burning, Smoked Array of statuses that mob must have had all of while dying, to enable this drop. If empty, allows all
ConditionKilledBySkillType string Swords, Unarmed Array of skill types that will enable this drop, if they were listed as the skill causing the damage of the final killing blow. If empty, allows all
SetQualityLevel int -1 10 Sets the quality level of the item. If 0 or less, this setting is ignored
SetAmountLimit int -1 200 Sets an absolute limit to the number of drops. This will stop multipliers from generating more than the amount set in this condition. Ignored if 0 or less
SetAutoStack bool false true If true, will attempt to stack items before dropping them. This means the item generation will only be run once per stack

Example

[Draugr.0]
ItemName = Entrails
AmountMin = 1
AmountMax = 1
Chance = 1
OnePerPlayer = false
LevelMultiplier = true
Enabled = true

[Draugr.1]
ItemName = IronScrap
AmountMin = 1
AmountMax = 1
Chance = 1
OnePerPlayer = false
LevelMultiplier = true
Enabled = true

[Deer.5]
ItemName = Coins
AmountMin = 1
AmountMax = 100
Chance = 0.5
OnePerPlayer = false
LevelMultiplier = false
Enabled = true
ConditionMinLevel=1
ConditionMaxLevel=2
ConditionNotDay=false
ConditionNotNight=false
ConditionNotAfternoon=false
ConditionEnvironments=Misty
ConditionGlobalKeys=defeated_bonemass
ConditionBiomes=Blackforest,Meadows

Supplemental

By default, Drop That will load additional configurations from configs with names prefixed with "drop_that.supplemental.".

This allows for adding your own custom templates to Drop That. Eg. "drop_that.supplemental.my_custom_configuration.cfg"

The supplemental configuration expects the same structure as "drop_that.tables.cfg".

Mod specific configuration

Mod-specific configs can be added to each configuration entry as [<EntityPrepfabName>.<DropIndex>.<ModName>] These are implemented soft-dependant, meaning if the mod is not present, the configuration will do nothing.

Spawn That

Integrates features based on Spawn That.

Setting Type Default Example Description
ConditionTemplateId string MyTemplateId, 1234 Array of Spawn That TemplateId values to enable to drop for

Example of Eikthyr dropping ore only when spawned by an existing spawn that template with an assigned template id.

[Eikthyr.10]
ItemName = CopperOre

[Eikthyr.10.SpawnThat]
ConditionTemplateId=SomeTemplateIdForEikthyr

Example files for setting up a loot goblin can be found in the github example here.

Epic Loot

Integrates to magic item roll system from Epic Loot. Allows for making items magic. See the mod page for more in-depth description of the magic system.

The items are first given a rarity level, based on the configured options. The roll is done as a weighted distribution, meaning if you gave Magic 100 and Legendary 100, it would be 50% chance to become one of them. If you added Rare as 100, it would be 33% for any of them.

Setting Type Default Example Description
RarityWeightNone float 0 250 Weight to use for rolling as a non-magic item
RarityWeightMagic float 0 100 Weight to use for rolling as rarity 'Magic'
RarityWeightRare float 0 75 Weight to use for rolling as rarity 'Rare'
RarityWeightEpic float 0 50 Weight to use for rolling as rarity 'Epic'
RarityWeightLegendary float 0 10 Weight to use for rolling as rarity 'Legendary'
RarityWeightUnique float 0 1 Weight to use for rolling unique items from the UniqueIDs array. If item rolls as unique, a single id will be selected randomly from the UniqueIDs
UniqueIDs string HeimdallLegs, RagnarLegs Id's for unique legendaries from Epic Loot. Will drop as a non-magic item if the legendary does not meet its requirements

Example of bonemass set to always drop a pair of epic pants.

[Bonemass.10]
ItemName = ArmorBronzeLegs

[Bonemass.10.EpicLoot]
RarityWeightEpic = 1

Creature Level and Loot Control

Additional conditions for Creature Level and Loot Control. See the mod nexus page for more in-depth documentation for the options.

Setting Type Default Example Description
ConditionBossAffix string Reflective, Shielded Array of boss affixes, for which item will drop
ConditionNotBossAffix string Reflective, Shielded Array of boss affixes, for which item will not drop.
ConditionInfusion string Fire, Frost Array of creature infusions, for which item will drop
ConditionNotInfusion string Fire, Frost of creature infusions, for which item will not drop
ConditionExtraEffect string Quick, Curious Array of creature extra effects, for which item will drop
ConditionNotExtraEffect string Quick, Curious Array of creature extra effects, for which item will not drop

Example for boar which will drop iron scraps only when it has an Infusion.

[Boar.0]
ItemName = IronScrap
Enabled = true
AmountMin = 1
AmountMax = 1
Chance = 1

[Boar.0.CreatureLevelAndLootControl]
ConditionNotInfusion = None

Boss Affixes

  • None
  • Reflective
  • Shielded
  • Mending
  • Summoner
  • Elementalist
  • Enraged
  • Twin

Extra Effects

  • None
  • Aggressive
  • Quick
  • Regenerating
  • Curious
  • Splitting
  • Armored

Infusions

  • None
  • Lightning
  • Fire
  • Frost
  • Poison
  • Chaos
  • Spirit

General Field Options

Biomes

  • Meadows
  • Swamp
  • Mountain
  • Blackforest
  • Plains
  • AshLands
  • DeepNorth
  • Ocean
  • Mistlands

Environments

  • Clear
  • Twilight_Clear
  • Misty
  • Darklands_dark
  • Heath clear
  • DeepForest Mist
  • GDKing
  • Rain
  • LightRain
  • ThunderStorm
  • Eikthyr
  • GoblinKing
  • nofogts
  • SwampRain
  • Bonemass
  • Snow
  • Twilight_Snow
  • Twilight_SnowStorm
  • SnowStorm
  • Moder
  • Ashrain
  • Crypt
  • SunkenCrypt

Creature state

  • Default
  • Tamed
  • Event

Factions

  • Players
  • AnimalsVeg
  • ForestMonsters
  • Undead
  • Demon
  • MountainMonsters
  • SeaMonsters
  • PlainsMonsters
  • Boss

Damage Types

  • Blunt
  • Slash
  • Pierce
  • Chop
  • Pickaxe
  • Fire
  • Frost
  • Lightning
  • Poison
  • Spirit
  • Physical (Blunt, Slash, Pierce, Chop and Pickaxe)
  • Elemental (Fire, Frost, Lightning)

Skill Types

  • Swords
  • Knives
  • Clubs
  • Polearms
  • Spears
  • Blocking
  • Axes
  • Bows
  • FireMagic
  • FrostMagic
  • Unarmed
  • Pickaxes
  • WoodCutting
  • Jump
  • Sneak
  • Run
  • Swim

Status Effects

Valheim status effect options are not easily identified. But this is a list of at least some of the possibilities.

  • Burning
  • Spirit
  • Poison
  • Frost
  • Lightning
  • Smoked
  • Wet
  • Rested
  • Shelter
  • CampFire
  • Resting
  • Cold
  • Freezing
  • Encumbered
  • SoftDeath

Epic Loot status effects:

  • Paralyze

Changelog

  • v1.10.1:
    • Fixed issue with modifiers (eg. SetQualityLevel) not being applied in certain scenarios.
    • Fixed issue with Oozer not spawning more blobs when modified with Drop That. Turns out, not all drops are items. I encourage creative use of this knowledge, but wash my hands of the consequences.
    • Fixed unintended references to Spawn That, causing errors when not installed.
  • v1.10.0:
    • Optimized config sync.
    • Added settings for dropping items in stacks. Both global and/or per item.
    • Added settings for limiting max amount of a drop. Both global and/or per item.
    • Added conditions for killed while having specified statuses (eg. burning, smoked).
    • Added condition for killed by skill type (eg. swords, unarmed).
    • Added condition for killed by damage type (eg. blunt, fire).
    • Added condition for spawn location, and general setting for outputting all location names in a file.
    • Added setting "SetQualityLevel".
    • Added additional options for Epic Loot to roll specific unique legendaries.
  • v1.9.0:
    • Added conditions for creature faction.
    • Added support for Spawn That condition "ConditionTemplateId", allowing for drops only for a specific template.
    • Added sub-folder search for supplemental configs. It should now be possible to place Drop That supplemental files in any folder in the bepinex config folder.
  • v1.8.2:
    • Updated support for Epic Loot to v0.7.10. Added world luck factor to loot drops. Magic Items should no longer cause endless drops and error spam.
  • v1.8.1:
    • Fixed endless drop and error spam when Epic Loot was NOT installed.
  • v1.8.0:
    • Added support for Epic Loot.
  • v1.7.0:
    • Added conditions for mod Creature Level and Loot Control.
    • Improved config merging. Supplemental files interacting with same creature will now merge in item configs from each.
    • Rewrote internal configuration management to support soft-dependant, mod-specific configurations.
  • v1.6.2:
    • Fixed option AlwaysAppend being ignored.
    • Fixed drops with no configuration being discarded
  • v1.6.1:
    • Fixed empty ConditionHasItem not being considered "all allowed".
  • v1.6.0:
    • Added output file for creature items.
    • Added conditions for creature items (eg. skeleton_bow)
    • Added conditions for creature states (eg. tamed, event)
  • v1.5.0:
    • Adding option in drop_that.cfg to generate a file containing all default drop table items. Long missing feature, I know.
  • v1.4.0:
    • Server-to-client config synchronization added.
    • Removed option "LoadDropTableConfigsOnWorldStart". This will be done by default now (including the general config).
  • v1.3.3:
    • Fixed quality being set to 3 by mistake. Leftover from discarded feature, ups!
    • Fixed readme example.
  • v1.3.0:
    • Fixed lie about drop table configurations reloading on world start. It should work properly now!
    • Added support for setting drop conditions on each item
    • Added support for selecting whether to apply conditions at time of spawn or death.
  • v1.2.0:
    • Port and rewrite of configuration system from Custom Raids
    • Now supports loading of templates
    • Additional general configuration options
    • Now supports reloading of drop table configurations when reloading world. This means you can avoid having to completely restart the game if you only change the loot configs.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%