Paste #28551: Tutorial

Date: 2016/01/16 07:24:10 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


##############################
# File for NPC Sage Tutorial #
##############################

###########################################
# Assignment script for NPC Sage Tutorial #
###########################################
NPC_Sage_Tutorial:
  type: assignment
  actions:
    on assignment:
    - ^run Assign_Triggers npc:<npc>
  interact scripts:
  - 1 NPC_Sage_Tutorial_Interact

#########################################
# Interact script for NPC Sage Tutorial #
#########################################
NPC_Sage_Tutorial_Interact:
  type: interact
  steps:
      1:
            click trigger:
                script:
                - inject Tutorial_Whisper_Script
            chat trigger:
                1:
                      trigger: /Yes/ please!
                      script:
                      - inject NPC_Sage_Tutorial_Yes_Event
                      - run Tutorial npc:<npc>
                2:
                      trigger: /No/ thanks!
                      - inject NPC_Sage_Tutorial_No_Event
                      - run Tutorial_End
      2:
            click trigger:
                script:
                - flag <player> next
                - narrate format:Talk_Format "Great! Moving on..."
            chat trigger:
                1:
                      trigger: /cancel/
                      script:
                      - inject Tutorial_Cancel
                      - run Tutorial_End
#########################################
# Task script for initialising tutorial #
#########################################
Tutorial_Initialiser:
  type: task
  script:
  - flag <player> inTutorial
  - ^adjust <player> show_entity:<server.flag[TutorialNPC]>
  - ^adjust <player> show_entity:<server.flag[TutorialPlaceHolder]>
  - wait 10t
  - ^adjust <player> spectate:<server.flag[TutorialPlaceHolder]>

###################################
# Task script for ending tutorial #
###################################
Tutorial_End:
  type: task
  script:
  - if <s@NPC_Sage_Tutorial_Interact.step[<player>]> == 2 {
    - zap s@NPC_Sage_Tutorial_Interact 1
    }
  - queue <player.has_flag[tutorialQueue]> clear
  - flag <player> tutorialQueue:!
  - flag <player> inTutorial:!
  - ^adjust <player> spectate:<player>
  - wait 10t
  - ^adjust <player> hide_entity:<server.flag[TutorialNPC]>
  - ^adjust <player> hide_entity:<server.flag[TutorialPlaceHolder]>
  - queue clear

##############################################################
# World script for hiding NPCs on join, and handling log out #
##############################################################
Tutorial_World_Handler:
  type: world
  events:
    on player first login:
    - wait 3s
    - inject Tutorial_Initialiser
    - ^run Tutorial_Introduction npc:<server.flag[TutorialNPC]>
    on player joins:
    - wait 5t
    - if <player.has_flag[inTutorial]> {
      - ^run Tutorial_Introduction npc:<server.flag[TutorialNPC]>
      }
      else {
      - ^adjust <player> hide_entity:<server.flag[TutorialNPC]>
      - ^adjust <player> hide_entity:<server.flag[TutorialPlaceHolder]>
      }
    on player quits:
    - if <player.has_flag[inTutorial]> {
      - queue <player.has_flag[tuorialQueue]> stop
      }

#############################################
# Task script for handling the introduction #
#############################################
Tutorial_Introduction:
  type: task
  script:
  - narrate format:Talk_Format "Greetings, <player.name> and welcome to Custom Kits! I'm Ecaxon the sage, you seem new around here..."
  - wait 2s
  - narrate format:Talk_Format "Would you like some help?"
  - wait 2s
##################
# Whisper format #
##################
Tutorial_Whisper_Script:
  type: task
  script:
  - narrate format:Server_Format "Type <&l>'Yes'<&r> or <&l>'No'<&r> in chat!"
  - wait 2s
  - narrate format:Server_Format "You can cancel this tutorial anytime by saying <&l>'cancel'<&r>"
