Bad Spider


Author: jwt3
Created: 2013-10-02T09:34:51-0400
Edited: 2013-10-15T08:55:31-0400
Denizen Version: 9.2
Views: 15
Downloads: 839
Likes: 1


WGET
Description: BadSpider: A Boss spider that shoots webs and can capture players

The spider has a nest and a home. The nest is where a captured player
will be sent and its home is where it rests. During combat the spider
can cast webs and spells. If during combat the players health drops
below a certian level they are captured and sent to the nest.

Highlights:
- When fighting a player the player is captured and teleported to
the spiders nest if the players health is too low.
- spider casts webs on/near player. These webs only appear in 'air'
spaces and fade away over time (change back to air)
- spider moves every so often to a set of user programmed waypoints
this is based on the 'on time changes in w@[world]' event
- this is not a single NPC script, multiple spiders can be created
- when in combat spider has a chance to make a special attack...
a) cast web on/near player
b) cast spell of some sort (poison, weakness, slow)

Creation & use:
'/npc create [Name]'
'/npc assign --set BadSpider'

The world script below has the line....
on time changes in w@pluto:
Change the w@pluto to a world on your server

1) Once assigned right click it to select it
2) Walk to the place the spider will consider its home and use the
command '/bspider home'
3) Walk to the place you want the spiders web to be and use the
command '/bspider nest' (NOTE: This will create a webbed cube that
is desctructive to its enviornment (i.e. changes blocks to web)
4) Walk around an use the '/bspider wp' to add waypoints to the spiders
path. Every game hour (about 50sec at 20T lag) there is a chance the
spider will move to its next waypoint.
5) other /bspider commands....
'sel' - selects the spider (vs clicking it)"
'nest' - sets the nest to the player location"
'home' - sets the home postion to the player location"
'info' - displays various info of selected spider"
'r0' - sets web toss 1x1x2"
'r1' - sets web toss 3x3x2 (default)"
'r2' - sets web toss 5x5x2"
'tweb1' - fires a test web on your position?"
'tweb2' - fires a test web on your position?"
'tweb3' - fires a test web on your position?"
'tweb4' - fires a test web on your position?"
'tcap' - tests spider capture (on you)"
'tmove' - sends to next waypoint (chance)"

NOTES:
- when the spider casts a web it replaces blocks with webs. This can
make a mess of an area.
- The spider is based on the Sentry trait. The Sentries main configuration
is set in the 'on assignment:' action
- The interactive script exists for an OP to change the spiders parameters
- Since the 'on time changes' event fires every 60sec or so this can generate
a lot of text into the logs if the denizen debugger is on

TODO:
- add a setting to have the spiders web cast on the player only
- change the OP permission/control to a permissions based setting

Misc.
Author: J Taylor (jwt3)
Version: Denizen 9.2

Revision History:
1.0 initial upload
1.1 Change/New/Upgraded
- webs are non destructive to the enviornment and slowly
fade away.
- on xx:00 event for movement & start of day
- waypoints for movement
- converted "runtask" to "run" commands
- pushed configuration from interactive to world scripts
- restrict /bspider commands to OPs
1.2 - fixed waypoint error

