################################################################################ # # Q u e s t G U I # GUI Interface for Quest Data # # # Authors: |Anthony| # Version: 0.1 # dScript Version: 0.9.8-DEV_b548 # # # #_______________________________________________________________________________ # #--- About QuestGUI # # QuestGUI was written upon request # #--- Installation & Setup # # # #--- Permissions & Commands # # # #--- Basic Usage Tutorial # # # #--- TODO # # ################################################################################ # # QuestGUI Configurations # QuestGUI_Config: type: yaml data command: '' quests: - 'MyQuestGUIQuest_1' trophies: - 'QuestTrophies_MyQuestGUIQuest_1_Flowers' # # END QuestGUI Configurationst #-------------------------------------- # ################################################################################ # # QuestGUI Command Script # QuestGUI_Command: type: command debug: false name: questgui description: Check your quest data usage: /questgui aliases: - qg helpData: help: desc: Learn how to use QuestGUI long: - 'A lot of help will go here' - 'And some more here too.' about: desc: Learn about the project long: - 'A lot of help will go here' - 'And some more here too.' tab complete: - if { - queue clear } - if || { - define player '' - define result '' - if { - define result '' } - determine %result% } script: - if { - queue clear } - if != 0 { - define arg '' - if { - if || { - flag 'QuestGUI_AdminMenu_Editing:' - run instantly s@QuestGUI_World display_AdminMainMenu 'def:' delay:1t - queue clear } } - if '%arg%' == 'about' { - inject locally about - queue clear } - inject locally help - queue clear } - run instantly s@QuestGUI_World display_MainMenu delay:1t about: - define page ']:||1>' - define msg1 ' QuestGUI is system for players to track, and admins to administrate, quests written with the Denizen Scripting Engine.' - define msg2 ' QuestGUI provides a graphical user interface to all player quest data. Users can see their available, active, and completed quests. Detailed stats, and available and completed objectives are provided for every quest. There<&sq>s even a trophy room!' - define msg3 ' Administrators are able to manage all of the player data through the GUI.' - run s@msgBoxed 'def:QuestGUI|QuestGUI|About|%page%|52|12|%msg1%| |<&7>%msg2%| |<&7>%msg3%]>' help: - define page '' - define topic '' - define topics '' - if '%topics%' contains '%topic%' { - define title 'Help - %topic%' - define desc '' - define long '' - define msgs '<&7>%desc%|<&sp>|<&f>%long%]>' } else { - define title 'Help List' - define msgs 'li@' - foreach %topics% { - define topic '%value%' - define desc '' - define msgs '%loop_index%<&dot> <&e>%topic%|<&sp><&sp><&sp><&b>%desc%]>' } } - run s@msgBoxed 'def:QuestGUI|QuestGUI|%title%|%page%|52|12|' # # END QuestGUI Command Script #-------------------------------------- # ################################################################################ # # QuestGUI World Events Script # # This should cover all QuestGUI related world events. # # QuestGUI_World: type: world debug: false # #-------------------------------------- # # QuestGUI Event Handlers # events: on player chats: - if ! { - queue clear } - determine passively cancelled - define array '' - queue clear - define player '' - flag %player% ':' - flag questGUI_SettingStats:! - run locally instantly display_AdminSetStats 'def:||%player%|' on player closes inventory: - if '' == 'QuestGUI' { - if { - flag QuestGUI_AdminMenu_Editing:! } - note remove 'as:' } on player right clicks with QuestGUI_Journal: - run instantly locally display_MainMenu delay:1t on player clicks in inventory: - if '' != 'QuestGUI' { - queue clear } - if '' == 'OUTSIDE' || '' == 'i@air' { - queue clear } - determine passively cancelled - inject locally 'p:inventoryClick_' resetAllQuests: - define player '%1%' - define quests '' - foreach '%quests%' { - define iconScript '' - inject '%iconScript%' p:reset } # # END QuestGUI Event Handlers #-------------------------------------- # # Inventory Display Generators # #-------------------- # User Displays # display_MainMenu: - define GUI 'QuestGUI_MainMenu_' - note 'in@generic[title=<&1>QuestGUI Menu;size=18]' 'as:%GUI%' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestJournal' 'slot:1' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestTrophies' 'slot:2' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestsCompleted' 'slot:3' - if ! { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_ServerMenu' 'slot:17' } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close' 'slot:18' - inventory open 'd:in@%GUI%' display_Overview: - define GUI 'QuestGUI_Overview_' - note 'in@generic[title=<&1>QuestGUI Overview;size=36]' 'as:%GUI%' - define hr '<&5>--------------------' - define quests '].include[].deduplicate>' - foreach '%quests%' { - define questID '%value%' - define iconScript '' - define unlockFlag '' - define isHidden '' - if '].strip_color||null>' == 'complete' { - define isComplete 'true' } else { - define isComplete 'false' } - if ( %isHidden% && ! && ! ) { - define quests '' } } - define page '' - define pages '' - if %page% > %pages% { - define page '%pages%' } - define highNumber '' - define lowNumber '' - foreach { - define slot '%loop_index%' - define questID '%value%' - define iconScript '' - define unlockFlag '' - if ! && ! { - adjust 'display_name:<&c>LOCKED' save:lockItem - adjust 'flags:HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE' save:lockItemClean - inventory add 'd:in@%GUI%' 'o:' 'slot:%slot%' - foreach next } - define titleString '' - define titleLines '' - define title '<&6>' - define titleLong 'li@' - foreach { - define titleLong "%value%]>" } - define descString '' - define descLines '' - define desc 'li@' - foreach %descLines% { - define desc "<&sp.pad_left[2]>%value%]>" } - define progressFlag '' - define progress '' - if %progress% != null { - define objString '' - define objLines '' - define obj 'li@' - foreach %objLines% { - define obj "<&sp.pad_left[2]>%value%]>" } - define lore '|%hr%|<&f>|<&f>Description<&co>||<&f>|<&f>Objective %progress%<&co>|' } else { - define lore '|%hr%|<&f>|<&f>Description<&co>||<&f>|<&a><&l.pad_left[10]>Available' } - inventory add 'd:in@%GUI%' 'o:i@%questID%_Icon[display_name=%title%;lore=%lore%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:%slot%' } - if %pages% > 1 { - if %page% != 1 { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_PreviousPage[nbt=page/]' 'slot:34' } - if %page% < %pages% { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_NextPage[nbt=page/]' 'slot:35' } } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestMenu' 'slot:35' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close' 'slot:36' - inventory open 'd:in@%GUI%' display_Objectives: - define questID '%1%' - define GUI 'QuestGUI_Objectives_' - note 'in@generic[title=<&1>QuestGUI Objectives;size=36]' 'as:%GUI%' - define hr '<&5>--------------------' - define iconScript '' - define progressFlag '' - define progress '' - define objectives '' - if '%progress%' == 'Completed' { - define progress '' } - foreach { - define obj '%value%' - define isHidden '' - if %isHidden% && { - if %obj% > %progress% { - define objectives '' } } } - define page '' - define pages '' - if %page% > %pages% { - define page '%pages%' } - define highNumber '' - define lowNumber '' - foreach { - define slot '%loop_index%' - define obj '%value%' - define isLocked '' - define icon '' - if %isLocked% && %progress% < %obj% { - inventory add 'd:in@%GUI%' 'o:%icon%[display_name=<&c>LOCKED;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:%slot%' - foreach next } - define nameString '' - define nameLines '' - define name '<&6>' - define nameLong 'li@' - foreach { - define nameLong "%value%]>" } - define descString '' - define descLines '' - define desc 'li@' - foreach %descLines% { - define desc "<&sp.pad_left[2]>%value%]>" } - define oProgressFlags '' - if ! { - define pLore 'li@' - foreach %oProgressFlags% { - define pNameString '' - define pStatusString ']||Pending>' - define pNameLines '' - define pName 'li@' - foreach %pNameLines% { - define pName "%value%]>" } - define pStatusLines '' - define pStatus 'li@' - foreach %pStatusLines% { - define pStatus "<&sp.pad_left[2]>%value%]>" } - define pLore '||<&f>]>' } - define lore '|%hr%|<&f>|<&f>Description<&co>||<&f>|<&9><&n.pad_left[13]>Stats|<&f>|' } else { - define lore '|%hr%|<&f>|<&f>Description<&co>|' } - inventory add 'd:in@%GUI%' 'o:%icon%[display_name=%name%;lore=%lore%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:%slot%' } - if %pages% > 1 { - if %page% != 1 { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_PreviousPage[nbt=page/]' 'slot:32' } - if %page% < %pages% { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_NextPage[nbt=page/]' 'slot:33' } } - if '' == 'Complete' { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestsCompleted[lore=]' 'slot:34' } else { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestJournal[lore=]' 'slot:34' } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestMenu' 'slot:35' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close' 'slot:36' - inventory open 'd:in@%GUI%' display_Trophies: - define questID '%1%' - define GUI 'QuestGUI_Trophies_' - note 'in@generic[title=<&1>QuestGUI Trophies;size=36]' 'as:%GUI%' - define hr '<&5>--------------------' - define trophies '' - define page '' - define pages '' - if %page% > %pages% { - define page '%pages%' } - define highNumber '' - define lowNumber '' - foreach { - define slot '%loop_index%' - define trophy '' - define trophyScript '' - define nameString '' - define nameLines '' - define name '<&2>' - define nameLong 'li@' - foreach { - define nameLong "%value%]>" } - define descString '' - define descLines '' - define desc 'li@' - foreach %descLines% { - define desc "<&sp.pad_left[2]>%value%]>" } - define quest '' - define questString '' - define questLines '' - define quest 'li@' - foreach %questLines% { - define quest "<&sp.pad_left[2]>%value%]>" } - define lore '|%hr%|<&f>|<&f>About<&co>||<&f>|<&b>Quest<&co>|' - inventory add 'd:in@%GUI%' 'o:%trophy%[display_name=%name%;lore=%lore%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:%slot%' } - if %pages% > 1 { - if %page% != 1 { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_PreviousPage[nbt=page/]' 'slot:33' } - if %page% < %pages% { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_NextPage[nbt=page/]' 'slot:34' } } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestMenu' 'slot:35' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close' 'slot:36' - inventory open 'd:in@%GUI%' display_Complete: - define GUI 'QuestGUI_Complete_' - note 'in@generic[title=<&1>QuestGUI Complete;size=36]' 'as:%GUI%' - define hr '<&5>--------------------' - define quests '' - define page '' - define pages '' - if %page% > %pages% { - define page '%pages%' } - define highNumber '' - define lowNumber '' - foreach { - define slot '%loop_index%' - define questID '%value%' - define iconScript '' - define titleString '' - define titleLines '' - define title '<&6>' - define titleLong 'li@' - foreach { - define titleLong "%value%]>" } - define descString '' - define descLines '' - define desc 'li@' - foreach %descLines% { - define desc "<&sp.pad_left[2]>%value%]>" } - define timesCompleted '' - if { - define lore '|%hr%|<&f>|<&f>Description<&co>|' } else { - define lore '|%hr%|<&f>|<&f>Description<&co>||<&f>|<&a>Times Completed<&co> <&f>' } - inventory add 'd:in@%GUI%' 'o:i@%questID%_Icon[display_name=%title%;lore=%lore%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:%slot%' } - if %pages% > 1 { - if %page% != 1 { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_PreviousPage[nbt=page/]' 'slot:34' } - if %page% < %pages% { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_NextPage[nbt=page/]' 'slot:35' } } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_QuestMenu' 'slot:35' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close' 'slot:36' - inventory open 'd:in@%GUI%' # #-------------------- # Admin Displays # display_AdminMainMenu: - define GUI 'QuestGUI_AdminMainMenu_' - note 'in@generic[title=<&1>QuestGUI Admin Menu;size=18]' 'as:%GUI%' - define player '' - narrate "" - define hr '<&5>----------------' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminOverview[nbt=dPlayer/%player%;lore=<&sp>|%hr%|<&7>Show all Quest|<&7>details]' 'slot:1' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminTrophies[nbt=dPlayer/%player%;lore=<&sp>|%hr%|<&7>Show all Trophy|<&7>details]' 'slot:2' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminResetAll[nbt=dPlayer/%player%;lore=<&sp>|%hr%|<&7>Reset all Quests|<&7>for this player]' 'slot:3' - if ! { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_ServerMenu[nbt=dPlayer/%player%;lore=<&sp>]' 'slot:17' } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close[nbt=dPlayer/%player%;lore=<&sp>]' 'slot:18' - inventory open 'd:in@%GUI%' display_AdminOverview: - define GUI 'QuestGUI_AdminOverview_' - note 'in@generic[title=<&1>QuestGUI Admin Overview;size=36]' 'as:%GUI%' - define hr '<&5>--------------------' - define player '%2%' - narrate "display overview " - define completed '' - define active '' - define quests '' - define msg0 '<&e> <&n>Click Actions' - define page '' - define pages '' - if %page% > %pages% { - define page '%pages%' } - define highNumber '' - define lowNumber '' - foreach { - define slot '%loop_index%' - define questID '%value%' - define item 'i@%questID%_Icon[flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' - define iconScript '' - define unlockFlag '' - define progressFlag '' - define repeatableFlag '' - define isHidden '' - define isActive '' - define isCompleted '' - define isLockable '' - define isLocked ']||false>' - define isRepeatable '' - define progress '' - define msg1 '<&3>Edit Progress<&f><&co> <&7>Left' - define msg2 '<&b> <&f><&o>Shift<&f> Left||Set Complete<&f><&co> <&f><&o><&m>Shift<&f><&m> Left||Set Complete<&co> <&f><&o>Shift<&f> Left>>' - if %isLockable% { - define msg3 '<&3><&f><&co> <&7>Right' } else { - define msg3 '<&3><&m>Lock<&f><&m><&co> <&7><&m>Right' } - define msg4 '<&b><&f><&co> <&f><&o>Shift<&f> Right' - define msg5 '<&3>Reset<&f><&co> <&7>Middle' - if %isLocked% { - define color '<&c>' } else { - if %isActive% { - define color '<&2>' } else if %isCompleted% { - define color '<&d>' } else { - define color '<&a>' } } - if %isRepeatable% { - define color '%color%<&o>' } - define titleString '' - define titleLines '' - define title '%color%' - define titleLong 'li@' - foreach { - define titleLong "" } - define lore '|%hr%|<&f>|%msg0%|<&f>|%msg1%|%msg2%|%msg3%|%msg4%|%msg5%|<&sp>' - adjust '%item%' 'display_name:%title%' save:ficon - adjust '' 'lore:%lore%' save:uicon - nbt '' 'page:%page%' save:cicon - nbt '' 'dPlayer:%player%' save:kicon - inventory add 'd:in@%GUI%' 'o:' 'slot:%slot%' } - if %pages% > 1 { - if %page% != 1 { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminPreviousPage[nbt=page/%page%;nbt=dPlayer/%player%]' 'slot:33' } - if %page% < %pages% { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminNextPage[nbt=page/%page%;nbt=dPlayer/%player%]' 'slot:34' } } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminQuestMenu[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:35' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:36' - inventory open 'd:in@%GUI%' display_AdminObjectives: - define GUI 'QuestGUI_AdminObjectives_' - note 'in@generic[title=<&1>QuestGUI Admin Objectives;size=36]' 'as:%GUI%' - define hr '<&5>--------------------' - define questID '%2%' - define player '%3%' - define iconScript '' - define progressFlag '' - define progress '' - define objectives '' - define msg0 '<&e> <&n>Click Actions' - define page '' - define pages '' - if %page% > %pages% { - define page '%pages%' } - define highNumber '' - define lowNumber '' - foreach { - define slot '%loop_index%' - define obj '%value%' - define isLocked '' - define icon '' - define msg1 '<&3>Set Objective<&f><&co> <&7>Left' - if %progress% == Complete { - define color '<&a>' } else if %isLocked% && %progress% < %obj% { - define color '<&7>' } else { - define color '<&a>' } - define nameString '' - define nameLines '' - define name '%color%' - define nameLong 'li@' - foreach { - define nameLong "" } - define oProgressFlags '' - if ! { - define pLore 'li@' - foreach %oProgressFlags% { - define pNameString '' - define pStatusString ']||Pending>' - define pNameLines '' - define pName 'li@' - foreach %pNameLines% { - define pName "%value%]>" } - define pStatusLines '' - define pStatus 'li@' - foreach %pStatusLines% { - define pStatus "<&sp.pad_left[2]>%value%]>" } - define pLore '||<&f>]>' } - define msg2 '<&a>Edit Stats<&f><&co> <&7>Right' - define lore '|%hr%|<&f>|%msg0%|<&f>|%msg1%|%msg2%|%hr%|<&f>|<&9><&n.pad_left[13]>Stats|<&f>||<&sp>' } else { - define lore '|%hr%|<&f>|%msg0%|<&f>|%msg1%|<&sp>' } - inventory add 'd:in@%GUI%' 'o:%icon%[display_name=%name%;lore=%lore%;nbt=dPlayer/%player%;nbt=questID/%questID%;nbt=page/%page%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:%slot%' } - if %pages% > 1 { - if %page% != 1 { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminPreviousPage[lore=<&sp>;nbt=dPlayer/%player%;nbt=page/%page%]' 'slot:32' } - if %page% < %pages% { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminNextPage[lore=<&sp>;nbt=dPlayer/%player%;nbt=page/%page%]' 'slot:33' } } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminOverview[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:34' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminQuestMenu[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:35' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:36' - inventory open 'd:in@%GUI%' display_AdminSetStats: - define GUI 'QuestGUI_AdminSetStats_' - note 'in@generic[title=<&1>QuestGUI Admin Stats;size=36]' 'as:%GUI%' - define hr '<&5>--------------------' - define questID '%2%' - define player '%3%' - define objective '%4%' - define iconScript '' - define stats '' - define msg0 '<&e> <&n>Click Actions' - define msg1 '<&3>Edit Stat<&f><&co> <&7>Left' - define msg2 '<&c>Clear Stat<&f><&co> <&7>Right<&7>' - define page '' - define pages '' - if %page% > %pages% { - define page '%pages%' } - define highNumber '' - define lowNumber '' - foreach { - define slot '%loop_index%' - define statNameString '' - define statFlag '' - define statValueString '' - define statNameStringLines '' - define statName '<&3>' - define statNameLong 'li@' - foreach { - define statNameLong "%value%]>" } - define statValueStringLines '' - define statValueLong 'li@' - foreach %statValueStringLines% { - define statValueLong "%value%]>" } - define lore '|<&f>||%hr%|%msg0%|<&f>|%msg1%|%msg2%|<&sp>' - inventory add 'd:in@%GUI%' 'o:i@paper[display_name=%statName%;lore=%lore%;nbt=dPlayer/%player%;nbt=page/%page%;nbt=questID/%questID%;nbt=objective/%objective%;nbt=statFlag/%statFlag%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:%slot%' } - if %pages% > 1 { - if %page% != 1 { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminPreviousPage[lore=<&sp>;nbt=dPlayer/%player%;nbt=page/%page%;nbt=questID/%questID%]' 'slot:32' } - if %page% < %pages% { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminNextPage[lore=<&sp>;nbt=dPlayer/%player%;nbt=page/%page%;nbt=questID/%questID%]' 'slot:33' } } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminObjectives[lore=<&sp>;nbt=dPlayer/%player%;nbt=questID/%questID%]' 'slot:34' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminQuestMenu[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:35' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:36' - inventory open 'd:in@%GUI%' display_AdminTrophies: - define GUI 'QuestGUI_AdminTrophies_' - note 'in@generic[title=<&1>QuestGUI Admin Trophies;size=36]' 'as:%GUI%' - define hr '<&5>--------------------' - define player '%2%' - define trophies '' - define msg0 '<&e> <&n>Click Actions' - define page '' - define pages '' - if %page% > %pages% { - define page '%pages%' } - define highNumber '' - define lowNumber '' - foreach { - define slot '%loop_index%' - define trophy '' - define trophyName '%value%' - define trophyScript '' - define hasTrophy '' - define color '||<&7>>' - define action '' - define msg1 '<&3>%action% Trophy<&f><&co> <&7>Left' - define nameString '' - define nameLines '' - define name '%color%' - define nameLong 'li@' - foreach { - define nameLong "" } - define quest '' - define questString '' - define questLines '' - define quest 'li@' - foreach %questLines% { - define quest "<&sp.pad_left[2]>%value%]>" } - define lore '|%hr%|<&f>|<&b>Quest<&co>||<&f>|%hr%|<&f>|%msg0%|<&f>|%msg1%|<&sp>' - inventory add 'd:in@%GUI%' 'o:%trophy%[display_name=%name%;lore=%lore%;nbt=dPlayer/%player%;nbt=page/%page%;nbt=trophy/%trophyName%;nbt=action/%action%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:%slot%' } - if %pages% > 1 { - if %page% != 1 { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminPreviousPage[lore=<&sp>;nbt=dPlayer/%player%;nbt=page/%page%]' 'slot:33' } - if %page% < %pages% { - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminNextPage[lore=<&sp>;nbt=dPlayer/%player%;nbt=page/%page%]' 'slot:34' } } - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminQuestMenu[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:35' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:36' - inventory open 'd:in@%GUI%' display_AdminResetAll: - define GUI 'QuestGUI_AdminResetAll_' - note 'in@generic[title=<&1>QuestGUI Admin Reset All;size=18]' 'as:%GUI%' - define hr '<&5>--------------------' - define player '%1%' - define trophies '' - define msg0 '<&c> <&n>WARNING' - define msg1 '<&c>This can not be undone!' - define msg2 '<&f>Click to proceed' - define lore '%hr%|<&f>|%msg0%|<&f>|%msg1%|<&f>|<&f>|%msg2%|<&sp>' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminConfirmResetAll[lore=%lore%;nbt=dPlayer/%player%]' 'slot:5' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_AdminQuestMenu[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:17' - inventory add 'd:in@%GUI%' 'o:i@QuestGUI_Button_Close[lore=<&sp>;nbt=dPlayer/%player%]' 'slot:18' - inventory open 'd:in@%GUI%' # # END QuestGUI Display Generators #-------------------------------------- # # Inventory Click Handlers: Users # inventoryClick_MainMenu: - if > 36 { - queue clear } - if == button { - define GUI 'QuestGUI_MainMenu_' - inject } inventoryClick_Overview: - if > 36 { - queue clear } - if == icon { - if == LOCKED { - queue clear } - run locally instantly display_Objectives 'def:' - queue clear } - if == button { - define GUI 'QuestGUI_Overview_' - define menuType 'Overview' - inject } inventoryClick_Objectives: - if > 36 { - queue clear } - if == button { - define GUI 'QuestGUI_Objectives_' - define menuType 'Objectives' - inject } inventoryClick_Trophies: - if > 36 { - queue clear } - if == button { - define GUI 'QuestGUI_Objectives_' - define menuType 'Objectives' - inject } inventoryClick_Complete: - if > 36 { - queue clear } - if == icon { - if == LOCKED { - queue clear } - run locally instantly display_Objectives 'def:|Complete' - queue clear } - if == button { - define GUI 'QuestGUI_Complete_' - define menuType 'Complete' - inject } # #-------------------------------------- # # Inventory Click Handlers: Admins # inventoryClick_AdminMainMenu: - if > 18 { - queue clear } - if == button { - define GUI 'QuestGUI_AdminMainMenu_' - define player '' - inject } inventoryClick_AdminOverview: - if > 36 { - queue clear } - define player '' - narrate "overview " - define page '' - if == button { - define GUI 'QuestGUI_AdminOverview_' - define menuType 'AdminOverview' - inject } - if == icon { - define questID '' - define iconScript '' - if == LEFT { - inventory close - note remove 'as:QuestGUI_AdminOverview_' - run locally instantly display_AdminObjectives 'def:1|%questID%|%player%' - queue clear } - if == RIGHT { - define unlockFlag '' - define isLockable '' - if !%isLockable% { - queue clear } - define isLocked ']||false>' - if %isLocked% { - flag %player% %unlockFlag% } else { - flag %player% %unlockFlag%:! } - inventory close - note remove 'as:QuestGUI_AdminOverview_' - run instantly s@QuestGUI_World p:display_AdminOverview 'def:%page%|%player%' delay:1t - queue clear } - if == MIDDLE { - inject %iconScript% p:reset - inventory close - note remove 'as:QuestGUI_AdminOverview_' - run instantly s@QuestGUI_World p:display_AdminOverview 'def:%page%|%player%' delay:1t - queue clear } - if == SHIFT_LEFT { - inject %iconScript% p:complete - inventory close - note remove 'as:QuestGUI_AdminOverview_' - run instantly s@QuestGUI_World p:display_AdminOverview 'def:%page%|%player%' delay:1t - queue clear } - if == SHIFT_RIGHT { - if contains '<&b>Activate<&f><&co> <&f><&o>Shift<&f> Right' { - define action 'activate' } else { - define action 'deactivate' } - inject %iconScript% p:%action% - inventory close - note remove 'as:QuestGUI_AdminOverview_' - run instantly s@QuestGUI_World p:display_AdminOverview 'def:%page%|%player%' delay:1t - queue clear } - queue clear } inventoryClick_AdminObjectives: - if > 36 { - queue clear } - define GUI 'QuestGUI_AdminObjectives_' - define player '' - define page '' - if == button { - define menuType 'AdminObjectives' - inject - queue clear } - if { - define questID '' - define iconScript '' - if == LEFT { - define progressFlag '' - define progress '' - flag %player% '%progressFlag%:' - inventory close - note remove 'as:%GUI%' - run locally instantly display_AdminObjectives 'def:%page%|%questID%|%player%' - queue clear } - if == RIGHT { - if !contains '<&a>Edit Stats<&f><&co> <&7>Right' { - queue clear } - define objective '' - define progressFlag '' - define progress '' - flag %player% '%progressFlag%:%objective%' - inventory close - note remove 'as:%GUI%' - run locally instantly display_AdminSetStats 'def:1|%questID%|%player%|%objective%' - queue clear } - queue clear } inventoryClick_AdminSetStats: - if > 36 { - queue clear } - define GUI 'QuestGUI_AdminSetStats_' - define player '' - define page '' - if == button { - define questID '' - define menuType 'AdminSetStats' - inject - queue clear } - if { - define questID '' - define statFlag '' - define objective '' - define iconScript '' - inventory close - note remove 'as:%GUI%' - if == LEFT { - narrate "<&3><&lb><&b>QuestGUI<&3><&rb> <&f>Type the new value for %statFlag%" - flag 'questGUI_SettingStats:|:%page%|%questID%|%player%|%objective%|%statFlag%|' - wait 10s - flag questGUI_SettingStats:! - narrate "<&3><&lb><&b>QuestGUI<&3><&rb> <&c>You took too long setting a value!" - run locally instantly display_AdminSetStats 'def:%page%|%questID%|%player%|%objective%' } - if == RIGHT { - define progress '' - flag %player% '%statFlag%:!' - run locally instantly display_AdminSetStats 'def:%page%|%questID%|%player%|%objective%' } - queue clear } inventoryClick_AdminTrophies: - if > 36 { - queue clear } - define GUI 'QuestGUI_AdminTrophies_' - define player '' - define page '' - if == button { - define menuType 'AdminTrophies' - inject - queue clear } - define trophy '' - define action '' - if { - if == LEFT { - if %action% == Take { - flag %player% 'QuestTrophies:<-:%trophy%' } else { - flag %player% 'QuestTrophies:->:%trophy%' } - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_AdminTrophies 'def:%page%|%player%' delay:1t } } inventoryClick_AdminResetAll: - if > 18 { - queue clear } - define GUI 'QuestGUI_AdminResetAll_' - define player '' - define page '' - if == button { - define menuType 'AdminTrophies' - inject - queue clear } # # END Inventory Click Handlers #-------------------------------------- # # QuestGUI Buttons and Items: Users # QuestGUI_Journal: type: item material: i@book_and_quill debug: false display name: Quest Journal lore: - "<&b>Hold in your hand and" - "<&b>Right Click to open" QuestGUI_Button_QuestJournal: type: item material: i@book_and_quill debug: false display name: <&f>Quest Journal lore: - '<&5>----------------' - '<&f>' - '<&7>Check objectives' - '<&7>for active quests' script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_Overview 'def:1' delay:1t QuestGUI_Button_QuestTrophies: type: item material: i@chest debug: false display name: <&f>Quest Trophies lore: - '<&5>----------------' - '<&f>' - '<&7>See all of your' - '<&7>shiny Trophies' script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_Trophies 'def:1' delay:1t QuestGUI_Button_QuestsCompleted: type: item material: i@bookshelf debug: false display name: <&f>Completed lore: - '<&5>----------------' - '<&f>' - '<&7>Check stats for' - '<&7>completed quests' script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_Complete 'def:1' delay:1t QuestGUI_Button_QuestMenu: type: item material: i@book debug: false display name: <&f>Quest Menu script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_MainMenu 'def:1' delay:1t QuestGUI_Button_ServerMenu: type: item material: i@bed debug: false display name: <&f>Server Menu script: - inventory close - note remove 'as:%GUI%' - execute as_player '' QuestGUI_Button_Close: type: item material: i@barrier debug: false display name: <&f>Close QuestGUI script: - inventory close - note remove 'as:%GUI%' QuestGUI_Button_NextPage: type: item material: i@golden_carrot debug: false display name: <&f>Next Page script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_%menuType% 'def:' delay:1t QuestGUI_Button_PreviousPage: type: item material: i@carrot debug: false display name: <&f>Previous Page script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_%menuType% 'def:' delay:1t # # END QuestGUI Buttons and Items: Users #-------------------------------------- # # QuestGUI Buttons and Items: Admins # QuestGUI_Button_AdminQuestMenu: type: item material: i@book debug: false display name: <&f>Quest Menu script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_AdminMainMenu 'def:%player%' delay:1t QuestGUI_Button_AdminOverview: type: item material: i@book_and_quill debug: false display name: <&f>Quest Journal lore: - '<&5>----------------' - '<&f>' - '<&7>Show all Quest' - '<&7>details' script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_AdminOverview 'def:1|%player%' delay:1t QuestGUI_Button_AdminTrophies: type: item material: i@ender_chest debug: false display name: <&f>Quest Trophies lore: - '<&5>----------------' - '<&f>' - '<&7>Show all Quest' - '<&7>Trophies' script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_AdminTrophies 'def:1|%player%' delay:1t QuestGUI_Button_AdminObjectives: type: item material: i@paper debug: false display name: <&f>Quest Obejectives lore: - '<&5>----------------' - '<&f>' - '<&7>Back to Quest' - '<&7>Objectives' script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_AdminObjectives 'def:%page%|%questID%|%player%' delay:1t QuestGUI_Button_AdminResetAll: type: item material: i@tnt debug: false display name: <&f>Reset Quests lore: - '<&5>----------------' - '<&f>' - '<&7>Rest all quests' - '<&7>for this player' script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_AdminResetAll 'def:%player%' delay:1t QuestGUI_Button_AdminConfirmResetAll: type: item material: i@tnt debug: false display name: <&6>Confirm Reset script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:resetAllQuests 'def:%player%' delay:1t - run instantly s@QuestGUI_World p:display_AdminMainMenu 'def:%player%' delay:1t QuestGUI_Button_AdminNextPage: type: item material: i@golden_carrot debug: false display name: <&f>Next Page script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_%menuType% 'def:|%player%' delay:1t QuestGUI_Button_AdminPreviousPage: type: item material: i@carrot_item debug: false display name: <&f>Previous Page script: - inventory close - note remove 'as:%GUI%' - run instantly s@QuestGUI_World p:display_%menuType% 'def:|%player%' delay:1t # # END QuestGUI Buttons and Items: Admins #-------------------------------------- # # QuestGUI Author Banner Items # # Banner items representing the authors # QuestGUI_Author_Anthony: type: item debug: false material: i@human_skull display name: "<&f> <&pipe>Anthony<&pipe>" text_name: '|Anthony|' url: 'http://mineconomy.org' lore: - <&7> Owner<&co> <&e>M<&6>ine<&e>C<&6>onomy <&e>N<&6>etwork - <&5>------------------------- - <&7> - <&7> I<&sq>ve been playing minecraft - <&7> and running a server since - <&7> 2010. I have fun and share - <&7> what I do. - <&7> - <&9> Click To Visit # # END QuestGUI Author Banner Items #-------------------------------------- # # QuestGUI Example Quest Entry # # Quests need to have a yaml data container to register with QuestGUI # MyQuestGUIQuest_1_Icon: type: yaml data debug: false # Unused in the gui display name: Quest Journal # The material used as the gui icon for this quest material: i@iron_chestplate # A flag required to mark the quest as Available or LOCKED quest_unlocked_flag: MyQuestGUIQuest_1_Unlocked # Set to true to not display this quest if the player does not have the specified unlock flag. # Set to false to show the quest as LOCKED if the player does not have the specified unlock flag. hide_ifLocked: true # A flag for repeatable quests. Flag must store the number of times the quest has been completed. # Once completed, repeatable quests will only show up in the quest journal if they are in the Active_Quests player flag. # but will always display in the completed gui after the first completion. # There's potential for stale data to display in the Objectives view, so we might need to address that in the future. times_completed_flag: MyQuestGUIQuest_1_Completed # What to display the quest title as quest_title: An example quest # What to display for the description of this quest quest_desc: Learn how to integrate your existing quests with QuestGUI. # A flag to store the number value for the players current objective quest_progress_flag: MyQuestGUIQuest_1_Stage # Define your quest objectives here. Must use a numbered node structure. # Number corresponds to quest_progress_flag objectives: 1: # The text to display as the name of this objective name: Accept the Quest # A long description of this objective description: Read the description and accept the quest. # Set to true to remove this objective from the list until the player is at this objective # Set to false to allow this objective to be displayed before they reach this objective hide: false # Set to true to show this objective as LOCKED hiding all info about it until the player reaches this objective # Set to false to show all info about this objective even if the player hasn't reached it yet lockDisplay: true # Set the icon to display for this objective icon: i@paper # A list of flags that hold stats for this objective. # Value must be set as a split list in the format statname/flagname # statname is the phrase displayed as the title of this stat # flagname is the flag that holds the value to display progress_flags: - 'Stone Collected/MyQuestGUIQuest_1_stones' 2: name: A second Objective description: Do that thing hide: false lockDisplay: true icon: i@iron_sword progress_flags: [] 3: name: Complete description: You did it! hide: true lockDisplay: true icon: i@paper progress_flags: [] reset: # Script run when an admin resets this quest for a player - flag %player% MyQuestGUIQuest_1_stones:! - flag %player% QuestTrophies:<-:QuestTrophies_MyQuestGUIQuest_1_Flowers - flag %player% QuestsCompleted:<-:MyQuestGUIQuest_1 complete: # Script run when an admin completes this quest for a player - flag %player% QuestTrophies:->:QuestTrophies_MyQuestGUIQuest_1_Flowers - if !contains MyQuestGUIQuest_1 { - flag %player% QuestsCompleted:->:MyQuestGUIQuest_1 } - flag %player% MyQuestGUIQuest_1_Completed:++ - flag %player% Active_Quests:<-:MyQuestGUIQuest_1 activate: # Script run when an admin activates this quest for a player - run player:%player% MyQuestGUIQuest_1_Dialogue_2 deactivate: # Script run when an admin deactivates this quest for a player - narrate "stub" # # END Example Quest Entry #-------------------------------------- # # Quest Trophies # - Item script containers for all obtainable quest trophies # - Should live in the script file for their respective quests # QuestTrophies_MyQuestGUIQuest_1_Flowers: type: item material: i@book debug: false display name: Pretty Flowers description: Just a sign of my appreciation quest: MyQuestGUIQuest_1 # # END Quest Trophies #-------------------------------------- # ################################################################################