Paste #18592: Untitled Paste

Date: 2015/07/24 20:03:17 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


can_do_damage:
  type: task
  debug: false
  script:
  - if <player.location.world> == w@guildworld {
    - if <player.location.cursor_on.cuboids.include[<player.location.cuboids>].deduplicate.get[1]||none> != cu@<yaml[GUILDSAVES].read[guilds.<player>.current_guild].replace[p@]>_guild {
      - determine cancelled passively
      - queue clear
      } else {
      - if li@item_frame|armor_stand|painting contains <def[target].entity_type||none> {
        - queue clear
        } else {
        - determine cancelled passively
        - queue clear
        }
      }
    } else if <def[target].exists> {
    - if <def[target].is_tameable> {
      - if <yaml[GUILDSAVES].read[guilds.<player>.current_guild]||1> == <yaml[GUILDSAVES].read[guilds.<def[target].get_owner>.current_guild]||2> {
        - determine cancelled passively
        - queue clear
        }
      } else if <def[target].is_player> {
      - if <yaml[GUILDSAVES].read[guilds.<player>.current_guild]||1> == <yaml[GUILDSAVES].read[guilds.%target%.current_guild]||2> {
        - determine cancelled passively
        - queue clear
        } else if <player.location.cursor_on[5].cuboids.size> > 0 || <player.location.cuboids.size> > 0 {
        - foreach <player.location.cursor_on[5].cuboids.include[<player.location.cuboids>].deduplicate> {
          - if <yaml[SERVER_CUBOIDS].read[server.<def[value].notable_name>.pvp]> == disabled {
            - determine cancelled passively
            - queue clear
            }
          }
        } else if <player.location.world> == w@world_the_end {
        - if <def[target].is_player> {
          - determine cancelled passively
          - queue clear
          }
        }
      } else if <def[target].is_npc> {
      - if !<def[target].name.starts_with[<&4>]> {
        - determine cancelled passively
        - queue clear
        }
      }
    } 
  - if <player.location.cursor_on[5].cuboids.size> > 0 || <player.location.cuboids.size> > 0 {
    - foreach <player.location.cursor_on[5].cuboids.include[<player.location.cuboids>].deduplicate> {
      - if <yaml[SERVER_CUBOIDS].read[server.<def[value].notable_name>.general_damage]> == disabled {
        - determine cancelled passively
        - queue clear
        }
      }
    }