Revise override capabilities. Add permission world prompt, fixes #1113

This commit is contained in:
PikaMug 2020-03-14 19:59:30 -04:00
parent 6eb71d6021
commit 0fec3b35fe
19 changed files with 1171 additions and 954 deletions

View File

@ -440,10 +440,8 @@ public class Quest {
q.timers.remove(entry.getKey()); q.timers.remove(entry.getKey());
} }
} }
String none = null;
if (player.isOnline()) { if (player.isOnline()) {
Player p = (Player)player; Player p = (Player)player;
none = ChatColor.GRAY + "- (" + Lang.get(p, "none") + ")";
final String[] ps = ConfigUtil.parseStringWithPossibleLineBreaks(ChatColor.AQUA + finished, this, p); final String[] ps = ConfigUtil.parseStringWithPossibleLineBreaks(ChatColor.AQUA + finished, this, p);
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
@ -453,10 +451,6 @@ public class Quest {
} }
}, 40); }, 40);
} }
if (rews.getMoney() > 0 && plugin.getDependencies().getVaultEconomy() != null) {
plugin.getDependencies().getVaultEconomy().depositPlayer(player, rews.getMoney());
none = null;
}
if (pln.getCooldown() > -1) { if (pln.getCooldown() > -1) {
q.completedTimes.put(this.name, System.currentTimeMillis()); q.completedTimes.put(this.name, System.currentTimeMillis());
if (q.amountsCompleted.containsKey(this.name)) { if (q.amountsCompleted.containsKey(this.name)) {
@ -465,6 +459,13 @@ public class Quest {
q.amountsCompleted.put(this.name, 1); q.amountsCompleted.put(this.name, 1);
} }
} }
// Issue rewards
boolean issuedReward = false;
if (rews.getMoney() > 0 && plugin.getDependencies().getVaultEconomy() != null) {
plugin.getDependencies().getVaultEconomy().depositPlayer(player, rews.getMoney());
issuedReward = true;
}
if (player.isOnline()) { if (player.isOnline()) {
Player p = (Player)player; Player p = (Player)player;
for (ItemStack i : rews.getItems()) { for (ItemStack i : rews.getItems()) {
@ -476,7 +477,7 @@ public class Quest {
p.sendMessage(ChatColor.RED + "Quests encountered a problem with an item. " p.sendMessage(ChatColor.RED + "Quests encountered a problem with an item. "
+ "Please contact an administrator."); + "Please contact an administrator.");
} }
none = null; issuedReward = true;
} }
} }
for (String s : rews.getCommands()) { for (String s : rews.getCommands()) {
@ -496,25 +497,24 @@ public class Quest {
} }
}); });
} }
none = null; issuedReward = true;
} }
for (int i = 0; i < rews.getPermissions().size(); i++) { for (int i = 0; i < rews.getPermissions().size(); i++) {
if (plugin.getDependencies().getVaultPermission() != null) { if (plugin.getDependencies().getVaultPermission() != null) {
String perm = rews.getPermissions().get(i); String perm = rews.getPermissions().get(i);
plugin.getDependencies().getVaultPermission().playerAdd(null, player, perm); String world = rews.getPermissionWorlds().get(i);
/*String world = rews.getPermissionWorlds().get(i); if (world == null || world.equals("null")) {
if (world == null) {
plugin.getDependencies().getVaultPermission().playerAdd(null, player, perm); plugin.getDependencies().getVaultPermission().playerAdd(null, player, perm);
} else { } else {
plugin.getDependencies().getVaultPermission().playerAdd(world, player, perm); plugin.getDependencies().getVaultPermission().playerAdd(world, player, perm);
}*/ }
} }
none = null; issuedReward = true;
} }
for (String s : rews.getMcmmoSkills()) { for (String s : rews.getMcmmoSkills()) {
UserManager.getOfflinePlayer(player).getProfile().addLevels(Quests.getMcMMOSkill(s), UserManager.getOfflinePlayer(player).getProfile().addLevels(Quests.getMcMMOSkill(s),
rews.getMcmmoAmounts().get(rews.getMcmmoSkills().indexOf(s))); rews.getMcmmoAmounts().get(rews.getMcmmoSkills().indexOf(s)));
none = null; issuedReward = true;
} }
if (player.isOnline()) { if (player.isOnline()) {
for (String s : rews.getHeroesClasses()) { for (String s : rews.getHeroesClasses()) {
@ -522,7 +522,7 @@ public class Quest {
hero.addExp(rews.getHeroesAmounts().get(rews.getHeroesClasses().indexOf(s)), hero.addExp(rews.getHeroesAmounts().get(rews.getHeroesClasses().indexOf(s)),
plugin.getDependencies().getHeroes().getClassManager().getClass(s), plugin.getDependencies().getHeroes().getClassManager().getClass(s),
((Player)player).getLocation()); ((Player)player).getLocation());
none = null; issuedReward = true;
} }
} }
LinkedList<ItemStack> phatLootItems = new LinkedList<ItemStack>(); LinkedList<ItemStack> phatLootItems = new LinkedList<ItemStack>();
@ -566,17 +566,25 @@ public class Quest {
if (lb.getMessageList().isEmpty() == false) { if (lb.getMessageList().isEmpty() == false) {
phatLootMessages.addAll(lb.getMessageList()); phatLootMessages.addAll(lb.getMessageList());
} }
issuedReward = true;
} }
if (rews.getExp() > 0 && player.isOnline()) { if (rews.getExp() > 0 && player.isOnline()) {
((Player)player).giveExp(rews.getExp()); ((Player)player).giveExp(rews.getExp());
none = null; issuedReward = true;
} }
if (rews.getQuestPoints() > 0) {
q.questPoints += rews.getQuestPoints();
issuedReward = true;
}
if (rews.getCustomRewards().isEmpty() == false) {
issuedReward = true;
}
// Inform player
if (player.isOnline()) { if (player.isOnline()) {
Player p = (Player)player; Player p = (Player)player;
String complete = Lang.get(p, "questCompleteTitle"); p.sendMessage(ChatColor.GOLD + Lang.get(p, "questCompleteTitle").replace("<quest>", ChatColor.YELLOW + name
complete = complete.replace("<quest>", ChatColor.YELLOW + name + ChatColor.GOLD); + ChatColor.GOLD));
p.sendMessage(ChatColor.GOLD + complete);
p.sendMessage(ChatColor.GREEN + Lang.get(p, "questRewardsTitle"));
if (plugin.getSettings().canShowQuestTitles()) { if (plugin.getSettings().canShowQuestTitles()) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "title " + p.getName() Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "title " + p.getName()
+ " title " + "{\"text\":\"" + Lang.get(p, "quest") + " " + Lang.get(p, "complete") + " title " + "{\"text\":\"" + Lang.get(p, "quest") + " " + Lang.get(p, "complete")
@ -584,177 +592,189 @@ public class Quest {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "title " + p.getName() Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "title " + p.getName()
+ " subtitle " + "{\"text\":\"" + name + "\",\"color\":\"yellow\"}"); + " subtitle " + "{\"text\":\"" + name + "\",\"color\":\"yellow\"}");
} }
if (rews.getQuestPoints() > 0) { p.sendMessage(ChatColor.GREEN + Lang.get(p, "questRewardsTitle"));
p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getQuestPoints() + " " if (!issuedReward) {
+ Lang.get(p, "questPoints")); p.sendMessage(ChatColor.GRAY + "- (" + Lang.get("none") + ")");
q.questPoints += rews.getQuestPoints(); } else if (!rews.getDetailsOverride().isEmpty()) {
none = null; for (String s: rews.getDetailsOverride()) {
} String message = ChatColor.DARK_GREEN + ConfigUtil.parseString(
for (ItemStack i : rews.getItems()) { ChatColor.translateAlternateColorCodes('&', s));
String text = "error"; if (plugin.getDependencies().getPlaceholderApi() != null) {
if (i.hasItemMeta() && i.getItemMeta().hasDisplayName()) { message = PlaceholderAPI.setPlaceholders(p, message);
if (i.getEnchantments().isEmpty()) { }
text = "- " + ChatColor.DARK_AQUA + ChatColor.ITALIC + i.getItemMeta().getDisplayName() p.sendMessage("- " + message);
+ ChatColor.RESET + ChatColor.GRAY + " x " + i.getAmount(); }
} else { } else {
text = "- " + ChatColor.DARK_AQUA + ChatColor.ITALIC + i.getItemMeta().getDisplayName() if (rews.getQuestPoints() > 0) {
+ ChatColor.RESET; p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getQuestPoints() + " "
try { + Lang.get(p, "questPoints"));
if (!i.getItemMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS)) { }
text += ChatColor.GRAY + " " + Lang.get(p, "with") + ChatColor.DARK_PURPLE; for (ItemStack i : rews.getItems()) {
for (Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) { String text = "error";
text += " " + ItemUtil.getPrettyEnchantmentName(e.getKey()) + ":" + e.getValue(); if (i.hasItemMeta() && i.getItemMeta().hasDisplayName()) {
if (i.getEnchantments().isEmpty()) {
text = "- " + ChatColor.DARK_AQUA + ChatColor.ITALIC + i.getItemMeta().getDisplayName()
+ ChatColor.RESET + ChatColor.GRAY + " x " + i.getAmount();
} else {
text = "- " + ChatColor.DARK_AQUA + ChatColor.ITALIC + i.getItemMeta().getDisplayName()
+ ChatColor.RESET;
try {
if (!i.getItemMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS)) {
text += ChatColor.GRAY + " " + Lang.get(p, "with") + ChatColor.DARK_PURPLE;
for (Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) {
text += " " + ItemUtil.getPrettyEnchantmentName(e.getKey()) + ":" + e.getValue();
}
} }
} catch (Throwable tr) {
// Do nothing, hasItemFlag() not introduced until 1.8.6
} }
} catch (Throwable tr) { text += ChatColor.GRAY + " x " + i.getAmount();
// Do nothing, hasItemFlag() not introduced until 1.8.6
} }
text += ChatColor.GRAY + " x " + i.getAmount(); } else if (i.getDurability() != 0) {
} if (i.getEnchantments().isEmpty()) {
} else if (i.getDurability() != 0) { text = "- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() + ChatColor.GRAY
if (i.getEnchantments().isEmpty()) { + " x " + i.getAmount();
text = "- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() + ChatColor.GRAY } else {
+ " x " + i.getAmount(); text = "- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() + ChatColor.GRAY
} else { + " " + Lang.get(p, "with");
text = "- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() + ChatColor.GRAY for (Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) {
+ " " + Lang.get(p, "with"); text += " " + ItemUtil.getPrettyEnchantmentName(e.getKey()) + ":" + e.getValue();
for (Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) { }
text += " " + ItemUtil.getPrettyEnchantmentName(e.getKey()) + ":" + e.getValue(); text += ChatColor.GRAY + " x " + i.getAmount();
} }
text += ChatColor.GRAY + " x " + i.getAmount();
}
} else {
if (i.getEnchantments().isEmpty()) {
text = "- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x " + i.getAmount();
} else { } else {
text = "- " + ChatColor.DARK_GREEN + ItemUtil.getName(i); if (i.getEnchantments().isEmpty()) {
try { text = "- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x " + i.getAmount();
if (!i.getItemMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS)) { } else {
text += ChatColor.GRAY + " " + Lang.get(p, "with"); text = "- " + ChatColor.DARK_GREEN + ItemUtil.getName(i);
for (Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) { try {
text += " " + ItemUtil.getPrettyEnchantmentName(e.getKey()) + ":" + e.getValue(); if (!i.getItemMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS)) {
text += ChatColor.GRAY + " " + Lang.get(p, "with");
for (Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) {
text += " " + ItemUtil.getPrettyEnchantmentName(e.getKey()) + ":" + e.getValue();
}
} }
} catch (Throwable tr) {
// Do nothing, hasItemFlag() not introduced until 1.8.6
} }
} catch (Throwable tr) { text += ChatColor.GRAY + " x " + i.getAmount();
// Do nothing, hasItemFlag() not introduced until 1.8.6
} }
text += ChatColor.GRAY + " x " + i.getAmount();
} }
p.sendMessage(text);
} }
p.sendMessage(text); for (ItemStack i : phatLootItems) {
none = null; if (i.hasItemMeta() && i.getItemMeta().hasDisplayName()) {
} if (i.getEnchantments().isEmpty()) {
for (ItemStack i : phatLootItems) { p.sendMessage("- " + ChatColor.DARK_AQUA + ChatColor.ITALIC + i.getItemMeta().getDisplayName()
if (i.hasItemMeta() && i.getItemMeta().hasDisplayName()) { + ChatColor.RESET + ChatColor.GRAY + " x " + i.getAmount());
if (i.getEnchantments().isEmpty()) { } else {
p.sendMessage("- " + ChatColor.DARK_AQUA + ChatColor.ITALIC + i.getItemMeta().getDisplayName() p.sendMessage("- " + ChatColor.DARK_AQUA + ChatColor.ITALIC + i.getItemMeta().getDisplayName()
+ ChatColor.RESET + ChatColor.GRAY + " x " + i.getAmount()); + ChatColor.RESET + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " "
} else { + Lang.get(p, "enchantedItem"));
p.sendMessage("- " + ChatColor.DARK_AQUA + ChatColor.ITALIC + i.getItemMeta().getDisplayName() }
+ ChatColor.RESET + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " } else if (i.getDurability() != 0) {
+ Lang.get(p, "enchantedItem")); if (i.getEnchantments().isEmpty()) {
} p.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability()
} else if (i.getDurability() != 0) { + ChatColor.GRAY + " x " + i.getAmount());
if (i.getEnchantments().isEmpty()) { } else {
p.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() p.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability()
+ ChatColor.GRAY + " x " + i.getAmount()); + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " "
} else { + Lang.get(p, "enchantedItem"));
p.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability()
+ ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " "
+ Lang.get(p, "enchantedItem"));
}
} else {
if (i.getEnchantments().isEmpty()) {
p.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x "
+ i.getAmount());
} else {
p.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x "
+ i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get(p, "enchantedItem"));
}
}
none = null;
}
if (rews.getMoney() > 1) {
p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getMoney() + " " + ChatColor.DARK_PURPLE
+ plugin.getDependencies().getCurrency(true));
none = null;
} else if (rews.getMoney() == 1) {
p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getMoney() + " " + ChatColor.DARK_PURPLE
+ plugin.getDependencies().getCurrency(false));
none = null;
}
if (rews.getExp() > 0 || phatLootExp > 0) {
int tot = rews.getExp() + phatLootExp;
p.sendMessage("- " + ChatColor.DARK_GREEN + tot + ChatColor.DARK_PURPLE + " "
+ Lang.get(p, "experience"));
none = null;
}
if (rews.getCommands().isEmpty() == false) {
int index = 0;
for (String s : rews.getCommands()) {
if (rews.getCommandsOverrideDisplay().isEmpty() == false && rews.getCommandsOverrideDisplay().size()
> index) {
if (!rews.getCommandsOverrideDisplay().get(index).trim().equals("")) {
p.sendMessage("- " + ChatColor.DARK_GREEN
+ rews.getCommandsOverrideDisplay().get(index));
} }
} else { } else {
p.sendMessage("- " + ChatColor.DARK_GREEN + s); if (i.getEnchantments().isEmpty()) {
} p.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x "
index++; + i.getAmount());
} } else {
none = null; p.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x "
} + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get(p, "enchantedItem"));
if (rews.getMcmmoSkills().isEmpty() == false) {
for (String s : rews.getMcmmoSkills()) {
p.sendMessage("- " + ChatColor.DARK_GREEN
+ rews.getMcmmoAmounts().get(rews.getMcmmoSkills().indexOf(s)) + " " + ChatColor.DARK_PURPLE
+ s + " " + Lang.get(p, "experience"));
}
none = null;
}
if (rews.getHeroesClasses().isEmpty() == false) {
for (String s : rews.getHeroesClasses()) {
p.sendMessage("- " + ChatColor.AQUA
+ rews.getHeroesAmounts().get(rews.getHeroesClasses().indexOf(s)) + " " + ChatColor.BLUE
+ s + " " + Lang.get(p, "experience"));
}
none = null;
}
if (phatLootMessages.isEmpty() == false) {
for (String s : phatLootMessages) {
p.sendMessage("- " + s);
}
none = null;
}
for (String s : rews.getCustomRewards().keySet()) {
CustomReward found = null;
for (CustomReward cr : plugin.getCustomRewards()) {
if (cr.getName().equalsIgnoreCase(s)) {
found = cr;
break;
}
}
if (found != null) {
Map<String, Object> datamap = rews.getCustomRewards().get(found.getName());
String message = found.getRewardName();
if (message != null) {
for (String key : datamap.keySet()) {
message = message.replace("%" + key + "%", datamap.get(key).toString());
} }
p.sendMessage("- " + ChatColor.GOLD + message);
} else {
plugin.getLogger().warning("Failed to notify player: Custom Reward does not have an assigned name");
} }
found.giveReward(p, rews.getCustomRewards().get(s));
} else {
plugin.getLogger().warning("Quester \"" + player.getName() + "\" completed the Quest \"" + name
+ "\", but the Custom Reward \"" + s + "\" could not be found. Does it still exist?");
} }
none = null; if (rews.getMoney() > 1) {
} p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getMoney() + " " + ChatColor.DARK_PURPLE
if (none != null) { + plugin.getDependencies().getCurrency(true));
p.sendMessage(none); } else if (rews.getMoney() == 1) {
p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getMoney() + " " + ChatColor.DARK_PURPLE
+ plugin.getDependencies().getCurrency(false));
}
if (rews.getExp() > 0 || phatLootExp > 0) {
int tot = rews.getExp() + phatLootExp;
p.sendMessage("- " + ChatColor.DARK_GREEN + tot + ChatColor.DARK_PURPLE + " "
+ Lang.get(p, "experience"));
}
if (rews.getCommands().isEmpty() == false) {
int index = 0;
for (String s : rews.getCommands()) {
if (rews.getCommandsOverrideDisplay().isEmpty() == false && rews.getCommandsOverrideDisplay().size()
> index) {
if (!rews.getCommandsOverrideDisplay().get(index).trim().equals("")) {
p.sendMessage("- " + ChatColor.DARK_GREEN
+ rews.getCommandsOverrideDisplay().get(index));
}
} else {
p.sendMessage("- " + ChatColor.DARK_GREEN + s);
}
index++;
}
}
if (rews.getPermissions().isEmpty() == false) {
int index = 0;
for (String s : rews.getPermissions()) {
if (rews.getPermissionWorlds() != null) {
p.sendMessage("- " + ChatColor.DARK_GREEN + s + " (" + rews.getPermissionWorlds().get(index)
+ ")");
} else {
p.sendMessage("- " + ChatColor.DARK_GREEN + s);
}
index++;
}
}
if (rews.getMcmmoSkills().isEmpty() == false) {
for (String s : rews.getMcmmoSkills()) {
p.sendMessage("- " + ChatColor.DARK_GREEN
+ rews.getMcmmoAmounts().get(rews.getMcmmoSkills().indexOf(s)) + " " + ChatColor.DARK_PURPLE
+ s + " " + Lang.get(p, "experience"));
}
}
if (rews.getHeroesClasses().isEmpty() == false) {
for (String s : rews.getHeroesClasses()) {
p.sendMessage("- " + ChatColor.AQUA
+ rews.getHeroesAmounts().get(rews.getHeroesClasses().indexOf(s)) + " " + ChatColor.BLUE
+ s + " " + Lang.get(p, "experience"));
}
}
if (phatLootMessages.isEmpty() == false) {
for (String s : phatLootMessages) {
p.sendMessage("- " + s);
}
}
for (String s : rews.getCustomRewards().keySet()) {
CustomReward found = null;
for (CustomReward cr : plugin.getCustomRewards()) {
if (cr.getName().equalsIgnoreCase(s)) {
found = cr;
break;
}
}
if (found != null) {
Map<String, Object> datamap = rews.getCustomRewards().get(found.getName());
String message = found.getRewardName();
if (message != null) {
for (String key : datamap.keySet()) {
message = message.replace("%" + key + "%", datamap.get(key).toString());
}
p.sendMessage("- " + ChatColor.GOLD + message);
} else {
plugin.getLogger().warning("Failed to notify player: Custom Reward does not have an assigned name");
}
found.giveReward(p, rews.getCustomRewards().get(s));
} else {
plugin.getLogger().warning("Quester \"" + player.getName() + "\" completed the Quest \"" + name
+ "\", but the Custom Reward \"" + s + "\" could not be found. Does it still exist?");
}
}
} }
} }
q.saveData(); q.saveData();

