Paste #38124: New wander script

Date: 2016/12/04 08:09:51 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


NPCAction_Soldat:
  type: task
  debug : false
  script:
  - if <npc[<def[1]>].has_flag[Ziellocation]> {
    - if <npc[<def[1]>].flag[Zielcounter].as_int||0> >= 5 {
      - walk <def[1]> stop
      - flag <def[1]> Ziellocation:<def[1].location.find.surface_blocks.within[6].random.add[0,1,0].simple>
      - flag <def[1]> Zielcounter:!
      - queue clear
      }
    - if <def[1].location.simple> != <npc[<def[1]>].flag[Ziellocation]> {
      - walk <def[1]> stop
      - walk <def[1]> <npc[<def[1]>].flag[Ziellocation]> speed:0.9 auto_range lookat:<npc[<def[1]>].flag[Ziellocation]>
      - flag <def[1]> Zielcounter:+:1
      }
      else {
      - walk <def[1]> stop
      - flag <def[1]> Ziellocation:<def[1].location.find.surface_blocks.within[6].random.add[0,1,0].simple>
      }
    }
    else {
    - flag <def[1]> Ziellocation:<def[1].location.find.surface_blocks.within[6].random.add[0,1,0].simple>
    }