Paste #43465: Untitled Paste

Date: 2017/08/11 22:39:36 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#
#This file uses - if !<player.has_flag[erpg_region]> queue clear
#This file uses - [REQ]env_player-closes-inv.yml
#
pl_inv_small:
  type: inventory
  inventory: chest
  title: Loot Kiste
  size: 27
  procedural items:
  - determine <player.flag[inv_data]>
  slots:
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"

pl_inv_big:
  type: inventory
  inventory: chest
  title: Loot Kiste
  size: 54
  procedural items:
  - determine <player.flag[inv_data]>
  slots:
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"

lc_emptytask:
  type: task
  script:
  - define 1 1
  #- narrate "<&6>THIS IS A EXAMPLE TASK SCRIPT MESSAGE"

lc_chesthandler:
  type: world
  debug: false
  events:
    on player right clicks chest:
    - if <yaml[lt].contains[<context.location.simple>]||false> {

      - if !<player.has_flag[erpg_region]> {
        - narrate "<&4>Access denied."
        - queue clear
        }
      - determine passively cancelled
      - define region "<yaml[lt].read[chest.loc.<context.location.simple>.name]||default>"
      - define id "<yaml[lt].read[chest.loc.<context.location.simple>.id]>"
      - flag player "lc_lastchestid:<def[id]>"
      - run s@sound def:custom_chest_open


      - if <yaml[lt_<player>].contains[inv.id.<def[id]>]> {

        - flag player inv_data:<yaml[lt_<player>].read[inv.id.<def[id]>.items]>

        } else {
        - narrate "<&6>Du hast eine neue Kiste gefunden!"

        - define locname "<yaml[lt].read[chest.loc.<context.location.simple>.name]>"
        - define invname "<yaml[lt].read[chest.loc.<context.location.simple>.inv]>"     
        - flag player "inv_data:<yaml[lt].read[inv.<def[region]>.name.<def[invname]>]>"

        - inject <yaml[lt].read[chest.<def[region]>.id.<def[id]>.script]>

        - yaml id:lt set "chest.<def[region]>.id.<def[id]>.finders:->:<player>"
        - yaml id:lt_<player> set "inv.<def[region]>.name:->:<def[locname]>/<def[invname]>"
        - yaml id:lt_<player> set "inv.<def[region]>.id_list:->:<def[id]>"

        - define money "<yaml[lt].read[chest.<def[region]>.id.<def[id]>.money]>"
        - if <def[money]> != 0 {
          - run s@emoney_give def:<def[region]>|<def[money]>
          - narrate "Du hast beim Fund dieser Kiste <&6><def[money]> <s@g_var.constant[m_<def[region]>_pl]> <&f>erhalten."
          }

        }
      #Open Chest
      - inventory open d:in@pl_inv_<yaml[lt].read[chest.<def[region]>.loc.<context.location.simple>.size]>
      - queue clear
      } else if <player.flag[erpg_region]||x> == erpg {
      - narrate "This is a public chest!"
      }