View File

@ -648,8 +648,8 @@ public class QuestFactory implements ConversationAbandonedListener {
context.setSessionData(CK.REQ_CUSTOM, list); context.setSessionData(CK.REQ_CUSTOM, list);
context.setSessionData(CK.REQ_CUSTOM_DATA, datamapList); context.setSessionData(CK.REQ_CUSTOM_DATA, datamapList);
} }
if (reqs.getFailRequirements() != null) { if (reqs.getDetailsOverride().isEmpty() == false) {
context.setSessionData(CK.REQ_FAIL_MESSAGE, reqs.getFailRequirements()); context.setSessionData(CK.REQ_FAIL_MESSAGE, reqs.getDetailsOverride());
} }
Rewards rews = q.getRewards(); Rewards rews = q.getRewards();
if (rews.getMoney() != 0) { if (rews.getMoney() != 0) {
@ -673,6 +673,9 @@ public class QuestFactory implements ConversationAbandonedListener {
if (rews.getPermissions().isEmpty() == false) { if (rews.getPermissions().isEmpty() == false) {
context.setSessionData(CK.REW_PERMISSION, rews.getPermissions()); context.setSessionData(CK.REW_PERMISSION, rews.getPermissions());
} }
if (rews.getPermissions().isEmpty() == false) {
context.setSessionData(CK.REW_PERMISSION_WORLDS, rews.getPermissionWorlds());
}
if (rews.getMcmmoSkills().isEmpty() == false) { if (rews.getMcmmoSkills().isEmpty() == false) {
context.setSessionData(CK.REW_MCMMO_SKILLS, rews.getMcmmoSkills()); context.setSessionData(CK.REW_MCMMO_SKILLS, rews.getMcmmoSkills());
context.setSessionData(CK.REW_MCMMO_AMOUNTS, rews.getMcmmoAmounts()); context.setSessionData(CK.REW_MCMMO_AMOUNTS, rews.getMcmmoAmounts());
@ -688,6 +691,9 @@ public class QuestFactory implements ConversationAbandonedListener {
context.setSessionData(CK.REW_CUSTOM, new LinkedList<String>(rews.getCustomRewards().keySet())); context.setSessionData(CK.REW_CUSTOM, new LinkedList<String>(rews.getCustomRewards().keySet()));
context.setSessionData(CK.REW_CUSTOM_DATA, new LinkedList<Object>(rews.getCustomRewards().values())); context.setSessionData(CK.REW_CUSTOM_DATA, new LinkedList<Object>(rews.getCustomRewards().values()));
} }
if (rews.getDetailsOverride().isEmpty() == false) {
context.setSessionData(CK.REW_DETAILS_OVERRIDE, rews.getDetailsOverride());
}
Planner pln = q.getPlanner(); Planner pln = q.getPlanner();
if (pln.getStart() != null) { if (pln.getStart() != null) {
context.setSessionData(CK.PLN_START_DATE, pln.getStart()); context.setSessionData(CK.PLN_START_DATE, pln.getStart());
@ -962,8 +968,8 @@ public class QuestFactory implements ConversationAbandonedListener {
if (stage.startMessage != null) { if (stage.startMessage != null) {
context.setSessionData(pref + CK.S_START_MESSAGE, stage.startMessage); context.setSessionData(pref + CK.S_START_MESSAGE, stage.startMessage);
} }
if (stage.objectiveOverride != null) { if (stage.objectiveOverrides.isEmpty() == false) {
context.setSessionData(pref + CK.S_OVERRIDE_DISPLAY, stage.objectiveOverride); context.setSessionData(pref + CK.S_OVERRIDE_DISPLAY, stage.objectiveOverrides);
} }
} }
} }
@ -1547,7 +1553,7 @@ public class QuestFactory implements ConversationAbandonedListener {
String heroesSecondaryReq = null; String heroesSecondaryReq = null;
LinkedList<String> customReqs = null; LinkedList<String> customReqs = null;
LinkedList<Map<String, Object>> customReqsData = null; LinkedList<Map<String, Object>> customReqsData = null;
String failMessage = null; List<String> detailsOverrideReqs = null;
Integer moneyRew = null; Integer moneyRew = null;
Integer questPointsRew = null; Integer questPointsRew = null;
List<ItemStack> itemRews = null; List<ItemStack> itemRews = null;
@ -1557,6 +1563,7 @@ public class QuestFactory implements ConversationAbandonedListener {
List<String> commandRews = null; List<String> commandRews = null;
List<String> commandDisplayOverrideRews = null; List<String> commandDisplayOverrideRews = null;
List<String> permRews = null; List<String> permRews = null;
List<String> permWorldRews = null;
List<String> mcMMOSkillRews = null; List<String> mcMMOSkillRews = null;
List<Integer> mcMMOSkillAmounts = null; List<Integer> mcMMOSkillAmounts = null;
List<String> heroesClassRews = null; List<String> heroesClassRews = null;
@ -1564,6 +1571,7 @@ public class QuestFactory implements ConversationAbandonedListener {
List<String> phatLootRews = null; List<String> phatLootRews = null;
LinkedList<String> customRews = null; LinkedList<String> customRews = null;
LinkedList<Map<String, Object>> customRewsData = null; LinkedList<Map<String, Object>> customRewsData = null;
List<String> detailsOverrideRews = null;
String startDatePln = null; String startDatePln = null;
String endDatePln = null; String endDatePln = null;
Long repeatCyclePln = null; Long repeatCyclePln = null;
@ -1621,7 +1629,8 @@ public class QuestFactory implements ConversationAbandonedListener {
customReqsData = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA); customReqsData = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
} }
if (context.getSessionData(CK.REQ_FAIL_MESSAGE) != null) { if (context.getSessionData(CK.REQ_FAIL_MESSAGE) != null) {
failMessage = (String) context.getSessionData(CK.REQ_FAIL_MESSAGE); detailsOverrideReqs = new LinkedList<String>();
detailsOverrideReqs.addAll((List<String>)context.getSessionData(CK.REQ_FAIL_MESSAGE));
} }
if (context.getSessionData(CK.Q_INITIAL_EVENT) != null) { if (context.getSessionData(CK.Q_INITIAL_EVENT) != null) {
initialEvent = (String) context.getSessionData(CK.Q_INITIAL_EVENT); initialEvent = (String) context.getSessionData(CK.Q_INITIAL_EVENT);
@ -1656,6 +1665,10 @@ public class QuestFactory implements ConversationAbandonedListener {
permRews = new LinkedList<String>(); permRews = new LinkedList<String>();
permRews.addAll((List<String>) context.getSessionData(CK.REW_PERMISSION)); permRews.addAll((List<String>) context.getSessionData(CK.REW_PERMISSION));
} }
if (context.getSessionData(CK.REW_PERMISSION_WORLDS) != null) {
permWorldRews = new LinkedList<String>();
permWorldRews.addAll((List<String>) context.getSessionData(CK.REW_PERMISSION_WORLDS));
}
if (context.getSessionData(CK.REW_MCMMO_SKILLS) != null) { if (context.getSessionData(CK.REW_MCMMO_SKILLS) != null) {
mcMMOSkillRews = new LinkedList<String>(); mcMMOSkillRews = new LinkedList<String>();
mcMMOSkillAmounts = new LinkedList<Integer>(); mcMMOSkillAmounts = new LinkedList<Integer>();
@ -1676,6 +1689,10 @@ public class QuestFactory implements ConversationAbandonedListener {
customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM); customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
customRewsData = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA); customRewsData = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA);
} }
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) != null) {
detailsOverrideRews = new LinkedList<String>();
detailsOverrideRews.addAll((List<String>)context.getSessionData(CK.REW_DETAILS_OVERRIDE));
}
if (context.getSessionData(CK.PLN_START_DATE) != null) { if (context.getSessionData(CK.PLN_START_DATE) != null) {
startDatePln = (String) context.getSessionData(CK.PLN_START_DATE); startDatePln = (String) context.getSessionData(CK.PLN_START_DATE);
} }
@ -1740,7 +1757,7 @@ public class QuestFactory implements ConversationAbandonedListener {
customReqSec.set("data", customReqsData.get(i)); customReqSec.set("data", customReqsData.get(i));
} }
} }
reqs.set("fail-requirement-message", failMessage); reqs.set("fail-requirement-message", detailsOverrideReqs);
} else { } else {
cs.set("requirements", null); cs.set("requirements", null);
} }
@ -1804,7 +1821,7 @@ public class QuestFactory implements ConversationAbandonedListener {
LinkedList<String> commandEvents; LinkedList<String> commandEvents;
LinkedList<String> commandEventTriggers; LinkedList<String> commandEventTriggers;
Long delay; Long delay;
String overrideDisplay; LinkedList<String> overrideDisplay;
String delayMessage; String delayMessage;
String startMessage; String startMessage;
String completeMessage; String completeMessage;
@ -1992,7 +2009,7 @@ public class QuestFactory implements ConversationAbandonedListener {
script = (String) context.getSessionData(pref + CK.S_DENIZEN); script = (String) context.getSessionData(pref + CK.S_DENIZEN);
} }
if (context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) != null) { if (context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY) != null) {
overrideDisplay = (String) context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY); overrideDisplay = (LinkedList<String>) context.getSessionData(pref + CK.S_OVERRIDE_DISPLAY);
} }
if (context.getSessionData(pref + CK.S_START_MESSAGE) != null) { if (context.getSessionData(pref + CK.S_START_MESSAGE) != null) {
startMessage = (String) context.getSessionData(pref + CK.S_START_MESSAGE); startMessage = (String) context.getSessionData(pref + CK.S_START_MESSAGE);
@ -2124,8 +2141,7 @@ public class QuestFactory implements ConversationAbandonedListener {
stage.set("delay", delay.intValue() / 1000); stage.set("delay", delay.intValue() / 1000);
} }
stage.set("delay-message", delayMessage == null ? delayMessage : delayMessage.replace("\\n", "\n")); stage.set("delay-message", delayMessage == null ? delayMessage : delayMessage.replace("\\n", "\n"));
stage.set("objective-override", overrideDisplay == null ? overrideDisplay stage.set("objective-override", overrideDisplay);
: overrideDisplay.replace("\\n", "\n"));
stage.set("start-message", startMessage == null ? startMessage : startMessage.replace("\\n", "\n")); stage.set("start-message", startMessage == null ? startMessage : startMessage.replace("\\n", "\n"));
stage.set("complete-message", completeMessage == null ? completeMessage stage.set("complete-message", completeMessage == null ? completeMessage
: completeMessage.replace("\\n", "\n")); : completeMessage.replace("\\n", "\n"));
@ -2144,6 +2160,7 @@ public class QuestFactory implements ConversationAbandonedListener {
rews.set("quest-points", questPointsRew); rews.set("quest-points", questPointsRew);
rews.set("exp", expRew); rews.set("exp", expRew);
rews.set("permissions", permRews); rews.set("permissions", permRews);
rews.set("permission-worlds", permWorldRews);
rews.set("commands", commandRews); rews.set("commands", commandRews);
rews.set("commands-override-display", commandDisplayOverrideRews); rews.set("commands-override-display", commandDisplayOverrideRews);
rews.set("mcmmo-skills", mcMMOSkillRews); rews.set("mcmmo-skills", mcMMOSkillRews);
@ -2161,6 +2178,7 @@ public class QuestFactory implements ConversationAbandonedListener {
customRewSec.set("data", customRewsData.get(i)); customRewSec.set("data", customRewsData.get(i));
} }
} }
rews.set("details-override", detailsOverrideRews);
} else { } else {
cs.set("rewards", null); cs.set("rewards", null);
} }

