Paste #56431: Magic spell caster Sentinel NPC

Date: 2019/08/06 12:05:28 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


# Usage:
# 1: Select an NPC
# 2: Configure as a Sentinel
# 3: /ex flag npc magic_power:SPELL_NAME_HERE     | Change the SPELL_NAME_HERE to the spell name
# 4: /ex flag npc power_cooldown:10               | Change 10 to the cooldown time (in seconds)

sentinel_spell_magic:
    type: world
    events:
        on sentinel npc attacks:
        - if !<npc.has_flag[magic_power]>:
            - stop
        - if <npc.has_flag[power_cooldown_active]>:
            - determine cancelled
        - flag npc power_cooldown_active duration:<npc.flag[power_cooldown]>
        - execute as_npc "/c <npc.flag[magic_power]>"
        - determine cancelled