# BadSpider: A Boss spider that shoots webs and can capture players
#
# The spider has a nest and a home. The nest is where a captured player 
# will be sent and its home is where it rests. During combat the spider
# can cast webs and spells. If during combat the players health drops
# below a certian level they are captured and sent to the nest.
#
# Highlights:
#   - When fighting a player the player is captured and teleported to
#     the spiders nest if the players health is too low.
#   - spider casts webs on/near player. These webs only appear in 'air'
#     spaces and fade away over time (change back to air)
#   - spider moves every so often to a set of user programmed waypoints
#     this is based on the 'on time changes in w@[world]' event
#   - this is not a single NPC script, multiple spiders can be created
#   - when in combat spider has a chance to make a special attack...
#     a) cast web on/near player
#     b) cast spell of some sort (poison, weakness, slow)
#
# Creation & use:
#   '/npc create [Name]'
#   '/npc assign --set BadSpider'
#
#   The world script below has the line....
#        on time changes in w@pluto:
#   Change the w@pluto to a world on your server
#
# 1) Once assigned right click it to select it
# 2) Walk to the place the spider will consider its home and use the
#    command '/bspider home'
# 3) Walk to the place you want the spiders web to be and use the 
#    command '/bspider nest' (NOTE: This will create a webbed cube that 
#    is desctructive to its enviornment (i.e. changes blocks to web)
# 4) Walk around an use the '/bspider wp' to add waypoints to the spiders
#    path. Every game hour (about 50sec at 20T lag) there is a chance the 
#    spider will move to its next waypoint.
# 5) other /bspider commands....
#    'sel' <id> - selects the spider (vs clicking it)"
#    'nest'  - sets the nest to the player location"
#    'home'  - sets the home postion to the player location"
#    'info'  - displays various info of selected spider"
#    'r0'    - sets web toss 1x1x2"
#    'r1'    - sets web toss 3x3x2 (default)"
#    'r2'    - sets web toss 5x5x2"
#    'tweb1' - fires a test web on your position?"
#    'tweb2' - fires a test web on your position?"
#    'tweb3' - fires a test web on your position?"
#    'tweb4' - fires a test web on your position?"
#    'tcap'  - tests spider capture (on you)"
#    'tmove' - sends to next waypoint (chance)"
#
# NOTES:
#  - when the spider casts a web it replaces blocks with webs. This can
#    make a mess of an area. 
#  - The spider is based on the Sentry trait. The Sentries main configuration
#    is set in the 'on assignment:' action
#  - The interactive script exists for an OP to change the spiders parameters
#  - Since the 'on time changes' event fires every 60sec or so this can generate
#    a lot of text into the logs if the denizen debugger is on
#
# TODO:
#   - add a setting to have the spiders web cast on the player only
#   - change the OP permission/control to a permissions based setting
#
# Misc.
#  Author: J Taylor (jwt3)
#  Version: Denizen 9.2
#
# Revision History:
#   1.0     initial upload
#   1.1     Change/New/Upgraded
#           - webs are non destructive to the enviornment and slowly 
#             fade away.
#           - on xx:00 event for movement & start of day
#           - waypoints for movement
#           - converted "runtask" to "run" commands
#           - pushed configuration from interactive to world scripts
#           - restrict /bspider commands to OPs
#   1.2     - fixed waypoint error
# ******************************************************************

"BadSpider":
    type: assignment

    actions:
        on assignment:
        - trigger name:click toggle:true
        - trigger name:proximity toggle:true
        - trigger name:damage toggle:true
        - ^vulnerable true
        # create a sentry trait **************************************
        - ^execute as_server "npc sel <npc.id>"
        - ^execute as_server "trait sentry"
        - ^execute as_server "npc type spider"
        - ^execute as_server "sentry respawn 60s"
        - ^execute as_server "sentry healrate 1"
        - ^execute as_server "sentry health 35"
        - ^execute as_server "sentry strength 3"
        - ^execute as_server "sentry armor 2"
        - ^execute as_server "sentry targetable False"
        - ^execute as_server "sentry target add entity:player"
        # set both speeds (one of them will work)
        - ^execute as_server "sentry speed 0.9"
        - ^execute as_server "npc speed 0.9"
        - ^flag npc home_loc:<npc.location>
        - ^flag npc web_radius:0
        - ^flag npc nest_radius:2
        - ^flag player npc_select:<npc.id>
        - ^execute as_server "denizen save"
        - ^run "NPC Add To List" "def:bad_spider"

        on remove:
        - ^run "NPC Remove From List" "def:bad_spider"
        
        on spawn:
        - ^teleport npc location:<npc.flag[home_loc]>
        - ^narrate "<yellow>hsssss..."

        on damage:
        # some chance the spider fights back with a web
        - ^flag npc in_combat:true duration:90s
        - ^if <util.random.int[1].to[100]> <= <cons:bs_damage_webbed> {
            - ^narrate "<yellow>screeee!!!!"
            - ^runtask "script:Bad Spider Web Toss" "context:true"
            }
        
        on hit on player:
        # if the players health is low then send them to the nest. Otherwise do a special attack
