Paste #42330: Untitled Paste

Date: 2017/06/02 08:17:15 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


DUNGEON_01_GUARDIANS:
  type: task
  debug: false
  script:
  - if <def[1].is_spawned> {
    - define location <def[1].location.simple>
    - wait 10s
    - if <server.flag[guardiansspawneddungeon01]||0> >= <util.random.int[1].to[4]> {
      - wait 40s
      - run s@DUNGEON_01_GUARDIANS def:<def[1]>
      - queue clear
      }
      else if <def[1].is_spawned> {
      - if <def[1].is_spawned> {
        - create player "<&4><&l>SUMMONED GUARD<&r> <yaml[dungeon-names].read[all].get[<util.random.int[1].to[10000]>]||false>" <def[location]> save:Dungeon01_GuardianSpawn
        - flag server "guardiansspawneddungeon01:+:1"
        - assignment set script:SPAWN_GUARDIAN_BOSS_01 npc:<entry[Dungeon01_GuardianSpawn].created_npc>
        - wait 40s
        - run s@DUNGEON_01_GUARDIANS def:<def[1]>
        }
      }
    }   

FOLLOWBOSSSCRIPT:
  type: task
  debug: false
  script:
  - if <def[1].is_living||false> == false || <def[1].is_spawned||false> == false  {
    - queue clear
    }
  - foreach <server.flag[DUNGEON_01_MOBS_FLAG]> {
    - follow followers:<def[value]> target:<def[1]>
    - wait 5s
    - if <def[value].is_living||false> == true || <def[value].is_spawned||false> == true  {
      - run s@FOLLOWBOSSSCRIPT def:<def[1]||false>
      }
    }

#- flag server "DUNGEON_01_MOBS_FLAG:|:<npc>"

SPAWN_GUARDIAN_BOSS_01:
  type: assignment
  debug: false
  actions:
    on assignment:
    - wait 1t
    - execute as_server "npc sel <npc.id>" silent
    - execute as_server "npc constant --set butcher --value true" silent
    - execute as_server "npc constant --set SPAWN_GUARDIAN_BOSS_01 --value true" silent
    - execute as_server "npc vulnerable" silent
    - execute as_server "npc targetable" silent
    - execute as_server "trait sentinel" silent
    - execute as_server "sentinel addtarget PLAYERS" silent
    - execute as_server "sentinel addignore MONSTERS" silent
    - execute as_server "sentinel speed 1.7" silent
    - execute as_server "sentinel health <util.random.int[5].to[10]>" silent
    - execute as_server "sentinel damage 1" silent
    - execute as_server "sentinel attackrate 50" silent
    - execute as_server "sentinel accuracy 0.01" silent
    - execute as_server "npc pathopt --avoid-water true" silent
    - give arrow qty:10 to:<npc.inventory> slot:20
    - execute as_server "npc skin MasterSkeleton -p" silent
    - execute as_server "npc lookclose" silent
    - execute as_server "npc push" silent
    - equip <npc> offhand:shield[enchantments=DURABILITY,1] hand:bow[enchantments=DURABILITY,1|ARROW_DAMAGE,1|KNOCKBACK,1] legs:leather_leggings[enchantments=DURABILITY,1;dye=co@25,25,25] chest:leather_chestplate[enchantments=DURABILITY,1;dye=co@25,25,25] boots:leather_boots[enchantments=DURABILITY,1;dye=co@25,25,25] 
    - trigger name:proximity state:true
    - execute as_server "npc constant --set guardianboss --value true" silent
    on spawn:
    - wait 1t
    - run s@FOLLOWBOSSSCRIPT def:<npc>
    - walk <npc> <npc.location.add[<util.random.int[-5].to[5]>,0,<util.random.int[-5].to[5]>].simple> speed:0.7
    on move proximity:
    - if <player.gamemode.contains_any[CREATIVE|SPECTATOR]> {
      - attack <npc> target:cancel
      }
      else {
      - attack <npc> target:<player>
      }


DUNGEON_01_SPAWNARMYNEXTTO:
  type: task
  debug: false
  script:
  - define boss <server.flag[DUNGEON_01_BOSS_FIND_FLAG]>
  - if <def[boss].is_living||false> == false || <def[boss].is_spawned||false> == false {
    - queue clear
    }
  - foreach <def[boss].location.find.npcs.within[300]> {
    - if <def[value].is_living||false> || <def[value].is_spawned||false> == false || <def[value]||null> == null {
      - wait <util.random.int[1].to[20]>t
      - walk <def[value]> <def[boss].location> speed:3.0
      }
      else {
      - queue clear
      }
    }
  - wait 1m
  - run s@DUNGEON_01_SPAWNARMYNEXTTO