# This is a reward file
# Define rewards in here (Items, commands, etc)
# File name is the reward name, without file extention
# This reward is named "ExampleAdvanced"
# That is what you put as a reward for other plugins, like VotingPlugin
# DO NOT HAVE DUPLICATE NAMES!!

# Do not use ExampleBasic or ExampleAdvanced as rewards, they are disabled from loading!

# Wiki Page: 
# https://github.com/BenCodez/AdvancedCore/wiki/Reward-files

# You can just remove values you don't want (just delete it)
# If you just want money just have a reward file containg only "Money: 100", for example
# Don't use this file as a reward, example only

# This is the advanced example, if you only want an item or command then look
# at the basic example, you can simply copy and paste from here what you want
# in other reward files, that is the way they are designed

# This will delay the reward file from running
Delayed:
  Enabled: false
  Hours: 1
  Minutes: 0
  Seconds: 0
  MilliSeconds: 0
  
# Specific time of day to give this reward file
# in 24 hour time, relative to local time zone
Timed:
  Enabled: false
  Hour: 12
  Minute: 0

# Chance out of 100
# Set to 0 or 100 for always, or delete this line to disable chance
# Will not give any rewards unless chance is lucky or disabled
Chance: 40

# Item conditional example
Items:
  Item1:
    # Javacript for conditional
    # Uses return value to get item info (can be anything, like numbers)
    ConditionalJavascript: 'User.canVoteAll()'
    Conditional:
      false:
        Material: 'REDSTONE_BLOCK'
        Amount: 1
      true:
        Material: 'EMERALD_BLOCK'
        Amount: 1

# Player must be with a certain distance of said location
#LocationDistance:
#  World: world
#  X: 0
#  Y: 0
#  Z: 0
#  Distance: 10
  
# Will give one command from the list
RandomCommand: []

# Will give one reward from the list of rewards
RandomReward: []

# Picks a random number and uses that within the command
NumberCommand:
  Min: 1
  Max: 10
  Command: "say The random number is %number%"

# Works similar to RandomReward above, just avoids reward files
# Similar style to AdvancedPriority
AdvancedRandomReward:
  reward1:
    Commands:
    - say reward1
  reward2:
    Commands:
    - say reward2
  reward3:
    Commands:
    - say reward3

# Give one of the following items
RandomItem:
  Diamond:
    Material: DIAMOND
    Amount: 1
  Iron:
    Material: IRON_INGOT
    Amount: 10

# Require permission to give this reward file
# Permission is AdvancedCore.Reward.(REWARDNAME) by default
# E.g: AdvancedCore.Reward.ExampleAdvanced
RequirePermission: false

# Permission that must be required if RequirePermission is true
# Add ! in front to make it only run when permission isn't there instead
Permission: 'AdvancedCore.Reward.ExampleAdvanced'

#TempPermission:
#  Permission: 'PERMISSIONHERE'
#  # Time in seconds
#  Expiration: 60

# Amount of time to still allow the reward to be executed
# if reward is saved offline
# Time in minutes
#RewardExpiration: 1440

# Javascript
# Only use this if you know what you are doing
# 
# Bukkit API placeholders:
# Using "BukkitServer" in your javascript will return Bukkit.getServer()
# You can use any methods inside of the Server class
# Example: BukkitServer.getBannedPlayers().size().toFixed()
#
# "BukkitPlayer" in your javascript will return the Player object of the player getting the reward
# You can use any methods inside of the Player class
# Example: BukkitPlayer.hasPermission("some.permission")
Javascript:
  Enabled: false
  Expression: ''
  # Reward files to run if expression is true
  TrueRewards: {}
  # Reward files to run if expression is false
  FalseRewards: {}
  
# Do things like set health or other things
# not possible with commands
Javascripts: []

# Javascript expression which must be true in order to give this reward
JavascriptExpression: ''

# List of reward files to try and execute
# Will only execute first possible reward that can be given
# Recommend using AdvancedPriority (same thing but can avoid having multiple files)
Priority: []
  
# Advanced example
# 50% chance for reward1, if reward1 not given then 20% chance to get reward2, if reward2 not given then fallback
AdvancedPriority:
  # Similar to priority, but no need to have to use reward files
  # Add requirements under each reward
  # Will go in order from list here and try to run each of the following rewards...
  # This name can be anything, but they need to be different
  Reward1:
    Chance: 50
    # Any other requirement here
    # If any requirement fails, the next will be attempted
    Messages:
      Player: 'You got first reward'
  Reward2:
    Chance: 20
    Messages:
      Player: 'You got second reward'
  # Fallback, 100% chance
  Fallback:
    Messages:
      Player: 'You got unlucky'
      
# Give rewards based on what world the player is on
AdvancedWorld:
  world:
    Commands:
    - say %player% in world
  world_nether:
    Commands:
    - say %player% in nether

# List of rewards to run, works similar to AdvancedPriority, but runs all rewards
#AdvancedRewards:
#  Reward1:
#    Commands:
#    - say test
      
# Special chance
# percentage is caculated with all numbers added up
# E.g. below:
# Total is 100, so 5 is 5 out of 100, and so on
# The number represents a weight value essentially
# Decimals are allowed as well, just use _ as the decimal
# no duplicates numbers allowed
# If using decimals avoid the last number decimal value being 0, no 5.500
SpecialChance:
  5:
    # rewards here
    Commands:
    - say 5
  15:
    Commands:
    - say 15
  30:
    Commands:
    - say 30
  50:
    Commands:
    - say 50
    
# Let the user pick a reward file to get
# User can only pick one
EnableChoices: false
Choices:
  Diamond:
    DisplayItem:
      Name: '&c3 Diamonds'
      Material: DIAMOND
      Amount: 3
    Rewards:
      Items:
        Diamond:
          Material: 'DIAMOND'
          Amount: 3
      Messages:
        Player: '&aYou picked %choice%'
  Iron:
    DisplayItem:
      Name: '&c15 Iron Ingots'
      Material: IRON_INGOT
      Amount: 15
    Rewards:
      Items:
        Iron:
          Material: 'IRON_INGOT'
          Amount: 15
      Messages:
        Player: '&aYou picked %choice%'

# Will execute rewards in one of the given worlds when player is in world
Worlds:
- 'world1'
- 'world2'

# Reward will never execute in the worlds below
# Similar to Worlds, but in reverse
BlackListedWorlds:
- 'world3'
- 'world4'

# Reward type
# Possible Values: ONLINE,OFFLINE,BOTH
# Default: BOTH
# Make this reward file only give rewards depending 
# if player was online/offline when the reward attempted to give
RewardType: 'BOTH'

# If true, reward file will execute even if player is offline
# Does not support all rewards
# ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING
ForceOffline: false


# ------------------------------------
# Date based rewards
# ------------------------------------

Date:  
  # Day required to give reward
  # Also supports using 1-7 for week day
  WeekDay: MONDAY

  # Day of the month to give reward
  DayOfMonth: 15

  # Month required to give reward
  Month: MARCH
  
# DayOfMonth requirement configuration
DayOfMonth:
  # Enable or disable the DayOfMonth requirement
  Enabled: false
  # List of days of the month when the requirement should be met
  Days:
  - 1
  - 15


# Vault group required to get reward 
#VaultGroup: 'NORMAL'
  
# Potions to give on reward
Potions:
  # Potion effect name
  # Potions can be found here:
  # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html
  ABSORPTION:
    # Duration in seconds
    Duration: 100
    # Amplifier
    Amplifier: 1
    
# Title to send to player
Title:
  Enabled: false
  Title: '&cTitle!'
  SubTitle: '&aSubTitle!'
  FadeIn: 10
  ShowTime: 50
  FadeOut: 10
  
# Send bossbar to player
# This requires 1.9+
BossBar:
  Enabled: false
  # Message to send
  Message: '&aBossbar'
  # Bar Colors:
  # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/boss/BarColor.html
  Color: 'BLUE'
  # Bar Styles:
  # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/boss/BarStyle.html
  Style: 'SOLID'
  # Precentage for bar
  Progress: 0.50
  # Delay until bar goes away (in ticks)
  Delay: 30
  
# Sound on reward
Sound:
  # Enable or Disable Sound
  Enabled: false
  # Sound to play
  # Uses minecraft names
  Sound: 'entity.player.levelup'
  # Volume
  # Range: 0.0 to 1.0
  Volume: 1.0
  # Pitch
  # Range: 0.0 to 2.0
  Pitch: 1.0
  
# Play particle effect on reward
# 1.10 Effects can be found here:
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Effect.html
Effect:
  Enabled: false
  Effect: 'EXPLOSION_NORMAL'
  # Ususally speed
  Data: 1
  Particles: 10
  Radius: 5
  
Firework:
  Enabled: false
  Power: 2
  # Colors can be found here:
  # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/DyeColor.html
  Colors:
  - BLUE
  #- #123123 hex color code format
  FadeOutColor: 
  - RED
  Trail: true
  Flicker: true
  # Types can be found here:
  # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/FireworkEffect.Type.html
  Types:
  - BALL_LARGE
  # Detonate firework instantly
  Detonate: false
  
# Send action bar
ActionBar:
  Message: '&cThis is an actionbar!'
  # Delay until action bar goes away (in ticks)
  Delay: 30

# Lucky rewards  
  
OnlyOneLucky: false
# The example below would give a 1 in 10 chance of receiving an extra $100, and a 1 in 50 chance of an extra $1000.
Lucky:
  '10':
    Messages:
      Player: 'You were lucky and received an extra $100!'
    Money: 100
  '50':
    Messages:
      Player: 'You were lucky and received an extra $1000!'
    Money: 1000
    
# Only for some GUI's
# Required for choice rewards
# not a reward
DisplayItem:
  Material: 'DIAMOND'
  Name: '&aAdvancedReward'
  Amount: 1
    
# Ability for server option
# Makes sure the correct server gets the reward
#Server: 'Minecraft Server'

# List of servers that will prevent the reward from running on, such as a hub/lobby server
#BlockedServers: 
#- lobby

#############################################
# RECOMMEND using AdvancedPriority
# as it easier to use
#############################################
#
# Advanced Random Rewards, just ignore this if you don't want fancy chance rewards
# This is to give random rewards, with fallback
# Rewards defined in this reward file below are still given regardless of this below
Random:
  # Chance to give a randomly selected reward below (from list), will only give random reward
  # if lucky (according to chance)
  # Works same as chance above
  Chance: 40
  # If this value is true it will pick a random reward in the Rewards list
  # if false, all rewards are given
  # Value is true if not specified
  # Can also use RandomReward (a few lines below) to give a random reward only
  PickRandom: true
  # Rewards if chance is lucky, can be random depending in option above
  # Don't set this reward as a possible reward, may cause infinite loop
  Rewards: []
  # A list of fall back rewards if chance is unlucky
  # Don't set this reward as a reward, may cause infinite loop
  FallBack: [] 
  
################################################
# REPEAT REWARDS
# Meant for advanced uses
# Rewards do not persist on shutdown (unless enabled)
# Not tested in all situations yet, use at your own risk
################################################
Repeat:
  Enabled: true
  # Time in milliseconds 1000 = 1 second
  TimeBetween: 60000
  # Number of times to repeat
  # set to -1 for no limit
  Amount: -1
  # Start repeating on startup, otherwise it will only repeat when reward is given
  # If true, the reward will not repeat when executed
  # Will execute for every player online at time of execution
  RepeatOnStartup: false
  # If any reward requirement fails to pass, the reward will stop repeating
  AutoStop: true