Paste #3717: batttask

Date: 2014/04/24 15:39:46 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


BasicAttackTask:
    type: task
    definitions: radius|anchor|zap
    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
                else {
                - flag <npc> newtarget:!
                }
                }
            }
        - if <npc.has_flag[newtarget]> == false {
            - anchor walkto id:%anchor%
            - if %zap% >= 1 {
                - zap <queue.id> step:%zap%
                }
            }
        }