Paste #6510: Guard Script

Date: 2014/07/07 13:32:00 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


IntroShipGuardNPC:
    type: assignment
    interact scripts:
    - 10 Guard
    actions:
        on assignment:
        # These triggers enable interaction with an NPC via chatting, clicking and entering proximity
        - trigger name:chat state:true radius:10
        - trigger name:click state:true
        - trigger name:proximity state:true
        - lookclose <npc> state:true

GuardIntro:
    type: task
    Script:
    - ^spawn <npc> <npc.anchor[start]>
    - lookclose <npc> state:true
    - walk <npc.anchor[end]> auto_range
    - narrate "<aqua>Suddenly, you hear the door open as the captain enters the hull of the ship"
    - wait 1
    - look <player> <npc.location>
    - narrate "<green>[Captain] -> You<&co> <yellow> Traveler, who are you talking to?"
    - zap script:Guard step:1

Guard:
    type: interact
    steps:
        1:
            chat Trigger:
                1:
                    Trigger: "/regex:.+/"
                    Script:
                        - wait 1
                        - narrate "<aqua>The Captain gives you an inquisitive look as he contemplates your response."
                        - wait 1
                        - narrate "<green>[Captain] -> You<&co> <yellow>Get some rest - you've been at sea for too long."
                        - wait 1
                        - narrate "<green>[Captain] -> You<&co> <yellow>No worries, we arrive at our destination tomorrow."
                        - wait 2
                        - walk <npc.anchor[start]> auto_range
                        - switch l@226,27,9819,world state:off
                        - switch l@226,27,9819,world state:on
                        - wait 1
                        - Despawn <npc>
                        - ^flag <player> Quest_A_New_Story_Begins_1:!
                        - narrate "<blue>New Quest Objective<&co> <gold>Get some Rest"
                        - finish
            Click Trigger:
                Script:
                - narrate "<green>[Arithian Guard] -> You<&co> <yellow>Who were you talking to?"
                - zap step:1