Paste #48768: Untitled Paste

Date: 2018/07/30 16:49:52 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#######################################
#Quest Log System
#Author: theDadmin
#Version 1.0
#Instructions: A detailed video can be found here https://www.youtube.com/watch?v=MWgeukJGv7c&feature=youtu.be 
#Using this system is fairly easy and can be applied to existing quests. 
#This script is stand alone and only requires certain commands be added to quests. You will need to, at the completion of a quest flag a player with the completedquests flag +1. You will need to do this as well for quest points. You will also need to make books and bookitem scripts and include an event in worldscripts to allow the books to be read. Below are examples of these scripts for copy and paste purposes.
#Start of quest:
#- inventory add d:<player>questjournal o:examplebookitem
#
#At end of quest:
#- inventory add d:<player>completedquests o:examplebookitem
#- inventory remove d:<player>questjournal o:examplebookitem
#- flag player completedquests:+:1 (This is only needed if this is a scripted quest)
#- flag player questpoints:+:(number awarded) (This is only needed if this is a scripted quest)
#
#Example Book
#rolandreagentsb:
#  type: book
#  author: Active Quest
#  title: Roland's Reagents
#  signed: yes
#  text:
#  - "I have been asked by Roland to retrieve the following items:<n>10 Blaze Rods<n>32 Glowstone Dust<n>64 Netherwart."
#Example Book Item 
#
#rolandreagentsbi:
#  type: item
#  material: book
#  display name: Roland's Reagents
#  lore:
#  - "Click here to bring up quest information"
#
#You may wish to have two different books for when a quest is active and completed. In this case you will also need a second book item for the completed quest book with a cooresponding event.
#
#Example Event: (This can be added to ANY existing world script)
#    on player clicks examplebookitem in inventory:
#    - inventory close
#    - define held <player.item_in_hand>
#    - adjust <player> item_in_hand:examplebook
#    - adjust <player> open_book
#    - adjust <player> item_in_hand:<def[held]>
#    - queue clear
#
#IF YOU ARE USING THE QUESTS PLUGIN: You will need to create task scripts and a standing world script for the quests plugin to call. I detailed explanation of this can be found in the video posted above.
#######################################
questlogworld:
  type: world
  events:
    on player left clicks queststatsi in inventory:
    - inventory close
    - narrate "Completed Quests: <player.quests.completed.add[<player.flag[completedquests]>].round>"
    - wait 3
    - inventory open d:in@<player>completedquests
    - queue clear
    on player left clicks completedquestsi in inventory:
      - inventory close
      - inventory open d:in@<player>completedquests
    on player left clicks activequestsi in inventory:
      - inventory close
      - inventory open d:in@<player>questjournal
    on player logs in:
      - if <player.has_flag[questjournal].not> {
        - note in@QuestJournalMenu as:<player>questjournal
        - note in@questcompletemenu as:<player>completedquests
        - flag player questjournal
        }
questlog:
  type: command
  name: questlog
  usage: /questlog
  script:
  - if <player.has_flag[questjournal].not> {
    - note in@QuestJournalMenu as:<player>questjournal
    - note in@questcompletemenu as:<player>completedquests
    - flag player questjournal
    }
  - inventory open d:in@<player>questjournal
questcompletemenu:
  type: inventory
  title: Completed Quests
  size: 45
  slots:
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [i@queststatsi] [i@activequestsi]"
QuestJournalMenu:
  type: inventory
  title: Active Quests
  size: 45
  slots:
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] [i@completedquestsi]"

completedquestsi:
  type: item
  material: book
  display name: Quest Stats
  lore:
  - "Click here to view your completed quests."
queststatsi:
  type: item
  material: book
  display name: Quest Stats
  lore:
  - "Click here to view your quest stats."

activequestsi:
  type: item
  material: book
  display name: Active Quests.
  lore:
  - "Click here to access information."
  - "about your active quests."