diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/com/leonardobishop/quests/Quests.java | 181 | ||||
| -rw-r--r-- | src/main/java/com/leonardobishop/quests/QuestsConfigLoader.java | 206 | ||||
| -rw-r--r-- | src/main/java/com/leonardobishop/quests/blocktype/SimilarBlocks.java | 2 | ||||
| -rw-r--r-- | src/main/java/com/leonardobishop/quests/commands/CommandQuests.java | 11 | ||||
| -rw-r--r-- | src/main/java/com/leonardobishop/quests/obj/Items.java | 2 | ||||
| -rw-r--r-- | src/main/resources/config.yml | 1070 | ||||
| -rw-r--r-- | src/main/resources/quests/README.txt | 30 | ||||
| -rw-r--r-- | src/main/resources/quests/example1.yml | 55 | ||||
| -rw-r--r-- | src/main/resources/quests/example2.yml | 42 | ||||
| -rw-r--r-- | src/main/resources/quests/example3.yml | 45 | ||||
| -rw-r--r-- | src/main/resources/quests/example4.yml | 39 | ||||
| -rw-r--r-- | src/main/resources/quests/example5.yml | 34 | ||||
| -rw-r--r-- | src/main/resources/quests/example6.yml | 30 |
13 files changed, 545 insertions, 1202 deletions
diff --git a/src/main/java/com/leonardobishop/quests/Quests.java b/src/main/java/com/leonardobishop/quests/Quests.java index 6c198ade..fac08e53 100644 --- a/src/main/java/com/leonardobishop/quests/Quests.java +++ b/src/main/java/com/leonardobishop/quests/Quests.java @@ -28,6 +28,7 @@ import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; +import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -52,6 +53,7 @@ public class Quests extends JavaPlugin { private static Updater updater; private static Title title; private boolean brokenConfig = false; + private QuestsConfigLoader questsConfigLoader; public static Quests getInstance() { return instance; @@ -73,6 +75,10 @@ public class Quests extends JavaPlugin { return brokenConfig; } + public void setBrokenConfig(boolean brokenConfig) { + this.brokenConfig = brokenConfig; + } + public static Title getTitle() { return title; } @@ -81,6 +87,10 @@ public class Quests extends JavaPlugin { return updater; } + public QuestsConfigLoader getQuestsConfigLoader() { + return questsConfigLoader; + } + public static String convertToFormat(long m) { long hours = m / 60; long minutesLeft = m - hours * 60; @@ -135,7 +145,7 @@ public class Quests extends JavaPlugin { Metrics metrics = new Metrics(this); this.getLogger().log(Level.INFO, "Metrics started. This can be disabled at /plugins/bStats/config.yml."); - SimilarBlocks.addBlocks(); + questsConfigLoader = new QuestsConfigLoader(Quests.this); new BukkitRunnable() { @Override @@ -174,6 +184,12 @@ public class Quests extends JavaPlugin { } reloadQuests(); + if (!questsConfigLoader.getBrokenFiles().isEmpty()) { + Quests.this.getLogger().warning("Quests has failed to load the following files:"); + for (Map.Entry<String, QuestsConfigLoader.ConfigLoadError> entry : questsConfigLoader.getBrokenFiles().entrySet()) { + Quests.this.getLogger().warning(" - " + entry.getKey() + ": " + entry.getValue().getMessage()); + } + } for (Player player : Bukkit.getOnlinePlayers()) { qPlayerManager.loadPlayer(player.getUniqueId()); @@ -243,136 +259,13 @@ public class Quests extends JavaPlugin { questManager.getCategories().clear(); taskTypeManager.resetTaskTypes(); - // test file integrity - try { - YamlConfiguration config = new YamlConfiguration(); - config.load(new File(String.valueOf(Quests.this.getDataFolder() + File.separator + "config.yml"))); - } catch (Exception ex) { - Quests.this.getLogger().log(Level.SEVERE, "You have a YAML error in your Quests config. If this is your first time using Quests, please remove the Quests folder and RESTART (not reload!) the server and try again."); - brokenConfig = true; - } - - for (String id : getConfig().getConfigurationSection("categories").getKeys(false)) { - ItemStack displayItem = getItemStack("categories." + id + ".display"); - boolean permissionRequired = getConfig().getBoolean("categories." + id + ".permission-required", false); - - Category category = new Category(id, displayItem, permissionRequired); - questManager.registerCategory(category); - } - - for (String id : getConfig().getConfigurationSection("quests").getKeys(false)) { - String root = "quests." + id; - - QItemStack displayItem = getQItemStack(root + ".display"); - List<String> rewards = getConfig().getStringList(root + ".rewards"); - List<String> requirements = getConfig().getStringList(root + ".options.requires"); - List<String> rewardString = getConfig().getStringList(root + ".rewardstring"); - boolean repeatable = getConfig().getBoolean(root + ".options.repeatable", false); - boolean cooldown = getConfig().getBoolean(root + ".options.cooldown.enabled", false); - boolean permissionRequired = getConfig().getBoolean(root + ".options.permission-required", false); - int cooldownTime = getConfig().getInt(root + ".options.cooldown.time", 10); - String category = getConfig().getString(root + ".options.category"); - - if (rewardString == null) { - rewardString = new ArrayList<>(); - } - if (requirements == null) { - requirements = new ArrayList<>(); - } - if (rewards == null) { - rewards = new ArrayList<>(); - } - if (category == null) { - category = ""; - } - - - Quest quest; - if (category.equals("")) { - quest = new Quest(id, displayItem, rewards, requirements, repeatable, cooldown, cooldownTime, permissionRequired, rewardString); - } else { - quest = new Quest(id, displayItem, rewards, requirements, repeatable, cooldown, cooldownTime, permissionRequired, rewardString, category); - Category c = questManager.getCategoryById(category); - if (c != null) { - c.registerQuestId(id); - } - } - - for (String taskId : getConfig().getConfigurationSection(root + ".tasks").getKeys(false)) { - String taskRoot = root + ".tasks." + taskId; - String taskType = getConfig().getString(taskRoot + ".type"); - - Task task = new Task(taskId, taskType); - - for (String key : getConfig().getConfigurationSection(taskRoot).getKeys(false)) { - task.addConfigValue(key, getConfig().get(taskRoot + "." + key)); - } - - quest.registerTask(task); - } - - if (getConfig().getBoolean("options.show-quest-registrations")) { - this.getLogger().log(Level.INFO, "Registering quest " + quest.getId() + " with " + quest.getTasks().size() + " tasks."); - } - questManager.registerQuest(quest); - taskTypeManager.registerQuestTasksWithTaskTypes(quest); - } - } - - private QItemStack getQItemStack(String path) { - String cName = this.getConfig().getString(path + ".name", path + ".name"); - String cType = this.getConfig().getString(path + ".type", path + ".type"); - List<String> cLoreNormal = this.getConfig().getStringList(path + ".lore-normal"); - List<String> cLoreStarted = this.getConfig().getStringList(path + ".lore-started"); - - String name; - Material type = null; - int data = 0; - List<String> loreNormal = new ArrayList<>(); - if (cLoreNormal != null) { - for (String s : cLoreNormal) { - loreNormal.add(ChatColor.translateAlternateColorCodes('&', s)); - } - } - List<String> loreStarted = new ArrayList<>(); - if (cLoreStarted != null) { - for (String s : cLoreStarted) { - loreStarted.add(ChatColor.translateAlternateColorCodes('&', s)); - } - } - name = ChatColor.translateAlternateColorCodes('&', cName); - - if (StringUtils.isNumeric(cType)) { - type = Material.getMaterial(Integer.parseInt(cType)); - } else if (Material.getMaterial(cType) != null) { - type = Material.getMaterial(cType); - } else if (cType.contains(":")) { - String[] parts = cType.split(":"); - if (parts.length > 1) { - if (StringUtils.isNumeric(parts[0])) { - type = Material.getMaterial(Integer.parseInt(parts[0])); - } else if (Material.getMaterial(parts[0]) != null) { - type = Material.getMaterial(parts[0]); - } - if (StringUtils.isNumeric(parts[1])) { - data = Integer.parseInt(parts[1]); - } - } - } - - if (type == null) { - type = Material.STONE; - } - - QItemStack is = new QItemStack(name, loreNormal, loreStarted, type, data); - - return is; + questsConfigLoader.loadConfig(); } - public ItemStack getItemStack(String path) { - String cName = this.getConfig().getString(path + ".name", path + ".name"); - String cType = this.getConfig().getString(path + ".type", path + ".type"); - List<String> cLore = this.getConfig().getStringList(path + ".lore"); + public ItemStack getItemStack(String path, FileConfiguration config) { + String cName = config.getString(path + ".name", path + ".name"); + String cType = config.getString(path + ".type", path + ".type"); + List<String> cLore = config.getStringList(path + ".lore"); String name; Material type = null; @@ -489,7 +382,35 @@ public class Quests extends JavaPlugin { } } catch (IOException e) { e.printStackTrace(); - return; + } + } + + File questsDirectory = new File(String.valueOf(this.getDataFolder() + File.separator + "quests")); + if (!questsDirectory.exists() && !questsDirectory.isDirectory()) { + questsDirectory.mkdir(); + + ArrayList<String> examples = new ArrayList<>(); + examples.add("example1.yml"); + examples.add("example2.yml"); + examples.add("example3.yml"); + examples.add("example4.yml"); + examples.add("example5.yml"); + examples.add("example6.yml"); + examples.add("README.txt"); + + for (String name : examples) { + File file = new File(this.getDataFolder() + File.separator + "quests" + File.separator + name); + try { + file.createNewFile(); + try (InputStream in = Quests.class.getClassLoader().getResourceAsStream("quests/" + name)) { + OutputStream out = new FileOutputStream(file); + ByteStreams.copy(in, out); + } catch (IOException e) { + e.printStackTrace(); + } + } catch (IOException e) { + e.printStackTrace(); + } } } } diff --git a/src/main/java/com/leonardobishop/quests/QuestsConfigLoader.java b/src/main/java/com/leonardobishop/quests/QuestsConfigLoader.java new file mode 100644 index 00000000..a8abb580 --- /dev/null +++ b/src/main/java/com/leonardobishop/quests/QuestsConfigLoader.java @@ -0,0 +1,206 @@ +package com.leonardobishop.quests; + +import com.leonardobishop.quests.obj.misc.QItemStack; +import com.leonardobishop.quests.quests.Category; +import com.leonardobishop.quests.quests.Quest; +import com.leonardobishop.quests.quests.Task; +import org.apache.commons.lang.StringUtils; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.inventory.ItemStack; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; + +public class QuestsConfigLoader { + + private Map<String, ConfigLoadError> brokenFiles = new HashMap<>(); + private Quests quests; + + public QuestsConfigLoader(Quests quests) { + this.quests = quests; + } + + /** + * Loads and parses config into memory including the quests folder. + */ + public void loadConfig() { + brokenFiles.clear(); + + // test CONFIG file integrity + try { + YamlConfiguration config = new YamlConfiguration(); + config.load(new File(String.valueOf(quests.getDataFolder() + File.separator + "config.yml"))); + } catch (Exception ex) { + brokenFiles.put("<MAIN CONFIG> config.yml", ConfigLoadError.MAIN_CONFIG_ERROR); + quests.setBrokenConfig(true); + return; + } + + for (String id : quests.getConfig().getConfigurationSection("categories").getKeys(false)) { + ItemStack displayItem = quests.getItemStack("categories." + id + ".display", quests.getConfig()); + boolean permissionRequired = quests.getConfig().getBoolean("categories." + id + ".permission-required", false); + + Category category = new Category(id, displayItem, permissionRequired); + Quests.getQuestManager().registerCategory(category); + } + + File questDirectory = new File(quests.getDataFolder() + File.separator + "quests"); + if (questDirectory.isDirectory()) { + File[] fileList = questDirectory.listFiles(); + for (File questFile : fileList) { + if (!questFile.getName().toLowerCase().endsWith(".yml")) continue; + + YamlConfiguration config = new YamlConfiguration(); + // test QUEST file integrity + try { + config.load(questFile); + } catch (Exception ex) { + brokenFiles.put(questFile.getName(), ConfigLoadError.MALFORMED_YAML); + continue; + } + + String id = questFile.getName().replace(".yml", ""); + + if (!StringUtils.isAlphanumeric(id)) { + brokenFiles.put(questFile.getName(), ConfigLoadError.INVALID_QUEST_ID); + continue; + } + + QItemStack displayItem = getQItemStack("display", config); + List<String> rewards = config.getStringList("rewards"); + List<String> requirements = config.getStringList("options.requires"); + List<String> rewardString = config.getStringList("rewardstring"); + boolean repeatable = config.getBoolean("options.repeatable", false); + boolean cooldown = config.getBoolean("options.cooldown.enabled", false); + boolean permissionRequired = config.getBoolean("options.permission-required", false); + int cooldownTime = config.getInt("options.cooldown.time", 10); + String category = config.getString("options.category"); + + if (rewardString == null) { + rewardString = new ArrayList<>(); + } + if (requirements == null) { + requirements = new ArrayList<>(); + } + if (rewards == null) { + rewards = new ArrayList<>(); + } + if (category == null) { + category = ""; + } + + + Quest quest; + if (category.equals("")) { + quest = new Quest(id, displayItem, rewards, requirements, repeatable, cooldown, cooldownTime, permissionRequired, rewardString); + } else { + quest = new Quest(id, displayItem, rewards, requirements, repeatable, cooldown, cooldownTime, permissionRequired, rewardString, category); + Category c = Quests.getQuestManager().getCategoryById(category); + if (c != null) { + c.registerQuestId(id); + } + } + + for (String taskId : config.getConfigurationSection("tasks").getKeys(false)) { + String taskRoot = "tasks." + taskId; + String taskType = config.getString(taskRoot + ".type"); + + Task task = new Task(taskId, taskType); + + for (String key : config.getConfigurationSection(taskRoot).getKeys(false)) { + task.addConfigValue(key, config.get(taskRoot + "." + key)); + } + + quest.registerTask(task); + } + + if (quests.getConfig().getBoolean("options.show-quest-registrations")) { + quests.getLogger().log(Level.INFO, "Registering quest " + quest.getId() + " with " + quest.getTasks().size() + " tasks."); + } + Quests.getQuestManager().registerQuest(quest); + Quests.getTaskTypeManager().registerQuestTasksWithTaskTypes(quest); + } + } + } + + /** + * Gets recent file errors during load. + * + * @return Errors during load, Map<String, ConfigLoadError> of file name and error + */ + public Map<String, ConfigLoadError> getBrokenFiles() { + return brokenFiles; + } + + private QItemStack getQItemStack(String path, FileConfiguration config) { + String cName = config.getString(path + ".name", path + ".name"); + String cType = config.getString(path + ".type", path + ".type"); + List<String> cLoreNormal = config.getStringList(path + ".lore-normal"); + List<String> cLoreStarted = config.getStringList(path + ".lore-started"); + + String name; + Material type = null; + int data = 0; + List<String> loreNormal = new ArrayList<>(); + if (cLoreNormal != null) { + for (String s : cLoreNormal) { + loreNormal.add(ChatColor.translateAlternateColorCodes('&', s)); + } + } + List<String> loreStarted = new ArrayList<>(); + if (cLoreStarted != null) { + for (String s : cLoreStarted) { + loreStarted.add(ChatColor.translateAlternateColorCodes('&', s)); + } + } + name = ChatColor.translateAlternateColorCodes('&', cName); + + if (StringUtils.isNumeric(cType)) { + type = Material.getMaterial(Integer.parseInt(cType)); + } else if (Material.getMaterial(cType) != null) { + type = Material.getMaterial(cType); + } else if (cType.contains(":")) { + String[] parts = cType.split(":"); + if (parts.length > 1) { + if (StringUtils.isNumeric(parts[0])) { + type = Material.getMaterial(Integer.parseInt(parts[0])); + } else if (Material.getMaterial(parts[0]) != null) { + type = Material.getMaterial(parts[0]); + } + if (StringUtils.isNumeric(parts[1])) { + data = Integer.parseInt(parts[1]); + } + } + } + + if (type == null) { + type = Material.STONE; + } + + return new QItemStack(name, loreNormal, loreStarted, type, data); + } + + public enum ConfigLoadError { + + MAIN_CONFIG_ERROR("You have a YAML error in your Quests config. If this is your first time using Quests, please remove the Quests folder and RESTART (not reload!) the server and try again."), + MALFORMED_YAML("Malformed YAML"), + INVALID_QUEST_ID("Invalid quest ID (must be alphanumeric)"); + + private String message; + + ConfigLoadError(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + } +} diff --git a/src/main/java/com/leonardobishop/quests/blocktype/SimilarBlocks.java b/src/main/java/com/leonardobishop/quests/blocktype/SimilarBlocks.java index caa71333..4e6571d4 100644 --- a/src/main/java/com/leonardobishop/quests/blocktype/SimilarBlocks.java +++ b/src/main/java/com/leonardobishop/quests/blocktype/SimilarBlocks.java @@ -9,7 +9,7 @@ public class SimilarBlocks { private static HashMap<Block, Block> similarBlocks = new HashMap<>(); - public static void addBlocks() { + static { // Redstone Ore similarBlocks.put(new Block(Material.REDSTONE_ORE), new Block(Material.GLOWING_REDSTONE_ORE)); similarBlocks.put(new Block(Material.GLOWING_REDSTONE_ORE), new Block(Material.REDSTONE_ORE)); diff --git a/src/main/java/com/leonardobishop/quests/commands/CommandQuests.java b/src/main/java/com/leonardobishop/quests/commands/CommandQuests.java index deea2e94..fe6e5c92 100644 --- a/src/main/java/com/leonardobishop/quests/commands/CommandQuests.java +++ b/src/main/java/com/leonardobishop/quests/commands/CommandQuests.java @@ -1,6 +1,7 @@ package com.leonardobishop.quests.commands; import com.leonardobishop.quests.Quests; +import com.leonardobishop.quests.QuestsConfigLoader; import com.leonardobishop.quests.obj.Messages; import com.leonardobishop.quests.obj.Options; import com.leonardobishop.quests.player.QPlayer; @@ -17,6 +18,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; +import java.util.Map; import java.util.UUID; public class CommandQuests implements CommandExecutor { @@ -50,7 +52,14 @@ public class CommandQuests implements CommandExecutor { } else if (args[1].equalsIgnoreCase("reload")) { Quests.getInstance().reloadConfig(); Quests.getInstance().reloadQuests(); - sender.sendMessage(ChatColor.GRAY + "Quests was reloaded."); + if (!Quests.getInstance().getQuestsConfigLoader().getBrokenFiles().isEmpty()) { + sender.sendMessage(ChatColor.RED + "Quests has failed to load the following files:"); + for (Map.Entry<String, QuestsConfigLoader.ConfigLoadError> entry : Quests.getInstance().getQuestsConfigLoader().getBrokenFiles().entrySet()) { + sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + entry.getKey() + ": " + ChatColor.GRAY + entry.getValue().getMessage()); + } + } else { + sender.sendMessage(ChatColor.GRAY + "Quests was reloaded."); + } return true; } else if (args[1].equalsIgnoreCase("types")) { sender.sendMessage(ChatColor.GRAY + "Registered task types:"); diff --git a/src/main/java/com/leonardobishop/quests/obj/Items.java b/src/main/java/com/leonardobishop/quests/obj/Items.java index 9b660c5d..9b5f4430 100644 --- a/src/main/java/com/leonardobishop/quests/obj/Items.java +++ b/src/main/java/com/leonardobishop/quests/obj/Items.java @@ -23,7 +23,7 @@ public enum Items { } public ItemStack getItem() { - return Quests.getInstance().getItemStack(path); + return Quests.getInstance().getItemStack(path, Quests.getInstance().getConfig()); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index ab931615..b5a5273e 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -2,7 +2,7 @@ # | Thank you for downloading and trying out my plugin: | # | Quests | # | https://www.spigotmc.org/resources/23696/ | -# | Created by lmbishop | +# | https://github.com/LMBishop/Quests/ | # | | # | =x= | # | | @@ -17,1050 +17,6 @@ # | https://www.discord.gg/8amrJnX | # | =================================================== | -# !! READ ME !! -# -# A quest is a series of tasks which players must complete for a reward and may require a previous quest to start. -# A task is an objective such as breaking blocks or obtaining items. -# A reward is a command executed by the SERVER. Use {player} to get the players name. -# -# A quest can have a 'rewardstring' (this is optional). They will be sent to the player when they complete the quest. -# An example of the rewardstring in use can be seen in the quest example4. -# -# Each quest will have ONE "display" item, this is the item shown to the player in the GUI. -# The display item will have a "name", a "type" and TWO lores. -# The name is the name of the item, the type is the material and the lore is the text underneath the item (when mouse-over-ing). -# The first lore you must give is called 'lore-normal'. This is the lore seen if the player has not started the quest. -# The second lore you must give is 'lore-started'. This will be appended to the first lore IF the player has started the quest - useful for putting progression. -# Within the lores you can get the players" progress for each task. Use {TASKID:progress} (replace TASKID with the ID of the task). -# You can also get if a task is complete. Use {TASKID:complete} (replace TASKID with the ID of the task). -# -# Quests can be put inside a category. When a player does /quests they will first see a menu of categories. They can click one and another menu of quests -# under that category will show up. Categories can be disabled. -# -# !! READ ME !! - -# Everything inside of this section is a quest -quests: - # This is the quest ID ("example"). This MUST be unique against all other quest IDs. - example1: - # Everything inside of this section defines tasks the player must complete to progress. - tasks: - # This is the task ID ("mining"). This can share the same name as the quest ID but MUST be unique with all other task IDs in the same quest. - mining: - # This defines what type of task this is. In this instance, it is "blockbreak" (breaking blocks) - # NOTE: guides to set up each type of task is on the plugin page! - type: "blockbreak" - # This defines the amount of blocks which need to be broken - amount: 30 - # You can have multiple tasks for each quest (example further down). - # Everything inside of this section defines the display item. - display: - # This is the name of the item. This allows color codes. - name: "&cExample I (Single Task)" - # This is the lore of the item if the player has not started the quest. This allows color codes and task/player placeholders. - lore-normal: - - "&cThis category is designed to show you the different" - - "&cattributes a quest can have." - - "" - - "&7This quest requires you to:" - - "&7 - Break 30 blocks." - - "" - - "&7Rewards:" - - "&7 - 10 diamonds." - # This lore will be appended to the bottom of the above lore when the player starts their quest. - # To get the players progress through a task, use {TASKID:progress} and replace TASKID with the ID of the task. - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {mining:progress}/30 blocks broken." - # This is the material of the item. It is recommended to stick to bukkit names. - type: "WOOD_PICKAXE" - # List all commands to be executed by the server when the player completes the quest. Use {player} to get the players name. - rewards: - - "give {player} diamond 10" - # Everything inside this section define quest-specific options - options: - # This is the category for the quest, it will appear under the "examples" category. Categories can be disabled. - category: "examples" - # Set the quest IDs of required quests here, leave empty if none. - requires: - - "" - # Set if the quest can be repeated after being completed for the first time. - repeatable: false - # Define the cooldown on quests. The above (repeatable) must be true for this to take effect. - cooldown: - # If true, players will have to wait between repeating quests. - enabled: true - # Time (in minutes) - time: 1440 - - # This is a quest which requires the previous quest to be complete to start. - example2: - tasks: - # Unlike the previous quest, this quest has multiple tasks. - mining: - type: "blockbreak" - amount: 100 - building: - type: "blockplace" - amount: 100 - display: - name: "&cExample II (Multiple Tasks)" - lore-normal: - - "&cThis category is designed to show you the different" - - "&cattributes a quest can have. This quest requires" - - "&cmultiple things to be done, unlike the previous one." - - "" - - "&7This quest requires you to:" - - "&7 - Break 100 blocks." - - "&7 - Place 100 blocks." - - "" - - "&7Rewards:" - - "&7 - 15 diamonds." - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {mining:progress}/100 blocks broken." - - "&7 - {building:progress}/100 blocks placed." - type: "GRASS" - rewards: - - "give {player} diamond 15" - - "eco give {player} 50" - options: - category: "examples" - # Unlike the previous quest, this quest has "example1" as a required quest. You cannot start this quest without "example1" quest complete. - requires: - - "example1" - repeatable: false - cooldown: - enabled: true - time: 1440 - - # This is a quest which requires the previous quest to be complete to start. - # Unlike the previous quest, this one can be re-done but it has a 10 minute cooldown. - example3: - tasks: - # Unlike the previous two quests, this quest specifies a specific block to be broken. - mining: - type: "blockbreakcertain" - amount: 81 - block: 14 # (gold ore) - building: - type: "blockplacecertain" - amount: 9 - block: 41 # (gold blocks) - display: - name: "&cExample III (Repeatable, 10 minute cooldown)" - lore-normal: - - "&cThis category is designed to show you the different" - - "&cattributes a quest can have. This quest can be replayed" - - "&cafter a cooldown, unlike the previous one." - - "" - - "&7This quest requires you to:" - - "&7 - Break 81 gold ore." - - "&7 - Place 9 gold blocks." - - "" - - "&7Rewards:" - - "&7 - 30 diamonds." - - "&7 - $10 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {mining:progress}/81 gold ore broken." - - "&7 - {building:progress}/9 gold blocks placed." - type: "GOLD_ORE" - rewards: - - "give {player} diamond 30" - - "eco give {player} 10" - options: - category: "examples" - requires: - - "example2" - # This quest is repeatable, it has cooldowns enabled (meaning the player must wait before repeating it) and the time set to 10 (minutes). - repeatable: true - cooldown: - enabled: true - time: 10 - - # This is a quest which requires the previous quest to be complete to start. - # Unlike the previous quests, this quest has a reward string. - example4: - tasks: - mobkilling: - type: "mobkilling" - amount: 3 - display: - name: "&cExample IV (Reward String)" - lore-normal: - - "&cThis category is designed to show you the different" - - "&cattributes a quest can have. This quest has a 'reward string'" - - "&c(a series of messages sent when a quest is complete)," - - "&cunlike the previous one." - - "" - - "&7This quest requires you to:" - - "&7 - Kill 3 mobs." - - "" - - "&7Rewards:" - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {mobkilling:progress}/3 mobs killed." - type: "STRING" - rewards: - - "eco give {player} 50" - # Here you can list messages which will be sent to the player (if they are online) upon completion. - rewardstring: - - " &8* &c$10 &7was added to your in-game balance." - - " &8* &c30 diamonds &7was added to your inventory." - options: - category: "examples" - requires: - - "example3" - repeatable: true - cooldown: - enabled: true - time: 10 - - example5: - tasks: - building: - type: "blockplace" - amount: 10 - display: - name: "&cExample V (Permission)" - lore-normal: - - "&cThis category is designed to show you the different" - - "&cattributes a quest can have. This quest requires" - - "&ccertain permissions." - - "" - - "&7This quest requires you to:" - - "&7 - Place 10 blocks." - - "" - - "&7Rewards:" - - "&7 - $10 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {building:progress}/10 blocks placed." - type: "GRASS" - rewards: - - "eco give {player} 10" - options: - category: "examples" - requires: - - "example4" - # Unlike the previous quests, this one requires you to have the permission "quests.quest.example5" to start. - # The permission for other quests is: "quests.quest.<id>". - permission-required: true - repeatable: false - cooldown: - enabled: true - time: 1440 - - example6: - tasks: - building: - type: "blockplace" - amount: 10 - display: - name: "&cExample VI (Different category, permissions)" - lore-normal: - - "&cThis category is designed to show you the different" - - "&cattributes a quest can have. This quest requires" - - "&ccertain permissions." - - "" - - "&7This quest requires you to:" - - "&7 - Place 10 blocks." - - "" - - "&7Rewards:" - - "&7 - $10 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {building:progress}/10 blocks placed." - type: "GRASS" - rewards: - - "eco give {player} 10" - options: - category: "permissionexample" - # This quest has no specific permission, however its category does. The permission for the category is "quests.category.permissionexample" - repeatable: false - cooldown: - enabled: true - time: 1440 - - # This is the end of the config example quests. - # Hopefully you should be able to understand the quest config from this. - # -------------------------------------------------------------------------------------- - # Below are some basic quests. You should be able to understand what to do from reading these. - # These quests show off the other task types this plugin has to offer by default. - # Developers can add their own (look at the wiki on GitHub for details). - - mining1: - tasks: - mining: - type: "blockbreak" - amount: 100 - display: - name: "&cNovice Miner" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Break 100 blocks." - - "" - - "&7Rewards:" - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {mining:progress}/100 blocks broken." - type: "WOOD_PICKAXE" - rewards: - - "eco give {player} 50" - options: - category: "easy" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - building1: - tasks: - building: - type: "blockplace" - amount: 100 - display: - name: "&cNovice Builder" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Place 100 blocks." - - "" - - "&7Rewards:" - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {building:progress}/100 blocks placed." - type: "STONE" - rewards: - - "eco give {player} 50" - options: - category: "easy" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - youmonster: - tasks: - mobkilling: - type: "mobkilling" - amount: 10 - hostile: false - display: - name: "&cYou Monster" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Kill 10 non-hostile animals." - - "" - - "&7Rewards:" - - "&7 - $1 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {mobkilling:progress}/10 non-hostile animals." - type: "PORK" - rewards: - - "eco give {player} 1" - options: - category: "easy" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - mobkiller: - tasks: - mobkilling: - type: "mobkilling" - amount: 10 - hostile: true - display: - name: "&cMonster Slayer" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Kill 10 hostile monsters." - - "" - - "&7Rewards:" - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {mobkilling:progress}/10 hostile monsters killed." - type: "WOOD_SWORD" - rewards: - - "eco give {player} 50" - options: - category: "easy" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - walking1: - tasks: - walking: - type: "walking" - distance: 1000 - display: - name: "&cAdventurer" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Walk 1km." - - "" - - "&7Rewards:" - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {walking:progress}m/1000m walked." - type: "LEATHER_BOOTS" - rewards: - - "eco give {player} 50" - options: - category: "easy" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - inventory1: - tasks: - beef: - type: "inventory" - item: RAW_BEEF - amount: 8 - remove-items-when-complete: false - chicken: - type: "inventory" - item: RAW_CHICKEN - amount: 8 - remove-items-when-complete: false - pork: - type: "inventory" - item: PORK - amount: 8 - remove-items-when-complete: false - display: - name: "&cMeat Eater" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Collect 8 raw beef, pork & chicken." - - "" - - "&7Rewards:" - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - 8 raw beef collected: {beef:complete}." - - "&7 - 8 chicken collected: {chicken:complete}." - - "&7 - 8 pork collected: {pork:complete}." - type: "PORK" - rewards: - - "eco give {player} 50" - options: - category: "easy" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - playtime: - tasks: - playtime: - type: "playtime" - minutes: 10 - display: - name: "&cPlay Time" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Play for 10 minutes." - - "" - - "&7Rewards:" - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {playtime:progress} minutes/10 minutes." - type: "WATCH" - rewards: - - "eco give {player} 50" - options: - category: "easy" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - playerkiller: - tasks: - playerkilling: - type: "playerkilling" - amount: 10 - display: - name: "&cMurderer" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Kill 10 players." - - "" - - "&7Rewards:" - - "&7 - $10 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {playerkilling:progress}/10 players killed." - type: "IRON_SWORD" - rewards: - - "eco give {player} 50" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - fisher: - tasks: - fishing: - type: "fishing" - amount: 10 - display: - name: "&cProfessional Fisher" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Catch 10 items from the sea." - - "" - - "&7Rewards:" - - "&7 - $30 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {fishing:progress}/10 items caught." - type: "FISHING_ROD" - rewards: - - "eco give {player} 30" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - breeding1: - tasks: - breeding: - type: "breeding" - amount: 5 - display: - name: "&cBreeder" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Breed 5 animals" - - "" - - "&7Rewards:" - - "&7 - $30 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - Animals bred: {breeding:progress}" - type: "WHEAT" - rewards: - - "eco give {player} 30" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - expearn1: - tasks: - expearn: - type: "expearn" - amount: 10 - display: - name: "&cExperience Earner" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Gain 10 XP" - - "" - - "&7Rewards:" - - "&7 - $30 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - XP earned: {expearn:progress}" - type: "EXP_BOTTLE" - rewards: - - "eco give {player} 30" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - dealdamage1: - tasks: - dealdamage: - type: "dealdamage" - amount: 100 - display: - name: "&cPain Giver" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Deal 100 HP damage" - - "" - - "&7Rewards:" - - "&7 - $100 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - Damage dealt: {dealdamage:progress} HP" - type: "REDSTONE" - rewards: - - "eco give {player} 100" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - enchanting1: - tasks: - enchanting: - type: "enchanting" - amount: 5 - display: - name: "&cEnchanter" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Enchant 5 items" - - "" - - "&7Rewards:" - - "&7 - $100 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - Items enchanted: {enchanting:progress}" - type: "REDSTONE" - rewards: - - "eco give {player} 100" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - animals1: - tasks: - milking: - type: "milking" - amount: 10 - shearing: - type: "shearing" - amount: 10 - taming: - type: "taming" - amount: 3 - display: - name: "&cAnimal Keeper" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Milk 10 cows." - - "&7 - Shear 10 sheep." - - "&7 - Tame 3 animals as pets." - - "" - - "&7Rewards:" - - "&7 - $50 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {milking:progress}/10 cows milked." - - "&7 - {shearing:progress}/10 sheep sheared." - - "&7 - {taming:progress}/3 animals tamed." - type: "MILK_BUCKET" - rewards: - - "eco give {player} 50" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - position1: - tasks: - position: - type: "position" - x: 0 - y: 0 - z: 0 - world: "world" - display: - name: "&cOrigin Point" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Reach position: 0, 0, 0 in world world." - - "" - - "&7Rewards:" - - "&7 - $100 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - Position reached: {position:complete}." - type: "GOLD_BOOTS" - rewards: - - "eco give {player} 100" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - distancefrom1: - tasks: - distancefrom: - type: "distancefrom" - x: 0 - y: 0 - z: 0 - world: "world" - distance: 10000 - display: - name: "&cExplorer" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Walk 10km away from the coords 0,0." - - "" - - "&7Rewards:" - - "&7 - $500 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {distancefrom:progress}m/10000m walked." - type: "STICK" - rewards: - - "eco give {player} 100" - options: - category: "medium" - requires: - - "" - repeatable: true - cooldown: - enabled: true - time: 1440 - - mining2: - tasks: - mining: - type: "blockbreak" - amount: 350 - ironmining: - type: "blockbreakcertain" - block: IRON_ORE - amount: 20 - display: - name: "&cSkilled Miner" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Break 350 blocks." - - "&7 - Break 20 iron ore." - - "" - - "&7Rewards:" - - "&7 - $150 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {mining:progress}/350 blocks broken." - - "&7 - {ironmining:progress}/20 iron ore broken." - type: "IRON_PICKAXE" - rewards: - - "eco give {player} 150" - options: - category: "medium" - requires: - - "mining1" - repeatable: true - cooldown: - enabled: true - time: 1440 - - building2: - tasks: - building: - type: "blockplace" - amount: 350 - woodbuilding: - type: "blockplacecertain" - block: 5 - amount: 20 - bricksbuilding: - type: "blockplacecertain" - block: 45 - amount: 20 - redwoolbuilding: - type: "blockplacecertain" - block: 35 - amount: 20 - data: 14 - display: - name: "&cVariety Builder" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Place 350 blocks." - - "&7 - Place 20 oak wood." - - "&7 - Place 20 bricks." - - "&7 - Place 20 red wool." - - "" - - "&7Rewards:" - - "&7 - $150 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {building:progress}/350 blocks placed." - - "&7 - {woodbuilding:progress}/20 oak wood placed." - - "&7 - {bricksbuilding:progress}/20 bricks placed." - - "&7 - {redwoolbuilding:progress}/20 red wool placed." - type: "WOOL" - rewards: - - "eco give {player} 150" - options: - category: "medium" - requires: - - "building1" - repeatable: true - cooldown: - enabled: true - time: 1440 - - walking2: - tasks: - walking: - type: "walking" - distance: 10000 - display: - name: "&cMountaineer" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Walk 10km." - - "" - - "&7Rewards:" - - "&7 - $500 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {walking:progress}m/10000m walked." - type: "LEATHER_BOOTS" - rewards: - - "eco give {player} 500" - options: - category: "medium" - requires: - - "walking1" - repeatable: true - cooldown: - enabled: true - time: 1440 - - brewing: - tasks: - brewing: - type: "brewing" - amount: 10 - display: - name: "&cBrewer" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Brew 10 potions." - - "" - - "&7Rewards:" - - "&7 - $500 added to your in-game balance." - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {brewing:progress}/10 potions brewed." - type: "BREWING_STAND_ITEM" - rewards: - - "eco give {player} 500" - options: - category: "medium" - repeatable: true - cooldown: - enabled: true - time: 1440 - - askyblock: - tasks: - islandlevel: - type: "askyblock_level" - level: 50 - display: - name: "&cIslander (ASkyBlock)" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Reach island level 50" - - "" - - "&7Rewards:" - - "&7 - $30 added to your in-game balance." - - "" - - "&cRequires plugin ASkyBlock!" - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {islandlevel:progress}/50 island level." - type: "GRASS" - rewards: - - "eco give {player} 30" - options: - category: "dependent" - requires: - - "" - repeatable: false - cooldown: - enabled: true - time: 1440 - - uskyblock: - tasks: - islandlevel: - type: "uskyblock_level" - level: 50 - display: - name: "&cIslander (uSkyBlock)" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Reach island level 50" - - "" - - "&7Rewards:" - - "&7 - $30 added to your in-game balance." - - "" - - "&cRequires plugin uSkyBlock!" - lore-started: - - "" - - "&7Your current progression:" - - "&7 - {islandlevel:progress}/50 island level." - type: "GRASS" - rewards: - - "eco give {player} 30" - options: - category: "dependent" - requires: - - "" - repeatable: false - cooldown: - enabled: true - time: 1440 - - citizensdeliver: - tasks: - deliver: - type: "citizens_deliver" - item: IRON_BLOCK - amount: 1 - npc-name: "Gerald" - remove-items-when-complete: true - display: - name: "&cDeliverer (Citizens)" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Deliver 1 iron block to a NPC named Gerald" - - "" - - "&7Rewards:" - - "&7 - $30 added to your in-game balance." - - "" - - "&cRequires plugin Citizens!" - lore-started: - - "" - - "&7Your current progression:" - - "&7 - Iron block delivered: {deliver:complete}." - type: "MILK_BUCKET" - rewards: - - "eco give {player} 30" - options: - category: "dependent" - requires: - - "" - repeatable: false - cooldown: - enabled: true - time: 1440 - - citizensinteract: - tasks: - talker: - type: "citizens_interact" - npc-name: "Krystina" - display: - name: "&cTalker (Citizens)" - lore-normal: - - "&7This quest requires you to:" - - "&7 - Deliver 1 iron block to a NPC named Krystina" - - "" - - "&7Rewards:" - - "&7 - $30 added to your in-game balance." - - "" - - "&cRequires plugin Citizens!" - lore-started: - - "" - - "&7Your current progression:" - - "&7 - Citizen talked to: {deliver:complete}." - type: "PAPER" - rewards: - - "eco give {player} 30" - options: - category: "dependent" - requires: - - "" - repeatable: false - cooldown: - enabled: true - time: 1440 - # Categories are a way of grouping up quests. # When a player uses /quests, a menu of categories will be presented to them. # When a player clicks ona category, a list of quests under that category will show. @@ -1095,30 +51,6 @@ categories: # This category needs the permission "quests.category.permissionexample", because the category ID is 'permissionexample'. # The permission for other categories is: "quests.category.<id>". permission-required: true - easy: - display: - name: "&cEasy Difficulty Quests" - lore: - - "&7This category contains easy quests." - - "&7They do not require you to do much but" - - "&7rewards are low." - type: "260" - medium: - display: - name: "&cIntermediate Difficulty Quests" - lore: - - "&7This category contains intermediate quests." - - "&7These quests are more challenging than the" - - "&7previous with greater rewards." - type: "264" - dependent: - display: - name: "&cDependent Quests" - lore: - - "&7This category contains quests which are dependent" - - "&7on other plugins being installed such as &cASkyBlock," - - "&cuSkyBlock &7and &cCitizens&7." - type: "GRASS" # The items listed below are placeholder items for quests which the player cannot start. gui: diff --git a/src/main/resources/quests/README.txt b/src/main/resources/quests/README.txt new file mode 100644 index 00000000..fa0f0186 --- /dev/null +++ b/src/main/resources/quests/README.txt @@ -0,0 +1,30 @@ +# !! READ ME - IT WILL NOT TAKE LONG !! +# +# Each file ín the 'quests' folder defines a single quest. +# The name of the file is the quest ID. These must be alphanumeric and unique. +# Quest files must be in the .yml format. +# +# A quest is a series of tasks which players must complete for a reward and may require a previous quest to start. +# A task is an objective such as breaking blocks or obtaining items. +# A reward is a command executed by the SERVER. Use {player} to get the players name. +# +# A quest can have a 'rewardstring' (this is optional). They will be sent to the player when they complete the quest. +# An example of the rewardstring in use can be seen in the quest example4. +# +# Each quest will have ONE "display" item, this is the item shown to the player in the GUI. +# The display item will have a "name", a "type" and TWO lores. +# The name is the name of the item, the type is the material and the lore is the text underneath the item (when mouse-over-ing). +# The first lore you must give is called 'lore-normal'. This is the lore seen if the player has not started the quest. +# The second lore you must give is 'lore-started'. This will be appended to the first lore IF the player has started the quest - useful for putting progression. +# Within the lores you can get the players" progress for each task. Use {TASKID:progress} (replace TASKID with the ID of the task). +# You can also get if a task is complete. Use {TASKID:complete} (replace TASKID with the ID of the task). +# +# Quests can be put inside a category. When a player does /quests they will first see a menu of categories. They can click one and another menu of quests +# under that category will show up. Categories can be disabled. +# +# =============================================================== +# +# You can see other task types here: +# https://github.com/LMBishop/Quests/wiki/Task-Types +# +# ===============================================================
\ No newline at end of file diff --git a/src/main/resources/quests/example1.yml b/src/main/resources/quests/example1.yml new file mode 100644 index 00000000..7e38f01f --- /dev/null +++ b/src/main/resources/quests/example1.yml @@ -0,0 +1,55 @@ +# The name of this file is the quest ID. It must be alphanumeric and unique. + +# Everything inside of this section defines tasks the player must complete to progress. +tasks: + # This is the task ID ("mining"). This can share the same name as the quest ID but MUST be unique with all other task IDs in the same quest. + mining: + # This defines what type of task this is. In this instance, it is "blockbreak" (breaking blocks) + # NOTE: guides to set up each type of task is on the plugin page! + type: "blockbreak" + # This defines the amount of blocks which need to be broken + amount: 30 + # You can have multiple tasks for each quest (example further down). + +# Everything inside of this section defines the display item. +display: + # This is the name of the item. This allows color codes. + name: "&cExample I (Single Task)" + # This is the lore of the item if the player has not started the quest. This allows color codes and task/player placeholders. + lore-normal: + - "&cThis category is designed to show you the different" + - "&cattributes a quest can have." + - "" + - "&7This quest requires you to:" + - "&7 - Break 30 blocks." + - "" + - "&7Rewards:" + - "&7 - 10 diamonds." + # This lore will be appended to the bottom of the above lore when the player starts their quest. + # To get the players progress through a task, use {TASKID:progress} and replace TASKID with the ID of the task. + lore-started: + - "" + - "&7Your current progression:" + - "&7 - {mining:progress}/30 blocks broken." + # This is the material of the item. It is recommended to stick to bukkit names. + type: "WOOD_PICKAXE" + +# List all commands to be executed by the server when the player completes the quest. Use {player} to get the players name. +rewards: + - "give {player} diamond 10" + +# Everything inside this section define quest-specific options +options: + # This is the category for the quest, it will appear under the "examples" category. Categories can be disabled. + category: "examples" + # Set the quest IDs of required quests here, leave empty if none. + requires: + - "" + # Set if the quest can be repeated after being completed for the first time. + repeatable: false + # Define the cooldown on quests. The above (repeatable) must be true for this to take effect. + cooldown: + # If true, players will have to wait between repeating quests. + enabled: true + # Time (in minutes) + time: 1440
\ No newline at end of file diff --git a/src/main/resources/quests/example2.yml b/src/main/resources/quests/example2.yml new file mode 100644 index 00000000..8a3a367f --- /dev/null +++ b/src/main/resources/quests/example2.yml @@ -0,0 +1,42 @@ +# This is a quest which requires the previous quest to be complete to start. + +tasks: + # Unlike the previous quest, this quest has multiple tasks. + mining: + type: "blockbreak" + amount: 100 + building: + type: "blockplace" + amount: 100 +display: + name: "&cExample II (Multiple Tasks)" + lore-normal: + - "&cThis category is designed to show you the different" + - "&cattributes a quest can have. This quest requires" + - "&cmultiple things to be done, unlike the previous one." + - "" + - "&7This quest requires you to:" + - "&7 - Break 100 blocks." + - "&7 - Place 100 blocks." + - "" + - "&7Rewards:" + - "&7 - 15 diamonds." + - "&7 - $50 added to your in-game balance." + lore-started: + - "" + - "&7Your current progression:" + - "&7 - {mining:progress}/100 blocks broken." + - "&7 - {building:progress}/100 blocks placed." + type: "GRASS" +rewards: + - "give {player} diamond 15" + - "eco give {player} 50" +options: + category: "examples" + # Unlike the previous quest, this quest has "example1" as a required quest. You cannot start this quest without "example1" quest complete. + requires: + - "example1" + repeatable: false + cooldown: + enabled: true + time: 1440
\ No newline at end of file diff --git a/src/main/resources/quests/example3.yml b/src/main/resources/quests/example3.yml new file mode 100644 index 00000000..598b94d1 --- /dev/null +++ b/src/main/resources/quests/example3.yml @@ -0,0 +1,45 @@ +# This is a quest which requires the previous quest to be complete to start. +# Unlike the previous quest, this one can be re-done but it has a 10 minute cooldown. + +tasks: + # Unlike the previous two quests, this quest specifies a specific block to be broken. + mining: + type: "blockbreakcertain" + amount: 81 + block: 14 # (gold ore) + building: + type: "blockplacecertain" + amount: 9 + block: 41 # (gold blocks) +display: + name: "&cExample III (Repeatable, 10 minute cooldown)" + lore-normal: + - "&cThis category is designed to show you the different" + - "&cattributes a quest can have. This quest can be replayed" + - "&cafter a cooldown, unlike the previous one." + - "" + - "&7This quest requires you to:" + - "&7 - Break 81 gold ore." + - "&7 - Place 9 gold blocks." + - "" + - "&7Rewards:" + - "&7 - 30 diamonds." + - "&7 - $10 added to your in-game balance." + lore-started: + - "" + - "&7Your current progression:" + - "&7 - {mining:progress}/81 gold ore broken." + - "&7 - {building:progress}/9 gold blocks placed." + type: "GOLD_ORE" +rewards: + - "give {player} diamond 30" + - "eco give {player} 10" +options: + category: "examples" + requires: + - "example2" + # This quest is repeatable, it has cooldowns enabled (meaning the player must wait before repeating it) and the time set to 10 (minutes). + repeatable: true + cooldown: + enabled: true + time: 10
\ No newline at end of file diff --git a/src/main/resources/quests/example4.yml b/src/main/resources/quests/example4.yml new file mode 100644 index 00000000..37744eee --- /dev/null +++ b/src/main/resources/quests/example4.yml @@ -0,0 +1,39 @@ +# This is a quest which requires the previous quest to be complete to start. +# Unlike the previous quests, this quest has a reward string. + +tasks: + mobkilling: + type: "mobkilling" + amount: 3 +display: + name: "&cExample IV (Reward String)" + lore-normal: + - "&cThis category is designed to show you the different" + - "&cattributes a quest can have. This quest has a 'reward string'" + - "&c(a series of messages sent when a quest is complete)," + - "&cunlike the previous one." + - "" + - "&7This quest requires you to:" + - "&7 - Kill 3 mobs." + - "" + - "&7Rewards:" + - "&7 - $50 added to your in-game balance." + lore-started: + - "" + - "&7Your current progression:" + - "&7 - {mobkilling:progress}/3 mobs killed." + type: "STRING" +rewards: + - "eco give {player} 50" +# Here you can list messages which will be sent to the player (if they are online) upon completion. +rewardstring: + - " &8* &c$10 &7was added to your in-game balance." + - " &8* &c30 diamonds &7was added to your inventory." +options: + category: "examples" + requires: + - "example3" + repeatable: true + cooldown: + enabled: true + time: 10
\ No newline at end of file diff --git a/src/main/resources/quests/example5.yml b/src/main/resources/quests/example5.yml new file mode 100644 index 00000000..38e9e601 --- /dev/null +++ b/src/main/resources/quests/example5.yml @@ -0,0 +1,34 @@ +tasks: + building: + type: "blockplace" + amount: 10 +display: + name: "&cExample V (Permission)" + lore-normal: + - "&cThis category is designed to show you the different" + - "&cattributes a quest can have. This quest requires" + - "&ccertain permissions." + - "" + - "&7This quest requires you to:" + - "&7 - Place 10 blocks." + - "" + - "&7Rewards:" + - "&7 - $10 added to your in-game balance." + lore-started: + - "" + - "&7Your current progression:" + - "&7 - {building:progress}/10 blocks placed." + type: "GRASS" +rewards: + - "eco give {player} 10" +options: + category: "examples" + requires: + - "example4" + # Unlike the previous quests, this one requires you to have the permission "quests.quest.example5" to start. + # The permission for other quests is: "quests.quest.<id>". + permission-required: true + repeatable: false + cooldown: + enabled: true + time: 1440
\ No newline at end of file diff --git a/src/main/resources/quests/example6.yml b/src/main/resources/quests/example6.yml new file mode 100644 index 00000000..3262b1a8 --- /dev/null +++ b/src/main/resources/quests/example6.yml @@ -0,0 +1,30 @@ +tasks: + building: + type: "blockplace" + amount: 10 +display: + name: "&cExample VI (Different category, permissions)" + lore-normal: + - "&cThis category is designed to show you the different" + - "&cattributes a quest can have. This quest requires" + - "&ccertain permissions." + - "" + - "&7This quest requires you to:" + - "&7 - Place 10 blocks." + - "" + - "&7Rewards:" + - "&7 - $10 added to your in-game balance." + lore-started: + - "" + - "&7Your current progression:" + - "&7 - {building:progress}/10 blocks placed." + type: "GRASS" +rewards: + - "eco give {player} 10" +options: + category: "permissionexample" + # This quest has no specific permission, however its category does. The permission for the category is "quests.category.permissionexample" + repeatable: false + cooldown: + enabled: true + time: 1440
\ No newline at end of file |