View File

@ -638,15 +638,17 @@ public class Quester {
} }
Requirements reqs = quest.getRequirements(); Requirements reqs = quest.getRequirements();
if (!ignoreOverrides) { if (!ignoreOverrides) {
if (reqs.getFailRequirements() != null) { if (reqs.getDetailsOverride() != null) {
LinkedList<String> requirements = new LinkedList<String>(); LinkedList<String> requirements = new LinkedList<String>();
String message = ChatColor.RED + ConfigUtil.parseString( for (String s : reqs.getDetailsOverride()) {
ChatColor.translateAlternateColorCodes('&', reqs.getFailRequirements()), String message = ChatColor.RED + ConfigUtil.parseString(
quest, getPlayer()); ChatColor.translateAlternateColorCodes('&', s), quest, getPlayer());
if (plugin.getDependencies().getPlaceholderApi() != null) { if (plugin.getDependencies().getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(getPlayer(), message); message = PlaceholderAPI.setPlaceholders(getPlayer(), message);
}
requirements.add(message);
} }
requirements.add(message);
return requirements; return requirements;
} }
} }
@ -770,15 +772,16 @@ public class Quester {
public LinkedList<String> getCurrentObjectives(Quest quest, boolean ignoreOverrides) { public LinkedList<String> getCurrentObjectives(Quest quest, boolean ignoreOverrides) {
if (!ignoreOverrides) { if (!ignoreOverrides) {
if (getCurrentStage(quest) != null) { if (getCurrentStage(quest) != null) {
if (getCurrentStage(quest).objectiveOverride != null) { if (getCurrentStage(quest).objectiveOverrides.isEmpty() == false) {
LinkedList<String> objectives = new LinkedList<String>(); LinkedList<String> objectives = new LinkedList<String>();
String message = ChatColor.GREEN + ConfigUtil.parseString( for (String s: getCurrentStage(quest).objectiveOverrides) {
ChatColor.translateAlternateColorCodes('&', getCurrentStage(quest).objectiveOverride), String message = ChatColor.GREEN + ConfigUtil.parseString(
quest, getPlayer()); ChatColor.translateAlternateColorCodes('&', s), quest, getPlayer());
if (plugin.getDependencies().getPlaceholderApi() != null) { if (plugin.getDependencies().getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(getPlayer(), message); message = PlaceholderAPI.setPlaceholders(getPlayer(), message);
}
objectives.add(message);
} }
objectives.add(message);
return objectives; return objectives;
} }
} }
@ -2226,14 +2229,15 @@ public class Quester {
Enchantment enchantment, EntityType mob, String extra, NPC npc, Location location, DyeColor color, Enchantment enchantment, EntityType mob, String extra, NPC npc, Location location, DyeColor color,
String pass, CustomObjective co) { String pass, CustomObjective co) {
Player p = getPlayer(); Player p = getPlayer();
if (getCurrentStage(quest).objectiveOverride != null) { if (getCurrentStage(quest).objectiveOverrides.isEmpty() == false) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " for (String s: getCurrentStage(quest).objectiveOverrides) {
+ ConfigUtil.parseString(ChatColor.translateAlternateColorCodes('&', String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") "
getCurrentStage(quest).objectiveOverride), quest, p); + ConfigUtil.parseString(ChatColor.translateAlternateColorCodes('&', s), quest, p);
if (plugin.getDependencies().getPlaceholderApi() != null) { if (plugin.getDependencies().getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(p, message); message = PlaceholderAPI.setPlaceholders(p, message);
}
p.sendMessage(message);
} }
p.sendMessage(message);
} else if (objective.equalsIgnoreCase("password")) { } else if (objective.equalsIgnoreCase("password")) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + pass; String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + pass;
p.sendMessage(message); p.sendMessage(message);

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@ public class Requirements {
private String heroesPrimaryClass = null; private String heroesPrimaryClass = null;
private String heroesSecondaryClass = null; private String heroesSecondaryClass = null;
private Map<String, Map<String, Object>> customRequirements = new HashMap<String, Map<String, Object>>(); private Map<String, Map<String, Object>> customRequirements = new HashMap<String, Map<String, Object>>();
private String failRequirements = null; private List<String> detailsOverride = new LinkedList<String>();
public int getMoney() { public int getMoney() {
return money; return money;
@ -106,10 +106,10 @@ public class Requirements {
protected void setCustomRequirements(Map<String, Map<String, Object>> customRequirements) { protected void setCustomRequirements(Map<String, Map<String, Object>> customRequirements) {
this.customRequirements = customRequirements; this.customRequirements = customRequirements;
} }
public String getFailRequirements() { public List<String> getDetailsOverride() {
return failRequirements; return detailsOverride;
} }
public void setFailRequirements(String failRequirements) { public void setDetailsOverride(List<String> detailsOverride) {
this.failRequirements = failRequirements; this.detailsOverride = detailsOverride;
} }
} }

View File

@ -34,6 +34,7 @@ public class Rewards {
private List<Double> heroesAmounts = new LinkedList<Double>(); private List<Double> heroesAmounts = new LinkedList<Double>();
private List<String> phatLoots = new LinkedList<String>(); private List<String> phatLoots = new LinkedList<String>();
private Map<String, Map<String, Object>> customRewards = new HashMap<String, Map<String, Object>>(); private Map<String, Map<String, Object>> customRewards = new HashMap<String, Map<String, Object>>();
private List<String> detailsOverride = new LinkedList<String>();
public int getMoney() { public int getMoney() {
return money; return money;
@ -119,4 +120,10 @@ public class Rewards {
protected void setCustomRewards(Map<String, Map<String, Object>> customRewards) { protected void setCustomRewards(Map<String, Map<String, Object>> customRewards) {
this.customRewards = customRewards; this.customRewards = customRewards;
} }
public List<String> getDetailsOverride() {
return detailsOverride;
}
public void setDetailsOverride(List<String> detailsOverride) {
this.detailsOverride = detailsOverride;
}
} }

View File

@ -127,7 +127,7 @@ public class Stage {
protected String delayMessage = null; protected String delayMessage = null;
protected String completeMessage = null; protected String completeMessage = null;
protected String startMessage = null; protected String startMessage = null;
protected String objectiveOverride = null; protected LinkedList<String> objectiveOverrides = new LinkedList<String>();
protected LinkedList<CustomObjective> customObjectives = new LinkedList<CustomObjective>(); protected LinkedList<CustomObjective> customObjectives = new LinkedList<CustomObjective>();
protected LinkedList<Integer> customObjectiveCounts = new LinkedList<Integer>(); protected LinkedList<Integer> customObjectiveCounts = new LinkedList<Integer>();
protected LinkedList<String> customObjectiveDisplays = new LinkedList<String>(); protected LinkedList<String> customObjectiveDisplays = new LinkedList<String>();
@ -470,12 +470,12 @@ public class Stage {
this.startMessage = startMessage; this.startMessage = startMessage;
} }
public String getObjectiveOverride() { public LinkedList<String> getObjectiveOverrides() {
return objectiveOverride; return objectiveOverrides;
} }
public void setObjectiveOverride(String objectiveOverride) { public void setObjectiveOverrides(LinkedList<String> objectiveOverrides) {
this.objectiveOverride = objectiveOverride; this.objectiveOverrides = objectiveOverrides;
} }
public LinkedList<CustomObjective> getCustomObjectives() { public LinkedList<CustomObjective> getCustomObjectives() {

View File

@ -364,7 +364,8 @@ public class Action {
quest.failQuest(quester); quest.failQuest(quester);
} }
if (timer > 0) { if (timer > 0) {
player.sendMessage(Lang.get(player, "timerStart").replace("<time>", String.valueOf(timer))); player.sendMessage(ChatColor.GREEN + Lang.get(player, "timerStart")
.replace("<time>", ChatColor.RED + String.valueOf(timer) + ChatColor.GREEN));
if (timer > 60) { if (timer > 60) {
quester.getTimers().put(new ActionTimer(quester, quest, 60, false) quester.getTimers().put(new ActionTimer(quester, quest, 60, false)
.runTaskLater(plugin, (timer-60)*20).getTaskId(), quest); .runTaskLater(plugin, (timer-60)*20).getTaskId(), quest);

View File

@ -21,6 +21,7 @@ public abstract class QuestsEditorStringPrompt extends QuestsStringPrompt {
private ConversationContext context; private ConversationContext context;
private QuestFactory factory; private QuestFactory factory;
//TODO - passing factory may be unnecessary
public QuestsEditorStringPrompt(final ConversationContext context, final QuestFactory factory) { public QuestsEditorStringPrompt(final ConversationContext context, final QuestFactory factory) {
this.context = context; this.context = context;
this.factory = factory; this.factory = factory;

View File

@ -38,16 +38,18 @@ import me.blackvein.quests.util.Lang;
import me.blackvein.quests.util.MiscUtil; import me.blackvein.quests.util.MiscUtil;
import me.blackvein.quests.util.RomanNumeral; import me.blackvein.quests.util.RomanNumeral;
/**
* Stores ItemStack in "tempStack" context data<p>
* Stores name in "tempName" context data<p>
* Stores amount in "tempAmount" context data<p>
* Stores durability in "tempData" context data<p>
* Stores enchantments in "tempEnchantments" context data<p>
* Stores display name in "tempDisplay" context data<p>
* Stores lore in "tempLore" context data<p>
* Stores metadata in "tempMeta" context data
*/
public class ItemStackPrompt extends FixedSetPrompt { public class ItemStackPrompt extends FixedSetPrompt {
// Stores ItemStack in "tempStack" context data
// Stores name in "tempName"
// Stores amount in "tempAmount"
// Stores durability in "tempData"
// Stores enchantments in "tempEnchantments"
// Stores display name in "tempDisplay"
// Stores lore in "tempLore"
// Stores metadata in "tempMeta"
private final Prompt oldPrompt; private final Prompt oldPrompt;
public ItemStackPrompt(Prompt old) { public ItemStackPrompt(Prompt old) {

View File

@ -41,14 +41,17 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
private final int size = 3; private final int size = 3;
@Override
public int getSize() { public int getSize() {
return size; return size;
} }
@Override
public String getTitle(ConversationContext context) { public String getTitle(ConversationContext context) {
return Lang.get("optionsTitle").replace("<quest>", (String) context.getSessionData(CK.Q_NAME)); return Lang.get("optionsTitle").replace("<quest>", (String) context.getSessionData(CK.Q_NAME));
} }
@Override
public ChatColor getNumberColor(ConversationContext context, int number) { public ChatColor getNumberColor(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -62,6 +65,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
} }
} }
@Override
public String getSelectionText(ConversationContext context, int number) { public String getSelectionText(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -75,6 +79,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
} }
} }
@Override
public String getAdditionalText(ConversationContext context, int number) { public String getAdditionalText(ConversationContext context, int number) {
return null; return null;
} }
@ -120,10 +125,12 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
return size; return size;
} }
@Override
public String getTitle(ConversationContext context) { public String getTitle(ConversationContext context) {
return null; return null;
} }
@Override
public String getQueryText(ConversationContext context) { public String getQueryText(ConversationContext context) {
String text = "Select '<true>' or '<false>'"; String text = "Select '<true>' or '<false>'";
text = text.replace("<true>", Lang.get("true")); text = text.replace("<true>", Lang.get("true"));
@ -191,10 +198,12 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
return size; return size;
} }
@Override
public String getTitle(ConversationContext context) { public String getTitle(ConversationContext context) {
return null; return null;
} }
@Override
public String getQueryText(ConversationContext context) { public String getQueryText(ConversationContext context) {
return "Pick level of progress sharing"; return "Pick level of progress sharing";
} }
@ -281,14 +290,17 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
private final int size = 3; private final int size = 3;
@Override
public int getSize() { public int getSize() {
return size; return size;
} }
@Override
public String getTitle(ConversationContext context) { public String getTitle(ConversationContext context) {
return ChatColor.DARK_GREEN + Lang.get("optGeneral"); return ChatColor.DARK_GREEN + Lang.get("optGeneral");
} }
@Override
public ChatColor getNumberColor(ConversationContext context, int number) { public ChatColor getNumberColor(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -302,6 +314,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
} }
} }
@Override
public String getSelectionText(ConversationContext context, int number) { public String getSelectionText(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -315,6 +328,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
} }
} }
@Override
public String getAdditionalText(ConversationContext context, int number) { public String getAdditionalText(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -395,14 +409,17 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
private final int size = 5; private final int size = 5;
@Override
public int getSize() { public int getSize() {
return size; return size;
} }
@Override
public String getTitle(ConversationContext context) { public String getTitle(ConversationContext context) {
return ChatColor.DARK_GREEN + Lang.get("optMultiplayer"); return ChatColor.DARK_GREEN + Lang.get("optMultiplayer");
} }
@Override
public ChatColor getNumberColor(ConversationContext context, int number) { public ChatColor getNumberColor(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -420,6 +437,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
} }
} }
@Override
public String getSelectionText(ConversationContext context, int number) { public String getSelectionText(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -437,6 +455,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
} }
} }
@Override
public String getAdditionalText(ConversationContext context, int number) { public String getAdditionalText(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:

View File

@ -0,0 +1,85 @@
package me.blackvein.quests.convo.quests.prompts;
import org.bukkit.ChatColor;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
import me.blackvein.quests.util.Lang;
public class OverridePrompt extends QuestsEditorStringPrompt {
private final Prompt oldPrompt;
private String promptText;
private String classPrefix;
public OverridePrompt(ConversationContext context, Prompt old, String promptText) {
super(context, null);
oldPrompt = old;
classPrefix = old.getClass().getSimpleName();
this.promptText = promptText;
}
private final int size = 1;
public int getSize() {
return size;
}
@Override
public String getTitle(ConversationContext context) {
return null;
}
@Override
public String getQueryText(ConversationContext context) {
return null;
}
@Override
public String getPromptText(ConversationContext context) {
QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, null, this);
context.getPlugin().getServer().getPluginManager().callEvent(event);
String text = ChatColor.YELLOW + promptText + "\n";;
return text;
}
@Override
public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdClear")) == false
&& input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) {
context.setSessionData(classPrefix + "-override", input);
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("cleared"));
context.setSessionData(classPrefix + "-override", null);
}
return oldPrompt;
}
public static class Builder {
private ConversationContext context;
private Prompt oldPrompt;
private String promptText = "Enter input";
public Builder context(ConversationContext context) {
this.context = context;
return this;
}
public Builder source(Prompt prompt) {
this.oldPrompt = prompt;
return this;
}
public Builder promptText(String text) {
this.promptText = text;
return this;
}
public OverridePrompt build() {
return new OverridePrompt(context, oldPrompt, promptText);
}
}
}

View File

@ -127,7 +127,9 @@ public class QuestOfferPrompt extends StringPrompt {
plugin.getConversationFactory().buildConversation((Conversable) player).begin(); plugin.getConversationFactory().buildConversation((Conversable) player).begin();
} }
} else { } else {
player.sendMessage(q.getRequirements().getFailRequirements()); for (String msg : q.getRequirements().getDetailsOverride()) {
player.sendMessage(msg);
}
} }
} else if (quester.getCurrentQuests().containsKey(q) == false) { } else if (quester.getCurrentQuests().containsKey(q) == false) {
String msg = Lang.get("questMaxAllowed"); String msg = Lang.get("questMaxAllowed");

View File

@ -43,6 +43,7 @@ import me.blackvein.quests.util.MiscUtil;
public class RequirementsPrompt extends QuestsEditorNumericPrompt { public class RequirementsPrompt extends QuestsEditorNumericPrompt {
private final Quests plugin; private final Quests plugin;
private final String classPrefix;
private final QuestFactory factory; private final QuestFactory factory;
private boolean hasRequirement = false; private boolean hasRequirement = false;
private final int size = 11; private final int size = 11;
@ -50,6 +51,7 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
public RequirementsPrompt(Quests plugin, ConversationContext context, QuestFactory qf) { public RequirementsPrompt(Quests plugin, ConversationContext context, QuestFactory qf) {
super(context, qf); super(context, qf);
this.plugin = plugin; this.plugin = plugin;
this.classPrefix = getClass().getSimpleName();
this.factory = qf; this.factory = qf;
} }
@ -91,6 +93,16 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
return ChatColor.BLUE; return ChatColor.BLUE;
} }
case 11: case 11:
if (context.getSessionData(CK.REQ_FAIL_MESSAGE) == null) {
if (!hasRequirement) {
return ChatColor.GRAY;
} else {
return ChatColor.BLUE;
}
} else {
return ChatColor.BLUE;
}
case 12:
return ChatColor.GREEN; return ChatColor.GREEN;
default: default:
return null; return null;
@ -119,9 +131,9 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
return ChatColor.DARK_PURPLE + Lang.get("reqSetCustom"); return ChatColor.DARK_PURPLE + Lang.get("reqSetCustom");
case 10: case 10:
if (!hasRequirement) { if (!hasRequirement) {
return ChatColor.GRAY + Lang.get("reqSetFail"); return ChatColor.GRAY + Lang.get("overrideCreateAdd");
} else { } else {
return ChatColor.YELLOW + Lang.get("reqSetFail"); return ChatColor.YELLOW + Lang.get("overrideCreateAdd");
} }
case 11: case 11:
return ChatColor.YELLOW + Lang.get("done"); return ChatColor.YELLOW + Lang.get("done");
@ -251,22 +263,34 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} }
} else { } else {
return ChatColor.GRAY + "(" + ChatColor.AQUA + "\"" + context.getSessionData(CK.REQ_FAIL_MESSAGE)+ "\"" String text = "\n";
+ ChatColor.GRAY + ")"; LinkedList<String> overrides = new LinkedList<String>();
overrides.addAll((List<String>) context.getSessionData(CK.REQ_FAIL_MESSAGE));
for (int i = 0; i < overrides.size(); i++) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + overrides.get(i) + "\n";
}
return text;
} }
case 11: case 11:
case 12:
case 13:
case 14:
case 15:
return ""; return "";
default: default:
return null; return null;
} }
} }
@SuppressWarnings("unchecked")
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
// Checkadd newly made override
if (context.getSessionData(classPrefix + "-override") != null) {
LinkedList<String> overrides = new LinkedList<String>();
if (context.getSessionData(CK.REQ_FAIL_MESSAGE) != null) {
overrides.addAll((List<String>) context.getSessionData(CK.REQ_FAIL_MESSAGE));
}
overrides.add((String) context.getSessionData(classPrefix + "-override"));
context.setSessionData(CK.REQ_FAIL_MESSAGE, overrides);
context.setSessionData(classPrefix + "-override", null);
}
checkRequirement(context); checkRequirement(context);
QuestsEditorPostOpenNumericPromptEvent event QuestsEditorPostOpenNumericPromptEvent event
@ -314,7 +338,10 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
return new CustomRequirementsPrompt(); return new CustomRequirementsPrompt();
case 10: case 10:
if (hasRequirement) { if (hasRequirement) {
return new FailMessagePrompt(); return new OverridePrompt.Builder()
.source(this)
.promptText(Lang.get("overrideCreateEnter"))
.build();
} else { } else {
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
return new RequirementsPrompt(plugin, context, factory); return new RequirementsPrompt(plugin, context, factory);
@ -326,7 +353,7 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
} }
} }
public void checkRequirement(ConversationContext context) { public boolean checkRequirement(ConversationContext context) {
if (context.getSessionData(CK.REQ_MONEY) != null if (context.getSessionData(CK.REQ_MONEY) != null
|| context.getSessionData(CK.REQ_QUEST_POINTS) != null || context.getSessionData(CK.REQ_QUEST_POINTS) != null
|| context.getSessionData(CK.REQ_ITEMS) != null || context.getSessionData(CK.REQ_ITEMS) != null
@ -338,7 +365,9 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|| context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null || context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null
|| context.getSessionData(CK.REQ_CUSTOM) != null) { || context.getSessionData(CK.REQ_CUSTOM) != null) {
hasRequirement = true; hasRequirement = true;
return true;
} }
return false;
} }
private class MoneyPrompt extends StringPrompt { private class MoneyPrompt extends StringPrompt {
@ -573,13 +602,13 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
// Check/add newly made item // Check/add newly made item
if (context.getSessionData("newItem") != null) { if (context.getSessionData("newItem") != null) {
if (context.getSessionData(CK.REQ_ITEMS) != null) { if (context.getSessionData(CK.REQ_ITEMS) != null) {
List<ItemStack> itemRews = getItems(context); List<ItemStack> itemReqs = getItems(context);
itemRews.add((ItemStack) context.getSessionData("tempStack")); itemReqs.add((ItemStack) context.getSessionData("tempStack"));
context.setSessionData(CK.REQ_ITEMS, itemRews); context.setSessionData(CK.REQ_ITEMS, itemReqs);
} else { } else {
LinkedList<ItemStack> itemRews = new LinkedList<ItemStack>(); LinkedList<ItemStack> itemReqs = new LinkedList<ItemStack>();
itemRews.add((ItemStack) context.getSessionData("tempStack")); itemReqs.add((ItemStack) context.getSessionData("tempStack"));
context.setSessionData(CK.REQ_ITEMS, itemRews); context.setSessionData(CK.REQ_ITEMS, itemReqs);
} }
context.setSessionData("newItem", null); context.setSessionData("newItem", null);
context.setSessionData("tempStack", null); context.setSessionData("tempStack", null);
@ -1162,20 +1191,4 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
} }
} }
} }
private class FailMessagePrompt extends StringPrompt {
@Override
public String getPromptText(ConversationContext context) {
return ChatColor.YELLOW + Lang.get("reqFailMessagePrompt");
}
@Override
public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase(Lang.get(Lang.get("cancel"))) == false) {
context.setSessionData(CK.REQ_FAIL_MESSAGE, input);
}
return new RequirementsPrompt(plugin, context, factory);
}
}
} }

