Paste #49328: Untitled Paste

Date: 2018/08/21 21:29:57 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


###Upper Management###

###The Mines###
LFMCSupervisorasn:
  type: assignment
  actions:
    on assignment:
      - trigger name:click state:true
      - trigger name:chat state:true radius:5
      - trigger name:proximity state:true radius:5
    on enter proximity:
      - if <player.has_flag[LFMCMiner].not> {
        - narrate "Supervisor: Hey man, what are you doin' down 'ere? You ain't supposed to be down here!"
        - wait 3
        - teleport <player> 139,70,11,map
        }
      - if <player.has_flag[LFMCMiner]> {
        - narrate "Supervisor: 'Bout time! We got a lot of work to do down here! Come over here and we can get started!"
        }

    on click:
      - narrate "Supervisor: Don't be lolly gaggin'! This ore ain't gonna mine itself!"
      - wait 1
      - inventory open d:in@LFMCMiningInv

LFMCMiningHandler:
  type: world
  events:
    on player clicks in LFMCMiningInv:
    - determine cancelled
    on player drags in LFMCMiningInv:
    - determine cancelled
    on player clicks LFMCMiningIt in LFMCMiningInv:
    - if <player.food_level> <= 15 {
      - narrate "You're too fatigued to work. Eat some food first."
      - queue clear
      }
    - if <player.has_flag[LFMCMinerShift].not> {
      - flag player LFMCMinerShift
      - flag player LFMCMinerShiftDay:<util.date>
      - flag player LFMCMinerShiftHour:<util.date.time.hour>
      - narrate "Supervisor: Man, they'll hire anyone these days... Well, pick up a pick-axe and get to it!"
      - wait 2
      - cast BLINDNESS <player> d:5s
      - playsound <player> sound:BLOCK_ANVIL_USE
      - wait 4
      - teleport <player> 139,70,11,map
      - adjust <player> food_level:5
      - narrate "Exhausted by the end of it, you complete your first shift in the mines. For your work you receive: $150!"
      - money give quantity:150
      - flag player LFMCMiner:+:1
      - queue clear
      }
    - if <player.flag[LFMCMinerShiftDay]> != <util.date> && <util.date.time.hour> >= <player.flag[LFMCMinerShiftHour]> {
      - flag player LFMCMinerShiftDay:<util.date>
      - flag player LFMCMinerShiftHour:<util.date.time.hour>
      - narrate "Supervisor: Back for more 'eh! I like the enthusiasm...NOW GET TO WORK!"
      - wait 2
      - cast BLINDNESS <player> d:5s
      - playsound <player> sound:BLOCK_ANVIL_USE
      - wait 4
      - teleport <player> 139,70,11,map
      - adjust <player> food_level:5
      - narrate "Though tired, your shift is finished. For your work you receive: $<player.flag[LFMCMiner].add[150]>!"
      - money give quantity:<player.flag[LFMCMiner].add[150]>
      - flag player LFMCMiner:+:1
      - queue clear
      } else {
      - narrate "Supervisor: You've already worked your shift! No overtime!"
      - if <util.date> == <player.flag[LFMCMinerShiftDay]> {
        - define day 24
        - narrate "Supervisor: Come back in <def[day].add[<player.flag[LFMCMinerShiftHour]>].min[<util.date.time.hour>]> hours."
        - queue clear
        } else {
        - narrate "Supervisor: Come back in <util.date.time.hour.min[<player.flag[LFMCMinerShiftHour]>]> hours."
        - queue clear
        }
      - queue clear
      }

LFMCMiningIt:
  type: item
  material: writable_book
  display name: Work The Mines
  lore:
  - "Time to put in a shift"
  - "in the mines!"
  - "Click here to start this"
  - "job."
  - "Can be done once per day."
  - "Pay: $150"

LFMCMiningInv:
  type: inventory
  title: Time to get to work!
  size: 9
  slots:
  - "[i@LFMCMiningIt] [] [] [] [] [] [] [] []"