Paste #34371: Untitled Paste

Date: 2016/06/20 08:17:54 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


## ZS_Round
ZS_Rounds_config:
    type: yaml data
    debug: false
    config:
        stats:
            zombies:
                health: 20
                speed: 0.5
        spawns:
            start:
                zombies:
                    amount: 5
                    round: 1
            rounds:
                zombies:
                    amount: 2

# Rounds
# Round 1:
# 5 Zombies
# Round 2:
# 7 Zombies
# 1 Skeleton


ZS_Rounds_SpawnRound:
    type: task
    definitions: ArenaName|round
    script:
    ## Zombies
    - announce "<&c>Runde <def[round]>:"
    - define type zombies
    - define start <s@ZS_Rounds_config.yaml_key[config.spawns.start.<def[type]>.amount]>
    - define multiplied <def[round].sub_int[<s@ZS_Rounds_config.yaml_key[config.spawns.start.<def[type]>.round]>]>
    - define amount <def[multiplied].mul_int[<s@ZS_Rounds_config.yaml_key[config.spawns.rounds.<def[type]>.amount]>].add_int[<def[start]>]>
    - run ZS_SpawnZombies context:<def[ArenaName]>|<def[amount]>|<def[round]> instantly


# ZS_Spawn_Tank:

# ZS_Spawn_Fast:

# ZS_Spawn_Skeleton:

# ZS_Spawn_Wither:

# ZS_Spawn_Spider:

# ZS_Spawn_CaveSpider:

ZS_SpawnZombies:
    type: task
    definitions: ArenaName|Amount|<def[round]>
    script:
    - announce "<&7><def[amount]> <&8>Zombier er spawned!"
    - define locs <yaml[ZS_config].read[Arenas.<def[ArenaName]>.SpawnLocs]>
    - repeat <def[Amount]> {
        - define Randomloc <def[locs].random>
        - inject ZS_Spawn_Zombie
    }

ZS_Spawn_Zombie:
    type: task
    definitions: Randomloc|<def[round]>
    script:
    - define speed <s@ZS_Rounds_config.yaml_key[config.stats.zombies.speed]>
    - define health <s@ZS_Rounds_config.yaml_key[config.stats.zombies.health]>
    - define Players <def[Randomloc].as_location.find.players.within[8].filter[has_flag[ZS_Survivor]]||null>
    - define Nearby <def[Randomloc].as_location.find.players.within[100].filter[has_flag[ZS_Survivor]].random||null>
    - spawn e@zombie[max_health=<def[health]>;health=<def[health]>;speed=<def[speed]>] <def[Randomloc]> persistent save:created
    # - follow followers:<entry[created].spawned_entities> lead:1.0 max:2.0
    - attack <entry[created].spawned_entities> target:<def[Nearby]>
    # - define locs <def[Randomloc].as_location.points_between[<def[Nearby].location>].distance[10]>
    # # <l@location.points_between[<location>].distance[<#.#>]>
    # - foreach <entry[created].spawned_entities> {
        # # - run ZS_Spawn_Walk context:<entry[created].spawned_entities>|<def[locs]>
    # }
    # - walk <entry[created].spawned_entities> <def[Nearby].location> auto_range radius:500
    # - spawn e@zombie[max_health=2;health=2;speed=0.5;equipment=leather_boots|air|air|air] <context.location>

# ZS_Spawn_Walk:
    # type: task
    # definitions: entity|locs
    # script:
    # - wait 5t
    # - walk <def[entity]> <def[locs].as_list.get[<def[locs].as_list.size>]>