Paste #21318: Untitled Paste

Date: 2015/10/21 17:04:29 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


ZombieLv1:
    type: assignment
    actions:
        on assignment:
        - trigger name:proximity state:true radius:4
        - vulnerable state:true
        - health state:true
        - health 20 <npc>
        - heal <npc>
        - flag npc Str:3
        - flag npc Dex:3
        - rename <yellow>Zombie<&sp><gold>Lv.1
        - adjust <npc> speed:0.9
        - flag npc NpcLocation:<npc.location>
        on enter proximity:
        - run script:MeleeAttackCheck1
        on complete navigation:
        - heal <npc>
        - flag npc Combat:false
        - adjust <npc> speed:0.9



MeleeAttackCheck1:
    type: task
    script:
    - if <npc.flag[Combat]> == true queue clear
    - define Target <npc.location.find.players.within[5]||false>
    - if %Target% == false
        {
        - queue clear
        }
    - attack
    - flag npc Combat:true
    - run script:MeleeReturnCheck1 delay:5s



MeleeReturnCheck1:
    type: task
    script:
    - if <npc.flag[Combat]> != true
        {
        - attack cancel
        - flag npc Combat:false
        - adjust <npc> speed:1.1
        - walk <npc.flag[NpcLocation]>
        - queue clear
        }
    - if <npc.location.find.players.within[4].size> < 1 && <player.location.distance[<npc.flag[NpcLocation]>]> > 20
        {
        - attack cancel
        - flag npc Combat:false
        - adjust <npc> speed:1.1
        - walk <npc.flag[NpcLocation]>
        - queue clear
        }
    - if <npc.location.find.players.within[5].size> > 0 && <player.location.distance[<npc.flag[NpcLocation]>]> < 20
        {
        - flag npc Combat:false
        - run script:MeleeAttackCheck1
        - queue clear
        }
        else
        {
        - attack cancel
        - flag npc Combat:false
        - adjust <npc> speed:1.1
        - walk <npc.flag[NpcLocation]>
        - queue clear
        }