#        - ^narrate "att <player.health> < <cons:bs_capture_health>"
        - ^flag npc in_combat:true duration:90s
        - ^if <player.health> <= <cons:bs_capture_health> run "Bad Spider Capture Player"
            else runtask "script:Bad Spider Special Attack"
        
        on death by player:
        - ^runtask "script:Bad Spider Death"

    default constants:
        # health points below which the player will be captured
        bs_capture_health: 7    
        # percent chance (0-100) the spider will make a special attack when hitting a player
        bs_special_attack: 50   
        # percent chance (0-100) the spider will web player when it (the spider) is damaged
        bs_damage_webbed: 25
        # percent chance (0-100) of moveing to a new waypoint each game hour
        bs_move_chance: 50
        # percent chance (0-100) of any given spit web being removed on each game hour
        bs_web_remove_change: 33
        
    interact scripts:
    - 20 Bad Spider Interact
 
# Called when killed by a player to drop treasure   
"Bad Spider Death":
    type: task
    script:
    - narrate "<player.name> - mmmm....smells like dead spider"
    # 322 gold apple
    # 375 spider eye
    - drop iten:322 qty:1 location:<npc.location>
    - drop iten:375 qty:2 location:<npc.location>
    # Bonus Stuff
    # 371 gold nugget
    # 388 emerald
    # 394 poison potato
    # 352 bone
    # 283 gold sword
    - random 5
    - drop iten:371 qty:3 location:<npc.location>   
    - drop iten:388 qty:2 location:<npc.location>
    - drop iten:394 qty:2 location:<npc.location>
    - drop iten:352 qty:1 location:<npc.location>
    - drop iten:283 qty:1 location:<npc.location>
    
    # track who is doing the killing (future use)
    - if <npc.flag[killed_by_<player.name>]> == null flag npc killed_by_<player.name>:1
        else flag npc killed_by_<player.name>:+:1
 
# Called to have the spider attack the player
"Bad Spider Special Attack":
    type: task
    script:
    - ^if <util.random.int[1].to[100]> <= <cons:bs_special_attack> {
        - narrate "<yellow>thwak!!!!!!"
        - random 9
        - cast POISON duration 60s
        - cast SLOW duration 20s
        - cast WEAKNESS duration 30s
        - run "Bad Spider Web Toss" "def:direct_small"
        - run "Bad Spider Web Toss" "def:direct_normal"
        - run "Bad Spider Web Toss" "def:small"
        - run "Bad Spider Web Toss" "def:small"
        - run "Bad Spider Web Toss" "def:normal"
        - run "Bad Spider Web Toss" "def:normal"
        }
        else narrate "<yellow>hsssss..."
 
# This routine places a web on or near the player. It has a single input that takes one of the
# following values -
# %1% = "direct_small"  1x1x2 on the player
# %1% = "direct_normal" nxnx2 on the player (based on web_radius flag)
# %1% = "small" 1x1x2 close to the player
# %1% anything else puts normal web near the player
"Bad Spider Web Toss":
    type: task
    speed: 5t
    context : value
    script:
    - ^if "%1%" == "direct_small" {
        - narrate "<yellow>sphh..."
        - run "Bad Spider Place Web" "def:<player.location>|0"
        }
        else if "%1%" == "direct_normal" {
        - narrate "<yellow>sphh......"
        - run "Bad Spider Place Web" "def:<player.location>|<npc.flag[web_radius]>"
        }
        else {
        - flag npc tx:<player.location.x>
        - flag npc tz:<player.location.z>
        - flag npc ty:<player.location.y>
        - flag npc tx:+:<util.random.int[-2].to[2]>
        - flag npc tz:+:<util.random.int[-2].to[2]>
        - flag npc "web_loc:<npc.flag[tx]>,<npc.flag[ty]>,<npc.flag[tz]>,<player.location.world.name>"
        - if "%1%" == "small"  {
            - narrate "<yellow>sphhh..."
            - run "Bad Spider Place Web" "def:<npc.flag[web_loc]>|0"
            }
            else {
            - narrate "<yellow>sphhh......"
            - run "Bad Spider Place Web" "def:<npc.flag[web_loc]>|<npc.flag[web_radius]>"
            }
        }
 