###########################
# Task script for waiting #
###########################
Tutorial_Wait_Next:
  type: task
  script:
  - flag <player> next:!
  - while <player.has_flag[next].not> {
    - wait 5t
    }
  - flag <player> next:!
####################
# Acctual tutorial #
####################
Tutorial:
  type: task
  script:
  - zap s@NPC_Sage_Tutorial_Interact 2
  - flag <player> tutorialQueue:<queue>
  - wait 2s
  - narrate format:Talk_Format "Great! Okay, so <player.name>, once again, welcome to the realm of Custom Kits!"
  - wait 3s
  - narrate format:Talk_Format "Something note-worthy about this realm is the sheer amount of NPCs wandering around!"
  - wait 2s
  - narrate format:Talk_Format "All of whom can be interacted with through typin in chat while looking at them or simply right clicking them!"
  - wait 3s
  - narrate format:Talk_Format "A very important thing to note is that very much like you and me, how you treat them will determine how they treat you!"
  - wait 3s
  - narrate format:Talk_Format "So, if you go around being a total jerk to them, don't be suprised if they turn hostile towards you!"
  - wait 3s
  - narrate format:Talk_Format "How the NPC treats you is based on the esteem you have which can be viewed using the command /Esteem (player) !"
  - wait 3s
  - narrate format:Talk_Format "That might be a-lot to digest so I'll pause here for now!"
  - wait 2s
  - narrate format:Talk_Format "Right click me to continue!"
  - inject Tutorial_Wait_Next
  - narrate format:Talk_Format "Alright! Moving on to the actual game itself!"
  - wait 2s
  - narrate format:Talk_Format "So....Custom Kits! What is it?"
  - wait 2s
  - narrate format:Talk_Format "It's a unique twist on kit PvP where you start off with 200 Kit Points to build your kits..."
  - wait 3s
  - narrate format:Talk_Format "Items such as armour and weapons will each use up a different amount of kit points based on the individual item!"
  - wait 4s
  - narrate format:Talk_Format "The amount of kit points is always fixed at 200! So, you don't have to worry about that if you die!"
  - wait 3s
  - narrate format:Talk_Format "However, for consumable items such as potions and foodstuff, you are required to spend gold, the server's currency, to buy them!"
  - wait 4s
  - narrate format:Talk_Format "Upon dying, you will lose any consumable items you are carrying so be careful!"
  - wait 3s
  - narrate format:Talk_Format "I'll pause here once again!"
  - wait 2s
  - narrate format:Server_Format "Right click me to continue!"
  - inject Tutoria_Wait_Next
  - narrate format:Talk_Format "Alright I shall not go too in-depth now as there are other NPCs specialising in those areas!"
  - wait 3s
  - narrate format:Talk_Format "Elizabeth the guide next to the map for example will give you a tour of this area!"
  - wait 3s
  - narrate format:Talk_Format "The warrior at the Highscores area will instruct you on the leaderboard system we have!"
  - wait 3s
  - narrate format:Talk_Format "And lastly, that creepy guy in a black hood in the guild hub will teach you all about the guild system we have!"
  - wait 4s
  - narrate format:Talk_Format "Alright! There's all for me now! If you ever need any help, feel free to find me by the waterfall!"
  - ^run Tutorial_End
#########################################
# Task script for handling cancel event #
#########################################
Tutorial_Cancel:
  type: task
  script:
  - narrate format:Talk_Format "Alright! Do find me by the pavillion if you ever need help!"
######################################
# Task script for handling Yes event #
######################################
NPC_Sage_Tutorial_Yes_Event:
  type: task
  script:
  - narrate format:Talk_Format "A wise choice indeed! Let's begin shall we?"
#####################################
# Task script for handling No event #
#####################################
NPC_Sage_Tutorial_No_Event:
  type: task
  script:
  - narrate format:Talk_Format "Alright child, you can find me at the pavillion by the waterfall if you ever need my help!"