diff --git a/lib/EpicBossGoldEdition.jar b/lib/EpicBossGoldEdition.jar deleted file mode 100644 index f0a705143..000000000 Binary files a/lib/EpicBossGoldEdition.jar and /dev/null differ diff --git a/lib/EpicBossRecoded.jar b/lib/EpicBossRecoded.jar new file mode 100644 index 000000000..b9bb2921c Binary files /dev/null and b/lib/EpicBossRecoded.jar differ diff --git a/lib/citizensapi-2.0.11-SNAPSHOT.jar b/lib/citizensapi-2.0.11-SNAPSHOT.jar index deb0c189e..bac3ed552 100644 Binary files a/lib/citizensapi-2.0.11-SNAPSHOT.jar and b/lib/citizensapi-2.0.11-SNAPSHOT.jar differ diff --git a/lib/rpgitems.jar b/lib/rpgitems.jar deleted file mode 100644 index 358626d86..000000000 Binary files a/lib/rpgitems.jar and /dev/null differ diff --git a/lib/rpgitems2.jar b/lib/rpgitems2.jar new file mode 100644 index 000000000..29e45c6d6 Binary files /dev/null and b/lib/rpgitems2.jar differ diff --git a/pom.xml b/pom.xml index d988c3f45..c758d3133 100644 --- a/pom.xml +++ b/pom.xml @@ -30,14 +30,14 @@ net.citizensnpcs citizens - 2.0.9-SNAPSHOT + 2.0.11 system ${project.basedir}/lib/citizensapi-2.0.11-SNAPSHOT.jar net.aufdemrand denizen - 0.9.2-SNAPSHOT + 0.9.3-SNAPSHOT system ${project.basedir}/lib/denizen-0.9.3-SNAPSHOT.jar @@ -57,17 +57,10 @@ think.rpgitems - RPGItems - 3.3 + RPGItems2 + 3.0.4 system - ${project.basedir}/lib/rpgitems.jar - - - me.ThaH3lper - EpicBossGoldEdition - 0.0.6 - system - ${project.basedir}/lib/EpicBossGoldEdition.jar + ${project.basedir}/lib/rpgitems2.jar com.herocraftonline @@ -84,7 +77,7 @@ ${project.basedir}/lib/PhatLoots.jar - com.sk89q.worldguard + com.sk89q.worldedit WorldEdit 5.5.8 system diff --git a/src/main/java/me/blackvein/quests/EventFactory.java b/src/main/java/me/blackvein/quests/EventFactory.java index 5893a48e2..93809aa6a 100644 --- a/src/main/java/me/blackvein/quests/EventFactory.java +++ b/src/main/java/me/blackvein/quests/EventFactory.java @@ -12,6 +12,7 @@ import java.util.Map.Entry; import me.blackvein.quests.prompts.ItemStackPrompt; import me.blackvein.quests.util.CK; +import static me.blackvein.quests.util.ColorUtil.PURPLE; import me.blackvein.quests.util.ItemUtil; import me.blackvein.quests.util.Lang; import me.blackvein.quests.util.QuestMob; @@ -218,7 +219,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ context.setSessionData(CK.E_CLEAR_INVENTORY, "Yes"); else context.setSessionData(CK.E_CLEAR_INVENTORY, "No"); - + if (event.failQuest == true) context.setSessionData(CK.E_FAIL_QUEST, "Yes"); else @@ -512,7 +513,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (context.getSessionData(CK.E_CLEAR_INVENTORY) == null) { context.setSessionData(CK.E_CLEAR_INVENTORY, "No"); } - + if (context.getSessionData(CK.E_FAIL_QUEST) == null) { context.setSessionData(CK.E_FAIL_QUEST, "No"); } @@ -696,9 +697,9 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } return new CreateMenuPrompt(); - + } else if (input.equalsIgnoreCase("4")) { - + String s = (String) context.getSessionData(CK.E_FAIL_QUEST); if (s.equalsIgnoreCase("Yes")) { context.setSessionData(CK.E_FAIL_QUEST, "No"); @@ -989,7 +990,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if(s.equalsIgnoreCase("Yes")) section.set("clear-inventory", true); } - + if (context.getSessionData(CK.E_FAIL_QUEST) != null) { String s = getCString(context, CK.E_FAIL_QUEST); if (s.equalsIgnoreCase("Yes")) @@ -2172,6 +2173,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ mobs += PURPLE + "EnderDragon, "; mobs += PURPLE + "Ghast, "; mobs += PURPLE + "Giant, "; + mobs += PURPLE + "Horse, "; mobs += PURPLE + "IronGolem, "; mobs += PURPLE + "MagmaCube, "; mobs += PURPLE + "MushroomCow, "; @@ -2332,7 +2334,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ @Override public Prompt acceptInput(ConversationContext context, String input) { - + float chance; if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) { diff --git a/src/main/java/me/blackvein/quests/PlayerListener.java b/src/main/java/me/blackvein/quests/PlayerListener.java index dda83d30c..8eeb55e64 100644 --- a/src/main/java/me/blackvein/quests/PlayerListener.java +++ b/src/main/java/me/blackvein/quests/PlayerListener.java @@ -1,8 +1,6 @@ package me.blackvein.quests; import java.io.File; -import me.ThaH3lper.com.Mobs.EpicMobs; -import me.ThaH3lper.com.Mobs.MobCommon; import net.citizensnpcs.api.CitizensAPI; import org.bukkit.ChatColor; import org.bukkit.Location; @@ -443,11 +441,6 @@ public class PlayerListener implements Listener { quester.killMob(evt.getEntity().getLocation(), evt.getEntity().getType()); } - if(quester.hasObjective("killBoss") && Quests.epicBoss.allMobs.contains(evt.getEntity().getUniqueId())) { - EpicMobs em = MobCommon.getEpicMob(evt.getEntity()); - quester.killBoss(em.cmdName); - } - } } @@ -469,11 +462,6 @@ public class PlayerListener implements Listener { quester.killMob(evt.getEntity().getLocation(), evt.getEntity().getType()); } - if(quester.hasObjective("killBoss") && Quests.epicBoss.allMobs.contains(evt.getEntity().getUniqueId())) { - EpicMobs em = MobCommon.getEpicMob(evt.getEntity()); - quester.killBoss(em.cmdName); - } - } } diff --git a/src/main/java/me/blackvein/quests/QuestFactory.java b/src/main/java/me/blackvein/quests/QuestFactory.java index 57bb34bb3..0602b2741 100644 --- a/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/src/main/java/me/blackvein/quests/QuestFactory.java @@ -1,7 +1,6 @@ package me.blackvein.quests; import com.sk89q.worldguard.protection.managers.RegionManager; -import com.sk89q.worldguard.protection.regions.ProtectedRegion; import me.blackvein.quests.util.ColorUtil; @@ -219,9 +218,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } } - + if(Quests.worldGuard != null){ - + if (context.getSessionData(CK.Q_REGION) == null){ if (quests.citizens != null) { @@ -241,15 +240,15 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } } - + }else { - + if (quests.citizens != null) { text += GRAY + "7 - Set Region (WorldGuard not installed)\n"; } else { text += GRAY + "6 - Set Region (WorldGuard not installed)\n"; } - + } if (context.getSessionData(CK.Q_INITIAL_EVENT) == null) { @@ -396,13 +395,13 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } } else if (input.equalsIgnoreCase("13")) { - + if (quests.citizens != null) { return new ExitPrompt(); }else{ return new CreateMenuPrompt(); } - + } return null; @@ -766,7 +765,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } } - + private class RegionPrompt extends StringPrompt { @Override @@ -774,19 +773,19 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { String text = DARKGREEN + "- Quest Region -\n"; boolean any = false; - + for(World world : quests.getServer().getWorlds()){ - + RegionManager rm = Quests.worldGuard.getRegionManager(world); for(String region : rm.getRegions().keySet()){ - + any = true; text += GREEN + region + ", "; - + } - + } - + if(any) { text = text.substring(0, text.length() - 2); text += "\n\n"; @@ -807,9 +806,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { String found = null; boolean done = false; - + for(World world : quests.getServer().getWorlds()){ - + RegionManager rm = Quests.worldGuard.getRegionManager(world); for(String region : rm.getRegions().keySet()){ @@ -867,14 +866,14 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } catch (NumberFormatException e) { delay = MiscUtil.getTimeFromString(input); } - + if (delay < -1) { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorPositiveAmount")); } else if (delay == 0) { context.setSessionData(CK.Q_REDO_DELAY, null); } else if (delay != -1) { context.setSessionData(CK.Q_REDO_DELAY, delay); - } + } return new CreateMenuPrompt(); @@ -1095,7 +1094,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (cc.getSessionData(CK.Q_INITIAL_EVENT) != null) { initialEvent = (String) cc.getSessionData(CK.Q_INITIAL_EVENT); } - + if (cc.getSessionData(CK.Q_REGION) != null) { region = (String) cc.getSessionData(CK.Q_REGION); } @@ -1147,7 +1146,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { heroesClassRews = (LinkedList) cc.getSessionData(CK.REW_HEROES_CLASSES); heroesExpRews = (LinkedList) cc.getSessionData(CK.REW_HEROES_AMOUNTS); } - + if (cc.getSessionData(CK.REW_PHAT_LOOTS) != null) { phatLootRews = (LinkedList) cc.getSessionData(CK.REW_PHAT_LOOTS); } @@ -1226,9 +1225,6 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { LinkedList npcKillIds; LinkedList npcKillAmounts; - LinkedList bossIds; - LinkedList bossAmounts; - LinkedList mobs; LinkedList mobAmounts; LinkedList mobLocs; @@ -1293,9 +1289,6 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { npcKillIds = null; npcKillAmounts = null; - bossIds = null; - bossAmounts = null; - mobs = null; mobAmounts = null; mobLocs = null; @@ -1378,11 +1371,6 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { npcKillAmounts = (LinkedList) cc.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS); } - if (cc.getSessionData(pref + CK.S_BOSS_IDS) != null) { - bossIds = (LinkedList) cc.getSessionData(pref + CK.S_BOSS_IDS); - bossAmounts = (LinkedList) cc.getSessionData(pref + CK.S_BOSS_AMOUNTS); - } - if (cc.getSessionData(pref + CK.S_MOB_TYPES) != null) { mobs = (LinkedList) cc.getSessionData(pref + CK.S_MOB_TYPES); mobAmounts = (LinkedList) cc.getSessionData(pref + CK.S_MOB_AMOUNTS); @@ -1491,8 +1479,6 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { stage.set("npc-ids-to-talk-to", npcTalkIds); stage.set("npc-ids-to-kill", npcKillIds); stage.set("npc-kill-amounts", npcKillAmounts); - stage.set("boss-ids-to-kill", bossIds); - stage.set("boss-amounts-to-kill", bossAmounts); stage.set("mobs-to-kill", mobs); stage.set("mob-amounts", mobAmounts); stage.set("locations-to-kill", mobLocs); @@ -1559,7 +1545,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (q.initialEvent != null) { cc.setSessionData(CK.Q_INITIAL_EVENT, q.initialEvent.getName()); } - + if(q.region != null) { cc.setSessionData(CK.Q_REGION, q.region); } @@ -1654,7 +1640,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { cc.setSessionData(CK.REW_HEROES_CLASSES, q.heroesClasses); cc.setSessionData(CK.REW_HEROES_AMOUNTS, q.heroesAmounts); } - + if(q.phatLootRewards.isEmpty() == false) { cc.setSessionData(CK.REW_PHAT_LOOTS, q.phatLootRewards); } @@ -1824,13 +1810,6 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } - if (stage.bossesToKill.isEmpty() == false) { - - cc.setSessionData(pref + CK.S_BOSS_IDS, stage.bossesToKill); - cc.setSessionData(pref + CK.S_BOSS_AMOUNTS, stage.bossAmountsToKill); - - } - if (stage.mobsToKill.isEmpty() == false) { LinkedList mobs = new LinkedList(); diff --git a/src/main/java/me/blackvein/quests/Quester.java b/src/main/java/me/blackvein/quests/Quester.java index 07c05e00d..e3013d161 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -58,8 +58,6 @@ public class Quester { Map citizensInteracted = new HashMap(); LinkedList citizensKilled = new LinkedList(); LinkedList citizenNumKilled = new LinkedList(); - LinkedList bossesKilled = new LinkedList(); - LinkedList bossAmountsKilled = new LinkedList(); LinkedList locationsReached = new LinkedList(); LinkedList hasReached = new LinkedList(); LinkedList radiiToReachWithin = new LinkedList(); @@ -427,22 +425,6 @@ public class Quester { } - for (String boss : currentStage.bossesToKill) { - - String bossName = ChatColor.stripColor(Quests.getBoss(boss).Display); - - if (bossAmountsKilled.get(bossesKilled.indexOf(boss)) < currentStage.bossAmountsToKill.get(currentStage.bossesToKill.indexOf(boss))) { - - unfinishedObjectives.add(ChatColor.GREEN + "Kill " + ChatColor.ITALIC + bossName + ChatColor.RESET + ChatColor.GREEN + " " + bossAmountsKilled.get(currentStage.bossesToKill.indexOf(boss)) + "/" + currentStage.bossAmountsToKill.get(currentStage.bossesToKill.indexOf(boss))); - - } else { - - unfinishedObjectives.add(ChatColor.GRAY + "Kill " + ChatColor.ITALIC + bossName + ChatColor.RESET + ChatColor.GRAY + " " + currentStage.bossAmountsToKill.get(currentStage.bossesToKill.indexOf(boss)) + "/" + currentStage.bossAmountsToKill.get(currentStage.bossesToKill.indexOf(boss))); - - } - - } - for (Entry e : currentStage.mobsToTame.entrySet()) { for (Entry e2 : mobsTamed.entrySet()) { @@ -558,9 +540,6 @@ public class Quester { } else if (s.equalsIgnoreCase("killNPC")) { return !currentStage.citizensToKill.isEmpty(); - } else if (s.equalsIgnoreCase("killBoss")) { - return !currentStage.bossesToKill.isEmpty(); - } else if (s.equalsIgnoreCase("tameMob")) { return !currentStage.mobsToTame.isEmpty(); @@ -586,7 +565,7 @@ public class Quester { blocksDamaged.put(m, (i + 1)); if (blocksDamaged.get(m).equals(currentStage.blocksToDamage.get(m))) { - finishObjective("damageBlock", m, null, null, null, null, null, null, null, null); + finishObjective("damageBlock", m, null, null, null, null, null, null, null); } } @@ -604,7 +583,7 @@ public class Quester { blocksBroken.put(m, (i + 1)); if (blocksBroken.get(m).equals(currentStage.blocksToBreak.get(m))) { - finishObjective("breakBlock", m, null, null, null, null, null, null, null, null); + finishObjective("breakBlock", m, null, null, null, null, null, null, null); } } @@ -621,7 +600,7 @@ public class Quester { blocksPlaced.put(m, (i + 1)); if (blocksPlaced.get(m).equals(currentStage.blocksToPlace.get(m))) { - finishObjective("placeBlock", m, null, null, null, null, null, null, null, null); + finishObjective("placeBlock", m, null, null, null, null, null, null, null); } } @@ -638,7 +617,7 @@ public class Quester { blocksUsed.put(m, (i + 1)); if (blocksUsed.get(m).equals(currentStage.blocksToUse.get(m))) { - finishObjective("useBlock", m, null, null, null, null, null, null, null, null); + finishObjective("useBlock", m, null, null, null, null, null, null, null); } } @@ -656,7 +635,7 @@ public class Quester { blocksCut.put(m, (i + 1)); if (blocksCut.get(m).equals(currentStage.blocksToCut.get(m))) { - finishObjective("cutBlock", m, null, null, null, null, null, null, null, null); + finishObjective("cutBlock", m, null, null, null, null, null, null, null); } } @@ -671,7 +650,7 @@ public class Quester { fishCaught++; if (((Integer) fishCaught).equals(currentStage.fishToCatch)) { - finishObjective("catchFish", null, null, null, null, null, null, null, null, null); + finishObjective("catchFish", null, null, null, null, null, null, null, null); } } @@ -694,7 +673,7 @@ public class Quester { itemsEnchanted.put(entry.getKey(), num); if (num.equals(entry2.getValue())) { - finishObjective("enchantItem", m, null, e, null, null, null, null, null, null); + finishObjective("enchantItem", m, null, e, null, null, null, null, null); } } @@ -735,7 +714,7 @@ public class Quester { mobNumKilled.set(index, numKilledInteger); if ((numKilledInteger).equals(currentStage.mobNumToKill.get(index))) { - finishObjective("killMob", null, null, null, e, null, null, null, null, null); + finishObjective("killMob", null, null, null, e, null, null, null, null); } } @@ -753,7 +732,7 @@ public class Quester { mobNumKilled.set(mobsKilled.indexOf(e), mobNumKilled.get(mobsKilled.indexOf(e)) + 1); if ((mobNumKilled.get(mobsKilled.indexOf(e))).equals(currentStage.mobNumToKill.get(mobsKilled.indexOf(e)))) { - finishObjective("killMob", null, null, null, e, null, null, null, null, null); + finishObjective("killMob", null, null, null, e, null, null, null, null); } } @@ -787,7 +766,7 @@ public class Quester { playersKilled++; if (((Integer) playersKilled).equals(currentStage.playersToKill)) { - finishObjective("killPlayer", null, null, null, null, null, null, null, null, null); + finishObjective("killPlayer", null, null, null, null, null, null, null, null); } } @@ -800,7 +779,7 @@ public class Quester { if (citizensInteracted.get(n.getId()) == false) { citizensInteracted.put(n.getId(), true); - finishObjective("talkToNPC", null, null, null, null, null, n, null, null, null); + finishObjective("talkToNPC", null, null, null, null, null, n, null, null); } } @@ -815,7 +794,7 @@ public class Quester { if (citizenNumKilled.get(index) < currentStage.citizenNumToKill.get(index)) { citizenNumKilled.set(index, citizenNumKilled.get(index) + 1); if (citizenNumKilled.get(index) == currentStage.citizenNumToKill.get(index)) { - finishObjective("killNPC", null, null, null, null, null, n, null, null, null); + finishObjective("killNPC", null, null, null, null, null, n, null, null); } } @@ -823,26 +802,6 @@ public class Quester { } - public void killBoss(String boss) { - - for(String s : bossesKilled){ - - if (s.equalsIgnoreCase(boss)) { - - int index = bossesKilled.indexOf(s); - if (bossAmountsKilled.get(index) < currentStage.bossAmountsToKill.get(index)) { - bossAmountsKilled.set(index, bossAmountsKilled.get(index) + 1); - if (bossAmountsKilled.get(index) == currentStage.bossAmountsToKill.get(index)) { - finishObjective("killBoss", null, null, null, null, null, null, null, null, boss); - } - } - - } - - } - - } - public void reachLocation(Location l) { for (Location location : locationsReached) { @@ -859,7 +818,7 @@ public class Quester { if (hasReached.get(index) == false) { hasReached.set(index, true); - finishObjective("reachLocation", null, null, null, null, null, null, location, null, null); + finishObjective("reachLocation", null, null, null, null, null, null, location, null); } @@ -880,7 +839,7 @@ public class Quester { mobsTamed.put(entity, (mobsTamed.get(entity) + 1)); if (mobsTamed.get(entity).equals(currentStage.mobsToTame.get(entity))) { - finishObjective("tameMob", null, null, null, entity, null, null, null, null, null); + finishObjective("tameMob", null, null, null, entity, null, null, null, null); } } @@ -894,7 +853,7 @@ public class Quester { sheepSheared.put(color, (sheepSheared.get(color) + 1)); if (sheepSheared.get(color).equals(currentStage.sheepToShear.get(color))) { - finishObjective("shearSheep", null, null, null, null, null, null, null, color, null); + finishObjective("shearSheep", null, null, null, null, null, null, null, color); } } @@ -929,14 +888,14 @@ public class Quester { i.setAmount(i.getAmount() - (req - amount)); //Take away the remaining amount needed to be delivered from the item stack player.getInventory().setItem(index, i); player.updateInventory(); - finishObjective("deliverItem", null, found, null, null, null, null, null, null, null); + finishObjective("deliverItem", null, found, null, null, null, null, null, null); } else if ((i.getAmount() + amount) == req) { itemsDelivered.put(found, req); player.getInventory().setItem(player.getInventory().first(i), null); player.updateInventory(); - finishObjective("deliverItem", null, found, null, null, null, null, null, null, null); + finishObjective("deliverItem", null, found, null, null, null, null, null, null); } else { @@ -954,7 +913,7 @@ public class Quester { } - public void finishObjective(String objective, Material material, ItemStack itemstack, Enchantment enchantment, EntityType mob, String player, NPC npc, Location location, DyeColor color, String boss) { + public void finishObjective(String objective, Material material, ItemStack itemstack, Enchantment enchantment, EntityType mob, String player, NPC npc, Location location, DyeColor color) { Player p = plugin.getServer().getPlayerExact(name); @@ -1074,15 +1033,6 @@ public class Quester { currentQuest.nextStage(this); } - } else if (objective.equalsIgnoreCase("killBoss")) { - - String message = ChatColor.GREEN + "(Completed) Kill " + ChatColor.ITALIC + boss + ChatColor.RESET + ChatColor.GREEN; - message = message + " " + currentStage.bossAmountsToKill.get(currentStage.bossesToKill.indexOf(boss)) + "/" + currentStage.bossAmountsToKill.get(currentStage.bossesToKill.indexOf(boss)); - p.sendMessage(message); - if (testComplete()) { - currentQuest.nextStage(this); - } - } else if (objective.equalsIgnoreCase("tameMob")) { String message = ChatColor.GREEN + "(Completed) Tame " + getCapitalized(mob.getName()); @@ -1221,15 +1171,6 @@ public class Quester { } } - if (currentStage.bossesToKill.isEmpty() == false) { - for (String s : currentStage.bossesToKill) { - - bossesKilled.add(s); - bossAmountsKilled.add(0); - - } - } - if (currentStage.blocksToCut.isEmpty() == false) { for (Material m : currentStage.blocksToCut.keySet()) { @@ -1289,8 +1230,6 @@ public class Quester { radiiToReachWithin.clear(); mobsTamed.clear(); sheepSheared.clear(); - bossesKilled.clear(); - bossAmountsKilled.clear(); } @@ -1811,13 +1750,6 @@ public class Quester { } - if (bossesKilled.isEmpty() == false) { - - data.set("bosses-killed", bossesKilled); - data.set("boss-amounts-killed", bossAmountsKilled); - - } - if (locationsReached.isEmpty() == false) { LinkedList locations = new LinkedList(); @@ -2325,20 +2257,6 @@ public class Quester { } - if (data.contains("bosses-killed")) { - - List ids = data.getStringList("bosses-killed"); - List num = data.getIntegerList("boss-amounts-killed"); - - for (String s : ids) { - - bossesKilled.add(s); - bossAmountsKilled.add(num.get(ids.indexOf(s))); - - } - - } - if (data.contains("locations-to-reach")) { LinkedList locations = new LinkedList(); diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index 9a5e9ffec..5c8f147d7 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -21,8 +21,6 @@ import java.util.Map.Entry; import java.util.logging.Level; import java.util.logging.Logger; -import me.ThaH3lper.com.EpicBoss; -import me.ThaH3lper.com.Mobs.EpicMobs; import me.blackvein.quests.exceptions.InvalidStageException; import me.blackvein.quests.prompts.QuestAcceptPrompt; import me.blackvein.quests.util.ColorUtil; @@ -94,7 +92,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, public static Permission permission = null; public static WorldGuardPlugin worldGuard = null; public static mcMMO mcmmo = null; - public static EpicBoss epicBoss = null; public static Plugin rpgItems = null; public static Heroes heroes = null; public static PhatLoots phatLoots = null; @@ -187,10 +184,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, rpgItems = (Plugin) getServer().getPluginManager().getPlugin("RPG Items"); } - if (getServer().getPluginManager().getPlugin("EpicBoss Gold Edition") != null) { - epicBoss = (EpicBoss) getServer().getPluginManager().getPlugin("EpicBoss Gold Edition"); - } - if (getServer().getPluginManager().getPlugin("Heroes") != null) { heroes = (Heroes) getServer().getPluginManager().getPlugin("Heroes"); } @@ -1238,9 +1231,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, cs.sendMessage(RED + "You do not have access to that command."); } - + } else if (args[0].equalsIgnoreCase("setstage")) { - + if (cs.hasPermission("quests.admin.setstage")) { Player target = null; @@ -1254,11 +1247,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } } - + if (target == null) { // for (Player p : getServer().getOnlinePlayers()) { - + if (p.getName().toLowerCase().contains(args[1].toLowerCase())) { target = p; break; @@ -1267,7 +1260,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } int stage = -1; if (args.length > 2) { - try { + try { stage = Integer.parseInt(args[2]); } catch (NumberFormatException e) { cs.sendMessage(YELLOW + "Invalid number"); @@ -1276,7 +1269,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, cs.sendMessage(YELLOW + "Enter a stage"); return true; } - + if (target == null) { cs.sendMessage(YELLOW + "Player not found."); @@ -2720,60 +2713,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } - List bossIdsToKill; - List bossKillAmounts; - - if (config.contains("quests." + s + ".stages.ordered." + s2 + ".boss-ids-to-kill")) { - - if (checkList(config.getList("quests." + s + ".stages.ordered." + s2 + ".boss-ids-to-kill"), String.class)) { - - if (config.contains("quests." + s + ".stages.ordered." + s2 + ".boss-amounts-to-kill")) { - - if (checkList(config.getList("quests." + s + ".stages.ordered." + s2 + ".boss-amounts-to-kill"), Integer.class)) { - - bossIdsToKill = config.getStringList("quests." + s + ".stages.ordered." + s2 + ".boss-ids-to-kill"); - bossKillAmounts = config.getIntegerList("quests." + s + ".stages.ordered." + s2 + ".boss-amounts-to-kill"); - for (String boss : bossIdsToKill) { - - if (Quests.getBoss(boss) != null) { - - if (bossKillAmounts.get(bossIdsToKill.indexOf(boss)) > 0) { - oStage.bossesToKill.add(boss); - oStage.bossAmountsToKill.add(bossKillAmounts.get(bossIdsToKill.indexOf(boss))); - } else { - printSevere("[Quests] " + bossKillAmounts.get(bossIdsToKill.indexOf(boss)) + GOLD + " inside boss-amounts-to-kill: inside Stage " + s2 + " of Quest " + quest.name + " is not a positive number!"); - stageFailed = true; - break; - } - - } else { - printSevere("[Quests] " + boss + " inside boss-ids-to-kill: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid EpicBoss name!"); - stageFailed = true; - break; - } - - } - - } else { - printSevere("[Quests] boss-amounts-to-kill: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!"); - stageFailed = true; - break; - } - - } else { - printSevere("[Quests] Stage " + s2 + " of Quest " + quest.name + " is missing boss-amounts-to-kill:"); - stageFailed = true; - break; - } - - } else { - printSevere("[Quests] boss-ids-to-kill: in Stage " + s2 + " of Quest " + quest.name + " is not a list of IDs!"); - stageFailed = true; - break; - } - - } - if (config.contains("quests." + s + ".stages.ordered." + s2 + ".mobs-to-kill")) { if (Quests.checkList(config.getList("quests." + s + ".stages.ordered." + s2 + ".mobs-to-kill"), String.class)) { @@ -4822,19 +4761,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, return false; } - - public static EpicMobs getBoss(String name) { - - for (EpicMobs em : Quests.epicBoss.listMobs) { - if (em.cmdName.equalsIgnoreCase(name)) { - return em; - } - } - - return null; - - } - + public static int getMCMMOSkillLevel(SkillType st, String player) { McMMOPlayer mPlayer = UserManager.getPlayer(player); diff --git a/src/main/java/me/blackvein/quests/Stage.java b/src/main/java/me/blackvein/quests/Stage.java index ea63b3062..5a8a02b0d 100644 --- a/src/main/java/me/blackvein/quests/Stage.java +++ b/src/main/java/me/blackvein/quests/Stage.java @@ -106,9 +106,6 @@ public class Stage { }; public LinkedList citizenNumToKill = new LinkedList(); - public LinkedList bossesToKill = new LinkedList(); - public LinkedList bossAmountsToKill = new LinkedList(); - public LinkedList locationsToReach = new LinkedList(); public LinkedList radiiToReachWithin = new LinkedList(); public LinkedList worldsToReachWithin = new LinkedList(); @@ -222,14 +219,6 @@ public class Stage { return false; } - if(other.bossesToKill.equals(bossesToKill) == false){ - return false; - } - - if(other.bossAmountsToKill.equals(bossAmountsToKill) == false){ - return false; - } - if (other.locationsToReach.equals(locationsToReach) == false) { return false; } diff --git a/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java b/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java index 4e7d69887..c6e926718 100644 --- a/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java @@ -4,7 +4,6 @@ import java.util.Arrays; import java.util.LinkedList; import java.util.List; -import me.ThaH3lper.com.Mobs.EpicMobs; import me.blackvein.quests.util.ColorUtil; import me.blackvein.quests.Event; import me.blackvein.quests.QuestFactory; @@ -31,7 +30,7 @@ import org.bukkit.inventory.ItemStack; public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { - private final int stageNum; + private final int stageNum; private final String pref; private final CitizensPlugin citizens; private final QuestFactory questFactory; @@ -68,7 +67,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + CK.S_DAMAGE_IDS) == null) { text += PINK + "" + BOLD + "2 " + RESET + PURPLE + "- " + Lang.get("stageEditorDamageBlocks") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { @@ -83,7 +81,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + CK.S_PLACE_IDS) == null) { text += PINK + "" + BOLD + "3 " + RESET + PURPLE + "- " + Lang.get("stageEditorPlaceBlocks") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { @@ -98,7 +95,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + CK.S_USE_IDS) == null) { text += PINK + "" + BOLD + "4 " + RESET + PURPLE + "- " + Lang.get("stageEditorUseBlocks") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { @@ -113,7 +109,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + CK.S_CUT_IDS) == null) { text += PINK + "" + BOLD + "5 " + RESET + PURPLE + "- " + Lang.get("stageEditorCutBlocks") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { @@ -201,7 +196,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (context.getSessionData(pref + CK.S_NPCS_TO_KILL) == null) { text += PINK + "" + BOLD + "11 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillNPCs") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "11 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillNPCs") + "\n"; + text += PINK + "" + BOLD + "11 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillNPCs") + "\n"; LinkedList npcs = (LinkedList) context.getSessionData(pref + CK.S_NPCS_TO_KILL); LinkedList amounts = (LinkedList) context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS); @@ -213,33 +208,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else { - text += GRAY + "" + BOLD + "11 " + RESET + GRAY + "- " + Lang.get("stageEditorKillNPCs") + GRAY + " (Citizens not installed)\n"; - } - - if(Quests.epicBoss != null){ - - if (context.getSessionData(pref + CK.S_BOSS_IDS) == null) { - text += PINK + "" + BOLD + "12 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillBosses") + GRAY + " (" + Lang.get("noneSet") + ")\n"; - } else { - text += PINK + "" + BOLD + "12 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillBosses") + "\n"; - - LinkedList bosses = (LinkedList) context.getSessionData(pref + CK.S_BOSS_IDS); - LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_BOSS_AMOUNTS); - - for (int i = 0; i < bosses.size(); i++) { - text += GRAY + " - " + ITALIC + AQUA + bosses.get(i) + RESET + GRAY + " x " + DARKAQUA + amnts.get(i) + "\n"; - } - - } - - }else{ - text += GRAY + "" + BOLD + "12 " + RESET + GRAY + "- " + Lang.get("stageEditorKillBosses") + GRAY + " (EpicBoss not installed)\n"; + text += GRAY + "" + BOLD + "11 " + RESET + GRAY + "- " + Lang.get("stageEditorKillNPCs") + GRAY + " (Citizens not installed)\n"; } if (context.getSessionData(pref + CK.S_MOB_TYPES) == null) { - text += PINK + "" + BOLD + "13 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillMobs") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "12 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillMobs") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "13 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillMobs") + "\n"; + text += PINK + "" + BOLD + "12 " + RESET + PURPLE + "- " + Lang.get("stageEditorKillMobs") + "\n"; LinkedList mobs = (LinkedList) context.getSessionData(pref + CK.S_MOB_TYPES); LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_MOB_AMOUNTS); @@ -265,27 +240,25 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) { - text += PINK + "" + BOLD + "14 " + RESET + PURPLE + "- " + Lang.get("stageEditorReachLocs") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "13 " + RESET + PURPLE + "- " + Lang.get("stageEditorReachLocs") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "14 " + RESET + PURPLE + "- " + Lang.get("stageEditorReachLocs") +"\n"; + text += PINK + "" + BOLD + "13 " + RESET + PURPLE + "- " + Lang.get("stageEditorReachLocs") + "\n"; LinkedList locations = (LinkedList) context.getSessionData(pref + CK.S_REACH_LOCATIONS); LinkedList radii = (LinkedList) context.getSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS); LinkedList names = (LinkedList) context.getSessionData(pref + CK.S_REACH_LOCATIONS_NAMES); for (int i = 0; i < locations.size(); i++) { - text += GRAY + " - " + Lang.get("stageEditorReachRadii1") +" " + BLUE + radii.get(i) + GRAY + " " + Lang.get("stageEditorReachRadii2")+ " " + AQUA + names.get(i) + GRAY + " (" + DARKAQUA + locations.get(i) + GRAY + ")\n"; + text += GRAY + " - " + Lang.get("stageEditorReachRadii1") + " " + BLUE + radii.get(i) + GRAY + " " + Lang.get("stageEditorReachRadii2") + " " + AQUA + names.get(i) + GRAY + " (" + DARKAQUA + locations.get(i) + GRAY + ")\n"; } - - } if (context.getSessionData(pref + CK.S_TAME_TYPES) == null) { - text += PINK + "" + BOLD + "15 " + RESET + PURPLE + "- " + Lang.get("stageEditorTameMobs") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "14 " + RESET + PURPLE + "- " + Lang.get("stageEditorTameMobs") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "15 " + RESET + PURPLE + "- " + Lang.get("stageEditorTameMobs") +"\n"; + text += PINK + "" + BOLD + "14 " + RESET + PURPLE + "- " + Lang.get("stageEditorTameMobs") + "\n"; LinkedList mobs = (LinkedList) context.getSessionData(pref + CK.S_TAME_TYPES); LinkedList amounts = (LinkedList) context.getSessionData(pref + CK.S_TAME_AMOUNTS); @@ -297,9 +270,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } if (context.getSessionData(pref + CK.S_SHEAR_COLORS) == null) { - text += PINK + "" + BOLD + "16 " + RESET + PURPLE + "- " + Lang.get("stageEditorShearSheep") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "15 " + RESET + PURPLE + "- " + Lang.get("stageEditorShearSheep") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "16 " + RESET + PURPLE + "- " + Lang.get("stageEditorShearSheep") + "\n"; + text += PINK + "" + BOLD + "15 " + RESET + PURPLE + "- " + Lang.get("stageEditorShearSheep") + "\n"; LinkedList colors = (LinkedList) context.getSessionData(pref + CK.S_SHEAR_COLORS); LinkedList amounts = (LinkedList) context.getSessionData(pref + CK.S_SHEAR_AMOUNTS); @@ -310,50 +283,49 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - text += PINK + "" + BOLD + "17 " + RESET + PURPLE + "- " + Lang.get("stageEditorEvents") + "\n"; + text += PINK + "" + BOLD + "16 " + RESET + PURPLE + "- " + Lang.get("stageEditorEvents") + "\n"; if (context.getSessionData(pref + CK.S_DELAY) == null) { - text += PINK + "" + BOLD + "18 " + RESET + PURPLE + "- " + Lang.get("delay") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "17 " + RESET + PURPLE + "- " + Lang.get("delay") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { long time = (Long) context.getSessionData(pref + CK.S_DELAY); - text += PINK + "" + BOLD + "18 " + RESET + PURPLE + "- " + Lang.get("delay") + GRAY + "(" + AQUA + Quests.getTime(time) + GRAY + ")\n"; + text += PINK + "" + BOLD + "17 " + RESET + PURPLE + "- " + Lang.get("delay") + GRAY + "(" + AQUA + Quests.getTime(time) + GRAY + ")\n"; } if (context.getSessionData(pref + CK.S_DELAY) == null) { - text += GRAY + "" + BOLD + "19 " + RESET + GRAY + "- " + Lang.get("stageEditorDelayMessage") + GRAY + " (" + Lang.get("noDelaySet") + ")\n"; + text += GRAY + "" + BOLD + "18 " + RESET + GRAY + "- " + Lang.get("stageEditorDelayMessage") + GRAY + " (" + Lang.get("noDelaySet") + ")\n"; } else if (context.getSessionData(pref + CK.S_DELAY_MESSAGE) == null) { - text += PINK + "" + BOLD + "19 " + RESET + PURPLE + "- "+ Lang.get("stageEditorDelayMessage") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "18 " + RESET + PURPLE + "- " + Lang.get("stageEditorDelayMessage") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "19 " + RESET + PURPLE + "- " + Lang.get("stageEditorDelayMessage") + GRAY + " (" + AQUA + "\"" + context.getSessionData(pref + CK.S_DELAY_MESSAGE) + "\"" + GRAY + ")\n"; + text += PINK + "" + BOLD + "18 " + RESET + PURPLE + "- " + Lang.get("stageEditorDelayMessage") + GRAY + " (" + AQUA + "\"" + context.getSessionData(pref + CK.S_DELAY_MESSAGE) + "\"" + GRAY + ")\n"; } - if (questFactory.quests.denizen == null) { text += GRAY + "" + BOLD + "19 " + RESET + GRAY + "- " + Lang.get("stageEditorDenizenScript") + GRAY + " (Denizen not installed)\n"; } else { if (context.getSessionData(pref + CK.S_DENIZEN) == null) { - text += PINK + "" + BOLD + "20 " + RESET + PURPLE + "- " + Lang.get("stageEditorDenizenScript") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "19 " + RESET + PURPLE + "- " + Lang.get("stageEditorDenizenScript") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "20 " + RESET + PURPLE + "- " + Lang.get("stageEditorDenizenScript") + GRAY + " (" + AQUA + context.getSessionData(pref + CK.S_DENIZEN) + GRAY + "\n"; + text += PINK + "" + BOLD + "19 " + RESET + PURPLE + "- " + Lang.get("stageEditorDenizenScript") + GRAY + " (" + AQUA + context.getSessionData(pref + CK.S_DENIZEN) + GRAY + "\n"; } } if (context.getSessionData(pref + CK.S_START_MESSAGE) == null) { - text += PINK + "" + BOLD + "21 " + RESET + PURPLE + "- " + Lang.get("stageEditorStartMessage") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "20 " + RESET + PURPLE + "- " + Lang.get("stageEditorStartMessage") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "21 " + RESET + PURPLE + "- " + Lang.get("stageEditorStartMessage") + GRAY + "(" + AQUA + "\"" + context.getSessionData(pref + CK.S_START_MESSAGE) + "\"" + GRAY + ")\n"; + text += PINK + "" + BOLD + "20 " + RESET + PURPLE + "- " + Lang.get("stageEditorStartMessage") + GRAY + "(" + AQUA + "\"" + context.getSessionData(pref + CK.S_START_MESSAGE) + "\"" + GRAY + ")\n"; } if (context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) == null) { - text += PINK + "" + BOLD + "22 " + RESET + PURPLE + "- " + Lang.get("stageEditorCompleteMessage") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += PINK + "" + BOLD + "21 " + RESET + PURPLE + "- " + Lang.get("stageEditorCompleteMessage") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "22 " + RESET + PURPLE + "- " + Lang.get("stageEditorCompleteMessage") + GRAY + "(" + AQUA + "\"" + context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) + "\"" + GRAY + ")\n"; + text += PINK + "" + BOLD + "21 " + RESET + PURPLE + "- " + Lang.get("stageEditorCompleteMessage") + GRAY + "(" + AQUA + "\"" + context.getSessionData(pref + CK.S_COMPLETE_MESSAGE) + "\"" + GRAY + ")\n"; } - text += RED + "" + BOLD + "23 " + RESET + PURPLE + "- " + Lang.get("stageEditorDelete") + "\n"; - text += GREEN + "" + BOLD + "24 " + RESET + PURPLE + "- " + Lang.get("done") + "\n"; + text += RED + "" + BOLD + "22 " + RESET + PURPLE + "- " + Lang.get("stageEditorDelete") + "\n"; + text += GREEN + "" + BOLD + "23 " + RESET + PURPLE + "- " + Lang.get("done") + "\n"; return text; @@ -389,56 +361,49 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (questFactory.quests.citizens != null) { return new NPCIDsToTalkToPrompt(); } else { - context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorNoCitizens")); + context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorNoCitizens")); return new CreateStagePrompt(stageNum, questFactory, citizens); } } else if (input.equalsIgnoreCase("11")) { if (questFactory.quests.citizens != null) { return new NPCKillListPrompt(); } else { - context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorNoCitizens")); + context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorNoCitizens")); return new CreateStagePrompt(stageNum, questFactory, citizens); } } else if (input.equalsIgnoreCase("12")) { - if (Quests.epicBoss != null) { - return new EpicBossListPrompt(); - } else { - context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorNoEpicBoss")); - return new CreateStagePrompt(stageNum, questFactory, citizens); - } - } else if (input.equalsIgnoreCase("13")) { return new MobListPrompt(); - } else if (input.equalsIgnoreCase("14")) { + } else if (input.equalsIgnoreCase("13")) { return new ReachListPrompt(); - } else if (input.equalsIgnoreCase("15")) { + } else if (input.equalsIgnoreCase("14")) { return new TameListPrompt(); - } else if (input.equalsIgnoreCase("16")) { + } else if (input.equalsIgnoreCase("15")) { return new ShearListPrompt(); - } else if (input.equalsIgnoreCase("17")) { + } else if (input.equalsIgnoreCase("16")) { return new EventListPrompt(); - } else if (input.equalsIgnoreCase("18")) { + } else if (input.equalsIgnoreCase("17")) { return new DelayPrompt(); - } else if (input.equalsIgnoreCase("19")) { + } else if (input.equalsIgnoreCase("18")) { if (context.getSessionData(pref + CK.S_DELAY) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorNoDelaySet")); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { return new DelayMessagePrompt(); } - } else if (input.equalsIgnoreCase("20")) { + } else if (input.equalsIgnoreCase("19")) { if (questFactory.quests.denizen == null) { context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorNoDenizen")); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { return new DenizenPrompt(); } + } else if (input.equalsIgnoreCase("20")) { + return new StartMessagePrompt(); } else if (input.equalsIgnoreCase("21")) { - return new StartMessagePrompt(); + return new CompleteMessagePrompt(); } else if (input.equalsIgnoreCase("22")) { - return new CompleteMessagePrompt(); - } else if (input.equalsIgnoreCase("23")) { return new DeletePrompt(); - } else if (input.equalsIgnoreCase("24")) { + } else if (input.equalsIgnoreCase("23")) { return new StagesPrompt(questFactory); } else { return new CreateStagePrompt(stageNum, questFactory, citizens); @@ -485,7 +450,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") +"\n"; + text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); } @@ -772,7 +737,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new DamageBlockIdsPrompt(); } @@ -963,7 +928,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new PlaceBlockIdsPrompt(); } @@ -1004,7 +969,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new PlaceBlockAmountsPrompt(); } @@ -1154,7 +1119,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new UseBlockIdsPrompt(); } @@ -1195,7 +1160,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new UseBlockAmountsPrompt(); } @@ -1295,7 +1260,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (one == two) { return new CreateStagePrompt(stageNum, questFactory, citizens); } else { - context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorListNotSameSize")); + context.getForWhom().sendRawMessage(RED + Lang.get("stageEditorListNotSameSize")); return new CutBlockListPrompt(); } } @@ -1345,7 +1310,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new CutBlockIdsPrompt(); } @@ -1386,7 +1351,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new CutBlockAmountsPrompt(); } @@ -1442,8 +1407,8 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { Player player = (Player) context.getForWhom(); if (num < -1) { - player.sendMessage(RED + Lang.get("stageEditorPositiveAmount")); - return new KillPlayerPrompt(); + player.sendMessage(RED + Lang.get("stageEditorPositiveAmount")); + return new KillPlayerPrompt(); } else if (num == 0) { context.setSessionData(pref + CK.S_PLAYER_KILL, null); } else if (num > 0) { @@ -1466,7 +1431,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + "- " + Lang.get("stageEditorEnchantItems") +" -\n"; + String text = GOLD + "- " + Lang.get("stageEditorEnchantItems") + " -\n"; if (context.getSessionData(pref + CK.S_ENCHANT_TYPES) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("stageEditorSetEnchantments") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "2 - " + Lang.get("stageEditorSetItemIds") + " (" + Lang.get("stageEditorNoEnchantmentsSet") + ")\n"; @@ -1685,7 +1650,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new EnchantItemsPrompt(); } @@ -1726,7 +1691,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new EnchantAmountsPrompt(); } @@ -1753,12 +1718,12 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { // Check/add newly made item - if(context.getSessionData("newItem") != null){ - if(context.getSessionData(pref + CK.S_DELIVERY_ITEMS) != null){ + if (context.getSessionData("newItem") != null) { + if (context.getSessionData(pref + CK.S_DELIVERY_ITEMS) != null) { List itemRews = getItems(context); itemRews.add((ItemStack) context.getSessionData("tempStack")); context.setSessionData(pref + CK.S_DELIVERY_ITEMS, itemRews); - }else{ + } else { LinkedList itemRews = new LinkedList(); itemRews.add((ItemStack) context.getSessionData("tempStack")); context.setSessionData(pref + CK.S_DELIVERY_ITEMS, itemRews); @@ -1931,7 +1896,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new DeliveryNPCsPrompt(); } @@ -1954,7 +1919,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String note = GOLD + Lang.get("stageEditorNPCNote"); - return YELLOW + Lang.get("stageEditorDeliveryMessagesPrompt")+ ".\n" + note; + return YELLOW + Lang.get("stageEditorDeliveryMessagesPrompt") + ".\n" + note; } @Override @@ -2006,7 +1971,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new NPCIDsToTalkToPrompt(); } @@ -2022,7 +1987,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - return new CreateStagePrompt(stageNum, questFactory, citizens); } @@ -2161,7 +2125,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new NpcIdsToKillPrompt(); } @@ -2204,7 +2168,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage( PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); + context.getForWhom().sendRawMessage(PINK + s + RED + Lang.get("stageEditorNotListofNumbers")); return new NpcAmountsToKillPrompt(); } @@ -2407,7 +2371,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { return new MobListPrompt(); } - } else { return new CreateStagePrompt(stageNum, questFactory, citizens); } @@ -2460,6 +2423,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { mobs += PURPLE + "EnderDragon, "; mobs += PURPLE + "Ghast, "; mobs += PURPLE + "Giant, "; + mobs += PURPLE + "Horse, "; mobs += PURPLE + "IronGolem, "; mobs += PURPLE + "MagmaCube, "; mobs += PURPLE + "MushroomCow, "; @@ -2542,7 +2506,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { mobAmounts.add(i); - } catch (NumberFormatException e) { player.sendMessage(PINK + input + " " + RED + Lang.get("stageEditorInvalidNumber")); return new MobAmountsPrompt(); @@ -2640,7 +2603,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { radii.add(i); - } catch (NumberFormatException e) { player.sendMessage(PINK + input + " " + RED + Lang.get("stageEditorInvalidItemID")); return new MobRadiiPrompt(); @@ -2694,7 +2656,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + "- " + Lang.get("stageEditorReachLocs") + " -\n"; + String text = GOLD + "- " + Lang.get("stageEditorReachLocs") + " -\n"; if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("stageEditorSetLocations") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "2 - " + Lang.get("stageEditorSetLocationRadii") + " (" + Lang.get("stageEditorNoLocationsSet") + ")\n"; @@ -2802,7 +2764,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { return new ReachListPrompt(); } - } else { return new ReachListPrompt(); } @@ -2903,7 +2864,6 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { radii.add(i); - } catch (NumberFormatException e) { player.sendMessage(PINK + input + " " + RED + Lang.get("stageEditorInvalidNumber")); return new ReachRadiiPrompt(); @@ -3372,7 +3332,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { private class EventListPrompt extends FixedSetPrompt { - public EventListPrompt(){ + public EventListPrompt() { super("1", "2", "3", "4", "5", "6"); @@ -3383,36 +3343,41 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { String text = GREEN + "- " + Lang.get("stageEditorStageEvents") + " -\n"; - if(context.getSessionData(pref + CK.S_START_EVENT) == null) + if (context.getSessionData(pref + CK.S_START_EVENT) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("stageEditorStartEvent") + " (" + Lang.get("noneSet") + ")\n"; - else + } else { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("stageEditorStartEvent") + " (" + AQUA + ((String) context.getSessionData(pref + CK.S_START_EVENT)) + YELLOW + ")\n"; + } - if(context.getSessionData(pref + CK.S_FINISH_EVENT) == null) + if (context.getSessionData(pref + CK.S_FINISH_EVENT) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("stageEditorFinishEvent") + " (" + Lang.get("noneSet") + ")\n"; - else + } else { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("stageEditorFinishEvent") + " (" + AQUA + ((String) context.getSessionData(pref + CK.S_FINISH_EVENT)) + YELLOW + ")\n"; + } - if(context.getSessionData(pref + CK.S_DEATH_EVENT) == null) + if (context.getSessionData(pref + CK.S_DEATH_EVENT) == null) { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("stageEditorDeathEvent") + " (" + Lang.get("noneSet") + ")\n"; - else + } else { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("stageEditorDeathEvent") + " (" + AQUA + ((String) context.getSessionData(pref + CK.S_DEATH_EVENT)) + YELLOW + ")\n"; + } - if(context.getSessionData(pref + CK.S_DISCONNECT_EVENT) == null) + if (context.getSessionData(pref + CK.S_DISCONNECT_EVENT) == null) { text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("stageEditorDisconnectEvent") + " (" + Lang.get("noneSet") + ")\n"; - else + } else { text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("stageEditorDisconnectEvent") + " (" + AQUA + ((String) context.getSessionData(pref + CK.S_DISCONNECT_EVENT)) + YELLOW + ")\n"; + } - if(context.getSessionData(pref + CK.S_CHAT_EVENTS) == null) + if (context.getSessionData(pref + CK.S_CHAT_EVENTS) == null) { text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("stageEditorChatEvents") + " (" + Lang.get("noneSet") + ")\n"; - else{ + } else { text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("stageEditorChatEvents") + "\n"; LinkedList chatEvents = (LinkedList) context.getSessionData(pref + CK.S_CHAT_EVENTS); LinkedList chatEventTriggers = (LinkedList) context.getSessionData(pref + CK.S_CHAT_EVENT_TRIGGERS); - for(String event : chatEvents) + for (String event : chatEvents) { text += AQUA + " - " + event + BLUE + " (" + Lang.get("stageEditorTriggeredBy") + ": \"" + chatEventTriggers.get(chatEvents.indexOf(event)) + "\")\n"; + } } @@ -3422,31 +3387,31 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } /* - en.put("stageEditorStageEvents", "Stage Events"); - en.put("stageEditorStartEvent", "Start Event"); - en.put("stageEditorFinishEvent", "Finish Event"); - en.put("stageEditorChatEvents", "Chat Events"); - en.put("stageEditorDeathEvent", "Death Event"); - en.put("stageEditorDisconnectEvent", "Disconnect Event"); + en.put("stageEditorStageEvents", "Stage Events"); + en.put("stageEditorStartEvent", "Start Event"); + en.put("stageEditorFinishEvent", "Finish Event"); + en.put("stageEditorChatEvents", "Chat Events"); + en.put("stageEditorDeathEvent", "Death Event"); + en.put("stageEditorDisconnectEvent", "Disconnect Event"); */ - @Override protected Prompt acceptValidatedInput(ConversationContext context, String input) { - if(input.equalsIgnoreCase("1")) + if (input.equalsIgnoreCase("1")) { return new StartEventPrompt(); - else if(input.equalsIgnoreCase("2")) + } else if (input.equalsIgnoreCase("2")) { return new FinishEventPrompt(); - else if(input.equalsIgnoreCase("3")) + } else if (input.equalsIgnoreCase("3")) { return new DeathEventPrompt(); - else if(input.equalsIgnoreCase("4")) + } else if (input.equalsIgnoreCase("4")) { return new DisconnectEventPrompt(); - else if(input.equalsIgnoreCase("5")) + } else if (input.equalsIgnoreCase("5")) { return new ChatEventPrompt(); - else if(input.equalsIgnoreCase("6")) + } else if (input.equalsIgnoreCase("6")) { return new CreateStagePrompt(stageNum, questFactory, citizens); - else + } else { return new EventListPrompt(); + } } @@ -3457,7 +3422,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = DARKGREEN + "- " + Lang.get("stageEditorStartEvent") + " -\n"; + String text = DARKGREEN + "- " + Lang.get("stageEditorStartEvent") + " -\n"; if (questFactory.quests.events.isEmpty()) { text += RED + "- None"; } else { @@ -3514,7 +3479,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = DARKGREEN + "- " + Lang.get("stageEditorFinishEvent") + " -\n"; + String text = DARKGREEN + "- " + Lang.get("stageEditorFinishEvent") + " -\n"; if (questFactory.quests.events.isEmpty()) { text += RED + "- None"; } else { @@ -3571,7 +3536,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = DARKGREEN + "- " + Lang.get("stageEditorDeathEvent") + " -\n"; + String text = DARKGREEN + "- " + Lang.get("stageEditorDeathEvent") + " -\n"; if (questFactory.quests.events.isEmpty()) { text += RED + "- None"; } else { @@ -3628,7 +3593,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = DARKGREEN + "- " + Lang.get("stageEditorDisconnectEvent") + " -\n"; + String text = DARKGREEN + "- " + Lang.get("stageEditorDisconnectEvent") + " -\n"; if (questFactory.quests.events.isEmpty()) { text += RED + "- None"; } else { @@ -3685,7 +3650,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = DARKGREEN + "- " + Lang.get("stageEditorChatEvents") + " -\n"; + String text = DARKGREEN + "- " + Lang.get("stageEditorChatEvents") + " -\n"; if (questFactory.quests.events.isEmpty()) { text += RED + "- None"; } else { @@ -3745,7 +3710,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { String tempEvent = (String) context.getSessionData(pref + CK.S_CHAT_TEMP_EVENT); - String text = GOLD + "- " + Lang.get("stageEditorChatTrigger") + " -\n"; + String text = GOLD + "- " + Lang.get("stageEditorChatTrigger") + " -\n"; text += YELLOW + Lang.get("stageEditorChatEventsTriggerPromptA") + " " + AQUA + tempEvent + " " + YELLOW + Lang.get("stageEditorChatEventsTriggerPromptB"); return text; @@ -3756,7 +3721,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) { - if(context.getSessionData(pref + CK.S_CHAT_EVENTS) == null){ + if (context.getSessionData(pref + CK.S_CHAT_EVENTS) == null) { LinkedList chatEvents = new LinkedList(); LinkedList chatEventTriggers = new LinkedList(); @@ -3771,7 +3736,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { return new EventListPrompt(); - }else { + } else { LinkedList chatEvents = (LinkedList) context.getSessionData(pref + CK.S_CHAT_EVENTS); LinkedList chatEventTriggers = (LinkedList) context.getSessionData(pref + CK.S_CHAT_EVENT_TRIGGERS); @@ -3810,39 +3775,38 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public Prompt acceptInput(ConversationContext context, String input) { Player player = (Player) context.getForWhom(); - + if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) { - return new CreateStagePrompt(stageNum, questFactory, citizens); + return new CreateStagePrompt(stageNum, questFactory, citizens); } if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { - context.setSessionData(pref + CK.S_DELAY, null); + context.setSessionData(pref + CK.S_DELAY, null); player.sendMessage(GREEN + "Delay cleared."); return new CreateStagePrompt(stageNum, questFactory, citizens); } - long l; try { - l = Long.parseLong(input); + l = Long.parseLong(input); } catch (NumberFormatException e) { - //returns -1 if incorrect input - l = MiscUtil.getTimeFromString(input); + //returns -1 if incorrect input + l = MiscUtil.getTimeFromString(input); - if (l == -1) { - player.sendMessage(RED + Lang.get("stageEditorNoNumber")); - return new DelayPrompt(); - } + if (l == -1) { + player.sendMessage(RED + Lang.get("stageEditorNoNumber")); + return new DelayPrompt(); + } } if (l < 1000) { - player.sendMessage(RED + Lang.get("stageEditorInvalidDelay")); - return new DelayPrompt(); + player.sendMessage(RED + Lang.get("stageEditorInvalidDelay")); + return new DelayPrompt(); } else { - context.setSessionData(pref + CK.S_DELAY, l); - return new CreateStagePrompt(stageNum, questFactory, citizens); + context.setSessionData(pref + CK.S_DELAY, l); + return new CreateStagePrompt(stageNum, questFactory, citizens); } } @@ -3917,199 +3881,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { player.sendMessage(YELLOW + "Denizen script cleared."); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { - return new CreateStagePrompt(stageNum, questFactory, citizens); - } - - } - } - - private class EpicBossListPrompt extends FixedSetPrompt { - - public EpicBossListPrompt() { - super("1", "2", "3", "4"); - } - - @Override - public String getPromptText(ConversationContext cc) { - String text = GOLD + "- " + DARKRED + Lang.get("stageEditorKillBosses") + GOLD + " -\n"; - - if (cc.getSessionData(pref + "bossIds") == null) { - text += BOLD + "" + RED + "1 " + RESET + RED + "- " + Lang.get("stageEditorSetBosses") + " (" + Lang.get("noneSet") + ")\n"; - } else { - text += BOLD + "" + RED + "1 " + RESET + RED + "- " + Lang.get("stageEditorSetBosses") + "\n"; - LinkedList ids = (LinkedList) cc.getSessionData(pref + "bossIds"); - for (String id : ids) { - - for (EpicMobs em : Quests.epicBoss.listMobs) { - - if (em.cmdName.equalsIgnoreCase(id)) { - text += GOLD + " - " + YELLOW + em.cmdName + "\n"; - break; - } - - } - } - } - - if (cc.getSessionData(pref + "bossAmounts") == null) { - text += BOLD + "" + RED + "2 " + RESET + RED + "- " + Lang.get("stageEditorSetKillAmounts") + " (" + Lang.get("noneSet") + ")\n"; - } else { - text += BOLD + "" + RED + "2 " + RESET + RED + "- " + Lang.get("stageEditorSetKillAmounts") + "\n"; - LinkedList amounts = (LinkedList) cc.getSessionData(pref + "bossAmounts"); - for (int amount : amounts) { - text += GOLD + " - " + YELLOW + amount + "\n"; - } - } - - text += BOLD + "" + RED + "3 " + RESET + RED + "- " + Lang.get("clear") + "\n"; - text += BOLD + "" + RED + "4 " + RESET + GREEN + "- " + Lang.get("done"); - - return text; - } - - @Override - protected Prompt acceptValidatedInput(ConversationContext cc, String input) { - - if (input.equalsIgnoreCase("1")) { - return new EpicBossIDListPrompt(); - }else if(input.equalsIgnoreCase("2")) { - return new EpicBossAmountListPrompt(); - }else if(input.equalsIgnoreCase("3")) { - - cc.setSessionData(pref + "bossIds", null); - cc.setSessionData(pref + "bossAmounts", null); - - cc.getForWhom().sendRawMessage(YELLOW + Lang.get("stageEditorBossesCleared")); - return new EpicBossListPrompt(); - - }else if(input.equalsIgnoreCase("4")) { - - int idNum = 0; - int amountNum = 0; - - if(cc.getSessionData(pref + "bossIds") != null) - idNum = ((LinkedList) cc.getSessionData(pref + "bossIds")).size(); - - if(cc.getSessionData(pref + "bossAmounts") != null) - amountNum = ((LinkedList) cc.getSessionData(pref + "bossAmounts")).size(); - - if(idNum != amountNum){ - - cc.getForWhom().sendRawMessage(RED + Lang.get("stageEditorBossesNotSameSize")); - return new EpicBossListPrompt(); - } - return new CreateStagePrompt(stageNum, questFactory, citizens); } - return new EpicBossListPrompt(); - - } - } - - private class EpicBossIDListPrompt extends StringPrompt { - - @Override - public String getPromptText(ConversationContext cc) { - String text = GOLD + "- " + DARKRED + Lang.get("stageEditorBosses") + GOLD + " -\n"; - if (Quests.epicBoss.listMobs.isEmpty()) { - text += RED + "- " + Lang.get("none") + "\n"; - } else { - - for (EpicMobs em : Quests.epicBoss.listMobs) { - text += RED + " - " + em.cmdName + "\n"; - } - - } - - text += "\n"; - text += YELLOW + Lang.get("stageEditorBossNamePrompt"); - - return text; - } - - @Override - public Prompt acceptInput(ConversationContext cc, String input) { - - if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) { - - String[] ids = input.split(" "); - LinkedList idList = new LinkedList(); - for (String id : ids) { - - EpicMobs found = null; - - for (EpicMobs em : Quests.epicBoss.listMobs) { - if (em.cmdName.equalsIgnoreCase(id)) { - found = em; - break; - } - } - - if (found == null) { - cc.getForWhom().sendRawMessage(RED + Lang.get("stageEditorInvalidBoss") + " " + id + "!"); - return new EpicBossIDListPrompt(); - } else { - if (idList.contains(found.cmdName)) { - cc.getForWhom().sendRawMessage(RED + Lang.get("stageEditorContainsDuplicates")); - return new EpicBossIDListPrompt(); - } else { - idList.add(found.cmdName); - } - } - - } - - cc.setSessionData(pref + "bossIds", idList); - - } - - return new EpicBossListPrompt(); - - } - } - - private class EpicBossAmountListPrompt extends StringPrompt { - - @Override - public String getPromptText(ConversationContext cc) { - String text = YELLOW + Lang.get("stageEditorBossAmountPrompt"); - - return text; - } - - @Override - public Prompt acceptInput(ConversationContext cc, String input) { - - if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) { - - String[] amounts = input.split(" "); - LinkedList amountList = new LinkedList(); - for (String amount : amounts) { - - try { - - int i = Integer.parseInt(amount); - if(i < 1){ - cc.getForWhom().sendRawMessage(RED + amount + " " + Lang.get("stageEditorNotGreaterThanZero")); - return new EpicBossAmountListPrompt(); - } - - amountList.add(i); - - } catch (NumberFormatException e) { - cc.getForWhom().sendRawMessage(RED + amount + " " + Lang.get("stageEditorInvalidNumber")); - return new EpicBossAmountListPrompt(); - } - - } - - cc.setSessionData(pref + "bossAmounts", amountList); - - } - - return new EpicBossListPrompt(); - } } @@ -4145,59 +3919,59 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { private class StartMessagePrompt extends StringPrompt { - @Override - public String getPromptText(ConversationContext context) { + @Override + public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("stageEditorStartMessagePrompt"); + return YELLOW + Lang.get("stageEditorStartMessagePrompt"); - } + } - @Override - public Prompt acceptInput(ConversationContext context, String input) { - Player player = (Player) context.getForWhom(); + @Override + public Prompt acceptInput(ConversationContext context, String input) { + Player player = (Player) context.getForWhom(); - if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { + if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { - context.setSessionData(pref + CK.S_START_MESSAGE, input); - return new CreateStagePrompt(stageNum, questFactory, citizens); + context.setSessionData(pref + CK.S_START_MESSAGE, input); + return new CreateStagePrompt(stageNum, questFactory, citizens); - } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { - context.setSessionData(pref + CK.S_START_MESSAGE, null); - player.sendMessage(YELLOW + Lang.get("stageEditorStartMessageCleared")); - return new CreateStagePrompt(stageNum, questFactory, citizens); - } else { - return new CreateStagePrompt(stageNum, questFactory, citizens); - } - } + } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { + context.setSessionData(pref + CK.S_START_MESSAGE, null); + player.sendMessage(YELLOW + Lang.get("stageEditorStartMessageCleared")); + return new CreateStagePrompt(stageNum, questFactory, citizens); + } else { + return new CreateStagePrompt(stageNum, questFactory, citizens); + } + } } private class CompleteMessagePrompt extends StringPrompt { - @Override - public String getPromptText(ConversationContext context) { + @Override + public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("Enter complete message, or enter \"clear\" to clear the message, or \"cancel\" to return"); + return YELLOW + Lang.get("Enter complete message, or enter \"clear\" to clear the message, or \"cancel\" to return"); - } + } - @Override - public Prompt acceptInput(ConversationContext context, String input) { - Player player = (Player) context.getForWhom(); + @Override + public Prompt acceptInput(ConversationContext context, String input) { + Player player = (Player) context.getForWhom(); - if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { + if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { - context.setSessionData(pref + CK.S_COMPLETE_MESSAGE, input); - return new CreateStagePrompt(stageNum, questFactory, citizens); + context.setSessionData(pref + CK.S_COMPLETE_MESSAGE, input); + return new CreateStagePrompt(stageNum, questFactory, citizens); - } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { - context.setSessionData(pref + CK.S_COMPLETE_MESSAGE, null); - player.sendMessage(YELLOW + Lang.get("stageEditorCompleteMessageCleared")); - return new CreateStagePrompt(stageNum, questFactory, citizens); - } else { - return new CreateStagePrompt(stageNum, questFactory, citizens); - } - } + } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { + context.setSessionData(pref + CK.S_COMPLETE_MESSAGE, null); + player.sendMessage(YELLOW + Lang.get("stageEditorCompleteMessageCleared")); + return new CreateStagePrompt(stageNum, questFactory, citizens); + } else { + return new CreateStagePrompt(stageNum, questFactory, citizens); + } + } } } diff --git a/src/main/java/me/blackvein/quests/util/CK.java b/src/main/java/me/blackvein/quests/util/CK.java index 685e69c77..87648af1a 100644 --- a/src/main/java/me/blackvein/quests/util/CK.java +++ b/src/main/java/me/blackvein/quests/util/CK.java @@ -67,8 +67,6 @@ public class CK { public static final String S_NPCS_TO_TALK_TO = "npcIdsToTalkTo"; public static final String S_NPCS_TO_KILL = "npcIdsToKill"; public static final String S_NPCS_TO_KILL_AMOUNTS = "npcAmountsToKill"; - public static final String S_BOSS_IDS = "bossIds"; - public static final String S_BOSS_AMOUNTS = "bossAmounts"; public static final String S_MOB_TYPES = "mobTypes"; public static final String S_MOB_AMOUNTS = "mobAmounts"; public static final String S_MOB_KILL_LOCATIONS = "killLocations"; diff --git a/src/main/java/me/blackvein/quests/util/Lang.java b/src/main/java/me/blackvein/quests/util/Lang.java index a196031cc..15bef30a3 100644 --- a/src/main/java/me/blackvein/quests/util/Lang.java +++ b/src/main/java/me/blackvein/quests/util/Lang.java @@ -108,7 +108,6 @@ public class Lang { en.put("stageEditorDeliverItems", "Deliver Items"); en.put("stageEditorTalkToNPCs", "Talk to NPCs"); en.put("stageEditorKillNPCs", "Kill NPCs"); - en.put("stageEditorKillBosses", "Kill Bosses"); en.put("stageEditorKillMobs", "Kill Mobs"); en.put("stageEditorReachLocs", "Reach locations"); en.put("stageEditorReachRadii1", "Reach within"); @@ -159,7 +158,6 @@ public class Lang { en.put("stageEditorSetTameAmounts", "Set tame amounts"); en.put("stageEditorSetShearColors", "Set sheep colors"); en.put("stageEditorSetShearAmounts", "Set shear amounts"); - en.put("stageEditorSetBosses", "Set Bosses"); en.put("stageEditorEnterBlockIds", "Enter block IDs, separating each one by a space, or enter \'cancel\' to return."); en.put("stageEditorBreakBlocksPrompt", "Enter block amounts (numbers), separating each one by a space, or enter \'cancel\' to return."); @@ -194,8 +192,6 @@ public class Lang { en.put("stageEditorDelayPrompt", "Enter time (in milliseconds), or enter \"clear\" to clear the delay, or \"cancel\" to return"); en.put("stageEditorDelayMessagePrompt", "Enter delay message, or enter \"clear\" to clear the message, or \"cancel\" to return"); en.put("stageEditorScriptPrompt", "Enter script name, or enter \"clear\" to clear the script, or \"cancel\" to return"); - en.put("stageEditorBossNamePrompt", "Enter Boss names, separating each one by a space, or \"cancel\" to return."); - en.put("stageEditorBossAmountPrompt", "Enter kill amounts (numbers), separating each one by a space, or \"cancel\" to return."); en.put("stageEditorStartMessagePrompt", "Enter start message, or enter \"clear\" to clear the message, or \"cancel\" to return"); en.put("stageEditorCompleteMessagePrompt", "Enter complete message, or enter \"clear\" to clear the message, or \"cancel\" to return"); @@ -215,10 +211,8 @@ public class Lang { en.put("stageEditorDuplicateEvent", "Event is already in the list!"); en.put("stageEditorInvalidDelay", "Delay must be at least one second!"); en.put("stageEditorInvalidScript", "Denizen script not found!"); - en.put("stageEditorInvalidBoss", "Could not find Boss with the name:"); en.put("stageEditorNoCitizens", "Citizens is not installed!"); - en.put("stageEditorNoEpicBoss", "EpicBoss is not installed!"); en.put("stageEditorNoDenizen", "Denizen is not installed!"); en.put("stageEditorPositiveAmount", "You must enter a positive number!"); @@ -250,7 +244,6 @@ public class Lang { en.put("stageEditorMobTypesNotSameSize", "The mob types list and the mob amounts list are not the same size!"); en.put("stageEditorTameMobsNotSameSize", "The mob types list and the tame amounts list are not the same size!"); en.put("stageEditorShearNotSameSize", "The sheep colors list and the shear amounts list are not the same size!"); - en.put("stageEditorBossesNotSameSize", "The Boss IDs list and the Boss amounts list are not the same size!"); en.put("stageEditorListContainsDuplicates", " List contains duplicates!"); @@ -265,7 +258,6 @@ public class Lang { en.put("stageEditorKillMobsCleared", "Kill Mobs objective cleared."); en.put("stageEditorTameCleared", "Tame Mobs objective cleared."); en.put("stageEditorShearCleared", "Shear Sheep objective cleared."); - en.put("stageEditorBossesCleared", "Kill Bosses objective cleared."); en.put("stageEditorStartMessageCleared", "Start message cleared."); en.put("stageEditorCompleteMessageCleared", "Complete message cleared."); @@ -277,7 +269,6 @@ public class Lang { en.put("stageEditorNPCNote", "Note: You may specify the name of the NPC with "); en.put("stageEditorOptional", "Optional"); en.put("stageEditorColors", "Sheep Colors"); - en.put("stageEditorBosses", "Bosses"); //Events