From 813462e4583fd6490bad4e2e2679c4103e431a51 Mon Sep 17 00:00:00 2001 From: Zino Date: Sat, 31 Aug 2013 16:58:49 +0200 Subject: [PATCH] + Added ignore-locked-quests config-option, when a player tries to take a quest from a npc, if the player can't take the quest, then don't display the quest in the list. --- src/main/java/me/blackvein/quests/NpcListener.java | 8 +++++++- src/main/java/me/blackvein/quests/Quests.java | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/blackvein/quests/NpcListener.java b/src/main/java/me/blackvein/quests/NpcListener.java index b7e83b4fb..14ecae1e0 100644 --- a/src/main/java/me/blackvein/quests/NpcListener.java +++ b/src/main/java/me/blackvein/quests/NpcListener.java @@ -82,7 +82,13 @@ public class NpcListener implements Listener { for (Quest q : plugin.getQuests()) { if (q.npcStart != null && q.npcStart.getId() == evt.getNPC().getId()) { - npcQuests.add(q); + if (Quests.ignoreLockedQuests) { + if (q.testRequirements(quester) && (q.redoDelay <= 0)) { + npcQuests.add(q); + } + } else { + npcQuests.add(q); + } } } diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index 475f0a831..543b41a32 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -77,6 +77,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, public static boolean snoop = true; public static boolean npcEffects = true; public static boolean broadcastPartyCreation = true; + public static boolean ignoreLockedQuests = false; public static int maxPartySize = 0; public static int acceptTimeout = 20; public static int inviteTimeout = 20; @@ -335,6 +336,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { config.set("language", "en"); } + + if (config.contains("ignore-locked-quests")) { + ignoreLockedQuests = config.getBoolean("ignore-locked-quests"); + } else { + config.set("ignore-locked-quests", false); + } if(config.contains("broadcast-party-creation")){ broadcastPartyCreation = config.getBoolean("broadcast-party-creation");