Zrips / Jobs

Jobs
Apache License 2.0
172 stars 213 forks source link

Scheduling and permission support for individual quests and work tasks #1392

Open Donkk0 opened 2 years ago

Donkk0 commented 2 years ago

Scheduling and permission support for individual quests and work tasks

Add support to schedule when a specific quest can be done, or payout from a job can be gotten, based on real-world date and time. This would allow seasonal quests, nighttime and daytime exclusive quests, weekend quests, etc. The example provided below is a simple Halloween quest.

  Quests:
    halloween-quest:
      Name: "Halloween quest"
      Objectives:
      - Place;jack_o_lantern;10
      Months:
      # Name or number of month
      - October
      - 10
      Days:
      # Name of a weekday, list of weekdays, day of the month, list of days of the month, or "all"
      - Monday
      - 31
      From: ‘18:00:00’
      Until: ‘23:59:59’
      RewardCommands:
      - "eco give [playerName] 500"
      - "msg You finished the Halloween quest, [playerName]. Go scare some kids and steal their candy!"
      RewardDesc:
      - "Place 10 Jack o'Lanterns"
      - "This is Halloween. Everybody make a scene!"
      Chance: 50

The same values could also be added to payouts for specific actions. A simple Halloween-related example is provided below.

  Place:
    jack_o_lantern:
      income: 50.0
      points: 40.0
      experience: 50.0
      months:
        - 10
      days: 
        - 31
      from: '18:00:00'
      until: '23:59:00'

I also suggest adding permissions checks for both, meaning you need to have a specific permission to get paid for the action or to get offered the quest. Examples for both payouts and quests provided below.

  Place:
    jack_o_lantern:
      permission: halloween.job
  Quests:
    halloween-quest:
      Name: "Halloween quest"
      permission: halloween.quest
Donkk0 commented 2 years ago

Another usecase:

I have a few kids on my server and I would like to discourage them from playing late at night without actually kicking anyone. With these options I could enact a "curfew" for Jobs, where they would only get paid during daytime, while the adult accos could still get paid for jobs throughout the day. Config example below:

#current config, everyone gets paid all day long, even if they're a minor any play at 2 in the night on a school night

  Place:
    jukebox:
      income: 1.5
      points: 1.5
      experience: 3

# config using permission and time restrictions allowing everyone to get paid at night, but only accounts with adult.worker permission set to be paid at night

  Place:
    jukebox:
      income: 1.5
      points: 1.5
      experience: 3
      permission:
      months:
        - all
      days: 
        - Monday
        - Tuesday
        - Wednesday
        - Thursday
        - Friday
      from: '08:00:00'
      until: '22:00:00'
    jukebox:
      income: 1.5
      points: 1.5
      experience: 3
      permission: adult.worker
      months:
        - all
      days: 
        - Monday
        - Tuesday
        - Wednesday
        - Thursday
        - Friday
      from: '22:00:00'
      until: '08:00:00'

Could go further and only have these active during the months when school is on, but not during summer months or around Christmas, etc.

Donkk0 commented 2 years ago

A couple more less fleshed out quest ideas that would be based on irl time / date and doable with the config suggestions above.

Quest to place flowers during Valentine's Day

Quest to place lights during christmas

Quest to build thigns out of snow during winter months

Quest to place logs during National Tree Week

Quest to place colorful concrete / terracotta / wool during the local Pride week (or a quest to dye leather armor black during Pride week for a more cheeky servers)

Quest to TNTbreak bricks during the week they demolish that legendary old building in your city

Quest to milk the cows between 4 and 5 am

The nice thing about this is that it's not culture-specific - these are just examples. If you have a date / time in your own area or culture that could have Minecraft representation it can probably have some kind of Jobs quest related to it. It's so easy to think up fun time-based quests.

Donkk0 commented 2 years ago

Another interesting thing this would allow for is having a system where more daily quests come available over time.

Let's say you have a basic crafter with a few simple crafter quests like building a couple of crafting tables. Then when you finish that quest, you run a command that gives you the permission you need to get some other daily quest you couldn't before.

This could allow for a very natural feeling development of the available quests over time, slowly going from basic jobs to more elaborate ones.

First having quets that have you craft tools with stone, then iron, then gold, then diamonds, then netherite. First birch planks, then slabs and stairs too. First a stone wall, then stone brick walls, then deepslate walls, etc.