# This routine is called to place a web as some give location
# e.g. run "Bad Spider Web" "def:location|web radius"
"Bad Spider Place Web":
    type: task
    speed: 1t
    script:
    - flag npc web_center:%1%
 
    - if "%2%" == "1" {
        - flag npc xy_off:-1
        - flag npc x_off:-1
        - flag npc z_off:-1
        - flag npc y_off:0
        - flag npc web_cnt:18
        }
        else if "%2%" == "2" {
        - flag npc xy_off:-2
        - flag npc x_off:-2
        - flag npc z_off:-2
        - flag npc y_off:0
        - flag npc web_cnt:50
        }
        else if "%2%" == "0" {
        - flag npc xy_off:0
        - flag npc x_off:0
        - flag npc z_off:0
        - flag npc y_off:0
        - flag npc web_cnt:2
        }
    # Loop through placing webs in places where there is air
    - repeat <npc.flag[web_cnt]> {
        - flag npc tx:<npc.flag[web_center].aslocation.x.asint.add[<npc.flag[x_off]>]>
        - flag npc tz:<npc.flag[web_center].aslocation.z.asint.add[<npc.flag[z_off]>]>
        - flag npc ty:<npc.flag[web_center].aslocation.y.asint.add[<npc.flag[y_off]>]>
        - flag npc "web_loc:<npc.flag[tx]>,<npc.flag[ty]>,<npc.flag[tz]>,<player.location.world.name>"
        - if "m@air" == "<npc.flag[web_loc].aslocation.block.material>" {
            - modifyblock <npc.flag[web_loc].aslocation> 30 radius:0
            - flag npc web_loc_list:->:<npc.flag[web_loc].aslocation>
            }
        - flag npc x_off:+:1
        - if <npc.flag[x_off].asint> > %2% {
            - flag npc x_off:<npc.flag[xy_off]>
            - flag npc z_off:+:1
            - if <npc.flag[z_off].asint> > %2% {
                - flag npc x_off:<npc.flag[xy_off]>
                - flag npc z_off:<npc.flag[xy_off]>
                - flag npc y_off:+:1
                }
            }
        }
# Call to periodically remove webs that have been tossed        
"Bad Spider Fade Web":
    type: task
    script:
    - foreach <npc.flag[web_loc_list].aslist> {
        - if <util.random.int[1].to[100]> <= <cons:bs_web_remove_change> {
            - flag npc web_loc:%value%
            - modifyblock <npc.flag[web_loc].aslocation> m@air radius:0
            - flag npc web_loc_list:<-:%value%
            }
        }
 
# Called to capture a player by teleporting them to their nest location then
# webing them in        
"Bad Spider Capture Player":
    type: task
    script:
    - ^chat "<yellow>food for later....."
    - ^run "Bad Spider Make Nest"
    - ^teleport location:<npc.flag[nest_loc]>
    - ^walkto "location:<npc.flag[home_loc]>"
    - ^cast SLOW duration:60s
    - ^cast WEAKNESS duration:60s
    # stop attacking current player and rest from attacking
    - ^LIVE PEACE
    - ^flag npc resting:true duration:60s
 
# Called to create a webbed area for the spider to put players
# when they are captured. The nest is 3 high and <npc.flag[nest_radius]>
# in radius. The npc.flag[nest_loc] must exist
"Bad Spider Make Nest":
    type: task
    script:
    - ^flag npc tx:<npc.flag[nest_loc].aslocation.x>
    - ^flag npc tz:<npc.flag[nest_loc].aslocation.z>
    - ^flag npc ty:<npc.flag[nest_loc].aslocation.y>

    # put a glow stone below just for effect
    - ^flag npc ty:-:1
    - ^flag npc "web_loc:<npc.flag[tx]>,<npc.flag[ty]>,<npc.flag[tz]>,<npc.location.world.name>"
    - ^modifyblock <npc.flag[web_loc].aslocation> 89 radius:0
 
    # create a 3 high nest
    - ^flag npc ty:+:1
    - ^flag npc "web_loc:<npc.flag[tx]>,<npc.flag[ty]>,<npc.flag[tz]>,<npc.location.world.name>"
    - ^modifyblock <npc.flag[web_loc].aslocation> 30 radius:<npc.flag[nest_radius]>
    - ^flag npc ty:+:1
    - ^flag npc "web_loc:<npc.flag[tx]>,<npc.flag[ty]>,<npc.flag[tz]>,<npc.location.world.name>"
    - ^modifyblock <npc.flag[web_loc].aslocation> 30 radius:<npc.flag[nest_radius]>
    - ^flag npc ty:+:1
    - ^flag npc "web_loc:<npc.flag[tx]>,<npc.flag[ty]>,<npc.flag[tz]>,<npc.location.world.name>"
    - ^modifyblock <npc.flag[web_loc].aslocation> 30 radius:<npc.flag[nest_radius]>

