AzathothR-BountyHunter icon

BountyHunter

BountyHunterCONTRACT

Last updated a day ago
Total downloads 9
Total rating 0 
Categories Mods Server-side Client-side
Dependency string AzathothR-BountyHunter-1.0.1
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333

README

Bounty Hunter Contract

Adds a server-managed player assassination contract system. Players can put a price on other players' heads, offer real items as rewards, decide how many hunters may participate, and set how long the target must survive. The server is responsible for storing the contract, the reward, the bond, the participants, the timer, and the final result.

  • You can find me on our Valheim server's Discord. My name is Azathothreborn in OdinPlus.

Features

  • Buildable contract board
  • Players can publish contracts against other connected players.
  • The reward is taken directly from the inventory when the contract is created.
  • The creator can choose the target, reward, duration, and maximum number of hunters.
  • The contract timer only advances while the target is connected.
  • Hunters can accept or leave active contracts.
  • The target can eliminate hunters and win the reward.
  • Participants are forced to use PvP while the contract remains active.
  • Rewards and bonds are claimed from the board when the contract ends.

How it works

An administrator must place the contract board in the world. By default, only administrators can build it, but any player can use a board that has already been placed.

To publish a contract:

  1. Open the board.
  2. Select a player as the target.
  3. Choose an item from your inventory as the reward.
  4. Enter the number of items you want to deposit.
  5. Set the maximum number of hunters.
  6. Choose the contract duration.
  7. Deposit the reward and the required bond.

Once published, other players can join as hunters.

The contract can end when:

  • A hunter eliminates the target.
  • The target eliminates all available hunters.
  • The contract timer expires.
  • The creator cancels the contract.
  • An administrator removes it.

The exact result depends on the server configuration.

Rewards and bonds

The reward is stored by the server when the contract is published. A new copy of the item is not created.

Administrators can also block specific items through their prefab.

In addition to the reward, the creator must pay a coin bond. It is returned when the contract ends normally.

When the creator cancels a contract:

  • If nobody had accepted it, the creator recovers the reward and the bond.
  • If hunters had already joined, the creator recovers the reward, but the bond is distributed among the accepted hunters.

Timer

The duration is calculated using only the time the target remains connected.

For example, a 24-hour contract requires 24 actual accumulated hours of the target being connected. When the target disconnects, the timer pauses.

Administrators can also allow permanent contracts with no expiration date.

PvP Behavior

The target and active hunters are forced to have PvP enabled while participating in a contract.

Installation

Install the mod using a Valheim-compatible mod manager or place its files inside:

BepInEx/plugins

Configuration

Open the file:

BepInEx/config/Azathoth.BountyHunterContract.cfg

You can also modify it in-game using a mod such as Configuration Manager. Options locked by the server can only be changed by an administrator.

[1 - General]

# Locks synchronized options so they can only be modified by administrators.
Lock Configuration = On


[2 - Contracts]

# Maximum number of units that can be deposited as a reward.
Maximum Reward Item Amount = 1000000

# Prefabs that cannot be used as rewards.
# Separate them with commas, semicolons, or line breaks.
Prohibited Reward Prefabs =

# Maximum number of open contracts per creator.
Maximum Open Contracts Per Creator = 5

# Required bond in Coins.
Cancellation Bond Coins = 100

# Default duration shown on the board, expressed in minutes.
Default Contract Duration Minutes = 1440

# Minimum allowed duration.
Minimum Contract Duration Minutes = 10

# Maximum allowed duration.
Maximum Contract Duration Minutes = 10080

# Allows using 0 minutes to create permanent contracts.
Allow Permanent Contracts = Off

# Allows the target to win the reward by defeating all hunters.
Target Can Win Reward = On

# Gives victory to the target when they survive until the timer ends.
Target Wins On Expiration = On

# Shows a global announcement when a contract ends.
Global Completion Announcements = On

# Frequency at which participant tracking is updated.
Tracking Interval Seconds = 5

# Maximum time allowed to recognize the last valid hit before a death.
Kill Credit Seconds = 20

# Shows a global announcement when a contract is published.
Global Contract Announcements = On


[3 - Registry]

# Maximum number of contracts kept in the world history.
Maximum History Entries = 100


[5 - Discord Webhook]

# Enables Discord notifications.
Enabled = Off

# Full webhook URL.
Webhook URL =

# Message language: Spanish or English.
Language = Spanish

# Name that will appear in Discord.
Username = Bounty Hunter

# Optional public avatar URL.
Avatar URL =

# Sends a notification when a contract is published.
Notify Contract Published = On

# Sends a notification when a contract is resolved or expires.
Notify Contract Resolved = On

# Sends a notification when the creator cancels a contract.
Notify Contract Cancelled = On

# Sends a notification when an administrator removes a contract.
Notify Admin Removed = Off

The file also includes diagnostic options intended for testing. For a normal server, it is recommended to keep them disabled, since they can considerably increase the size of the log.

Discord Webhook Setup

  1. Open the Discord channel settings.
  2. Go to Integrations.
  3. Select Webhooks.
  4. Create a new webhook.
  5. Copy its URL.
  6. Paste the full address into Webhook URL.
  7. Change Enabled to On.
  8. Restart the server or reload the configuration file.

Example:

[5 - Discord Webhook]

Enabled = On
Webhook URL = https://discord.com/api/webhooks/ID/TOKEN
Language = Spanish
Username = Bounty Hunter
Avatar URL =
Notify Contract Published = On
Notify Contract Resolved = On
Notify Contract Cancelled = On
Notify Admin Removed = Off

The webhook URL is private. Do not publish it in screenshots, logs, or shared files. If it is leaked, delete it from Discord and create a new one.

Administrative Commands

Open the F5 console:

bhc help
Command Access Description
bhc help Administrator Shows the available help.
bhc list active Administrator Lists active contracts.
bhc list completed Administrator Lists completed contracts that may still have pending claims.
bhc list all Administrator Lists all currently stored contracts.
bhc remove <id or prefix> [mode] Administrator Removes a specific contract.
bhc remove-target "Name" [mode] Administrator Removes contracts associated with a target.
bhc remove-creator "Name" [mode] Administrator Removes contracts published by a player.
bhc clear-active [mode] Administrator Removes all active contracts.
bhc clear-completed [mode] Administrator Removes all completed contracts.
bhc clear-all [mode] Administrator Removes all stored contracts.

Resolution

Removal commands accept one of these modes:

Mode Result
auto Gives the reward to the winner if one exists; otherwise, returns it to the creator.
creator Returns the reward to the creator.
winner Gives the reward to the registered winner. If none exists, it returns to the creator.
target Gives the reward to the target.
destroy Removes the contract without delivering the reward or returning the pending bond.

Examples:

bhc list active
bhc remove 84f06787 auto
bhc remove-target "Player Name" creator
bhc remove-creator "Player Name" auto
bhc clear-active creator
bhc clear-completed auto

Credits

  • Thanks to Valkyrie/quantumperception, creator of great mods, for patiently answering all my questions and mentoring me.
  • Thanks to Midnightsfx, creator of Valheim Armory and Valheim Fortress, for answering countless questions and encouraging me during tough times.
  • Thanks to Niu (for the icon!), one of Valheim’s building geniuses.
  • Thanks to Davidmandalorian for advice and opinions on aspects of the mod and continued support.
  • Special thanks to everyone for helping make this project a reality.

Discord Logo