View File

@ -43,12 +43,15 @@ import me.blackvein.quests.util.MiscUtil;
public class RewardsPrompt extends QuestsEditorNumericPrompt { public class RewardsPrompt extends QuestsEditorNumericPrompt {
private final Quests plugin; private final Quests plugin;
private final String classPrefix;
private final QuestFactory factory; private final QuestFactory factory;
private final int size = 11; private boolean hasReward = false;
private final int size = 12;
public RewardsPrompt(Quests plugin, ConversationContext context, QuestFactory qf) { public RewardsPrompt(Quests plugin, ConversationContext context, QuestFactory qf) {
super(context, qf); super(context, qf);
this.plugin = plugin; this.plugin = plugin;
this.classPrefix = getClass().getSimpleName();
factory = qf; factory = qf;
} }
@ -63,6 +66,11 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
public ChatColor getNumberColor(ConversationContext context, int number) { public ChatColor getNumberColor(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
if (plugin.getDependencies().getVaultEconomy() != null) {
return ChatColor.BLUE;
} else {
return ChatColor.GRAY;
}
case 2: case 2:
case 3: case 3:
case 4: case 4:
@ -90,6 +98,16 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
case 10: case 10:
return ChatColor.BLUE; return ChatColor.BLUE;
case 11: case 11:
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) == null) {
if (!hasReward) {
return ChatColor.GRAY;
} else {
return ChatColor.BLUE;
}
} else {
return ChatColor.BLUE;
}
case 12:
return ChatColor.GREEN; return ChatColor.GREEN;
default: default:
return null; return null;
@ -119,6 +137,12 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
case 10: case 10:
return ChatColor.DARK_PURPLE + Lang.get("rewSetCustom"); return ChatColor.DARK_PURPLE + Lang.get("rewSetCustom");
case 11: case 11:
if (!hasReward) {
return ChatColor.GRAY + Lang.get("overrideCreateAdd");
} else {
return ChatColor.YELLOW + Lang.get("overrideCreateAdd");
}
case 12:
return ChatColor.YELLOW + Lang.get("done"); return ChatColor.YELLOW + Lang.get("done");
default: default:
return null; return null;
@ -129,13 +153,18 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
public String getAdditionalText(ConversationContext context, int number) { public String getAdditionalText(ConversationContext context, int number) {
switch (number) { switch (number) {
case 1: case 1:
if (context.getSessionData(CK.REW_MONEY) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; if (plugin.getDependencies().getVaultEconomy() != null) {
if (context.getSessionData(CK.REW_MONEY) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else {
int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
+ (moneyRew > 1 ? plugin.getDependencies().getCurrency(true)
: plugin.getDependencies().getCurrency(false)) + ChatColor.GRAY + ")";
}
} else { } else {
int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY); return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
+ (moneyRew > 1 ? plugin.getDependencies().getCurrency(true)
: plugin.getDependencies().getCurrency(false)) + ChatColor.GRAY + ")";
} }
case 2: case 2:
if (context.getSessionData(CK.REW_QUEST_POINTS) == null) { if (context.getSessionData(CK.REW_QUEST_POINTS) == null) {
@ -148,7 +177,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(CK.REW_ITEMS) == null) { if (context.getSessionData(CK.REW_ITEMS) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
String text = ""; String text = "\n";
LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(CK.REW_ITEMS); LinkedList<ItemStack> items = (LinkedList<ItemStack>) context.getSessionData(CK.REW_ITEMS);
for (int i = 0; i < items.size(); i++) { for (int i = 0; i < items.size(); i++) {
text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getName(items.get(i)) text += ChatColor.GRAY + " - " + ChatColor.BLUE + ItemUtil.getName(items.get(i))
@ -167,7 +196,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(CK.REW_COMMAND) == null) { if (context.getSessionData(CK.REW_COMMAND) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
String text = ""; String text = "\n";
List<String> commands = (List<String>) context.getSessionData(CK.REW_COMMAND); List<String> commands = (List<String>) context.getSessionData(CK.REW_COMMAND);
List<String> overrides = (List<String>) context.getSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY); List<String> overrides = (List<String>) context.getSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY);
int index = 0; int index = 0;
@ -188,10 +217,20 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(CK.REW_PERMISSION) == null) { if (context.getSessionData(CK.REW_PERMISSION) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
String text = ""; String text = "\n";
List<String> permissions = (List<String>) context.getSessionData(CK.REW_PERMISSION); List<String> permissions = (List<String>) context.getSessionData(CK.REW_PERMISSION);
List<String> worlds = (List<String>) context.getSessionData(CK.REW_PERMISSION_WORLDS);
int index = 0;
for (String perm : permissions) { for (String perm : permissions) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + perm + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + perm;
if (worlds != null) {
if (index < worlds.size()) {
text += ChatColor.GRAY + "[" + ChatColor.DARK_AQUA + worlds.get(index)
+ ChatColor.GRAY + "]";
}
}
text += "\n";
index++;
} }
return text; return text;
} }
@ -200,7 +239,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) { if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
String text = ""; String text = "\n";
List<String> skills = (List<String>) context.getSessionData(CK.REW_MCMMO_SKILLS); List<String> skills = (List<String>) context.getSessionData(CK.REW_MCMMO_SKILLS);
List<Integer> amounts = (List<Integer>) context.getSessionData(CK.REW_MCMMO_AMOUNTS); List<Integer> amounts = (List<Integer>) context.getSessionData(CK.REW_MCMMO_AMOUNTS);
for (String skill : skills) { for (String skill : skills) {
@ -217,7 +256,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) { if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
String text = ""; String text = "\n";
List<String> heroClasses = (List<String>) context.getSessionData(CK.REW_HEROES_CLASSES); List<String> heroClasses = (List<String>) context.getSessionData(CK.REW_HEROES_CLASSES);
List<Double> amounts = (List<Double>) context.getSessionData(CK.REW_HEROES_AMOUNTS); List<Double> amounts = (List<Double>) context.getSessionData(CK.REW_HEROES_AMOUNTS);
for (String heroClass : heroClasses) { for (String heroClass : heroClasses) {
@ -235,7 +274,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) { if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
String text = ""; String text = "\n";
List<String> phatLoots = (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS); List<String> phatLoots = (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS);
for (String phatLoot : phatLoots) { for (String phatLoot : phatLoots) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + phatLoot + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + phatLoot + "\n";
@ -249,7 +288,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(CK.REW_CUSTOM) == null) { if (context.getSessionData(CK.REW_CUSTOM) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
String text = ""; String text = "\n";
LinkedList<String> customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM); LinkedList<String> customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
for (String s : customRews) { for (String s : customRews) {
text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s
@ -258,18 +297,43 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
return text; return text;
} }
case 11: case 11:
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) == null) {
if (!hasReward) {
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
} else {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
}
} else {
String text = "\n";
LinkedList<String> overrides = new LinkedList<String>();
overrides.addAll((List<String>) context.getSessionData(CK.REW_DETAILS_OVERRIDE));
for (int i = 0; i < overrides.size(); i++) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + overrides.get(i) + "\n";
}
return text;
}
case 12: case 12:
case 13:
case 14:
case 15:
return ""; return "";
default: default:
return null; return null;
} }
} }
@SuppressWarnings("unchecked")
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
// Check/add newly made override
if (context.getSessionData(classPrefix + "-override") != null) {
LinkedList<String> overrides = new LinkedList<String>();
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) != null) {
overrides.addAll((List<String>) context.getSessionData(CK.REW_DETAILS_OVERRIDE));
}
overrides.add((String) context.getSessionData(classPrefix + "-override"));
context.setSessionData(CK.REW_DETAILS_OVERRIDE, overrides);
context.setSessionData(classPrefix + "-override", null);
}
checkReward(context);
QuestsEditorPostOpenNumericPromptEvent event QuestsEditorPostOpenNumericPromptEvent event
= new QuestsEditorPostOpenNumericPromptEvent(context, factory, this); = new QuestsEditorPostOpenNumericPromptEvent(context, factory, this);
plugin.getServer().getPluginManager().callEvent(event); plugin.getServer().getPluginManager().callEvent(event);
@ -288,7 +352,11 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) { protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
switch (input.intValue()) { switch (input.intValue()) {
case 1: case 1:
return new MoneyPrompt(); if (plugin.getDependencies().getVaultEconomy() != null) {
return new MoneyPrompt();
} else {
return new RewardsPrompt(plugin, context, factory);
}
case 2: case 2:
return new QuestPointsPrompt(); return new QuestPointsPrompt();
case 3: case 3:
@ -296,9 +364,9 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
case 4: case 4:
return new ExperiencePrompt(); return new ExperiencePrompt();
case 5: case 5:
return new CommandsListPrompt(); return new CommandsPrompt();
case 6: case 6:
return new PermissionsPrompt(); return new PermissionsListPrompt(context, factory);
case 7: case 7:
if (plugin.getDependencies().getMcmmoClassic() != null) { if (plugin.getDependencies().getMcmmoClassic() != null) {
return new mcMMOListPrompt(); return new mcMMOListPrompt();
@ -320,11 +388,38 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
case 10: case 10:
return new CustomRewardsPrompt(); return new CustomRewardsPrompt();
case 11: case 11:
if (hasReward) {
return new OverridePrompt.Builder()
.source(this)
.promptText(Lang.get("overrideCreateEnter"))
.build();
} else {
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
return new RewardsPrompt(plugin, context, factory);
}
case 12:
return factory.returnToMenu(context); return factory.returnToMenu(context);
default: default:
return null; return null;
} }
} }
public boolean checkReward(ConversationContext context) {
if (context.getSessionData(CK.REW_MONEY) != null
|| context.getSessionData(CK.REW_EXP) != null
|| context.getSessionData(CK.REW_QUEST_POINTS) != null
|| context.getSessionData(CK.REW_ITEMS) != null
|| context.getSessionData(CK.REW_COMMAND) != null
|| context.getSessionData(CK.REW_PERMISSION) != null
|| context.getSessionData(CK.REW_MCMMO_SKILLS) != null
|| context.getSessionData(CK.REW_HEROES_CLASSES) != null
|| context.getSessionData(CK.REW_PHAT_LOOTS) != null
|| context.getSessionData(CK.REW_CUSTOM) != null) {
hasReward = true;
return true;
}
return false;
}
private class MoneyPrompt extends StringPrompt { private class MoneyPrompt extends StringPrompt {
@ -494,81 +589,6 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
return (List<ItemStack>) context.getSessionData(CK.REW_ITEMS); return (List<ItemStack>) context.getSessionData(CK.REW_ITEMS);
} }
} }
private class CommandsListPrompt extends FixedSetPrompt {
public CommandsListPrompt() {
super("1", "2", "3", "4");
}
@Override
public String getPromptText(ConversationContext context) {
String text = ChatColor.GOLD + "- " + Lang.get("rewCommands") + " -\n";
if (context.getSessionData(CK.REW_COMMAND) == null) {
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - "
+ Lang.get("rewSetCommands") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.GRAY + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.GRAY + " - "
+ Lang.get("rewSetCommandsOverrides") + " (" + Lang.get("noneSet") + ")\n";
text += ChatColor.RED + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - "
+ Lang.get("clear") + "\n";
text += ChatColor.GREEN + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - "
+ Lang.get("done");
} else {
text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - "
+ Lang.get("rewSetCommands") + "\n";
for (String s : getCommand(context)) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
if (context.getSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY) == null) {
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - "
+ Lang.get("rewSetCommandsOverrides") + " (" + Lang.get("stageEditorOptional") + ")\n";
} else {
text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - "
+ Lang.get("rewSetCommandsOverrides") + "\n";
for (String s : getCommandOverrideDisplay(context)) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
}
text += ChatColor.RED + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - "
+ Lang.get("clear") + "\n";
text += ChatColor.GREEN + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - "
+ Lang.get("done");
}
return text;
}
@Override
protected Prompt acceptValidatedInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase("1")) {
return new CommandsPrompt();
} else if (input.equalsIgnoreCase("2")) {
if (context.getSessionData(CK.REW_COMMAND) == null) {
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewNoCommands"));
return new CommandsListPrompt();
} else {
return new CommandsOverrideDisplayPrompt();
}
} else if (input.equalsIgnoreCase("3")) {
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCommandsCleared"));
context.setSessionData(CK.REW_COMMAND, null);
context.setSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY, null);
return new CommandsListPrompt();
} else if (input.equalsIgnoreCase("4")) {
return new RewardsPrompt(plugin, context, factory);
}
return null;
}
@SuppressWarnings("unchecked")
private List<String> getCommand(ConversationContext context) {
return (List<String>) context.getSessionData(CK.REW_COMMAND);
}
@SuppressWarnings("unchecked")
private List<String> getCommandOverrideDisplay(ConversationContext context) {
return (List<String>) context.getSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY);
}
}
private class CommandsPrompt extends StringPrompt { private class CommandsPrompt extends StringPrompt {
@ -597,37 +617,137 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.setSessionData(CK.REW_COMMAND, null); context.setSessionData(CK.REW_COMMAND, null);
} }
return new CommandsListPrompt(); return new RewardsPrompt(plugin, context, factory);
} }
} }
private class CommandsOverrideDisplayPrompt extends StringPrompt { private class PermissionsListPrompt extends QuestsEditorNumericPrompt {
public PermissionsListPrompt(ConversationContext context, QuestFactory factory) {
super(context, factory);
}
private final int size = 4;
@Override
public int getSize() {
return size;
}
@Override
public String getTitle(ConversationContext context) {
return Lang.get("permissionRewardsTitle");
}
@Override
public ChatColor getNumberColor(ConversationContext context, int number) {
switch (number) {
case 1:
return ChatColor.BLUE;
case 2:
if (context.getSessionData(CK.REW_PERMISSION) == null) {
return ChatColor.GRAY;
} else {
return ChatColor.BLUE;
}
case 3:
return ChatColor.RED;
case 4:
return ChatColor.GREEN;
default:
return null;
}
}
@Override
public String getSelectionText(ConversationContext context, int number) {
switch (number) {
case 1:
return ChatColor.YELLOW + Lang.get("rewSetPermission");
case 2:
if (context.getSessionData(CK.REW_PERMISSION) == null) {
return ChatColor.GRAY + Lang.get("rewSetPermissionWorlds");
} else {
return ChatColor.YELLOW + Lang.get("rewSetPermissionWorlds");
}
case 3:
return ChatColor.RED + Lang.get("clear");
case 4:
return ChatColor.GREEN + Lang.get("done");
default:
return null;
}
}
@SuppressWarnings("unchecked")
@Override
public String getAdditionalText(ConversationContext context, int number) {
switch (number) {
case 1:
if (context.getSessionData(CK.REW_PERMISSION) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else {
String text = "\n";
for (String s : (List<String>) context.getSessionData(CK.REW_PERMISSION)) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
return text;
}
case 2:
if (context.getSessionData(CK.REW_PERMISSION) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else {
if (context.getSessionData(CK.REW_PERMISSION_WORLDS) == null) {
return ChatColor.YELLOW + "(" + Lang.get("stageEditorOptional") + ")";
} else {
String text = "\n";
for (String s : (List<String>) context.getSessionData(CK.REW_PERMISSION_WORLDS)) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
}
return text;
}
}
case 3:
case 4:
return "";
default:
return null;
}
}
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = ChatColor.YELLOW + Lang.get("rewCommandsOverridePrompt") + "\n"; QuestsEditorPostOpenNumericPromptEvent event
text += ChatColor.ITALIC + "" + ChatColor.GOLD + Lang.get("rewCommandsOverrideHint"); = new QuestsEditorPostOpenNumericPromptEvent(context, factory, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context) + "\n";
for (int i = 1; i <= size; i++) {
text += getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - "
+ getSelectionText(context, i) + " " + getAdditionalText(context, i) + "\n";
}
return text; return text;
} }
@Override @Override
public Prompt acceptInput(ConversationContext context, String input) { protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false switch (input.intValue()) {
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { case 1:
String[] args = input.split(Lang.get("charSemi")); return new PermissionsPrompt();
List<String> overrides = new LinkedList<String>(); case 2:
for (String s : args) { return new PermissionsWorldsPrompt();
if (s.startsWith("/")) { case 3:
s = s.substring(1); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewPermissionsCleared"));
} context.setSessionData(CK.REW_PERMISSION, null);
overrides.add(s); context.setSessionData(CK.REW_PERMISSION_WORLDS, null);
} return new PermissionsListPrompt(context, factory);
context.setSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY, overrides.isEmpty() ? null : overrides); case 4:
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { return new RewardsPrompt(plugin, context, factory);
context.setSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY, null); default:
return null;
} }
return new CommandsListPrompt();
} }
} }
private class PermissionsPrompt extends StringPrompt { private class PermissionsPrompt extends StringPrompt {
@ -648,7 +768,36 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.setSessionData(CK.REW_PERMISSION, null); context.setSessionData(CK.REW_PERMISSION, null);
} }
return new RewardsPrompt(plugin, context, factory); return new PermissionsListPrompt(context, factory);
}
}
private class PermissionsWorldsPrompt extends StringPrompt {
@Override
public String getPromptText(ConversationContext context) {
return ChatColor.YELLOW + Lang.get("rewPermissionsWorldPrompt");
}
@Override
public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
String[] args = input.split(Lang.get("charSemi"));
List<String> worlds = new LinkedList<String>();
worlds.addAll(Arrays.asList(args));
for (String w : worlds) {
if (!w.equals("null") && w != null && plugin.getServer().getWorld(w) == null) {
context.getForWhom().sendRawMessage(ChatColor.RED + w + " "
+ Lang.get("eventEditorInvalidWorld"));
return new PermissionsWorldsPrompt();
}
}
context.setSessionData(CK.REW_PERMISSION_WORLDS, worlds);
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.setSessionData(CK.REW_PERMISSION_WORLDS, null);
}
return new PermissionsListPrompt(context, factory);
} }
} }