# ************************ Waypoint Handling ******************************    
# ************************ Waypoint Handling ******************************    
# ************************ Waypoint Handling ******************************    
"NPC Add Waypoint Player Location":
    type: task
    script:
    - narrate "<yellow>Add waypoint from current player location"
    - run "NPC Add Waypoint" "def:<player.location>"

"NPC Add Waypoint":
    type: task
    script:
    # create the list if it does not exist.
    - ^if <npc.flag[wp_list]> == null {
        - narrate "<yellow>Create waypoint list for <npc.name>/<npc.id>"
        - flag npc wp_list:->:%1%
        - narrate "<yellow>add location to waypoint list for <npc.name>/<npc.id>"
        }
        else {
        - narrate "<yellow>add location to waypoint list for <npc.name>/<npc.id>"
        - flag npc wp_list:->:%1%
        }
        
"NPC Clear Waypoints":
    type: task
    script:
    - narrate "<yellow>clear waypoint list for <npc.name>/<npc.id>"
    - flag npc wp_list:!

"NPC Move Next Waypoint":
    type: task
    script:
    # if the movement index does not exist then initialize it to 0
    - ^if <npc.flag[wp_idx]> == null flag npc wp_idx:0
    - ^walkto "location:<npc.flag[wp_list].get[<^npc.flag[wp_idx].asint>]>"
    # increment and clip index (record old index for future use)
    - ^flag npc wp_last_idx:<npc.flag[wp_idx]>
    - ^flag npc wp_idx:+:1
    - ^if <npc.flag[wp_idx]> >= <npc.flag[wp_list].size> flag npc wp_idx:0

"NPC Move Random Waypoint":
    type: task
    script:
    - ^walkto "location:<npc.flag[wp_list].random>"
 
# ************************* NPC List Creation ***************************    
# ************************* NPC List Creation ***************************    
# ************************* NPC List Creation ***************************    
# Call this to add/create to a list of NPCs. If the list does not exist
# is will be created. The example below will create a list called 
# 'monsters_npc_list'.
#   e.g. - runtask "script:NPC Add To List" "context:monsters"    
"NPC Add To List":
    type: task
    script:
    # create the list if it does not exist.
    - ^if <server.flag[%1%_npc_list]> == null {
        - announce "<yellow>Created NPC list '%1%'"
        - flag global "%1%_npc_list:->:<npc>"
        - announce "<yellow>Added <npc.name>/<npc.id> to NPC list '%1%'"
        }
        else if <server.flag[%1%_npc_list].aslist> contains <npc> {
        - narrate "<red><npc.name>/<npc.id> already in NPC list '%1%'"
        }
        else {
        - flag global "%1%_npc_list:->:<npc>"
        - narrate "<yellow>Added <npc.name>/<npc.id> to NPC list '%1%'"
        }
# Call this to remove a NPC from a list. If the list does not exist it will be flagged
# the list name enters the function via the first 'def' input
#   e.g. - run "script:NPC Remove From List" "def:monsters"    
"NPC Remove From List":    
    type: task
    script:
    - ^if <server.flag[%1%_npc_list]> == null {
        - narrate "<red><npc.name>/<npc.id> is not in list '%1%'"
        }
        else flag global <context.value>_npc_list:<-:<npc>

"NPC Display List":    
    type: task
    script:
    - narrate "<yellow>NPC List '%1%' has <server.flag[%1%_npc_list].aslist.size> entries"
    - foreach <server.flag[%1%_npc_list].aslist> {
        - narrate "<yellow>- <%value%.name>/<%value%.id>"
        }
 
# Called each morning to simply move the spider back to its home (in case
# it has wandered off somewhere)        
"Bad Spider New Day":
    type: task
    script:
    - teleport npc location:<npc.flag[home_loc]>
# Called each game minute (about 50sec). Spider will move and webs will
# be removed    
"Bad Spider Timed Move":
    type: task
    script:
    - run "Bad Spider Fade Web"
    # only move if not in combat
    - if <npc.flag[in_combat]> == null {
        - if <util.random.int[1].to[100]> <= <cons:bs_move_chance> run "NPC Move Next Waypoint"
        }
 
# Called to display the spiders general information    
"Bad Spider Info":    
    type: task
    script:
    - narrate "<yellow>Bad Spider:<npc.name>"
    - narrate "<yellow> Capture Health <cons:bs_capture_health>"
    - narrate "<yellow> Nest Location <npc.flag[nest_loc]>"
    - narrate "<yellow> Home Location <npc.flag[home_loc]>"
    - narrate "<yellow> Nest Radius <npc.flag[nest_radius]>"
    - narrate "<yellow> Web Radius  <npc.flag[web_radius]>"
    - narrate "<yellow> in combat <npc.flag[in_combat]>"
    - foreach <npc.flag[wp_list].aslist> {
        - chat "<yellow> wp %value%"
        }
 
# This interactive script is just for testing and configuration by ops
"Bad Spider Interact":
    type: interact
    speed: 5t
    Requirements:
        Mode: All

    steps:
        'idle*':
            proximity trigger:
                entry radius: 8
                entry:
                    script:
                    - ^if <player.is_op> == true chat 'entering <npc.name> area'
                    # if done resting then attack the player
                    - ^if <npc.flag[resting]> == null attack
                exit radius: 12
                exit:
                    script:
                    # once out of range then go home
                    - ^if <player.is_op> == true chat 'leaving <npc.name> area'
                    - attack stop
                    - ^walkto "location:<npc.flag[home_loc]>"

            click trigger:
                script:
                - engage
                - ^lookclose toggle:true
                - ^if <player.is_op> == true {
                    - flag player selected_npc:<npc>
                    - run "Bad Spider Info"
                    }
                - disengage

            chat trigger:
                # Testing ***********************************************
                't0':
                    trigger: /t0/, add NPC list
                    script:
                    - ^if <player.is_op> == true run "NPC Add To List" "def:bad_spider"
                't1':
                    trigger: /t1/, remove NPC list
                    script:
                    - ^if <player.is_op> == true run "NPC Remove From List" "def:bad_spider"
                    
                'CatchAll':
                    trigger: /REGEX:\w+/
                    script:
                    - engage
                    - ^if <player.is_op> == true {
                        - chat "not sure what <player.chat_history> means"
                        }
                    - disengage
 
