Hunts
On this page(25)
Every player has hunt slots, and each slot holds one hunt: an objective with a difficulty, a target and rewards. Hunts change on a fixed clock, for everybody at the same moment. Use them as rotating goals that keep every kind of play rewarding.
| Files | modules/hunts/config.yml, modules/hunts/hunts/ (one file per hunt), modules/hunts/guis/menu.yml |
| Player command | /hunt (alias /hunts) |
| Admin commands | /dungeons admin hunts ... |
| Switch | enabled: (first key of modules/hunts/config.yml) + /dungeons reload |
Hunts are built on the core Objectives: each hunt counts one objective type.
With the module off, /hunt goes away. Every slot stays stored.
How it works
The reset clock
The hunts change when the clock crosses a window (reset.every, 1 hour by default):
| Hunt state at the reset | What happens |
|---|---|
| Unfinished | It gets a new hunt. |
| Claimed ("Awaiting Reset") | It gets a new hunt. |
| Completed, not claimed | It WAITS for you: it stays claimable past the reset. |
There is no reset message: the clock of the menu (%sndungeons_hunts_reset_in%) says when. A player who was offline gets the new hunts when they join.
Assignment
- A difficulty is picked by its
weight(difficulties:of the config). - A hunt of the pool that defines that difficulty is picked, by its own
weight. - The target and the rewards are computed ONCE, from the formulas, and stay fixed.
The formulas follow the player's stage, so a hunt scales with their progress. A hunt counts only what happens AFTER it was assigned.
allow-duplicates: true lets the same hunt sit in two slots. A hunt whose type does not exist now (its module is off) is not given.
Progress and claims
Doing the objective adds to the hunt. Reaching the target completes it: chat lines, sounds.complete and a glowing tile.
- A click on a completed hunt claims it. Claim All claims every completed one in one go.
- The claim is SAVED FIRST, and only then its rewards run.
- A player who leaves before the rewards ran gets them at the next join.
- A click on an unfinished hunt does nothing.
Progress is saved with the player's data. A completion, a claim and a reroll are saved at once.
A crash at the exact moment between the rewards and their "paid" mark can give them twice.
Reroll
Right click an unfinished hunt, then right click it again within reroll.confirm-seconds. The tile shows the price in between.
- The slot gets another hunt of the SAME difficulty, from zero (another hunt when the pool has one).
- The price is
reroll.pricexreroll.growthper reroll already bought this window, inreroll.currency. - At most
reroll.limitrerolls per window.limit: 0orcurrency: ''turns the reroll off. - A completed or claimed hunt cannot be rerolled.
The bonus
Claiming EVERY slot you have in the window unlocks the bonus (the tile at the top). A click pays bonus.rewards, with the bonus.values formulas computed when you claim it. Once per window.
A hunt completed in the last window and claimed now counts for this window's bonus. A slot left without a hunt blocks it.
Slots
You have slots.base slots, plus:
- one per
slots.swing-unlockscount your swings reached; - the highest
sndungeons.hunts.slots.<n>permission you hold; - the slots an admin gave.
The total never passes slots.max (1 to 10). A new slot gets a hunt at once.
The locked tiles say how to open them: the next swing count, a rank, or "unlock slot N first". A slot you lose (a rank taken away) keeps its hunt. It counts nothing and cannot be claimed until you have the slot again.
Reminder
Every reminder-minutes (5), a player with completed hunts not claimed gets a chat line. The hunts.reminder setting (Chat tab of /settings) turns it off.
Configuration
reset
| Key | Default | What it does |
|---|---|---|
reset.every | 1h | Length of a window: 5m to 7d (s, m, h, d), aligned to the clock. |
reset.offset | 0m | Shift of the window start (0 to every). |
slots
| Key | Default | What it does |
|---|---|---|
slots.base | 3 | The slots everybody has. |
slots.swing-unlocks | [500000, 1000000, 2000000] | Each swing count reached opens one more slot (ascending). |
slots.max | 10 | The most slots (1 to 10). Also the highest sndungeons.hunts.slots.<n> that counts, and the cap of admin slots. |
difficulties
| Key | Default | What it does |
|---|---|---|
difficulties.easy.weight, .medium.weight, .hard.weight | 50, 35, 15 | The weight of each difficulty when a hunt is assigned. 0 = never. |
difficulties.<id>.name | 'Qc784Easy', '&#ffee58Medium', '&#ef5350Hard' | Its name (color codes allowed). |
allow-duplicates | true | The same hunt may sit in two slots at once. |
reroll
| Key | Default | What it does |
|---|---|---|
reroll.currency | perk-tickets | The currency of a reroll. '' = no reroll. |
reroll.price | 1 | The first reroll of a window. |
reroll.growth | 2.0 | Each reroll of the same window costs this many times the last one. |
reroll.limit | 3 | Rerolls per window. 0 = no reroll. |
reroll.confirm-seconds | 5 | How long the first right click waits for the second. |
bonus
| Key | Default | What it does |
|---|---|---|
bonus.rewards | ['souls give {player} {souls_raw}'] | Console commands. A line with a [tag] runs that action. |
bonus.values | souls: '{stage-reward:souls} * 2000' | Named formulas, computed when the bonus is claimed. # sn:extensible: add your own. |
bonus.rewards-display | ['&b{souls} Souls'] | The lines the menu shows. |
The reward lines take {player} and each value name: {souls} formatted, {souls_raw} as a plain number.
Other keys
| Key | Default | What it does |
|---|---|---|
reminder-minutes | 5 | Minutes between two reminders of unclaimed hunts. 0 = never. |
sounds.complete | 'ENTITY_PLAYER_LEVELUP 1 1.2' | Sound of a completion, as 'SOUND [volume] [pitch]'. '' = none. |
sounds.claim | 'ENTITY_EXPERIENCE_ORB_PICKUP 1 1' | Sound of a claim. |
sounds.deny | 'ENTITY_VILLAGER_NO' | Sound of a refusal. |
deny-cooldown-ticks | 20 | The least ticks between two refusals of one player. |
commands.main.command | hunt | Command name. |
commands.main.aliases | [hunts] | Other names. |
commands.main.permission | '' | Permission for the command and every hunts button. '' = everyone. |
commands.main.menu | menu | The menu /hunt opens (a file of modules/hunts/guis/). |
The sounds also follow the core.sounds setting of each player. The display-name key ('&eHunts') is the module's name in /dungeons admin modules.
Hunt files
Each file of modules/hunts/hunts/ is one hunt. The file name is its id: [a-z0-9-], at most 64 characters. The folder is created once with 20 hunts. Add, edit or delete files freely: a deleted file stays deleted.
modules/hunts/hunts/earn-money.yml (one difficulty)
name: 'Earn Money'
icon: GOLD_INGOT
description: 'Earn money while hitting mobs to complete this objective.'
weight: 10 # its chance in the pool (0 = never)
objective:
type: currency-earned # a type of /dungeons admin objectives types
filters: # context keys of the type (a value ending in * matches a prefix)
currency: [money]
difficulties: # easy, medium and/or hard: only the ones it defines
easy:
target: '{stage-reward:money} * 300' # a number or a formula
values:
souls: '{stage-reward:souls} * 200' # named formulas for the rewards
rewards:
- 'souls give {player} {souls_raw}' # a console command (or a line with a [tag])
rewards-display:
- '&b{souls} Souls' # what the menu shows| Key | What it does |
|---|---|
name | The hunt's name. |
icon | The material of its tile. An unknown material shows as paper. |
description | One line shown on its tile ({description}). |
weight | Its chance in the pool of a difficulty. 0 = never. |
objective.type | An objective type: a type of the plugin, or a custom:<id> of objectives/custom-events.yml. |
objective.filters | Context keys of that type and the accepted values. A value ending in * matches a prefix. |
objective.top | contest-place only: the places that count. |
difficulties.<easy|medium|hard> | Only the difficulties it defines. Each has the keys below. |
difficulties.<d>.target | A number or a formula. |
difficulties.<d>.values | Named formulas for the rewards. |
difficulties.<d>.rewards | Console commands, or lines with a [tag]. |
difficulties.<d>.rewards-display | What the menu shows as {rewards}. |
/dungeons admin objectives types lists the types and their context keys. The full type table is in Objectives.
Formulas
A target or a value is a formula computed for the player. It accepts + - * / ^ and parentheses. The functions are min(a, b, ...), max(...), floor(x), ceil(x) and round(x).
| Variable | Value |
|---|---|
{stage} | The global index (from 1) of the player's highest unlocked stage, counting every stage of every zone in order. |
{stage-reward:<currency>} | What a mob of that stage pays in that currency (no boosters, no rarity bonus). |
{stage-cost} | The price of the next stage (at the last one, the last one's). |
{level:<track>} | The player's level of that leveling track. |
Reward placeholders
{player}, {difficulty}, {hunt} and each value: {souls} in the number format, {souls_raw} as a plain number for commands.
The rewards-display lines are filled when the hunt is assigned and stored with it. So {player} shows nothing there.
Load warnings
Every problem is one console warning at load:
| Problem | Result |
|---|---|
| An unknown type, or a filter the type does not have | The hunt stays out. |
| A formula that does not compile | That difficulty is dropped. |
A reward line with an unknown [tag] | That difficulty is dropped. |
| A type of a module that is off | The hunt loads but is not given while that module is off. |
A hunt file deleted after it was assigned: a completed hunt is still claimed with its stored rewards. An unfinished one is replaced at the next reset.
The hunts menu
modules/hunts/guis/menu.yml (id hunts:menu), 5 rows:
| Letter | Tile |
|---|---|
a to j | The hunt slots 1 to 10. Move a letter to move its slot. |
B | The bonus. |
T | The time to the next reset. |
C | Claim All. |
K | How hunts work. |
# | Filler. |
The bonus items show by %sndungeons_hunts_bonus_state%: locked, ready or claimed.
The slots change with every reset, so the plugin binds them from templates:. slot-1 to slot-10 hold the clicks (left: claim, right: reroll) and their key places the slot. Keep them without a material, name or lore.
| Template | Look of a slot that is... |
|---|---|
hunt-active | An unfinished hunt. |
hunt-reroll-confirm | After a first right click. |
hunt-complete | Completed, ready to claim. |
hunt-claimed | Claimed, waiting for the reset. |
slot-empty | Without a hunt (none could be assigned). |
slot-locked-swings, slot-locked-rank, slot-locked-order | Locked by swings, by rank, or by the slot before. |
slot-hidden | Past slots.max. |
The three hunt looks show the hunt's icon instead of their material.
Locals of the hunt looks: {slot}, {name}, {description}, {progress}, {target}, {percent}, {difficulty}, {rewards}, {reroll-price}, {reroll-currency}, {rerolls-left}, {reset-in}. Locals of the slot looks: {slot}, {previous}, {required}, {swings}, {reset-in}.
The actions are [hunts] open, [hunts] claim <slot>, [hunts] claim-all, [hunts] reroll <slot> and [hunts] bonus. They work from any button, with the permission of /hunt. [open] hunts:menu also opens it.
Commands
| Command | Permission | Description |
|---|---|---|
/hunt | commands.main.permission ('' = everyone) | Opens the hunts menu: your slots, Claim All, the bonus and the time to the reset. |
/dungeons admin hunts slots <player> <add|set|take> <amount> | sndungeons.admin.hunts.slots | Changes the admin hunt slots of a player (online or not). |
/dungeons admin hunts reset <player> | sndungeons.admin.hunts.reset | Removes the hunts of a player, online or not. Claims whose rewards are still owed stay. An online player gets new hunts at once. |
/dungeons admin hunts complete <player> <slot> | sndungeons.admin.hunts.complete | Completes an unfinished hunt of an online player. |
/dungeons admin hunts progress <player> <slot> <amount> | sndungeons.admin.hunts.progress | Sets the progress of an unfinished hunt of an online player. |
/dungeons admin hunts info <player> | sndungeons.admin.hunts.info | Shows the hunt slots of an online player. |
/dungeons admin hunts list | sndungeons.admin.hunts.list | Lists the loaded hunts with their type and difficulties. |
| Permission | Default | What it gives |
|---|---|---|
sndungeons.hunts.slots.1 to .10 | false | That many extra hunt slots (the highest held counts, up to slots.max). |
Full lists: Commands and Permissions.
Placeholders
The hunts placeholders are listed in Placeholders. The most useful:
| Placeholder | Value |
|---|---|
%sndungeons_hunts_slots% | The hunt slots you have |
%sndungeons_hunts_completed_unclaimed% | Hunts completed and not claimed |
%sndungeons_hunts_reset_in% | Time to the next reset (like 42m 10s) |
%sndungeons_hunts_rerolls_left% | Rerolls left in this window |
%sndungeons_hunts_bonus_state% | locked, ready or claimed (_label for the word) |
%sndungeons_hunts_<slot>_name%, _difficulty, _progress, _target, _percent | The hunt in a slot (empty without one) |
%sndungeons_hunts_<slot>_state% | active, completed, claimed, empty or locked |
Tips
- Use
{stage-reward:<currency>}in targets and rewards, so a hunt stays fair from the first stage to the last. /dungeons admin hunts listafter a reload shows which hunts loaded. The console names the ones that did not.- Test a reward with
/dungeons admin hunts complete <player> <slot>, then claim it in the menu. - Hunts on a module's type (
perk-rolls,totem-merges...) are given only while that module is on.
Default modules/hunts/config.yml
enabled: true
# ============================================================
# SnDungeons - hunts module
# Managed by SnLib: new keys are auto-merged on boot; your values and
# comments are preserved. Re-read on /dungeons reload.
# ============================================================
# Switch of the module (the key above): false turns the hunts off on
# /dungeons reload; /hunt disappears and every slot stays stored.
# The hunts are the files of hunts/ in this folder: one file per hunt,
# created once with examples; add, edit or delete them freely (a deleted
# file stays deleted). A hunt counts an objective type of the core
# (/dungeons admin objectives types), only what happens after it was
# assigned.
# Name of the module in /dungeons admin modules (color codes allowed).
display-name: '&eHunts'
# The windows: every slot gets a new hunt when the clock crosses a window
# (an unfinished or claimed one; a completed one waits for its claim).
reset:
# Length of a window: 5m to 7d (s, m, h, d), aligned to the clock.
every: 1h
# Shift of the window start (0 to every).
offset: 0m
slots:
# The slots everybody has.
base: 3
# Each swing count reached opens one more slot (ascending).
swing-unlocks: [500000, 1000000, 2000000]
# The most slots (1 to 10): also the highest sndungeons.hunts.slots.<n>
# that counts, and the cap of the slots an admin adds.
max: 10
# The weight of each difficulty when a hunt is assigned (0 = never) and
# its name (color codes allowed).
difficulties:
easy:
weight: 50
name: 'Qc784Easy'
medium:
weight: 35
name: '&#ffee58Medium'
hard:
weight: 15
name: '&#ef5350Hard'
# The same hunt in two slots at once.
allow-duplicates: true
# A right click on an unfinished hunt, twice within confirm-seconds, buys
# another hunt of the same difficulty.
reroll:
# The currency of a reroll ('' = no reroll).
currency: perk-tickets
# The first reroll of a window.
price: 1
# Each reroll of the same window costs this many times the last one.
growth: 2.0
# Rerolls per window (0 = no reroll).
limit: 3
# How long the first right click waits for the second.
confirm-seconds: 5
# Claiming every available slot of a window unlocks the bonus.
bonus:
# Console commands (a line with a [tag] runs that action). Placeholders:
# {player} and each name of values ({souls}; {souls_raw} unformatted).
rewards:
- 'souls give {player} {souls_raw}'
# Named formulas, computed when the bonus is claimed.
# sn:extensible
values:
souls: '{stage-reward:souls} * 2000'
# The lines the menu shows.
rewards-display:
- '&b{souls} Souls'
# Every that many minutes a player with completed and unclaimed hunts is
# reminded (0 = never). /settings turns it off per player.
reminder-minutes: 5
# 'SOUND [volume] [pitch]' ('' = none). Also needs core.sounds of /settings.
sounds:
complete: 'ENTITY_PLAYER_LEVELUP 1 1.2'
claim: 'ENTITY_EXPERIENCE_ORB_PICKUP 1 1'
deny: 'ENTITY_VILLAGER_NO'
# The least ticks between two refusals of one player.
deny-cooldown-ticks: 20
commands:
# /hunt: bare opens the menu (menu = a file of guis/ in this folder).
main:
command: hunt
aliases:
- hunts
permission: ''
menu: menuExample hunt: modules/hunts/hunts/earn-money.yml
# A hunt of the hunts module (one file per hunt; the file name is its id).
# objective.type: an objective type of the core (/dungeons admin objectives types);
# objective.filters: the context keys of that type and the accepted values.
# Each difficulty: target (a number or a formula with {stage}, {stage-cost},
# {stage-reward:<currency>}, {level:<track>}), values (named formulas), rewards
# (console commands; a line with a [tag] runs that action; {player}, {difficulty},
# {hunt} and each value: {souls}, {souls_raw} unformatted) and rewards-display.
# Everything is computed when the hunt is assigned and stays fixed.
name: 'Earn Money'
icon: GOLD_INGOT
description: 'Earn money while hitting mobs to complete this objective.'
weight: 10
objective:
type: currency-earned
filters:
currency: [money]
difficulties:
easy:
target: '{stage-reward:money} * 300'
values:
souls: '{stage-reward:souls} * 200'
rewards:
- 'souls give {player} {souls_raw}'
rewards-display:
- '&b{souls} Souls'
medium:
target: '{stage-reward:money} * 600'
values:
souls: '{stage-reward:souls} * 450'
rewards:
- 'souls give {player} {souls_raw}'
- 'perktickets give {player} 1'
rewards-display:
- '&b{souls} Souls'
- '&d1x Perk Ticket'
hard:
target: '{stage-reward:money} * 1200'
values:
souls: '{stage-reward:souls} * 1000'
rewards:
- 'souls give {player} {souls_raw}'
- 'perktickets give {player} 2'
rewards-display:
- '&b{souls} Souls'
- '&d2x Perk Tickets'