Paste #46586: Edit of P#46585 - Edit of P#46584 - Edit of P#46583 - Edit of P#46582 - Untitled Paste

Date: 2018/02/04 18:40:54 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


e_food_chest_handler:
  food_duration: d@5m
  type: world
  events:
    on player clicks in e_food_chest_inventory:
    - determine passively cancelled
    - if <li@22|23|24.contains[<context.raw_slot>]> {

      - if <player.has_flag[erpg.food_chest.<player.flag[lc_lastchestid]>]||true> {
        - narrate "<&6>[Vorratskiste] <&f>Nicht so gierig! <&o>(<player.flag[erpg.food_chest.<player.flag[lc_lastchestid]>].expiration.formatted>)"

        } else if <player.food_level> > 15 {
        - narrate "<&6>[Vorratskiste] <&f>Du bist noch nicht hungrig genug."

        } else {

        - flag player erpg.food_chest.<player.flag[lc_lastchestid]> duration:<script.yaml_key[food_duration].as_duration>
        - repeat 8 { - run s@sound def:custom_eat - wait 2t }
        - feed amount:<el@val[24].sub[<player.food_level>]>
        - narrate "<&6>[Vorratskiste] <&f>Mhhmm... das hat gut geschmeckt."
        - random 2
        - define 1 1
        - if true {
          - random 2
          - define item i@bread
          - define item i@apple
          - narrate "<&6>[Vorratskiste] <&f>Niemand schaut hin? Du hast dir eine kleine Extraportion eingepackt. [ 1x <&6><def[item].display_name||<def[item].simple.after[i@]>><&f> ]"
          - give "<def[item]>" qty:1
          }

        }
      }