Perks
On this page(20)
Every player has one sword perk with a level from I to V. A perk adds its bonuses to the player's boosters, so it raises damage, attack speed, enchant chance or currency gains. Players roll perks with perk tickets in the Tool Perks menu. You use perks as a long-term ticket sink with a rare top prize.
| Files | modules/perks/config.yml, modules/perks/perks/ (one file per perk), modules/perks/guis/, modules/perks/lang/messages_en.yml |
| Player command | /perks (alias /perk) |
| Admin commands | /dungeons admin perks ... |
| Switch | enabled: (first key of modules/perks/config.yml) + /dungeons reload |
How it works
- Tickets. A roll spends
roll.costof the currencyroll.currency. The shipped currency isperk-tickets(currencies/perk-tickets.yml), so tickets get/perkticketswith balance, give, pay and top. - The roll replaces the perk. The plugin picks a perk by its
chanceamong every loaded perk. Then it picks a level by the level weights. There is no merge or upgrade: a new roll can give a lower perk. - Pity. Every roll adds 1 to the player's pity. Once it reaches
pity.threshold, the next roll comes frompity.target-rarity. Rolling a perk of that rarity, by pity or by luck, puts the count back to 0. - Confirmation. Each perk has a "from level". A roll that would replace that perk at that level or above asks Yes or No first.
- Roll Max. The emerald button rolls until the tickets run out, a marked perk and level comes up, or
roll-max.max-rollsis reached. It sends one summary line at the end. - The reveal. A single roll from the menu turns a ring of glass, then shows the glass of the rolled rarity. The perk is already stored before the ring turns, so closing the menu only cuts the show.
- Announcements. A perk rolled at its file's
broadcast-fromlevel or above is told to every player. Withbroadcast.pity: true, a perk the pity gave is announced too.
Boosters
Each effect of the perk's level is one additive booster named after the perk, listed in /boosts. It adds its bonus to the base of that target, next to every other additive booster (auras, totems, attributes, armors, admin boosters). Crystals multiply that total instead. See Boosters for the full math.
The sword line and rebirth
%sndungeons_perk_display% gives a lore line like ┃ Perk: Demon IV (empty without a perk). The shipped sword lore in modules/sword/config.yml already contains it. The sword is rebuilt after every roll, set, clear and reset. With the module on, the /sword tiers menu also gets a Perks button. See Sword.
The perk survives a rebirth. The reward tag [reset-perk] leaves the player without a perk (pity, tickets and confirmations stay). levelings/rebirth.yml ships it as a commented line of its rewards. See Levelings.
What is saved
The perk, its level, the pity, the total rolls and every confirmation that differs from the perk's default. They are saved with the player data, in the same pass as the tickets spent. The total rolls feed the stat perks-rolled and the "Perks Rolled" board of /tops (see Stats and Tops).
Configuration
General
| Key | Default | What it does |
|---|---|---|
enabled | true | The module switch. Off: /perks disappears and every perk booster is taken away. The perks stay stored and come back with the module. |
display-name | '&5Perks' | The module's name in /dungeons admin modules. |
roll.currency | perk-tickets | The currency a roll spends: a file of currencies/. |
roll.cost | 1 | How much of it one roll costs. |
level-weights | [35, 25, 20, 13, 7] | The relative weights of levels I to V (five numbers of 0 or more). A perk may override them. |
level-names | ['I', 'II', 'III', 'IV', 'V'] | How levels are written ({level} in texts and menus). |
effect-names.<target> | damage, swings, enchants, luck | How a perk's lore names each booster target. A currency:<id> without an entry shows the currency's display-name. |
On an existing installation without currencies/perk-tickets.yml, copy it from the jar into currencies/. You can also point roll.currency at a currency you already have.
pity
| Key | Default | What it does |
|---|---|---|
pity.enabled | true | Turns the pity on or off. |
pity.threshold | 500 | Rolls needed before the next roll is forced into the target rarity. |
pity.target-rarity | purple | The rarity the pity gives. A rarity with no loaded perk turns the pity off, with a console warning. |
rarities
The rarities go from the most common to the rarest. The Perk Index lists perks in this order. The block is yours (# sn:extensible): add or remove rarities freely.
| Key | Example (green) | What it does |
|---|---|---|
rarities.<id>.name | ')ff22Green' | The rarity's display name. |
rarities.<id>.gradient | ['#41ff22', '#a8ff9a'] | The #RRGGBB colors a perk name of this rarity is painted with. Two or more make a gradient, one is a plain color. |
rarities.<id>.glass | LIME_STAINED_GLASS_PANE | The glass the roll animation ends on. |
rarities.<id>.sound | ENTITY_EXPERIENCE_ORB_PICKUP | The sound the animation ends with ('' = none). |
Shipped rarities: green, aqua, blue, red, purple, orange.
animation
The reveal of a single roll in the Tool Perks menu. Roll Max never animates.
| Key | Default | What it does |
|---|---|---|
animation.duration-ticks | 60 | How long the ring turns (1 to 1200 ticks; 20 ticks = 1 second). |
animation.tick-interval | 2 | Ticks between two frames of the ring (1 or more). |
animation.ring-slots | [12, 13, 14, 21, 23, 30, 31, 32] | The menu cells the ring turns on. [] = no ring, the result shows at once. |
animation.start-sound | BLOCK_NOTE_BLOCK_PLING | The sound at the start ('' = none). |
animation.tick-sound | BLOCK_NOTE_BLOCK_HAT | The sound of each frame ('' = none). |
animation.result-display-ticks | 40 | How long the rolled rarity's glass shows before the menu comes back. |
The sounds also need the player's core.sounds setting. Each player switches the ring off with /settings or the menu's animation button (setting perks.roll-animation).
roll-max
| Key | Default | What it does |
|---|---|---|
roll-max.per-tick | 50 | Rolls per tick (1 to 1000), so thousands of rolls never stall the server. |
roll-max.max-rolls | 0 | The most rolls of one click. 0 = until the tickets run out, with a hard cap of 100000 rolls per click. |
A second click while Roll Max runs is ignored, and a single roll is refused meanwhile. The boosters and the sword update once per tick.
buy
The ticket purchase buttons of the Tool Perks menu.
| Key | Default | What it does |
|---|---|---|
buy.payment.type | currency | currency = a currency of the plugin. placeholder = an external balance read through PlaceholderAPI. |
buy.payment.currency | money | The currency charged with type: currency. |
buy.payment.balance-placeholder | '%vault_eco_balance%' | With type: placeholder: the player's balance. It must give a raw number, without commas or suffixes. |
buy.payment.remove-command | 'eco take {player} {price}' | With type: placeholder: the console command that takes the price. |
buy.payment.display-name | '&eCredits' | The name of the external currency in the texts. |
buy.cooldown-ticks | 10 | Ticks a player waits between two purchases (0 to 1200). |
buy.buttons.<id>.amount | 1, 10, 25 | The tickets a button gives (1 or more). |
buy.buttons.<id>.price | 50, 400, 750 | What it costs (above 0). |
Shipped buttons: one, ten and many. A button's id is what [perks] buy <id> uses in the menu.
With type: placeholder, SnDungeons cannot know whether the command took the money. Use a command that fails without taking anything when the balance is short.
A purchase that would push the tickets past the ticket currency's max-value is refused before anything is taken.
broadcast and commands
| Key | Default | What it does |
|---|---|---|
broadcast.pity | true | Also announce a perk the pity gave. Players hide announcements with /settings (perks.broadcasts). |
commands.main.command | perks | The command name. '' = no /perks (the menus and the API keep working). |
commands.main.aliases | [perk] | Other names of the command. |
commands.main.permission | '' | Needed for the command and every button of the perks menus ('' = everyone). |
commands.main.menu | perks | The menu /perks opens (a file of modules/perks/guis/ without .yml). '' = /perks tells the perk, pity and rolls in chat. |
If another plugin already uses the name or an alias, SnDungeons takes it (command priority). A server, vanilla or Brigadier command is never taken.
Perk files
Each file of modules/perks/perks/ is one perk; its id is the file name (demon.yml = demon). Ids use lowercase letters, digits and -, at most 64 characters. Copy a file under a new name to add a perk, delete it to remove one, then run /dungeons reload.
The example files are created only while the folder does not exist. A file you delete never comes back, and SnDungeons never updates these files.
| Key | Example | What it does |
|---|---|---|
name | 'Demon' | The perk's name, painted with its rarity's gradient. |
rarity | red | A rarity of rarities: in the config. An unknown rarity: the perk does not load. |
chance | 1 | Its relative weight among every loaded perk (above 0). A perk of 2.0 comes twice as often as one of 1.0. |
level-weights | [] | Its own weights for levels I to V. [] = the global level-weights. |
confirm-from | 4 | The default lowest level that asks before a roll replaces this perk. 0 = never, 4 = IV and V, 1 = every level. |
broadcast-from | 0 | The lowest level announced to every player when rolled. 0 = never. |
icon.material | BLAZE_POWDER | The perk's icon in the menus. |
icon.texture | '' | For PLAYER_HEAD: a base64 head texture ('' = a plain head). |
levels.<1-5>.<target> | damage: 0.075 | The bonus of each target at that level. 0.075 = +7.5%. |
A target is any booster target of boosters.yml: damage, swings (attack speed), enchants, enchant:<id>, luck or currency:<id>. A target that does not exist or is switched off there is ignored, with a console warning.
Shipped perks:
| Perk | Rarity | chance | confirm-from | broadcast-from |
|---|---|---|---|---|
| Attack | green | 12.5 | 0 | 0 |
| Money | green | 12.5 | 0 | 0 |
| Goldrush | aqua | 5 | 0 | 0 |
| Wizard | blue | 2.5 | 4 | 0 |
| Demon | red | 1 | 4 | 0 |
| Master | purple | 0.25 | 1 | 4 |
| Universal | orange | 0.1 | 1 | 1 |
A stored perk whose file is gone is kept but gives nothing, and shows as "Unknown perk" until the file comes back. /dungeons reload reads every file again and re-pushes the boosters only of the players whose perk file changed.
Menus
| Menu id | File | Opened by |
|---|---|---|
perks:perks | modules/perks/guis/perks.yml | /perks, "Tool Perks" |
perks:index | modules/perks/guis/index.yml | The Perks Index button |
perks:confirm | modules/perks/guis/confirm.yml | A roll that would replace a marked perk |
Tool Perks (perks.yml):
| Letter | Tile |
|---|---|
P | Pity: your total rolls and your pity count against the threshold. |
I | Perks Index: opens the index. |
C | Your perk: the current template (the perk's own icon) or no-perk. |
R | Roll one perk. |
1 2 3 | The one, ten and many ticket purchase buttons. |
M | Roll Max. |
A | The roll animation switch, in three states: on, off, and locked when the server locks the setting. |
b | Filler cells around C, where the ring turns by default. |
The C template takes {perk}, {perk_id}, {level}, {level_number}, {rarity}, {color}, {effects}, {chance} and {confirm}.
Perk Index (index.yml) fills the p cells with one tile per loaded perk, by rarity then id, paged with < and >. B goes back. A click on a perk cycles its confirmation: off, V, IV-V, III-V, II-V, I-V, off.
Purchase Confirmation (confirm.yml): y is Yes, and the roll runs after everything is checked again. n is No (back to Tool Perks), and C shows your perk.
The buttons run the action tags [perks] roll, rollmax, buy <button>, index, open, confirm <perk>, yes, no and animation. Each one needs the permission of /perks. See Menus and Action Tags.
Player settings
| Setting | Default | What it switches |
|---|---|---|
perks.roll-animation | on | The ring of glass of a single roll. Off = the result shows at once. |
perks.broadcasts | on | The announcements of other players' perks. Your own rolls are always told to you. |
See Player Settings.
Commands
| Command | Permission | Description |
|---|---|---|
/perks (alias /perk) | commands.main.permission ('') | Opens the Tool Perks menu. |
/dungeons admin perks set <player> <perk> <level> | sndungeons.admin.perks.set | Sets the sword perk of an online player, free. |
/dungeons admin perks clear <player> | sndungeons.admin.perks.clear | Takes the sword perk of an online player away. |
/dungeons admin perks pity <player> <set|reset> [n] | sndungeons.admin.perks.pity | Sets or resets the perk pity of an online player. |
/dungeons admin perks info <player> | sndungeons.admin.perks.info | The perk, pity, rolls and confirmations of an online player. |
/dungeons admin perks roll <player> [n] | sndungeons.admin.perks.roll | Rolls perks for an online player with their own tickets. |
/dungeons admin perks give <player> <amount> | sndungeons.admin.perks.give | Gives roll tickets to a player, also offline. |
perks roll without n rolls once; with n it runs a Roll Max of up to n rolls. A refused admin roll names its reason and tells the target too. perks give is capped by the ticket currency's max-value, and the answer says how many were added.
Full lists: Commands and Permissions.
Placeholders
The perks expose your perk, its effects, your pity and the ticket buttons. Full list: Placeholders.
| Placeholder | Description |
|---|---|
%sndungeons_perk_name% | Your perk's painted name |
%sndungeons_perk_level% | Its level (I to V) |
%sndungeons_perk_display% | The sword lore line (empty without a perk) |
%sndungeons_perk_effects% | The effects of your level |
%sndungeons_perk_pity%, _pity_threshold, _pity_left | Your pity count, threshold and rolls left |
%sndungeons_perk_tickets% | Your perk tickets |
%sndungeons_perk_rolls_total% | Your rolls in total |
Tips
- Keep the
chancevalues far apart. The shipped ones run from 12.5 down to 0.1, so Universal is about 125 times rarer than Attack. - The pity guarantees a perk of the target rarity, not a level. Pair it with high
level-weightsfor the last levels if you want pity rewards to feel big. - Test a perk with
/dungeons admin perks set <you> <perk> 5, then check/boostsfor its boosters. - A perk with
confirm-from: 1protects your rarest perks from a careless Roll Max.
Default modules/perks/config.yml
enabled: true
# ============================================================
# SnDungeons - perks 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 perks off on
# /dungeons reload; /perks disappears and every perk booster is taken away
# (the perks stay stored and come back with the module).
# Each player has ONE sword perk with a level from I to V. A roll spends
# perk tickets and REPLACES the perk. The perks are the files of the perks/
# folder next to this file (one file per perk, created once with examples;
# a perk you delete stays deleted). A stored perk whose file is gone is kept
# but gives nothing ("Unknown perk") until the file comes back.
# Name of the module in /dungeons admin modules (color codes allowed).
display-name: '&5Perks'
# What one roll costs: a currency of the plugin (currencies/<id>.yml) and how
# much of it. Shipped: perk-tickets (currencies/perk-tickets.yml, created on
# new installations; on an existing one copy it from the jar or make your own).
roll:
currency: perk-tickets
cost: 1
# Pity: every roll adds 1; once the count reaches threshold, the next roll
# comes from target-rarity. Rolling a perk of target-rarity (by pity or by
# luck) puts the count back to 0. A target-rarity without a loaded perk turns
# the pity off (with a warning).
pity:
enabled: true
threshold: 500
target-rarity: purple
# The relative weights of the levels I to V (5 numbers of 0 or more). A perk
# may have its own (level-weights in its file).
level-weights: [35, 25, 20, 13, 7]
# How the levels I to V are written ({level} of the texts and menus).
level-names: ['I', 'II', 'III', 'IV', 'V']
# How the lore of a perk names each booster target it gives. A currency
# target (currency:<id>) without an entry here shows the currency's
# display-name.
effect-names:
damage: 'Damage'
swings: 'Attack Speed'
enchants: 'Enchant Chance'
luck: 'Luck'
# The rarities, from the most common to the rarest (the Perk Index lists the
# perks in this order). name: its display name; gradient: the #RRGGBB colors a
# perk name of this rarity is painted with (two or more = a gradient, one =
# that color); glass: the glass the roll animation ends on; sound: the sound it
# ends with ('' = none).
# sn:extensible
rarities:
green:
name: ')ff22Green'
gradient: ['#41ff22', '#a8ff9a']
glass: LIME_STAINED_GLASS_PANE
sound: ENTITY_EXPERIENCE_ORB_PICKUP
aqua:
name: 'Le5fdAqua'
gradient: ['#76e5fd', '#a3f4ff']
glass: LIGHT_BLUE_STAINED_GLASS_PANE
sound: BLOCK_NOTE_BLOCK_BELL
blue:
name: 'a59fdBlue'
gradient: ['#3a59fd', '#567bff']
glass: BLUE_STAINED_GLASS_PANE
sound: BLOCK_NOTE_BLOCK_CHIME
red:
name: '&#d33333Red'
gradient: ['#d33333', '#ff8181']
glass: RED_STAINED_GLASS_PANE
sound: ENTITY_PLAYER_LEVELUP
purple:
name: 'ʾcffPurple'
gradient: ['#702cff', '#a35aff']
glass: PURPLE_STAINED_GLASS_PANE
sound: UI_TOAST_CHALLENGE_COMPLETE
orange:
name: '&#d0691eOrange'
gradient: ['#d0691e', '#ffac4b']
glass: ORANGE_STAINED_GLASS_PANE
sound: UI_TOAST_CHALLENGE_COMPLETE
# The reveal of a single roll in the Tool Perks menu (Roll Max never
# animates). The perk is decided BEFORE the ring turns: closing the menu only
# cuts the reveal. Each player switches it off with /settings or the
# animation button of the menu (the setting perks.roll-animation).
animation:
# How long the ring turns (1 to 1200 ticks; 20 = one second).
duration-ticks: 60
# Ticks between two frames of the ring (1 or more).
tick-interval: 2
# The cells of the menu the ring turns on ([] = no ring: the result at once).
ring-slots: [12, 13, 14, 21, 23, 30, 31, 32]
# The sounds of the start and of each frame ('' = none; they also need the
# player's core.sounds setting).
start-sound: BLOCK_NOTE_BLOCK_PLING
tick-sound: BLOCK_NOTE_BLOCK_HAT
# How long the glass of the rolled rarity shows before the menu comes back.
result-display-ticks: 40
# Roll Max: rolls until the player runs out of tickets, lands on a perk and
# level they marked for confirmation (the Perk Index), or reaches max-rolls.
roll-max:
# Rolls per tick (1 to 1000), so thousands of rolls never stall the server.
per-tick: 50
# The most rolls of one click (0 = until the tickets run out).
max-rolls: 0
# The ticket purchase buttons of the Tool Perks menu.
buy:
payment:
# currency = a currency of the plugin (currency below); placeholder = an
# external balance: balance-placeholder is read for the player (it must
# give a RAW number, without commas or suffixes) and remove-command runs
# from the console with {player} and {price}. SnDungeons cannot know
# whether that command took the money: use one that fails without taking
# when the balance is short.
type: currency
currency: money
balance-placeholder: '%vault_eco_balance%'
remove-command: 'eco take {player} {price}'
# The name of the external currency in the texts (type: placeholder).
display-name: '&eCredits'
# Ticks a player waits between two purchases (0 to 1200).
cooldown-ticks: 10
# One block per button (its id is used by [perks] buy <id> in the menu):
# amount = the tickets it gives (1 or more), price = what it costs (above 0).
# sn:extensible
buttons:
one:
amount: 1
price: 50
ten:
amount: 10
price: 400
many:
amount: 25
price: 750
# Announcements: a perk at its broadcast-from level or above (its file) is
# always announced; pity: true also announces a perk the pity gave. Each
# player hides them with /settings (perks.broadcasts).
broadcast:
pity: true
# The /perks command. If another plugin already has this name or an alias,
# SnDungeons takes it (command priority). A server, vanilla or Brigadier
# command, or a root of another SnLib plugin with command priority, is never
# taken: then this one answers only as /sndungeons:<name>.
commands:
main:
# Command name; '' = no /perks command at all (the menus and the API keep
# working).
command: perks
# Other names of the command.
aliases: [perk]
# Permission needed to use the command and every button of the perks
# menus ('' = everyone).
permission: ''
# The menu /perks opens: a file of modules/perks/guis/ without .yml. '' =
# no menu: /perks tells your perk, pity and rolls in chat.
menu: perksExample perk: modules/perks/perks/demon.yml
# ============================================================
# SnDungeons - perk file (demon)
# One file per perk; the perk id is the file name (demon.yml = demon):
# lowercase letters, digits and '-', at most 64 characters. Copy this
# file under a new name to add a perk, delete it to remove one;
# /dungeons reload applies either. SnDungeons never updates this file, so
# a key you delete reads its default. The example files are created only
# when the perks folder does not exist; a deleted file never comes back.
# ============================================================
# The perk's name, painted with the gradient of its rarity.
name: 'Demon'
# A rarity of rarities: in modules/perks/config.yml (an unknown one: the perk
# does not load).
rarity: red
# Its relative weight among every loaded perk (above 0): a perk of 2.0 comes
# twice as often as one of 1.0. The Perk Index shows the chance in percent.
chance: 1
# Its own relative weights of the levels I to V; [] = the global
# level-weights of the config.
level-weights: []
# The default confirmation: the lowest level that asks before a roll replaces
# this perk (and stops a Roll Max that lands on it). 0 = never, 4 = IV and V,
# 1 = every level. Each player changes it in the Perk Index.
confirm-from: 4
# The lowest level announced to every player when someone rolls it (0 =
# never).
broadcast-from: 0
# The icon of the perk in the menus: a material, and for PLAYER_HEAD the
# base64 texture of the head ('' = a plain head).
icon:
material: BLAZE_POWDER
texture: ''
# The effects of each level 1 to 5: a booster target of boosters.yml
# (damage, swings, enchants or currency:<id>) and its bonus (0.05 = +5%). Each
# effect is an additive memory booster named after the perk, shown in /boosts.
# A target that does not exist or is switched off in boosters.yml is ignored
# (with a warning).
levels:
1:
damage: 0.075
enchants: 0.075
2:
damage: 0.15
enchants: 0.15
3:
damage: 0.225
enchants: 0.225
4:
damage: 0.3
enchants: 0.3
5:
damage: 0.375
enchants: 0.375