Paste #7397: Untitled Paste

Date: 2014/07/23 21:28:34 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


BodyguardSpawn:
    type: task
    debug: true
    speed: 0
    script:
    - ^engage
    - ^execute as_op "npc create BodyGuard"
    - ^execute as_op "npc select <npc>"
    - ^execute as_op "trait sentry"
    - ^execute as_op "sentry strength 6"
    - ^execute as_op "sentry armor 5"
    - ^execute as_op "sentry equip DIAMOND_SWORD"
    - ^execute as_op "sentry equip IRON_HELMET"
    - ^execute as_op "sentry equip IRON_CHESTPLATE"
    - ^execute as_op "sentry equip IRON_LEGGINGS"
    - ^execute as_op "sentry equip IRON_BOOTS"
    - ^execute as_op "sentry health 20"
    - ^execute as_op "sentry invincible false"
    - ^execute as_op "sentry respawn 60"
    - ^execute as_op "sentry speed 1.2"
    - ^execute as_op "sentry follow 4"
    - ^execute as_op "npc owner <player.name>"
    - ^execute as_op "npc skin knight8"
    - ^execute as_op 'npc assign --set "BodyGuardSpawnAssignment"'
    - ^execute as_op "sentry guard <player.name>"
    - ^disengage



#    - trigger name:click state:true


BodyGuardSpawnAssignment:
  type: assignment
  debug: true
  actions:
    on player quits:
    - remove <npc.id>
    on assignment:
    - trigger name:proximity state:true radius:10
    on click:
    - if <npc.owner> != <player> {
      - chat "<yellow>I'm sorry <yellow><player.name><green>, but I'm guarding <yellow><npc.owner><green> so I'm not going to take orders from you."
      }
      else if "<npc.flag[Guarding]>" == "true" {
      - random {
        - ^chat "<yellow>Oh all right <player.name>, I'll wait back here for you."
        - ^chat "<yellow>Don't worry about me, I'll stay back here. Please don't forget about me."
        - ^chat "<yellow>I'll wait around for you..but please don't forget about me."
        - ^chat "<yellow>You want me to hang back? Ok, no problem."
        - ^chat "<yellow>Ok, I'll guard this spot."
        - ^chat "<yellow>I'll stand here and wait until you come get me again."
        }
      - ^execute as_npc "npc sel <npc.id>"
      - ^execute as_npc "sentry guard"
      - ^flag npc "Guarding:false"
      }
      else {
      - random {
        - ^chat "<yellow>Ok, I'm following you."
        - ^chat "<yellow>Great <white><player.name><yellow>, I'm right behind you."
        - ^chat "<yellow>You lead the way boss."
        - ^chat "<yellow>Watching your back. Let's go."
        - ^chat "<yellow>Great, let's go for a walk."
        - ^chat "<yellow>Hope we're going to crush some zombie skulls. Let's move."
        }
      - ^execute as_npc "npc sel <npc.id>"
      - ^execute as_npc "sentry guard <player.name>"
      - ^flag npc "Guarding:true"
      }
  interact scripts:
  - 10 BodyGuardSpawnAssignment1

BodyGuardSpawnAssignment1:
  type: interact
  debug: true
  steps:
    1:
      proximity trigger:
        entry:
          script:
          - if <player> == <npc.owner> {
            - narrate "Hello!"
            }