Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daily rewards #82

Open
makeevrserg opened this issue Sep 6, 2024 · 0 comments
Open

Daily rewards #82

makeevrserg opened this issue Sep 6, 2024 · 0 comments

Comments

@makeevrserg
Copy link
Member

makeevrserg commented Sep 6, 2024

[FEATURE] Daily Rewards

Overview

Daily rewards feature will provide players with daily rewards. This rewards can be vary with
permission.

Precise description

Player flow

First encounter

Player enters the server. He receives notification "You have unclaimed rewards. Use /rewards" if
there's any reward for him.

Using command

Player uses /rewards and see in gui list of available rewards. He clicks some category.

Now category of reward with all available rewards is opened. Player see first available reward and
others as not available yet.

He clicks first reward. He receives all available rewards. If there's no room in inventory - the
items will be dropped. The gui now is updated and he sees current reward as claimed and others as
unavailable.

Claiming all rewards

When player claimed all rewards, the progress should be reset somehow so player can claim first-day
reward again.

Storage

All the information is stored on SQL database.

  • H2 Is default
  • MySQL

Configuration

# Configuration defined in rewards/config.yml
database:
  # Use MySql
  type: MySql
  host: 0.0.0.0
  port: 25565
  user: user
  password: password
  name: DATABASE_NAME
  # Use H2
  type: H2

categories:
  rewards_default_player:
    id: "default"
    # Cooldown in seconds
    # Consider cooldown shouldn't be 24 hours. It should be ~16-18
    cooldown: 86400 # 24h
    # Display reward category in rewards gui
    display:
      type: MATERIAL
      material: WHEAT
      name: "Default player reward"
    # This item will be placed when reward not yet available
    next:
      type: MATERIAL
      material: BARRIER
      name: "This item will be available soon"
    # This will be placed when reward already claimed
    claimed:
      type: MATERIAL
      material: BARRIER
      name: "This item already claimed"
      lore:
        - "You already claimed this item"
        - "You will be available to get this items after all rewards claimed"
    # There will be placed rewards for current category
    entries:
      day_1:
        order: 0
        rewards:
          minecraftmaterial:              
            type: MATERIAL
            material: DIAMOND
            amount: 10
          itemsadderitem:              
            type: ITEMS_ADDER
            id: namespace:id
            amount: 2
          money:              
            type: MONEY
            # Nullable
            currency: some_currency
            amount: 12.22

Commands

Command Permission Description
/reward list aspekt.reward.all Open all available rewards
/reward <reward_id> aspekt.reward.open.<id> Open rewards gui for <id>
/reward claim <reward_id> aspekt.reward.claim.<id> Claim reward <id> without open gui
/reward setday <player> <day> aspekt.reward.setday Set specific <day> for <player>

Placeholder

Placeholder Description
%reward_day_<player> Current player reward day
%reward_remaining_<player>_<format> Time until next reward in format HH:MM:ss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant