Paste #3608: Attacktask

Date: 2014/04/19 15:48:58 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19


BasicAttackTask:
    type: task
    definitions: radius|anchor
    script:
    - if <npc.has_flag[<player>]> {
        - flag <npc> <player>:!
        foreach <location.find.players.within[<%radius%>]> {
            - if <npc.has_flag[<%value%>]> {
                - flag <npc> newtarget
                - attack <npc> target:<%value%>
                - foreach stop
                }
            }
        - if <npc.has_flag[newtarget]> {
            else {
            - anchor walkto id:%anchor%
            }
            }
        }