Paste #23059: walmart greeter

Date: 2015/11/27 17:00:36 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#format chat for the NPC
cchat:
  type: format
  format: "<&b><npc.name><&f> <&co> <&a><text>"
#my npc greeter, no need to be 65 or work at walmart.
greeter:
  type: assignment
  actions:
    on assignment:
    - trigger name:click state:true
    - trigger name:chat state:true
  interact scripts:
  - 10 greet_em
#now the actual scripts
greet_em:
  type: interact
  steps:
    1:
      click trigger:
        script:
        - narrate format:cchat "Hello I am <npc.name>, would you care for a tour?"
        - narrate "Type /yes/ or /no/"
      chat trigger:
        1:
          trigger: /Yes/ sure
          script:
          - narrate format:cchat "Ok then follow me"
#creater an NPC named greeter and saves it for later use in the script.
          - ^create player NPCGreeter <npc.location> save:greeter
#hide_entity is a mechanism
          - ^adjust <player> hide_entity:<npc>
# Now to make the npc not be in the list of online players.
          - ^adjust <server.list.online_players.exclude[<player>]> hide_entity:<entry[greeter].created_npc>
#now run the greeter_path and greeter_talk tasks
          - ^run greeter_path npc:<entry[greeter].created_npc> def:<^npc>
          - ^run greeter_talk npc:<entry[greeter].created_npc>
          - zap 2
        2:
          trigger: /No/ thanks
          script:
          - narrate format:cchat "Ok then enjoy your time here"
#now taks scrips for path
greeter_path:
  type: task
  definitions: masternpc
  script:
      - ^flag <npc> step:1
      - ~walk <def[masternpc].anchor[tourstop1]> auto_range
      - ^inject greeter_waits
      - ^flag <npc> step:2
      - ~walk <def[masternpc].anchor[tourstop2]> auto_range
      - ^inject greeter_waits
      - ^flag <npc> step:3
      - ~walk <def[masternpc].anchor[tourstop3]> auto_range
      - ^inject greeter_waits
      - wait 1
      - remove <npc>
      - adjust <player> show_entity:<def[masternpc]>
      - zap 1 script:s@greet_em
#the greeter waits for player to catch up
greeter_waits:
  type: task
  script:
  - ^while <npc.location.distance[<player.location>].is[OR_MORE].than[5]> {
  - narrate format:cchat "Come along, please try and keep up"
  - wait 1}
#now the taks script for talking points on the path
greeter_talk:
  type: task
  script:
  - narrrate format:cchat "We are glad you joined the Chapel Perilous"
  - wait 2
  - narrate format:cchat "A modded survival server"
  - while <npc.flag[step].is[OR_LESS].than[1]> {
  - wait 1
  }
  - narrate format:cchat "Here we have the Erisian Temple of Dealey Plaza"
    - while <npc.flag[step].is[OR_LESS].than[2]> {
  - wait 1
  }
  - narrate format:cchat "Here we have the JFK Inn of Dealey Plaza"
    - while <npc.flag[step].is[OR_LESS].than[3]> {
  - wait 1
  }
  - narrate format:cchat "Here we have the DealeyLlama's Deal o'Rama"