Paste #9016: take this from npc to just an executable script

Date: 2014/08/30 20:41:34 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# To assign to an NPC, literally type:
# /npc assign --set "race_batarian_selector"
race_batarian_selector:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:proximity state:true
        - trigger name:chat state:true
    interact scripts:
    - 10 batarian_interact

batarian_interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.flag[race]> == batarian {
                  - narrate format:cchat "Your already a Batarian, move on"
                  }
                  else {
                  - narrate format:cchat "<player.name> I can tell you about the nasty race of Batarians before you make your final choice."
                  - narrate format:cchat "Do you want to hear what I have to say?"
                  - narrate "You can say <&c><&o>Yes or <&c><&o>No."
                  }
            chat trigger:
                1:
                    trigger: /yes/ Tell me about the Bartarians.
                    script:
                    - narrate format:cchat "The Bartarians are a Dark race"
                    - wait 2
                    - narrate format:cchat "They hate all races besides the Draconians"
                    - wait 2
                    - execute as_player "race info Batarian <player.name>"
                    - wait 5
                    - narrate format:cchat "Do you want to become a Batarian and put fear in your foes eyes?"
                    - narrate "<&c><&o>You can say <&c><&o>Join or <&c><&o>Leave."
                2:
                    trigger: I want to /Join/ the Bartarian race!
                    script:
                    - narrate format:cchat "Very well then, may your dark heart be satisfied.."
                    - if <player.flag[race]||null> == null {
                      - execute as_player "race select batarian"
                      }
                      else {
                      - execute as_player "race change batarian"
                      }
                    - flag player race:batarian
                3:
                    trigger: /No/, What you have said is enough to turn me away.
                    script:
                    - narrate format:cchat "You may like the other races then, look around"
                4:
                    trigger: I think I will /leave/ while I can.
                    script:
                    - narrate format:cchat "Bartarians are ruthless anyway, you would not make it"