View File

@ -14,6 +14,7 @@ package me.blackvein.quests.tasks;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import de.erethon.dungeonsxl.util.commons.chat.ChatColor;
import me.blackvein.quests.Quest; import me.blackvein.quests.Quest;
import me.blackvein.quests.Quester; import me.blackvein.quests.Quester;
import me.blackvein.quests.util.Lang; import me.blackvein.quests.util.Lang;
@ -39,8 +40,8 @@ public class ActionTimer extends BukkitRunnable {
quest.failQuest(quester); quest.failQuest(quester);
quester.updateJournal(); quester.updateJournal();
} else { } else {
quester.getPlayer().sendMessage(Lang.get(quester.getPlayer(), "timerMessage") quester.getPlayer().sendMessage(ChatColor.GREEN + Lang.get(quester.getPlayer(), "timerMessage")
.replace("<time>", String.valueOf(time))); .replace("<time>", ChatColor.RED + String.valueOf(time) + ChatColor.GREEN));
} }
} }
} }

View File

@ -119,6 +119,7 @@ public class CK {
public static final String REW_COMMAND = "commandRews"; public static final String REW_COMMAND = "commandRews";
public static final String REW_COMMAND_OVERRIDE_DISPLAY = "commandOverrideDisplay"; public static final String REW_COMMAND_OVERRIDE_DISPLAY = "commandOverrideDisplay";
public static final String REW_PERMISSION = "permissionRews"; public static final String REW_PERMISSION = "permissionRews";
public static final String REW_PERMISSION_WORLDS = "permissionWorlds";
public static final String REW_MCMMO_SKILLS = "mcMMOSkillRews"; public static final String REW_MCMMO_SKILLS = "mcMMOSkillRews";
public static final String REW_MCMMO_AMOUNTS = "mcMMOSkillAmounts"; public static final String REW_MCMMO_AMOUNTS = "mcMMOSkillAmounts";
public static final String REW_HEROES_CLASSES = "heroesClassRews"; public static final String REW_HEROES_CLASSES = "heroesClassRews";
@ -128,6 +129,7 @@ public class CK {
public static final String REW_CUSTOM_DATA = "customRewData"; public static final String REW_CUSTOM_DATA = "customRewData";
public static final String REW_CUSTOM_DATA_DESCRIPTIONS = "customRewDataDesc"; public static final String REW_CUSTOM_DATA_DESCRIPTIONS = "customRewDataDesc";
public static final String REW_CUSTOM_DATA_TEMP = "customRewDataTemp"; public static final String REW_CUSTOM_DATA_TEMP = "customRewDataTemp";
public static final String REW_DETAILS_OVERRIDE = "detailsOverrideRew";
// Planner // Planner
public static final String PLN_START_DATE = "startDatePln"; public static final String PLN_START_DATE = "startDatePln";
public static final String PLN_END_DATE = "endDatePln"; public static final String PLN_END_DATE = "endDatePln";

View File

@ -183,7 +183,6 @@ stageEditorSetShearAmounts: "Set shear amounts"
stageEditorPassword: "Password" stageEditorPassword: "Password"
stageEditorAddPasswordDisplay: "Add password display" stageEditorAddPasswordDisplay: "Add password display"
stageEditorAddPasswordPhrases: "Add password phrase(s)" stageEditorAddPasswordPhrases: "Add password phrase(s)"
stageEditorObjectiveOverride: "Objective display override"
stageEditorCustom: "Custom objectives" stageEditorCustom: "Custom objectives"
stageEditorNoModules: "No modules loaded" stageEditorNoModules: "No modules loaded"
stageEditorModuleNotFound: "Custom objective module not found." stageEditorModuleNotFound: "Custom objective module not found."
@ -217,20 +216,15 @@ stageEditorShearColorsPrompt: "Enter sheep colors, <space>, <cancel>"
stageEditorShearAmountsPrompt: "Enter shear amounts, <space>, <cancel>" stageEditorShearAmountsPrompt: "Enter shear amounts, <space>, <cancel>"
stageEditorEventsPrompt: "Enter an action name, <clear>, <cancel>" stageEditorEventsPrompt: "Enter an action name, <clear>, <cancel>"
stageEditorChatEventsPrompt: "Enter an action name to add, <clear>, <cancel>" stageEditorChatEventsPrompt: "Enter an action name to add, <clear>, <cancel>"
stageEditorChatEventsTriggerPrompt: "%yellow%Enter a chat trigger for%aqua% <action>%yellow% <cancel>" stageEditorChatEventsTriggerPrompt: "Enter a chat trigger for <action>, <cancel>"
stageEditorCommandEventsPrompt: "Enter an action name to add, <clear>, <cancel>" stageEditorCommandEventsPrompt: "Enter an action name to add, <clear>, <cancel>"
stageEditorCommandEventsTriggerPrompt: "%yellow%Enter a command trigger for%aqua% <action>%yellow% <cancel>" stageEditorCommandEventsTriggerPrompt: "Enter a command trigger for <action>, <cancel>"
stageEditorDelayMessagePrompt: "Enter delay message, <clear>, <cancel>" stageEditorDelayMessagePrompt: "Enter delay message, <clear>, <cancel>"
stageEditorScriptPrompt: "Enter script name, <clear>, <cancel>" stageEditorScriptPrompt: "Enter script name, <clear>, <cancel>"
stageEditorStartMessagePrompt: "Enter start message, <clear>, <cancel>" stageEditorStartMessagePrompt: "Enter start message, <clear>, <cancel>"
stageEditorCompleteMessagePrompt: "Enter complete message, <clear>, <cancel>" stageEditorCompleteMessagePrompt: "Enter complete message, <clear>, <cancel>"
stageEditorPasswordDisplayPrompt: "Enter password display, <cancel>" stageEditorPasswordDisplayPrompt: "Enter password hint message, <cancel>"
stageEditorPasswordDisplayHint: "(This is the text that will be displayed to the player as their objective)" stageEditorPasswordPhrasePrompt: "Enter password phrases to accept, <semicolon>, <cancel>"
stageEditorPasswordPhrasePrompt: "Enter password phrases, <semicolon>, <cancel>"
stageEditorPasswordPhraseHint: "(This is the text that a player must enter to complete the objective)"
stageEditorObjectiveOverridePrompt: "Enter objective display override, <clear>, <cancel>"
stageEditorObjectiveOverrideHint: "(This override will display your own text as the objective)"
stageEditorObjectiveOverrideCleared: "Objective display override cleared."
stageEditorDeliveryAddItem: "Add item" stageEditorDeliveryAddItem: "Add item"
stageEditorDeliveryNPCs: "Set NPC IDs" stageEditorDeliveryNPCs: "Set NPC IDs"
stageEditorDeliveryMessages: "Set delivery messages" stageEditorDeliveryMessages: "Set delivery messages"
@ -410,7 +404,6 @@ reqSetQuestBlocks: "Set Quest blocks"
reqSetMcMMO: "Set mcMMO Classic requirements" reqSetMcMMO: "Set mcMMO Classic requirements"
reqSetHeroes: "Set Heroes requirements" reqSetHeroes: "Set Heroes requirements"
reqSetCustom: "Set custom requirements" reqSetCustom: "Set custom requirements"
reqSetFail: "Set fail requirements message"
reqSetSkills: "Set skills" reqSetSkills: "Set skills"
reqSetSkillAmounts: "Set skill amounts" reqSetSkillAmounts: "Set skill amounts"
reqHeroesSetPrimary: "Set Primary Class" reqHeroesSetPrimary: "Set Primary Class"
@ -426,7 +419,6 @@ reqMcMMOPrompt: "Enter mcMMO Classic skills, <space>, <clear>, <cancel>"
reqMcMMOAmountsPrompt: "Enter mcMMO Classic skill amounts, <space>, <clear>, <cancel>" reqMcMMOAmountsPrompt: "Enter mcMMO Classic skill amounts, <space>, <clear>, <cancel>"
reqHeroesPrimaryPrompt: "Enter a Heroes Primary Class name, <clear>, <cancel>" reqHeroesPrimaryPrompt: "Enter a Heroes Primary Class name, <clear>, <cancel>"
reqHeroesSecondaryPrompt: "Enter a Heroes Secondary Class name, <clear>, <cancel>" reqHeroesSecondaryPrompt: "Enter a Heroes Secondary Class name, <clear>, <cancel>"
reqFailMessagePrompt: "Enter fail requirements message, <cancel>"
reqAddItem: "Add item" reqAddItem: "Add item"
reqSetRemoveItems: "Set remove items" reqSetRemoveItems: "Set remove items"
reqNoItemsSet: "No items set" reqNoItemsSet: "No items set"
@ -471,13 +463,12 @@ rewSetQuestPoints: "Set Quest Points reward"
rewSetItems: "Set item rewards" rewSetItems: "Set item rewards"
rewSetExperience: "Set experience reward" rewSetExperience: "Set experience reward"
rewSetCommands: "Set command rewards" rewSetCommands: "Set command rewards"
rewCommands: "Command rewards"
rewSetCommandsOverrides: "Set command display overrides"
rewCommandsCleared: "Command rewards cleared." rewCommandsCleared: "Command rewards cleared."
rewCommandsOverridePrompt: "Enter command display override, <clear>, <cancel>"
rewCommandsOverrideHint: "(This override will display your own text as the reward)"
rewNoCommands: "You must set commands first!" rewNoCommands: "You must set commands first!"
rewPermissions: "Permission rewards"
rewSetPermission: "Set permission rewards" rewSetPermission: "Set permission rewards"
rewSetPermissionWorlds: "Set permission worlds"
rewPermissionsCleared: "Permission rewards cleared."
rewSetMcMMO: "Set mcMMO Classic skill rewards" rewSetMcMMO: "Set mcMMO Classic skill rewards"
rewSetHeroes: "Set Heroes experience rewards" rewSetHeroes: "Set Heroes experience rewards"
rewSetPhat: "Set PhatLoot rewards" rewSetPhat: "Set PhatLoot rewards"
@ -486,12 +477,11 @@ rewSetHeroesClasses: "Set classes"
rewSetHeroesAmounts: "Set experience amounts" rewSetHeroesAmounts: "Set experience amounts"
rewMoneyPrompt: "Enter amount of <money>, <clear>, <cancel>" rewMoneyPrompt: "Enter amount of <money>, <clear>, <cancel>"
rewExperiencePrompt: "Enter amount of experience, <clear>, <cancel>" rewExperiencePrompt: "Enter amount of experience, <clear>, <cancel>"
rewCommandPrompt: "Enter command rewards, <semicolon>, <clear>, <cancel>" rewCommandPrompt: "Enter command rewards (use '<player>' to represent the player), <semicolon>, <clear>, <cancel>"
rewCommandPromptHint: 'Note: You may put <player> to specify the player who completed the Quest. e.g. smite <player>'
rewPermissionsPrompt: "Enter permission rewards, <space>, <clear>, <cancel>" rewPermissionsPrompt: "Enter permission rewards, <space>, <clear>, <cancel>"
rewPermissionsWorldPrompt: "Enter permission worlds, <semicolon>, <clear>, <cancel>"
rewQuestPointsPrompt: "Enter amount of Quest Points, <clear>, <cancel>" rewQuestPointsPrompt: "Enter amount of Quest Points, <clear>, <cancel>"
rewMcMMOPrompt: "Enter mcMMO Classic skills, <space>, <cancel>" rewMcMMOPrompt: "Enter mcMMO Classic skills (or enter 'All' for all skills), <space>, <cancel>"
rewMcMMOPromptHint: "Note: Typing 'All' will give levels to all skills."
rewHeroesClassesPrompt: "Enter Heroes classes, <space>, <cancel>" rewHeroesClassesPrompt: "Enter Heroes classes, <space>, <cancel>"
rewHeroesExperiencePrompt: "Enter experience amounts (numbers, decimals are allowed), <space>, <cancel>" rewHeroesExperiencePrompt: "Enter experience amounts (numbers, decimals are allowed), <space>, <cancel>"
rewPhatLootsPrompt: "Enter PhatLoots, <space>, <clear>, <cancel>" rewPhatLootsPrompt: "Enter PhatLoots, <space>, <clear>, <cancel>"
@ -542,6 +532,8 @@ dateCreateEnterSecond: "Enter a second (max. 59), <cancel>"
dateCreateEnterOffset: "Enter a UTC time offset (max. 14), <cancel>" dateCreateEnterOffset: "Enter a UTC time offset (max. 14), <cancel>"
dateCreateEnterZone: "Enter a UTC time zone, <cancel>" dateCreateEnterZone: "Enter a UTC time zone, <cancel>"
dateCreateNoYearAmount: "You must set a year first!" dateCreateNoYearAmount: "You must set a year first!"
overrideCreateSet: "Set details list override"
overrideCreateEnter: "Enter replacement text, <clear>, <cancel>"
questObjectivesTitle: "---(<quest>)---" questObjectivesTitle: "---(<quest>)---"
questCompleteTitle: '**QUEST COMPLETE: <quest>**' questCompleteTitle: '**QUEST COMPLETE: <quest>**'
questRewardsTitle: "Rewards:" questRewardsTitle: "Rewards:"
@ -569,6 +561,7 @@ plannerTitle: "- <quest> | Planner -"
optionsTitle: "- <quest> | Options -" optionsTitle: "- <quest> | Options -"
itemRequirementsTitle: "- Item Requirements -" itemRequirementsTitle: "- Item Requirements -"
itemRewardsTitle: "- Item Rewards -" itemRewardsTitle: "- Item Rewards -"
permissionRewardsTitle: "- Permission Rewards -"
mcMMORequirementsTitle: "- mcMMO Classic Requirements -" mcMMORequirementsTitle: "- mcMMO Classic Requirements -"
mcMMORewardsTitle: "- mcMMO Classic Rewards -" mcMMORewardsTitle: "- mcMMO Classic Rewards -"
heroesRequirementsTitle: "- Heroes Requirements -" heroesRequirementsTitle: "- Heroes Requirements -"
@ -732,6 +725,7 @@ noWord: "No"
"true": "true" "true": "true"
"false": "false" "false": "false"
clear: "Clear" clear: "Clear"
cleared: "Cleared"
edit: "Edit" edit: "Edit"
none: "None" none: "None"
done: "Done" done: "Done"
@ -765,8 +759,8 @@ blocksWithin: "within <amount> blocks of"
valRequired: "Value required" valRequired: "Value required"
experience: "Experience" experience: "Experience"
timePrompt: "Enter amount of time (in seconds), <clear>, <cancel>" timePrompt: "Enter amount of time (in seconds), <clear>, <cancel>"
timerMessage: "%green%Time left to finish the quest/stage:%red% <time> seconds" timerMessage: "Time left to finish the quest/stage: <time> seconds"
timerStart: "%green%You have%red% <time> seconds%green% to finish this quest/stage" timerStart: "You have <time> seconds to finish this quest/stage"
questErrorReadingFile: "Error reading Quests file." questErrorReadingFile: "Error reading Quests file."
questSaveError: "An error occurred while saving." questSaveError: "An error occurred while saving."
noPermission: "You do not have permission to do that." noPermission: "You do not have permission to do that."