Paste #42031: Untitled Paste

Date: 2017/05/18 19:44:05 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


on player killed:
    - if <queue.list.filter[script.name.is[==].to[Ingame]].is_empty> {
      - determine cancelled
      }
    - determine passively cancelled
    - adjust <player> fall_distance:0
    - teleport <player> <s@Config.yaml_key[spawns.<server.flag[spawns].as_list.find[<player>]>]>
    - heal <player>
    - ^inject s@Durability instantly
    - if <player.has_flag[pvp]> {
      - define enemy <player.flag[pvp].as_player>
      - choose "<context.cause>" {
        - case "block_explosion" {
          - announce "<s@Config.yaml_key[deathmessages.BLOCK_EXPLOSION.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "contact" {
          - announce "<s@Config.yaml_key[deathmessages.CONTACT.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "entity_attack" {
          - announce "<s@Config.yaml_key[deathmessages.ENTITY_ATTACK.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "entity_sweep_attack" {
          - announce "<s@Config.yaml_key[deathmessages.ENTITY_SWEEP_ATTACK.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "fall" {
          - announce "<s@Config.yaml_key[deathmessages.FALL.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "fire_tick" {
          - announce "<s@Config.yaml_key[deathmessages.FIRE_TICK.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "drowning" {
          - announce "<s@Config.yaml_key[deathmessages.DROWNING.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "hot_floor" {
          - announce "<s@Config.yaml_key[deathmessages.HOT_FLOOR.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "lava" {
          - announce "<s@Config.yaml_key[deathmessages.LAVA.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "lightning" {
          - announce "<s@Config.yaml_key[deathmessages.LIGHTNING.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "magic" {
          - announce "<s@Config.yaml_key[deathmessages.MAGIC.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "poison" {
          - announce "<s@Config.yaml_key[deathmessages.POISON.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "projectile" {
          - flag <def[enemy]> alltimebowkills:+:1
          - announce "<s@Config.yaml_key[deathmessages.PROJECTILE.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          - repeat 3 {
            - if <s@Config.yaml_key[classunlock.Archer.<def[value]>].is[EQUALS].to[<def[enemy].flag[alltimebowkills]>]> {
              - narrate "<&b><&l>You<&sq>ve just unlocked the <&3><&l>Archer Level <def[value]> <&b><&l>class!" targets:<def[enemy]>
              }
            }
          }
        - case "thorns" {
          - announce "<s@Config.yaml_key[deathmessages.THORNS.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
        - case "wither" {
          - announce "<s@Config.yaml_key[deathmessages.WITHER.<util.random.int[1].to[<s@Config.list_keys[deathmessages.PROJECTILE].size>]>]>"
          }
      - flag <def[enemy]> alltimekills:+:1
      - repeat 3 {
        - if <s@Config.yaml_key[classunlock.Swordsman.<def[value]>].is[EQUALS].to[<def[enemy].flag[alltimekills]>]> {
          - narrate "<&b><&l>You<&sq>ve just unlocked the <&3><&l>Swordsman Level <def[value]> <&b><&l>class!" targets:<def[enemy]>
          }
        }
      - flag <def[enemy]> kills:+:1
      - flag <def[enemy]> xp:+:<s@Config.yaml_key[XPValues.kill]>
      - actionbar targets:<def[enemy]> "<&a>+<s@Config.yaml_key[XPValues.kill]> XP"
      - if <s@Config.list_keys[KillKitItems].contains[<def[enemy].flag[kills]>]> {
        - define items <s@Config.yaml_key[KillKitItems.<def[enemy].flag[kills]>.item].as_list>
        - give <def[items].get[<util.random.int[1].to[<def[items].size>]>]> quantity:<util.random.int[<s@Config.yaml_key[KillKitItems.<def[enemy].flag[kills]>.minq]>].to[<s@Config.yaml_key[KillKitItems.<def[enemy].flag[kills]>.maxq]>]> to:<def[enemy].inventory>
        }
      }
      else {
      - announce "<s@Config.yaml_key[suicidemessages.<context.cause>.<util.random.int[1].to[<s@Config.list_keys[deathmessages.<context.cause>].size>]>]>"
      }
    - flag player alltimedeaths:+:1
    - flag player solodeaths:+:1
    - flag player respawn duration:<s@Config.yaml_key[respawninvincibility]>