# Points, shop and rewards

Wire the Points currency into daily rewards, votes, parkour and the shop.

Points is the currency the other lobby modules share. Players earn it from daily logins, votes and parkour, spend it in the shop, and compare balances on the leaderboards.

## The currency

```yaml
general:
  starting-balance: 0
  autosave-interval: 30s
  currency-name-singular: "Point"
  currency-name-plural: "Points"
```

Players check their balance with `/points`. Staff manage balances:

```text
/pointsadmin give Steve 500
/pointsadmin take Steve 100
/pointsadmin set Steve 0
/pointsadmin reset Steve
```

Add `-s` to run silently, which is what the bundled reward commands do.

## Daily login rewards

`rewards.yml` maps a streak day to commands. Anything works as a reward, not just Points:

```yaml
general:
  reset-after-days: 2

tiers:
  "1":
    display: "&#A0B4C8100 Points"
    commands:
      - "glacierpointsadmin give {player} 100 -s"
  "3":
    display: "&#A0B4C8250 Points"
    commands:
      - "glacierpointsadmin give {player} 250 -s"
```

If `reset-after-days` or more days pass between two logins, the streak goes back to day one. With the default of 2, skipping one day is enough. Days without a tier still count toward the streak, they just give nothing.

## Vote rewards and Vote Parties

Install Votifier or NuVotifier first. Then in `voterewards.yml`:

- `rewards.commands` runs for every vote.
- Votes cast while a player is offline are paid out when they next join.
- `vote-party.goal` is the server-wide vote count that triggers a Vote Party, which runs `vote-party.commands`.
- `general.broadcast-votes` announces each vote in chat.

Test it without a voting site:

```text
/voterewards test Steve
/voterewards status
```

## The shop

Every entry has a price and a list of console commands to run when it's bought:

```yaml
shop:
  hearts-trail:
    category: cosmetics
    icon: POPPY
    name: "&#A0B4C8&lHearts Trail"
    lore:
      - "&#94A3B8Leave a trail of hearts behind you."
    price: 2500
    repeatable: false
    permission: ""
    commands:
      - "lp user {player} permission set glacierhub.cosmetics.particle.hearts true"
```

- `repeatable: false` makes it a one-time unlock. It shows as owned afterwards and can't be bought twice.
- `repeatable: true` suits consumables such as kits or crate keys.
- `permission` restricts who can buy it. Players without it still see the item, marked as locked.
- `category` decides which tab it shows in.

Selling cosmetics works by granting the cosmetic's permission, as above.

## Parkour rewards

Once a course is built, open `parkour.yml` and add rewards to it:

```yaml
courses:
  lobby_easy:
    enabled: true
    name: "&#A0B4C8&lLobby Easy"
    material: "FEATHER"
    points: 50
    first-clear-commands:
      - "lp user {player} permission set glacierhub.cosmetics.particle.portal true"
```

`points` are paid on every finish. `first-clear-commands` run once per player, the first time they finish. Reload with `/glacierhub reload parkour`.

## Leaderboards

The `leaderboards` module reads from Points, Vote Rewards and Parkour, so there's nothing to wire up. Players open it with `/lb`.