# World script to allow the setting of a spiders home and nest (after the spider is 
# selected by right clicking it)
# Commands:
#    /bspider home      ; sets home point
#    /bspider nest      ; sets nest
#    /bspider wp        ; adds a waypoint
#    /bspider wpc       ; clears waypoints
"bs_world_commands":
    type: world
    
    events:

        on time changes in w@pluto:
        - if <context.time> == "6" {
            - foreach <server.flag[bad_spider_npc_list].aslist> {
                - run "Bad Spider New Day" as:%value%
                }
            }
            else {
            - foreach <server.flag[bad_spider_npc_list].aslist> {
                - run "Bad Spider Timed Move" as:%value%
                }
           }
        - determine passive
            
        on bspider command:
        - narrate "<yellow>BadSpider command for '<player.flag[selected_npc]>' <npc[<player.flag[selected_npc]>].name>"
        - ^if <player.is_op> {
            - ^if "<context.args.get[0]>" == "sel" {
                - flag player "selected_npc:n@<context.args.get[2]>"
                - narrate "<yellow>select spider '<player.flag[selected_npc]>'/<npc[<player.flag[selected_npc]>].name>"
                }
                else if "<context.args.get[0]>" == "nest" {
                - narrate "<yellow>-set nest location to current location"
                - flag npc npcid:<player.flag[selected_npc].asnpc.id> nest_loc:<player.location>
                - run "Bad Spider Make Nest" as:<player.flag[selected_npc]> "def:<player.location>"
                - execute as_server "denizen save"
                }
                else if "<context.args.get[0]>" == "home" {
                - narrate "<yellow>-set home position to current location"
                - flag npc npcid:<player.flag[selected_npc].asnpc.id> home_loc:<player.location>
                - execute as_server "denizen save"
                }
                else if "<context.args.get[0]>" == "info" run "Bad Spider Info" as:<player.flag[selected_npc]>
                
                else if "<context.args.get[0]>" == "r0" {
                - flag npc npcid:<player.flag[selected_npc].asnpc.id> web_radius:0
                - narrate "<yellow>set web toss to 1x1 by 2 high"
                - execute as_server "denizen save"
                }
                else if "<context.args.get[0]>" == "r1" {
                - flag npc npcid:<player.flag[selected_npc].asnpc.id> web_radius:1
                - narrate "<yellow>set web toss to 3x3 by 2 high"
                - execute as_server "denizen save"
                }
                else if "<context.args.get[0]>" == "r2" {
                - flag npc npcid:<player.flag[selected_npc].asnpc.id> web_radius:2
                - narrate "<yellow>set web toss to 5x5 by 2 high"
                - execute as_server "denizen save"
                }
                else if "<context.args.get[0]>" == "wp" {
                - run "NPC Add Waypoint Player Location" as:<player.flag[selected_npc]> "def:<player.location>"
                - execute as_server "denizen save"
                }
                else if "<context.args.get[0]>" == "wpc" {
                - run "NPC Clear Waypoints" as:<player.flag[selected_npc]>
                - execute as_server "denizen save"
                }
                else if "<context.args.get[0]>" == "list" {
                - run "NPC Display List" "def:bad_spider"
                }
                else if "<context.args.get[0]>" == "tweb1" {
                - narrate "<yellow>test toss 1"
                - run "Bad Spider Web Toss" as:<player.flag[selected_npc]> "def:direct_small"
                }
                else if "<context.args.get[0]>" == "tweb2" {
                - narrate "<yellow>test toss 2"
                - run "Bad Spider Web Toss" as:<player.flag[selected_npc]> "def:direct_normal"
                }
                else if "<context.args.get[0]>" == "tweb3" {
                - narrate "<yellow>test toss 3"
                - run "Bad Spider Web Toss" as:<player.flag[selected_npc]> "def:small"
                }
                else if "<context.args.get[0]>" == "tweb4" {
                - narrate "<yellow>test toss 4"
                - run "Bad Spider Web Toss" as:<player.flag[selected_npc]> "def:normal"
                }
                else if "<context.args.get[0]>" == "tcap" {
                - run "Bad Spider Capture Player" as:<player.flag[selected_npc]>
                }
                else if "<context.args.get[0]>" == "tmove" {
                - narrate "<yellow>move next waypoint"
                - run "NPC Move Next Waypoint" as:<player.flag[selected_npc]>
                }
                else {
                - narrate "<red> '<context.args.get[0]>' is not a valid command"
                - narrate "<red>try one of these...."
                - narrate "<red>'sel' <id> - selects the spider (vs clicking it)"
                - narrate "<red>'nest'  - sets the nest to the player location"
                - narrate "<red>'home'  - sets the home postion to the player location"
                - narrate "<red>'info'  - displays various info of selected spider"
                - narrate "<red>'r0'    - sets web toss 1x1x2"
                - narrate "<red>'r1'    - sets web toss 3x3x2 (default)"
                - narrate "<red>'r2'    - sets web toss 5x5x2"
                - narrate "<red>'tweb1' - fires a test web on your position?"
                - narrate "<red>'tweb2' - fires a test web on your position?"
                - narrate "<red>'tweb3' - fires a test web on your position?"
                - narrate "<red>'tweb4' - fires a test web on your position?"
                - narrate "<red>'tcap'  - tests spider capture (on you)"
                - narrate "<red>'tmove' - sends to next waypoint (chance)"
                }
            }
            else narrate "<red>you must be an OP to use this command"
        - determine fulfilled
 




Comments
No one has posted a comment! Post one below: