Paste #47630: Edit of P#47628 MiningDropSkill

Date: 2018/06/02 20:30:54 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


MiningDropSkill:
  type: world

  #-------------------------------|
  # Here you can edit the chance. |
  # 1 to x   , you define x here. |
  #-------------------------------|
  gold_ore: 12
  iron_ore: 10
  coal_ore: 5
  lapis_ore: 8
  diamond_ore: 16
  redstone_ore: 12
  emerald_ore: 6
  quartz_ore: 7

  #-----------------------------------------------------------|
  # Only gets activated if the player has the flag: bDrop.use |
  #-----------------------------------------------------------|
  handleBreak:
  - if !<player.has_flag[bDrop.use]>
    || <util.random.int[1].to[<script.yaml_key[<c.material.name>]>]> != 1
    || <server.has_flag[bDrop.noDrop.<c.location.simple>]>
    || <c.cancelled> queue clear
  - drop <def[it]> <c.location>
  - narrate "<&o>A bonus <def[it].after[i@]> dropped out of this ore."

  events:
    on player breaks gold_ore:
    - define it i@gold_ore
    - inject locally handleBreak

    on player breaks iron_ore:
    - define it i@iron_ore
    - inject locally handleBreak

    on player breaks coal_ore:
    - define it i@coal
    - inject locally handleBreak

    on player breaks lapis_ore:
    - define it i@lapis_lazuli
    - inject locally handleBreak

    on player breaks diamond_ore:
    - define it i@diamond
    - inject locally handleBreak

    on player breaks redstone_ore:
    - define it i@redstone
    - inject locally handleBreak

    on player breaks emerald_ore:
    - define it i@emerald
    - inject locally handleBreak

    on player breaks quartz_ore:
    - define it i@quartz
    - inject locally handleBreak

    on system time hourly:
    - webget "http://stats.denizenscript.com/tracker?script=141&version=1&players=<server.list_online_players.size>"