Paste #37546: NPC Dialogue

Date: 2016/11/11 23:10:27 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#############################################
#####        MADE BY: Xanderpitz        #####
#####     /npc assign --set Paladin     #####
#############################################

Paladin:
    type: assignment
    debug: true
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:chat state:true
        - trigger name:proximity state:true
    interact scripts:
    - 1 Paladin_interact

Paladin_interact:
    type: interact
    debug: true
    first_dialogue:
    - if <player.flag[peasant_to_knight]> != "true" {
      - narrate "<&7>[<&b>Paladin<&7>] <&e><&l>Greetings! How may I assist you?"
      - narrate "<&c>1. <&7>I'd like to start a quest."
      - narrate "<&c>2. <&7>I'd like to become a <&e>Knight<&7>."
      - narrate "<&c>3. <&7>Nevermind."
      - narrate "<&a>Type 1, 2, or 3 in chat to answer."
      - flag player "clicked:true"
      }
    second_dialogue:
    - if <player.flag[peasant_to_knight]> == "true" {
      - narrate "<&7>[<&b>Paladin<&7>] <&a>Ah, I see you've read up on becoming a Knight. So, will you join the Royal Guard?"
      - narrate "<&c>1. <&7>Yes."
      - narrate "<&c>2. <&7>No."
      - flag player "path_to_knight:true"
      }
    steps:
        '1':
            Click trigger:
                Script:
                - inject locally first_dialogue
                - inject locally second_dialogue
            Proximity trigger:
                exit:
                  Script:
                  - if <player.flag[clicked]> == "true" && <player.flag[peasant_to_knight]> != true {
                    - narrate "<&7>[<&b>Paladin<&7>] <&a>Fare thee well..."
                    - flag player "clicked:false"
                  }
                  - queue clear
            Chat trigger:
                '1':
                  trigger: /1/
                  script:
                  - if <player.has_permission[essentials.kits.knight]> {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&c>Sorry, but I haven't got any quests for you at the moment. Check back later!"
                    - wait 2s
                    - inject locally first_dialogue instantly
                    }
                    else if <player.has_permission[essentials.kits.peasant]> {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&c>Sorry bud, gotta be a Knight first. We are looking for recruits though, are you interested?"
                    - narrate "<&c>1. <&7>Sure, sign me up!"
                    - narrate "<&c>2. <&7>No, I'll walk my own path."
                    - narrate "<&a>Type 1 or 2 in chat to answer."
                    - flag player "peasant1:true"
                    }
                    else {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&c>Sorry, you'll have to change classes to receive quests from me."
                    - wait 2s
                    - inject locally first_dialogue instantly
                    }
                  - if <player.flag[peasant1]> == "true" {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&a>Wonderful news! I shall alert the king immediately. In the meantime, please read the Knight info guide by typing <&dq>/kit Knightinfo<&dq>."
                    - wait 2s
                    - narrate "<&e>[<&b>Paladin<&e>] <&a>Come speak to me again when you have read the book and are ready to become a knight!"
                    - flag player "peasant1:false"
                    - flag player "peasant_to_knight:true"
                    }
                  - if <player.flag[peasant2]> == "true" {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&c>The king hasn't assigned the royal guard any quests yet, but he will very soon!"
                    - flag player "peasant2:false"
                    - wait 2s
                    }
                  - if <player.flag[path_to_knight]> == "true" {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&a>It is decided then. Congratulations! Talk to me if you'd like to check on quests or other info about being a Knight!"
                    - narrate "<&b>Your class has been switched from <&a>Peasant <&b>to <&a>Knight<&b>."
                    - execute as_server "setrank <player.name> Knight default"
                    }
                '2':
                  trigger: /2/
                  script:
                  - if <player.has_permission[essentials.kits.knight]> {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&c>Uh, I<&sq>m assuming that's a joke, right?"
                    - wait 2s
                    - inject locally first_dialogue instantly
                    }
                    else if <player.has_permission[essentials.kits.peasant]> && <player.flag[peasant2]> != "true" {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&a>Ah, excellent! First we must go over some details. What would you like to hear about?"
                    - narrate "<&c>1. <&7>Quests"
                    - narrate "<&c>2. <&7>Kits and Perks"
                    - narrate "<&c>3. <&7>Upgrades"
                    - narrate "<&c>4. <&7>All set. Sign me up!!!"
                    - narrate "<&c>5. <&7>Nah, nevermind..."
                    - narrate "<&a>Type 1, 2, 3, 4, or 5 in chat to answer."
                    - flag player "peasant2:true"
                    }
                  - if <player.flag[peasant1]> == "true" {
                    - determine passively cancelled
                    - narrate "<&7>[<&b>Paladin<&7>] <&c>Very well."
                    - queue clear
                    }
                  - if <player.flag[peasant2]> == "true" {
                    - determine passively cancelled
                    - narrate "<&7>[<&b>Paladin<&7>] <&a>You can find info about Knights and Paladins by typing <&dq>/kit knightinfo<&dq>. All soldiers can resupply on armor and weapons daily through their kit."
                    }
                '3':
                  trigger: /3/
                  script:
                  - if <player.flag[peasant2]> == "true" {
                    - determine passively cancelled
                    - narrate "<&7>[<&b>Paladin<&7>] <&a>You'll start as a Knight, but can be upgraded to Paladin by completeing Knight-related quests. Check your available quests with <&dq>/quests<&dq>"  
                    }
                    else {
                    - determine passively cancelled
                    - narrate "<&7>[<&b>Paladin<&7>] <&c>Very well."
                    }
                '4':
                  trigger: /4/
                  script:
                  - if <player.flag[peasant2]> == "true" {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&a>Wonderful news! I shall alert the king immediately. In the meantime, please read the Knight info guide by typing <&dq>/kit Knightinfo<&dq>."
                    - wait 2s
                    - narrate "<&e>[<&b>Paladin<&e>] <&a>Come speak to me again when you have read the book and are ready to become a knight!"
                    - flag player "peasant_to_knight:true"
                    }
                    else {
                    - narrate "<&c>To respond, you must type a number in chat."
                    }
                '5':
                  trigger: /5/
                  script:
                  - if <player.flag[peasant2]> == "true" {
                    - determine passively cancelled
                    - narrate "<&e>[<&b>Paladin<&e>] <&c>Very well. Come talk to me again if you change your mind."
                    }
                    else {
                    - narrate "<&c>To respond, you must type a number in chat."
                    }
                'default':
                  trigger: /regex:.*/
                  script:
                  - narrate "<&c>To respond, you must type a number in chat."







    response:

        - case '3':
          - determine passively cancelled
          - narrate "<&e>[<&b>Paladin<&e>] <&a>Fare thee well..."
        - default:
          - determine passively cancelled
          - narrate "<&c>You must type 1, 2, or 3."