From ae27c83253dd60b556049589becd480962ace0ed Mon Sep 17 00:00:00 2001 From: Zino Date: Sat, 3 Aug 2013 18:19:52 +0200 Subject: [PATCH] *Context data names to CK class. --- src/me/blackvein/quests/EventFactory.java | 495 +++++++-------- src/me/blackvein/quests/Party.java | 10 +- src/me/blackvein/quests/QuestFactory.java | 418 ++++++------- .../quests/prompts/CreateStagePrompt.java | 566 +++++++++--------- .../quests/prompts/RequirementsPrompt.java | 95 +-- .../quests/prompts/RewardsPrompt.java | 97 +-- .../quests/prompts/StagesPrompt.java | 150 ++--- src/me/blackvein/quests/util/CK.java | 111 ++++ 8 files changed, 1037 insertions(+), 905 deletions(-) create mode 100644 src/me/blackvein/quests/util/CK.java diff --git a/src/me/blackvein/quests/EventFactory.java b/src/me/blackvein/quests/EventFactory.java index c9b568bec..d8f2b1671 100644 --- a/src/me/blackvein/quests/EventFactory.java +++ b/src/me/blackvein/quests/EventFactory.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import me.blackvein.quests.prompts.ItemStackPrompt; +import me.blackvein.quests.util.CK; import me.blackvein.quests.util.ItemUtil; import me.blackvein.quests.util.Lang; import net.citizensnpcs.api.CitizensAPI; @@ -109,7 +110,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if(player.hasPermission("quests.editor.events.create")){ - context.setSessionData("oldEvent", ""); + context.setSessionData(CK.E_OLD_EVENT, ""); return new EventNamePrompt(); }else{ player.sendMessage(RED + "You do not have permission to create new Events."); @@ -169,50 +170,50 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public static void clearData(ConversationContext context) { - context.setSessionData("oldEvent", null); - context.setSessionData("evtName", null); - context.setSessionData("evtMessage", null); - context.setSessionData("evtClearInv", null); - context.setSessionData("evtItemIds", null); - context.setSessionData("evtItemAmounts", null); - context.setSessionData("evtExplosions", null); - context.setSessionData("evtEffects", null); - context.setSessionData("evtEffectLocations", null); - context.setSessionData("evtStormWorld", null); - context.setSessionData("evtStormDuration", null); - context.setSessionData("evtThunderWorld", null); - context.setSessionData("evtThunderDuration", null); - context.setSessionData("evtMobTypes", null); - context.setSessionData("evtMobAmounts", null); - context.setSessionData("evtMobLocations", null); - context.setSessionData("evtLightningStrikes", null); - context.setSessionData("evtPotionTypes", null); - context.setSessionData("evtPotionDurations", null); - context.setSessionData("evtPotionMagnitudes", null); - context.setSessionData("evtHunger", null); - context.setSessionData("evtSaturation", null); - context.setSessionData("evtHealth", null); - context.setSessionData("evtTeleportLocation", null); - context.setSessionData("evtCommands", null); + context.setSessionData(CK.E_OLD_EVENT, null); + context.setSessionData(CK.E_NAME, null); + context.setSessionData(CK.E_MESSAGE, null); + context.setSessionData(CK.E_CLEAR_INVENTORY, null); + context.setSessionData(CK.E_ITEMS, null); + context.setSessionData(CK.E_ITEMS_AMOUNTS, null); + context.setSessionData(CK.E_EXPLOSIONS, null); + context.setSessionData(CK.E_EFFECTS, null); + context.setSessionData(CK.E_EFFECTS_LOCATIONS, null); + context.setSessionData(CK.E_WORLD_STORM, null); + context.setSessionData(CK.E_WORLD_STORM_DURATION, null); + context.setSessionData(CK.E_WORLD_THUNDER, null); + context.setSessionData(CK.E_WORLD_THUNDER_DURATION, null); + context.setSessionData(CK.E_MOB_TYPES, null); + context.setSessionData(CK.E_MOB_AMOUNTS, null); + context.setSessionData(CK.E_MOB_LOCATIONS, null); + context.setSessionData(CK.E_LIGHTNING, null); + context.setSessionData(CK.E_POTION_TYPES, null); + context.setSessionData(CK.E_POTION_DURATIONS, null); + context.setSessionData(CK.E_POTION_STRENGHT, null); + context.setSessionData(CK.E_HUNGER, null); + context.setSessionData(CK.E_SATURATION, null); + context.setSessionData(CK.E_HEALTH, null); + context.setSessionData(CK.E_TELEPORT, null); + context.setSessionData(CK.E_COMMANDS, null); } public static void loadData(Event event, ConversationContext context){ if(event.message != null) - context.setSessionData("evtMessage", event.message); + context.setSessionData(CK.E_MESSAGE, event.message); if(event.clearInv == true) - context.setSessionData("evtClearInv", "Yes"); + context.setSessionData(CK.E_CLEAR_INVENTORY, "Yes"); else - context.setSessionData("evtClearInv", "No"); + context.setSessionData(CK.E_CLEAR_INVENTORY, "No"); if(event.items != null && event.items.isEmpty() == false){ LinkedList items = new LinkedList(); items.addAll(event.items); - context.setSessionData("evtItems", items); + context.setSessionData(CK.E_ITEMS, items); } @@ -223,7 +224,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ for(Location loc : event.explosions) locs.add(Quests.getLocationInfo(loc)); - context.setSessionData("evtExplosions", locs); + context.setSessionData(CK.E_EXPLOSIONS, locs); } @@ -239,22 +240,22 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - context.setSessionData("evtEffects", effs); - context.setSessionData("evtEffectLocations", locs); + context.setSessionData(CK.E_EFFECTS, effs); + context.setSessionData(CK.E_EFFECTS_LOCATIONS, locs); } if(event.stormWorld != null){ - context.setSessionData("evtStormWorld", event.stormWorld.getName()); - context.setSessionData("evtStormDuration", (long)event.stormDuration); + context.setSessionData(CK.E_WORLD_STORM, event.stormWorld.getName()); + context.setSessionData(CK.E_WORLD_STORM_DURATION, (long)event.stormDuration); } if(event.thunderWorld != null){ - context.setSessionData("evtThunderWorld", event.thunderWorld.getName()); - context.setSessionData("evtThunderDuration", (long)event.thunderDuration); + context.setSessionData(CK.E_WORLD_THUNDER, event.thunderWorld.getName()); + context.setSessionData(CK.E_WORLD_THUNDER_DURATION, (long)event.thunderDuration); } @@ -272,9 +273,9 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - context.setSessionData("evtMobTypes", types); - context.setSessionData("evtMobAmounts", amounts); - context.setSessionData("evtMobLocations", locs); + context.setSessionData(CK.E_MOB_TYPES, types); + context.setSessionData(CK.E_MOB_AMOUNTS, amounts); + context.setSessionData(CK.E_MOB_LOCATIONS, locs); } @@ -283,7 +284,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ LinkedList locs = new LinkedList(); for(Location loc : event.lightningStrikes) locs.add(Quests.getLocationInfo(loc)); - context.setSessionData("evtLightningStrikes", locs); + context.setSessionData(CK.E_LIGHTNING, locs); } @@ -301,39 +302,39 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - context.setSessionData("evtPotionTypes", types); - context.setSessionData("evtPotionDurations", durations); - context.setSessionData("evtPotionMagnitudes", mags); + context.setSessionData(CK.E_POTION_TYPES, types); + context.setSessionData(CK.E_POTION_DURATIONS, durations); + context.setSessionData(CK.E_POTION_STRENGHT, mags); } if(event.hunger > -1){ - context.setSessionData("evtHunger", (Integer) event.hunger); + context.setSessionData(CK.E_HUNGER, (Integer) event.hunger); } if(event.saturation > -1){ - context.setSessionData("evtSaturation", (Integer) event.saturation); + context.setSessionData(CK.E_SATURATION, (Integer) event.saturation); } if(event.health > -1){ - context.setSessionData("evtHealth", (Integer) event.health); + context.setSessionData(CK.E_HEALTH, (Integer) event.health); } if(event.teleport != null){ - context.setSessionData("evtTeleportLocation", Quests.getLocationInfo(event.teleport)); + context.setSessionData(CK.E_TELEPORT, Quests.getLocationInfo(event.teleport)); } if(event.commands != null){ - context.setSessionData("evtCommands", event.commands); + context.setSessionData(CK.E_COMMANDS, event.commands); } @@ -364,8 +365,8 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ for(Event evt : quests.events){ if(evt.name.equalsIgnoreCase(input)){ - context.setSessionData("oldEvent", evt.name); - context.setSessionData("evtName", evt.name); + context.setSessionData(CK.E_OLD_EVENT, evt.name); + context.setSessionData(CK.E_NAME, evt.name); loadData(evt, context); return new CreateMenuPrompt(); } @@ -425,7 +426,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } if(used.isEmpty()){ - context.setSessionData("delEvent", evt.name); + context.setSessionData(CK.ED_EVENT_DELETE, evt.name); return new DeletePrompt(); }else{ ((Player)context.getForWhom()).sendMessage(RED + Lang.get("eventEditorEventInUse") + " \"" + PURPLE + evt.name + RED + "\":"); @@ -456,7 +457,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public String getPromptText(ConversationContext context) { String text = - RED + Lang.get("eventEditorDeletePrompt") + " \"" + GOLD + (String)context.getSessionData("delEvent") + RED + "\"?\n"; + RED + Lang.get("eventEditorDeletePrompt") + " \"" + GOLD + (String)context.getSessionData(CK.ED_EVENT_DELETE) + RED + "\"?\n"; text += YELLOW + Lang.get("yes") + "/" + Lang.get("no"); return text; @@ -491,28 +492,28 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public String getPromptText(ConversationContext context) { String text = - GOLD + "- " + Lang.get("event") + ": " + AQUA + context.getSessionData("evtName") + GOLD + " -\n"; + GOLD + "- " + Lang.get("event") + ": " + AQUA + context.getSessionData(CK.E_NAME) + GOLD + " -\n"; text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetName") + "\n"; - if (context.getSessionData("evtMessage") == null) { + if (context.getSessionData(CK.E_MESSAGE) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMessage") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMessage") + "(" + AQUA + "\"" + context.getSessionData("evtMessage") + "\"" + YELLOW + ")\n"; + text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMessage") + "(" + AQUA + "\"" + context.getSessionData(CK.E_MESSAGE) + "\"" + YELLOW + ")\n"; } - if (context.getSessionData("evtClearInv") == null) { - context.setSessionData("evtClearInv", "No"); + if (context.getSessionData(CK.E_CLEAR_INVENTORY) == null) { + context.setSessionData(CK.E_CLEAR_INVENTORY, "No"); } - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorClearInv") + ": " + AQUA + context.getSessionData("evtClearInv") + "\n"; + text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorClearInv") + ": " + AQUA + context.getSessionData(CK.E_CLEAR_INVENTORY) + "\n"; - if (context.getSessionData("evtItems") == null) { + if (context.getSessionData(CK.E_ITEMS) == null) { text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("eventEditorSetItems") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("eventEditorSetItems") + "\n"; - LinkedList items = (LinkedList) context.getSessionData("evtItems"); + LinkedList items = (LinkedList) context.getSessionData(CK.E_ITEMS); for (ItemStack is : items) { @@ -522,12 +523,12 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if (context.getSessionData("evtExplosions") == null) { + if (context.getSessionData(CK.E_EXPLOSIONS) == null) { text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("eventEditorSetExplosions") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("eventEditorSetExplosions") + "\n"; - LinkedList locations = (LinkedList) context.getSessionData("evtExplosions"); + LinkedList locations = (LinkedList) context.getSessionData(CK.E_EXPLOSIONS); for (String loc : locations) { @@ -537,13 +538,13 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if (context.getSessionData("evtEffects") == null) { + if (context.getSessionData(CK.E_EFFECTS) == null) { text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("eventEditorSetEffects") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("eventEditorSetEffects") + "\n"; - LinkedList effects = (LinkedList) context.getSessionData("evtEffects"); - LinkedList locations = (LinkedList) context.getSessionData("evtEffectLocations"); + LinkedList effects = (LinkedList) context.getSessionData(CK.E_EFFECTS); + LinkedList locations = (LinkedList) context.getSessionData(CK.E_EFFECTS_LOCATIONS); for (String effect : effects) { @@ -553,25 +554,25 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if (context.getSessionData("evtStormWorld") == null) { + if (context.getSessionData(CK.E_WORLD_STORM) == null) { text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("eventEditorSetStorm") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("eventEditorSetStorm") + " (" + AQUA + (String) context.getSessionData("evtStormWorld") + YELLOW + " -> " + DARKAQUA + Quests.getTime((Long) context.getSessionData("evtStormDuration")) + YELLOW + ")\n"; + text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("eventEditorSetStorm") + " (" + AQUA + (String) context.getSessionData(CK.E_WORLD_STORM) + YELLOW + " -> " + DARKAQUA + Quests.getTime((Long) context.getSessionData(CK.E_WORLD_STORM_DURATION)) + YELLOW + ")\n"; } - if (context.getSessionData("evtThunderWorld") == null) { + if (context.getSessionData(CK.E_WORLD_THUNDER) == null) { text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("eventEditorSetThunder") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("eventEditorSetThunder") + " (" + AQUA + (String) context.getSessionData("evtThunderWorld") + YELLOW + " -> " + DARKAQUA + Quests.getTime((Long) context.getSessionData("evtThunderDuration")) + YELLOW + ")\n"; + text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("eventEditorSetThunder") + " (" + AQUA + (String) context.getSessionData(CK.E_WORLD_THUNDER) + YELLOW + " -> " + DARKAQUA + Quests.getTime((Long) context.getSessionData(CK.E_WORLD_THUNDER_DURATION)) + YELLOW + ")\n"; } - if (context.getSessionData("evtMobTypes") == null) { + if (context.getSessionData(CK.E_MOB_TYPES) == null) { text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobSpawns") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - LinkedList types = (LinkedList) context.getSessionData("evtMobTypes"); - LinkedList amounts = (LinkedList) context.getSessionData("evtMobAmounts"); - LinkedList locations = (LinkedList) context.getSessionData("evtMobLocations"); + LinkedList types = (LinkedList) context.getSessionData(CK.E_MOB_TYPES); + LinkedList amounts = (LinkedList) context.getSessionData(CK.E_MOB_AMOUNTS); + LinkedList locations = (LinkedList) context.getSessionData(CK.E_MOB_LOCATIONS); text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobSpawns") + "\n"; @@ -582,12 +583,12 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } } - if (context.getSessionData("evtLightningStrikes") == null) { + if (context.getSessionData(CK.E_LIGHTNING) == null) { text += BLUE + "" + BOLD + "10" + RESET + YELLOW + " - " + Lang.get("eventEditorSetLightning") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += BLUE + "" + BOLD + "10" + RESET + YELLOW + " - " + Lang.get("eventEditorSetLightning") + "\n"; - LinkedList locations = (LinkedList) context.getSessionData("evtLightningStrikes"); + LinkedList locations = (LinkedList) context.getSessionData(CK.E_LIGHTNING); for (String loc : locations) { @@ -597,14 +598,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if (context.getSessionData("evtPotionTypes") == null) { + if (context.getSessionData(CK.E_POTION_TYPES) == null) { text += BLUE + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionEffects") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += BLUE + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionEffects") + "\n"; - LinkedList types = (LinkedList) context.getSessionData("evtPotionTypes"); - LinkedList durations = (LinkedList) context.getSessionData("evtPotionDurations"); - LinkedList mags = (LinkedList) context.getSessionData("evtPotionMagnitudes"); + LinkedList types = (LinkedList) context.getSessionData(CK.E_POTION_TYPES); + LinkedList durations = (LinkedList) context.getSessionData(CK.E_POTION_DURATIONS); + LinkedList mags = (LinkedList) context.getSessionData(CK.E_POTION_STRENGHT); int index = -1; for (String type : types) { @@ -616,44 +617,44 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if(context.getSessionData("evtHunger") == null) { + if(context.getSessionData(CK.E_HUNGER) == null) { text += BLUE + "" + BOLD + "12" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHunger") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "12" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHunger") + AQUA + " (" + (Integer)context.getSessionData("evtHunger") + ")\n"; + text += BLUE + "" + BOLD + "12" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHunger") + AQUA + " (" + (Integer)context.getSessionData(CK.E_HUNGER) + ")\n"; } - if(context.getSessionData("evtSaturation") == null) { + if(context.getSessionData(CK.E_SATURATION) == null) { text += BLUE + "" + BOLD + "13" + RESET + YELLOW + " - " + Lang.get("eventEditorSetSaturation") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "13" + RESET + YELLOW + " - " + Lang.get("eventEditorSetSaturation") + AQUA + " (" + (Integer)context.getSessionData("evtSaturation") + ")\n"; + text += BLUE + "" + BOLD + "13" + RESET + YELLOW + " - " + Lang.get("eventEditorSetSaturation") + AQUA + " (" + (Integer)context.getSessionData(CK.E_SATURATION) + ")\n"; } - if(context.getSessionData("evtHealth") == null) { + if(context.getSessionData(CK.E_HEALTH) == null) { text += BLUE + "" + BOLD + "14" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHealth") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "14" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHealth") + AQUA + " (" + (Integer)context.getSessionData("evtHealth") + ")\n"; + text += BLUE + "" + BOLD + "14" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHealth") + AQUA + " (" + (Integer)context.getSessionData(CK.E_HEALTH) + ")\n"; } - if(context.getSessionData("evtTeleportLocation") == null) { + if(context.getSessionData(CK.E_TELEPORT) == null) { text += BLUE + "" + BOLD + "15" + RESET + YELLOW + " - " + Lang.get("eventEditorSetTeleport") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "15" + RESET + YELLOW + " - " + Lang.get("eventEditorSetTeleport") + AQUA + " (" + (String)context.getSessionData("evtTeleportLocation") + ")\n"; + text += BLUE + "" + BOLD + "15" + RESET + YELLOW + " - " + Lang.get("eventEditorSetTeleport") + AQUA + " (" + (String)context.getSessionData(CK.E_TELEPORT) + ")\n"; } - if(context.getSessionData("evtCommands") == null) { + if(context.getSessionData(CK.E_COMMANDS) == null) { text += BLUE + "" + BOLD + "16" + RESET + YELLOW + " - " + Lang.get("eventEditorSetCommands") + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += BLUE + "" + BOLD + "16" + RESET + YELLOW + " - " + Lang.get("eventEditorSetCommands") + "\n"; - for(String s : (LinkedList)context.getSessionData("evtCommands")) + for(String s : (LinkedList)context.getSessionData(CK.E_COMMANDS)) text += GRAY + " - " + AQUA + s + "\n"; } @@ -678,11 +679,11 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else if (input.equalsIgnoreCase("3")) { - String s = (String) context.getSessionData("evtClearInv"); + String s = (String) context.getSessionData(CK.E_CLEAR_INVENTORY); if (s.equalsIgnoreCase("Yes")) { - context.setSessionData("evtClearInv", "No"); + context.setSessionData(CK.E_CLEAR_INVENTORY, "No"); } else { - context.setSessionData("evtClearInv", "Yes"); + context.setSessionData(CK.E_CLEAR_INVENTORY, "Yes"); } return new CreateMenuPrompt(); @@ -744,8 +745,8 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else if (input.equalsIgnoreCase("17")) { - if(context.getSessionData("oldEvent") != null){ - return new FinishPrompt((String)context.getSessionData("oldEvent")); + if(context.getSessionData(CK.E_OLD_EVENT) != null){ + return new FinishPrompt((String)context.getSessionData(CK.E_OLD_EVENT)); }else{ return new FinishPrompt(null); } @@ -826,7 +827,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public String getPromptText(ConversationContext context) { String text = - RED + Lang.get("eventEditorFinishAndSave") + " \"" + GOLD + (String)context.getSessionData("evtName") + RED + "\"?\n"; + RED + Lang.get("eventEditorFinishAndSave") + " \"" + GOLD + (String)context.getSessionData(CK.E_NAME) + RED + "\"?\n"; if(modified.isEmpty() == false){ text += RED + Lang.get("eventEditorModifiedNote") + "\n"; for(String s : modified) @@ -903,7 +904,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ return; } - String event = (String)context.getSessionData("delEvent"); + String event = (String)context.getSessionData(CK.ED_EVENT_DELETE); ConfigurationSection sec = data.getConfigurationSection("events"); sec.set(event, null); @@ -939,27 +940,27 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ return; } - if(((String) context.getSessionData("oldEvent")).isEmpty() == false){ - data.set("events." + (String)context.getSessionData("oldEvent"), null); - quests.events.remove(quests.getEvent((String)context.getSessionData("oldEvent"))); + if(((String) context.getSessionData(CK.E_OLD_EVENT)).isEmpty() == false){ + data.set("events." + (String)context.getSessionData(CK.E_OLD_EVENT), null); + quests.events.remove(quests.getEvent((String)context.getSessionData(CK.E_OLD_EVENT))); } - ConfigurationSection section = data.createSection("events." + (String)context.getSessionData("evtName")); - names.remove((String)context.getSessionData("evtName")); + ConfigurationSection section = data.createSection("events." + (String)context.getSessionData(CK.E_NAME)); + names.remove((String)context.getSessionData(CK.E_NAME)); - if (context.getSessionData("evtMessage") != null) { - section.set("message", getCString(context, "evtMessage")); + if (context.getSessionData(CK.E_MESSAGE) != null) { + section.set("message", getCString(context, CK.E_MESSAGE)); } - if (context.getSessionData("evtClearInv") != null) { - String s = getCString(context, "evtClearInv"); + if (context.getSessionData(CK.E_CLEAR_INVENTORY) != null) { + String s = getCString(context, CK.E_CLEAR_INVENTORY); if(s.equalsIgnoreCase("Yes")) context.setSessionData("clear-inventory", "true"); } - if (context.getSessionData("evtItems") != null) { + if (context.getSessionData(CK.E_ITEMS) != null) { - LinkedList items = (LinkedList) context.getSessionData("evtItems"); + LinkedList items = (LinkedList) context.getSessionData(CK.E_ITEMS); LinkedList lines = new LinkedList(); for(ItemStack is : items) @@ -969,48 +970,48 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if (context.getSessionData("evtExplosions") != null) { + if (context.getSessionData(CK.E_EXPLOSIONS) != null) { - LinkedList locations = getCStringList(context, "evtExplosions"); + LinkedList locations = getCStringList(context, CK.E_EXPLOSIONS); section.set("explosions", locations); } - if (context.getSessionData("evtEffects") != null) { + if (context.getSessionData(CK.E_EFFECTS) != null) { - LinkedList effects = getCStringList(context, "evtEffects"); - LinkedList locations = getCStringList(context, "evtEffectLocations"); + LinkedList effects = getCStringList(context, CK.E_EFFECTS); + LinkedList locations = getCStringList(context, CK.E_EFFECTS_LOCATIONS); section.set("effects", effects); section.set("effect-locations", locations); } - if (context.getSessionData("evtStormWorld") != null) { + if (context.getSessionData(CK.E_WORLD_STORM) != null) { - String world = getCString(context, "evtStormWorld"); - Long duration = getCLong(context, "evtStormDuration"); + String world = getCString(context, CK.E_WORLD_STORM); + Long duration = getCLong(context, CK.E_WORLD_STORM_DURATION); section.set("storm-world", world); section.set("storm-duration", duration/50L); } - if (context.getSessionData("evtThunderWorld") != null) { + if (context.getSessionData(CK.E_WORLD_THUNDER) != null) { - String world = getCString(context, "evtThunderWorld"); - Long duration = getCLong(context, "evtThunderDuration"); + String world = getCString(context, CK.E_WORLD_THUNDER); + Long duration = getCLong(context, CK.E_WORLD_THUNDER_DURATION); section.set("thunder-world", world); section.set("thunder-duration", duration/50L); } - if (context.getSessionData("evtMobTypes") != null) { + if (context.getSessionData(CK.E_MOB_TYPES) != null) { - LinkedList types = getCStringList(context, "evtMobTypes"); - LinkedList amounts = getCIntList(context, "evtMobAmounts"); - LinkedList locations = getCStringList(context, "evtMobLocations"); + LinkedList types = getCStringList(context, CK.E_MOB_TYPES); + LinkedList amounts = getCIntList(context, CK.E_MOB_AMOUNTS); + LinkedList locations = getCStringList(context, CK.E_MOB_LOCATIONS); section.set("mob-spawn-types", types); section.set("mob-spawn-amounts", amounts); @@ -1018,25 +1019,25 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if (context.getSessionData("evtLightningStrikes") != null) { + if (context.getSessionData(CK.E_LIGHTNING) != null) { - LinkedList locations = getCStringList(context, "evtLightningStrikes"); + LinkedList locations = getCStringList(context, CK.E_LIGHTNING); section.set("lightning-strikes", locations); } - if (context.getSessionData("evtCommands") != null) { + if (context.getSessionData(CK.E_COMMANDS) != null) { - LinkedList commands = getCStringList(context, "evtCommands"); + LinkedList commands = getCStringList(context, CK.E_COMMANDS); section.set("commands", commands); } - if (context.getSessionData("evtPotionTypes") != null) { + if (context.getSessionData(CK.E_POTION_TYPES) != null) { - LinkedList types = getCStringList(context, "evtPotionTypes"); - LinkedList durations = getCLongList(context, "evtPotionDurations"); - LinkedList mags = getCIntList(context, "evtPotionMagnitudes"); + LinkedList types = getCStringList(context, CK.E_POTION_TYPES); + LinkedList durations = getCLongList(context, CK.E_POTION_DURATIONS); + LinkedList mags = getCIntList(context, CK.E_POTION_STRENGHT); section.set("potion-effect-types", types); section.set("potion-effect-durations", durations); @@ -1044,30 +1045,30 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if (context.getSessionData("evtHunger") != null) { + if (context.getSessionData(CK.E_HUNGER) != null) { - Integer i = getCInt(context, "evtHunger"); + Integer i = getCInt(context, CK.E_HUNGER); section.set("hunger", i); } - if (context.getSessionData("evtSaturation") != null) { + if (context.getSessionData(CK.E_SATURATION) != null) { - Integer i = getCInt(context, "evtSaturation"); + Integer i = getCInt(context, CK.E_SATURATION); section.set("saturation", i); } - if (context.getSessionData("evtHealth") != null) { + if (context.getSessionData(CK.E_HEALTH) != null) { - Integer i = getCInt(context, "evtHealth"); + Integer i = getCInt(context, CK.E_HEALTH); section.set("health", i); } - if (context.getSessionData("evtTeleportLocation") != null) { + if (context.getSessionData(CK.E_TELEPORT) != null) { - section.set("teleport-location", getCString(context, "evtTeleportLocation")); + section.set("teleport-location", getCString(context, CK.E_TELEPORT)); } @@ -1132,7 +1133,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - context.setSessionData("evtName", input); + context.setSessionData(CK.E_NAME, input); names.add(input); return new CreateMenuPrompt(); @@ -1195,14 +1196,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ Location loc = block.getLocation(); LinkedList locs; - if (context.getSessionData("evtExplosions") != null) { - locs = (LinkedList) context.getSessionData("evtExplosions"); + if (context.getSessionData(CK.E_EXPLOSIONS) != null) { + locs = (LinkedList) context.getSessionData(CK.E_EXPLOSIONS); } else { locs = new LinkedList(); } locs.add(Quests.getLocationInfo(loc)); - context.setSessionData("evtExplosions", locs); + context.setSessionData(CK.E_EXPLOSIONS, locs); selectedExplosionLocations.remove(player); } else { @@ -1214,7 +1215,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { - context.setSessionData("evtExplosions", null); + context.setSessionData(CK.E_EXPLOSIONS, null); selectedExplosionLocations.remove(player); return new CreateMenuPrompt(); @@ -1265,8 +1266,8 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - names.remove((String) context.getSessionData("evtName")); - context.setSessionData("evtName", input); + names.remove((String) context.getSessionData(CK.E_NAME)); + context.setSessionData(CK.E_NAME, input); names.add(input); } @@ -1289,9 +1290,9 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public Prompt acceptInput(ConversationContext context, String input) { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase("cmdNone") == false) { - context.setSessionData("evtMessage", input); + context.setSessionData(CK.E_MESSAGE, input); } else if (input.equalsIgnoreCase(Lang.get("cmdNone"))) { - context.setSessionData("evtMessage", null); + context.setSessionData(CK.E_MESSAGE, null); } return new CreateMenuPrompt(); @@ -1312,14 +1313,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ // Check/add newly made item if(context.getSessionData("newItem") != null){ - if(context.getSessionData("evtItems") != null){ + if(context.getSessionData(CK.E_ITEMS) != null){ List items = getItems(context); items.add((ItemStack) context.getSessionData("tempStack")); - context.setSessionData("evtItems", items); + context.setSessionData(CK.E_ITEMS, items); }else{ LinkedList itemRews = new LinkedList(); itemRews.add((ItemStack) context.getSessionData("tempStack")); - context.setSessionData("evtItems", itemRews); + context.setSessionData(CK.E_ITEMS, itemRews); } context.setSessionData("newItem", null); @@ -1328,7 +1329,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } String text = GOLD + "- Give Items -\n"; - if(context.getSessionData("evtItems") == null){ + if(context.getSessionData(CK.E_ITEMS) == null){ text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Add item\n"; text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Clear\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Done"; @@ -1358,7 +1359,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ return new ItemStackPrompt(ItemListPrompt.this); }else if(input.equalsIgnoreCase("2")){ context.getForWhom().sendRawMessage(YELLOW + "Event Items cleared."); - context.setSessionData("evtItems", null); + context.setSessionData(CK.E_ITEMS, null); return new ItemListPrompt(); }else if(input.equalsIgnoreCase("3")){ return new CreateMenuPrompt(); @@ -1368,7 +1369,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } private List getItems(ConversationContext context){ - return (List) context.getSessionData("evtItems"); + return (List) context.getSessionData(CK.E_ITEMS); } } @@ -1385,7 +1386,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public String getPromptText(ConversationContext context) { String text = GOLD + "- " + Lang.get("eventEditorEffects") + " -\n"; - if (context.getSessionData("evtEffects") == null) { + if (context.getSessionData(CK.E_EFFECTS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorAddEffect") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "2 - Add effect location (" + Lang.get("eventEditorNoEffects") + ")\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; @@ -1399,7 +1400,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - if (context.getSessionData("evtEffectLocations") == null) { + if (context.getSessionData(CK.E_EFFECTS_LOCATIONS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorAddEffectLocation") + " (" + Lang.get("noneSet") + ")\n"; } else { @@ -1427,7 +1428,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (input.equalsIgnoreCase("1")) { return new EffectPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData("evtEffects") == null) { + if (context.getSessionData(CK.E_EFFECTS) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustAddEffects")); return new EffectListPrompt(); } else { @@ -1436,21 +1437,21 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorEffectsCleared")); - context.setSessionData("evtEffects", null); - context.setSessionData("evtEffectLocations", null); + context.setSessionData(CK.E_EFFECTS, null); + context.setSessionData(CK.E_EFFECTS_LOCATIONS, null); return new EffectListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData("evtEffects") != null) { + if (context.getSessionData(CK.E_EFFECTS) != null) { one = getEffects(context).size(); } else { one = 0; } - if (context.getSessionData("evtEffectLocations") != null) { + if (context.getSessionData(CK.E_EFFECTS_LOCATIONS) != null) { two = getEffectLocations(context).size(); } else { two = 0; @@ -1468,11 +1469,11 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } private List getEffects(ConversationContext context) { - return (List) context.getSessionData("evtEffects"); + return (List) context.getSessionData(CK.E_EFFECTS); } private List getEffectLocations(ConversationContext context) { - return (List) context.getSessionData("evtEffectLocations"); + return (List) context.getSessionData(CK.E_EFFECTS_LOCATIONS); } } @@ -1498,14 +1499,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ Location loc = block.getLocation(); LinkedList locs; - if (context.getSessionData("evtEffectLocations") != null) { - locs = (LinkedList) context.getSessionData("evtEffectLocations"); + if (context.getSessionData(CK.E_EFFECTS_LOCATIONS) != null) { + locs = (LinkedList) context.getSessionData(CK.E_EFFECTS_LOCATIONS); } else { locs = new LinkedList(); } locs.add(Quests.getLocationInfo(loc)); - context.setSessionData("evtEffectLocations", locs); + context.setSessionData(CK.E_EFFECTS_LOCATIONS, locs); selectedEffectLocations.remove(player); } else { @@ -1558,14 +1559,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (Quests.getEffect(input.toUpperCase()) != null) { LinkedList effects; - if (context.getSessionData("evtEffects") != null) { - effects = (LinkedList) context.getSessionData("evtEffects"); + if (context.getSessionData(CK.E_EFFECTS) != null) { + effects = (LinkedList) context.getSessionData(CK.E_EFFECTS); } else { effects = new LinkedList(); } effects.add(input.toUpperCase()); - context.setSessionData("evtEffects", effects); + context.setSessionData(CK.E_EFFECTS, effects); selectedEffectLocations.remove(player); return new EffectListPrompt(); @@ -1596,20 +1597,20 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public String getPromptText(ConversationContext context) { String text = GOLD + "- " + Lang.get("eventEditorStorm") + " -\n"; - if (context.getSessionData("evtStormWorld") == null) { + if (context.getSessionData(CK.E_WORLD_STORM) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "2 - " + Lang.get("eventEditorSetDuration") + " " + Lang.get("eventEditorNoWorld") + "\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); } else { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + AQUA + ((String) context.getSessionData("evtStormWorld")) + YELLOW + ")\n"; + text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + AQUA + ((String) context.getSessionData(CK.E_WORLD_STORM)) + YELLOW + ")\n"; - if (context.getSessionData("evtStormDuration") == null) { + if (context.getSessionData(CK.E_WORLD_STORM_DURATION) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + Lang.get("noneSet") + ")\n"; } else { - Long dur = (Long) context.getSessionData("evtStormDuration"); + Long dur = (Long) context.getSessionData(CK.E_WORLD_STORM_DURATION); text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + AQUA + Quests.getTime(dur) + YELLOW + ")\n"; @@ -1630,7 +1631,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (input.equalsIgnoreCase("1")) { return new StormWorldPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData("evtStormWorld") == null) { + if (context.getSessionData(CK.E_WORLD_STORM) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorSetWorldFirst")); return new StormPrompt(); } else { @@ -1638,12 +1639,12 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorStormCleared")); - context.setSessionData("evtStormWorld", null); - context.setSessionData("evtStormDuration", null); + context.setSessionData(CK.E_WORLD_STORM, null); + context.setSessionData(CK.E_WORLD_STORM_DURATION, null); return new StormPrompt(); } else if (input.equalsIgnoreCase("4")) { - if (context.getSessionData("evtStormWorld") != null && context.getSessionData("evtStormDuration") == null) { + if (context.getSessionData(CK.E_WORLD_STORM) != null && context.getSessionData(CK.E_WORLD_STORM_DURATION) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetStormDuration")); return new StormPrompt(); } else { @@ -1681,7 +1682,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (quests.getServer().getWorld(input) != null) { - context.setSessionData("evtStormWorld", quests.getServer().getWorld(input).getName()); + context.setSessionData(CK.E_WORLD_STORM, quests.getServer().getWorld(input).getName()); } else { player.sendMessage(PINK + input + " " + RED + Lang.get("eventEditorInvalidWorld")); @@ -1711,7 +1712,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ return new StormDurationPrompt(); } - context.setSessionData("evtStormDuration", input.longValue()); + context.setSessionData(CK.E_WORLD_STORM_DURATION, input.longValue()); return new StormPrompt(); } @@ -1730,7 +1731,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ String text = GOLD + "- " + Lang.get("eventEditorThunder") + " -\n"; - if (context.getSessionData("evtThunderWorld") == null) { + if (context.getSessionData(CK.E_WORLD_THUNDER) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "2 - " + Lang.get("eventEditorSetDuration") + " " + Lang.get("eventEditorNoWorld") + "\n"; @@ -1739,13 +1740,13 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + AQUA + ((String) context.getSessionData("evtThunderWorld")) + YELLOW + ")\n"; + text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + AQUA + ((String) context.getSessionData(CK.E_WORLD_THUNDER)) + YELLOW + ")\n"; - if (context.getSessionData("evtThunderDuration") == null) { + if (context.getSessionData(CK.E_WORLD_THUNDER_DURATION) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + Lang.get("noneSet") + ")\n"; } else { - Long dur = (Long) context.getSessionData("evtThunderDuration"); + Long dur = (Long) context.getSessionData(CK.E_WORLD_THUNDER_DURATION); text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + AQUA + Quests.getTime(dur) + YELLOW + ")\n"; } @@ -1766,7 +1767,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (input.equalsIgnoreCase("1")) { return new ThunderWorldPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData("evtThunderWorld") == null) { + if (context.getSessionData(CK.E_WORLD_THUNDER) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorSetWorldFirst")); return new ThunderPrompt(); } else { @@ -1774,12 +1775,12 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorThunderCleared")); - context.setSessionData("evtThunderWorld", null); - context.setSessionData("evtThunderDuration", null); + context.setSessionData(CK.E_WORLD_THUNDER, null); + context.setSessionData(CK.E_WORLD_THUNDER_DURATION, null); return new ThunderPrompt(); } else if (input.equalsIgnoreCase("4")) { - if (context.getSessionData("evtThunderWorld") != null && context.getSessionData("evtThunderDuration") == null) { + if (context.getSessionData(CK.E_WORLD_THUNDER) != null && context.getSessionData(CK.E_WORLD_THUNDER_DURATION) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetThunderDuration")); return new ThunderPrompt(); } else { @@ -1817,7 +1818,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (quests.getServer().getWorld(input) != null) { - context.setSessionData("evtThunderWorld", quests.getServer().getWorld(input).getName()); + context.setSessionData(CK.E_WORLD_THUNDER, quests.getServer().getWorld(input).getName()); } else { player.sendMessage(PINK + input + " " + RED + Lang.get("eventEditorInvalidWorld")); @@ -1846,7 +1847,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorAtLeastOneSecond")); return new ThunderDurationPrompt(); } else { - context.setSessionData("evtThunderDuration", input.longValue()); + context.setSessionData(CK.E_WORLD_THUNDER_DURATION, input.longValue()); } return new ThunderPrompt(); @@ -1866,7 +1867,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public String getPromptText(ConversationContext context) { String text = GOLD + "- " + Lang.get("eventEditorMobSpawns") + " -\n"; - if (context.getSessionData("evtMobTypes") == null) { + if (context.getSessionData(CK.E_MOB_TYPES) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobTypes") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "2 - " + Lang.get("eventEditorSetMobAmounts") + " " + Lang.get("eventEditorNoTypesSet") + "\n"; text += GRAY + "3 - " + Lang.get("eventEditorAddSpawnLocation") + " " + Lang.get("eventEditorNoTypesSet") + "\n"; @@ -1875,27 +1876,27 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobTypes") + "\n"; - for (String s : (LinkedList) context.getSessionData("evtMobTypes")) { + for (String s : (LinkedList) context.getSessionData(CK.E_MOB_TYPES)) { text += GRAY + " - " + AQUA + s + "\n"; } - if (context.getSessionData("evtMobAmounts") == null) { + if (context.getSessionData(CK.E_MOB_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobAmounts") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "3 - " + Lang.get("eventEditorAddSpawnLocation") + Lang.get("eventEditorNoAmountsSet") + "\n"; } else { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobAmounts"); - for (int i : (LinkedList) context.getSessionData("evtMobAmounts")) { + for (int i : (LinkedList) context.getSessionData(CK.E_MOB_AMOUNTS)) { text += GRAY + " - " + DARKAQUA + i + "\n"; } - if (context.getSessionData("evtMobLocations") == null) { + if (context.getSessionData(CK.E_MOB_LOCATIONS) == null) { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorAddSpawnLocation") + " (" + Lang.get("noneSet") + ")\n"; } else { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorAddSpawnLocation") + "\n"; - for (String s : (LinkedList) context.getSessionData("evtMobLocations")) { + for (String s : (LinkedList) context.getSessionData(CK.E_MOB_LOCATIONS)) { text += GRAY + " - " + GREEN + s + "\n"; } @@ -1918,17 +1919,17 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (input.equalsIgnoreCase("1")) { return new MobTypesPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData("evtMobTypes") == null) { + if (context.getSessionData(CK.E_MOB_TYPES) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetMobTypesFirst")); return new MobPrompt(); } else { return new MobAmountsPrompt(); } } else if (input.equalsIgnoreCase("3")) { - if (context.getSessionData("evtMobTypes") == null) { + if (context.getSessionData(CK.E_MOB_TYPES) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetMobTypesAndAmountsFirst")); return new MobPrompt(); - } else if (context.getSessionData("evtMobAmounts") == null) { + } else if (context.getSessionData(CK.E_MOB_AMOUNTS) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetMobAmountsFirst")); return new MobPrompt(); } else { @@ -1937,9 +1938,9 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } } else if (input.equalsIgnoreCase("4")) { context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorMobSpawnsCleared")); - context.setSessionData("evtMobTypes", null); - context.setSessionData("evtMobAmounts", null); - context.setSessionData("evtMobLocations", null); + context.setSessionData(CK.E_MOB_TYPES, null); + context.setSessionData(CK.E_MOB_AMOUNTS, null); + context.setSessionData(CK.E_MOB_LOCATIONS, null); return new MobPrompt(); } else if (input.equalsIgnoreCase("5")) { @@ -1947,20 +1948,20 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ int two; int three; - if (context.getSessionData("evtMobTypes") != null) { - one = ((List) context.getSessionData("evtMobTypes")).size(); + if (context.getSessionData(CK.E_MOB_TYPES) != null) { + one = ((List) context.getSessionData(CK.E_MOB_TYPES)).size(); } else { one = 0; } - if (context.getSessionData("evtMobAmounts") != null) { - two = ((List) context.getSessionData("evtMobAmounts")).size(); + if (context.getSessionData(CK.E_MOB_AMOUNTS) != null) { + two = ((List) context.getSessionData(CK.E_MOB_AMOUNTS)).size(); } else { two = 0; } - if (context.getSessionData("evtMobLocations") != null) { - three = ((List) context.getSessionData("evtMobLocations")).size(); + if (context.getSessionData(CK.E_MOB_LOCATIONS) != null) { + three = ((List) context.getSessionData(CK.E_MOB_LOCATIONS)).size(); } else { three = 0; } @@ -2030,7 +2031,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (Quests.getMobType(s) != null) { mobTypes.add(Quester.prettyMobString(Quests.getMobType(s))); - context.setSessionData("evtMobTypes", mobTypes); + context.setSessionData(CK.E_MOB_TYPES, mobTypes); } else { player.sendMessage(PINK + s + " " + RED + Lang.get("eventEditorInvalidMob")); @@ -2084,7 +2085,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - context.setSessionData("evtMobAmounts", mobAmounts); + context.setSessionData(CK.E_MOB_AMOUNTS, mobAmounts); } @@ -2115,14 +2116,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ Location loc = block.getLocation(); LinkedList locs; - if (context.getSessionData("evtMobLocations") != null) { - locs = (LinkedList) context.getSessionData("evtMobLocations"); + if (context.getSessionData(CK.E_MOB_LOCATIONS) != null) { + locs = (LinkedList) context.getSessionData(CK.E_MOB_LOCATIONS); } else { locs = new LinkedList(); } locs.add(Quests.getLocationInfo(loc)); - context.setSessionData("evtMobLocations", locs); + context.setSessionData(CK.E_MOB_LOCATIONS, locs); selectedMobLocations.remove(player); } else { @@ -2166,14 +2167,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ Location loc = block.getLocation(); LinkedList locs; - if (context.getSessionData("evtLightningStrikes") != null) { - locs = (LinkedList) context.getSessionData("evtLightningStrikes"); + if (context.getSessionData(CK.E_LIGHTNING) != null) { + locs = (LinkedList) context.getSessionData(CK.E_LIGHTNING); } else { locs = new LinkedList(); } locs.add(Quests.getLocationInfo(loc)); - context.setSessionData("evtLightningStrikes", locs); + context.setSessionData(CK.E_LIGHTNING, locs); selectedLightningLocations.remove(player); } else { @@ -2185,7 +2186,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { - context.setSessionData("evtLightningStrikes", null); + context.setSessionData(CK.E_LIGHTNING, null); selectedLightningLocations.remove(player); return new CreateMenuPrompt(); @@ -2213,7 +2214,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ public String getPromptText(ConversationContext context) { String text = GOLD + "- " + Lang.get("eventEditorPotionEffects") + " -\n"; - if (context.getSessionData("evtPotionTypes") == null) { + if (context.getSessionData(CK.E_POTION_TYPES) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionEffects") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "2 - " + Lang.get("eventEditorSetPotionDurations") + " " + Lang.get("eventEditorNoTypesSet") + "\n"; text += GRAY + "3 - " + Lang.get("eventEditorSetPotionMagnitudes") + " " + Lang.get("eventEditorNoTypesSet") + "\n"; @@ -2222,26 +2223,26 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionEffects") + "\n"; - for (String s : (LinkedList) context.getSessionData("evtPotionTypes")) { + for (String s : (LinkedList) context.getSessionData(CK.E_POTION_TYPES)) { text += GRAY + " - " + AQUA + s + "\n"; } - if (context.getSessionData("evtPotionDurations") == null) { + if (context.getSessionData(CK.E_POTION_DURATIONS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionDurations") + " (" + Lang.get("noneSet") + ")\n"; text += GRAY + "3 - " + Lang.get("eventEditorSetPotionMagnitudes") + " " + Lang.get("eventEditorNoDurationsSet") + "\n"; } else { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorNoDurationsSet") + "\n"; - for (Long l : (LinkedList) context.getSessionData("evtPotionDurations")) { + for (Long l : (LinkedList) context.getSessionData(CK.E_POTION_DURATIONS)) { text += GRAY + " - " + DARKAQUA + Quests.getTime(l*50L) + "\n"; } - if (context.getSessionData("evtPotionMagnitudes") == null) { + if (context.getSessionData(CK.E_POTION_STRENGHT) == null) { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionMagnitudes") + " (" + Lang.get("noneSet") + ")\n"; } else { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionMagnitudes") + "\n"; - for (int i : (LinkedList) context.getSessionData("evtPotionMagnitudes")) { + for (int i : (LinkedList) context.getSessionData(CK.E_POTION_STRENGHT)) { text += GRAY + " - " + PURPLE + i + "\n"; } @@ -2264,17 +2265,17 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ if (input.equalsIgnoreCase("1")) { return new PotionTypesPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData("evtPotionTypes") == null) { + if (context.getSessionData(CK.E_POTION_TYPES) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetPotionTypesFirst")); return new PotionEffectPrompt(); } else { return new PotionDurationsPrompt(); } } else if (input.equalsIgnoreCase("3")) { - if (context.getSessionData("evtPotionTypes") == null) { + if (context.getSessionData(CK.E_POTION_TYPES) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetPotionTypesAndDurationsFirst")); return new PotionEffectPrompt(); - } else if (context.getSessionData("evtPotionDurations") == null) { + } else if (context.getSessionData(CK.E_POTION_DURATIONS) == null) { context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetPotionDurationsFirst")); return new PotionEffectPrompt(); } else { @@ -2283,9 +2284,9 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else if (input.equalsIgnoreCase("4")) { context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorPotionsCleared")); - context.setSessionData("evtPotionTypes", null); - context.setSessionData("evtPotionDurations", null); - context.setSessionData("evtPotionMagnitudes", null); + context.setSessionData(CK.E_POTION_TYPES, null); + context.setSessionData(CK.E_POTION_DURATIONS, null); + context.setSessionData(CK.E_POTION_STRENGHT, null); return new PotionEffectPrompt(); } else if (input.equalsIgnoreCase("5")) { @@ -2293,20 +2294,20 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ int two; int three; - if (context.getSessionData("evtPotionTypes") != null) { - one = ((List) context.getSessionData("evtPotionTypes")).size(); + if (context.getSessionData(CK.E_POTION_TYPES) != null) { + one = ((List) context.getSessionData(CK.E_POTION_TYPES)).size(); } else { one = 0; } - if (context.getSessionData("evtPotionDurations") != null) { - two = ((List) context.getSessionData("evtPotionDurations")).size(); + if (context.getSessionData(CK.E_POTION_DURATIONS) != null) { + two = ((List) context.getSessionData(CK.E_POTION_DURATIONS)).size(); } else { two = 0; } - if (context.getSessionData("evtPotionMagnitudes") != null) { - three = ((List) context.getSessionData("evtPotionMagnitudes")).size(); + if (context.getSessionData(CK.E_POTION_STRENGHT) != null) { + three = ((List) context.getSessionData(CK.E_POTION_STRENGHT)).size(); } else { three = 0; } @@ -2352,7 +2353,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ effTypes.add(PotionEffectType.getByName(s.toUpperCase()).getName()); - context.setSessionData("evtPotionTypes", effTypes); + context.setSessionData(CK.E_POTION_TYPES, effTypes); } else { player.sendMessage(PINK + s + " " + RED + Lang.get("eventEditorInvalidPotionType")); @@ -2406,7 +2407,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - context.setSessionData("evtPotionDurations", effDurations); + context.setSessionData(CK.E_POTION_DURATIONS, effDurations); } @@ -2453,7 +2454,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } - context.setSessionData("evtPotionMagnitudes", magAmounts); + context.setSessionData(CK.E_POTION_STRENGHT, magAmounts); } @@ -2480,11 +2481,11 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ ((Player)context.getForWhom()).sendMessage(RED + Lang.get("eventEditorHungerLevelAtLeastZero")); return new HungerPrompt(); }else{ - context.setSessionData("evtHunger", (Integer)input.intValue()); + context.setSessionData(CK.E_HUNGER, (Integer)input.intValue()); } }else{ - context.setSessionData("evtHunger", null); + context.setSessionData(CK.E_HUNGER, null); } return new CreateMenuPrompt(); @@ -2510,11 +2511,11 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ ((Player)context.getForWhom()).sendMessage(RED + Lang.get("eventEditorSaturationLevelAtLeastZero")); return new SaturationPrompt(); }else{ - context.setSessionData("evtSaturation", (Integer)input.intValue()); + context.setSessionData(CK.E_SATURATION, (Integer)input.intValue()); } }else{ - context.setSessionData("evtSaturation", null); + context.setSessionData(CK.E_SATURATION, null); } return new CreateMenuPrompt(); @@ -2540,11 +2541,11 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ ((Player)context.getForWhom()).sendMessage(RED + Lang.get("eventEditorHealthLevelAtLeastZero")); return new HealthPrompt(); }else{ - context.setSessionData("evtHealth", (Integer)input.intValue()); + context.setSessionData(CK.E_HEALTH, (Integer)input.intValue()); } }else{ - context.setSessionData("evtHealth", null); + context.setSessionData(CK.E_HEALTH, null); } return new CreateMenuPrompt(); @@ -2573,7 +2574,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ Location loc = block.getLocation(); - context.setSessionData("evtTeleportLocation", Quests.getLocationInfo(loc)); + context.setSessionData(CK.E_TELEPORT, Quests.getLocationInfo(loc)); selectedTeleportLocations.remove(player); } else { @@ -2585,7 +2586,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { - context.setSessionData("evtTeleportLocation", null); + context.setSessionData(CK.E_TELEPORT, null); selectedTeleportLocations.remove(player); return new CreateMenuPrompt(); @@ -2622,10 +2623,10 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil{ String[] commands = input.split(","); LinkedList cmdList = new LinkedList(); cmdList.addAll(Arrays.asList(commands)); - context.setSessionData("evtCommands", cmdList); + context.setSessionData(CK.E_COMMANDS, cmdList); }else if(input.equalsIgnoreCase(Lang.get("cmdClear"))) - context.setSessionData("evtCommands", null); + context.setSessionData(CK.E_COMMANDS, null); return new CreateMenuPrompt(); diff --git a/src/me/blackvein/quests/Party.java b/src/me/blackvein/quests/Party.java index d3c07918f..a222a2196 100644 --- a/src/me/blackvein/quests/Party.java +++ b/src/me/blackvein/quests/Party.java @@ -2,6 +2,8 @@ package me.blackvein.quests; import java.util.LinkedList; +import me.blackvein.quests.util.CK; + import org.bukkit.Bukkit; import org.bukkit.conversations.Conversable; import org.bukkit.conversations.Conversation; @@ -145,7 +147,7 @@ public class Party implements ConversationAbandonedListener, ColorUtil{ Player player = target.getPlayer(); Conversation conversation = factory.buildConversation((Conversable)player); - conversation.getContext().setSessionData("inviter", getLeader().getPlayer().getName()); + conversation.getContext().setSessionData(CK.P_INVITER, getLeader().getPlayer().getName()); conversation.begin(); } @@ -192,7 +194,7 @@ public class Party implements ConversationAbandonedListener, ColorUtil{ @Override public String getPromptText(ConversationContext context) { - String text = partyPrefix + PINK + "You have been invited to " + PURPLE + ((String) context.getSessionData("inviter")) + PINK + "'s party.\n"; + String text = partyPrefix + PINK + "You have been invited to " + PURPLE + ((String) context.getSessionData(CK.P_INVITER)) + PINK + "'s party.\n"; return text + YELLOW + "Accept Invite? " + GREEN + "Yes / No"; @@ -205,7 +207,7 @@ public class Party implements ConversationAbandonedListener, ColorUtil{ if (s.equalsIgnoreCase("Yes")) { - String inviterName = (String) context.getSessionData("inviter"); + String inviterName = (String) context.getSessionData(CK.P_INVITER); Quester quester = quests.getQuester(invited.getName()); members.add(quester); @@ -218,7 +220,7 @@ public class Party implements ConversationAbandonedListener, ColorUtil{ } else if (s.equalsIgnoreCase("No")) { - String inviterName = (String) context.getSessionData("inviter"); + String inviterName = (String) context.getSessionData(CK.P_INVITER); invited.sendMessage(partyPrefix + YELLOW + "Declined invite."); Bukkit.getPlayerExact(inviterName).sendMessage(partyPrefix + GREEN + invited.getName() + YELLOW + " has declined your invitation."); diff --git a/src/me/blackvein/quests/QuestFactory.java b/src/me/blackvein/quests/QuestFactory.java index bf4bbd3da..10f987683 100644 --- a/src/me/blackvein/quests/QuestFactory.java +++ b/src/me/blackvein/quests/QuestFactory.java @@ -9,6 +9,7 @@ import java.util.Map.Entry; import me.blackvein.quests.prompts.RequirementsPrompt; import me.blackvein.quests.prompts.RewardsPrompt; import me.blackvein.quests.prompts.StagesPrompt; +import me.blackvein.quests.util.CK; import me.blackvein.quests.util.ItemUtil; import me.blackvein.quests.util.Lang; import net.citizensnpcs.api.CitizensAPI; @@ -58,8 +59,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public void conversationAbandoned(ConversationAbandonedEvent abandonedEvent) { - if (abandonedEvent.getContext().getSessionData("questName") != null) { - names.remove((String) abandonedEvent.getContext().getSessionData("questName")); + if (abandonedEvent.getContext().getSessionData(CK.Q_NAME) != null) { + names.remove((String) abandonedEvent.getContext().getSessionData(CK.Q_NAME)); } Player player = (Player) abandonedEvent.getContext().getForWhom(); @@ -152,31 +153,31 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text = - GOLD + "- Quest: " + AQUA + context.getSessionData("questName") + GOLD + " -\n"; + GOLD + "- Quest: " + AQUA + context.getSessionData(CK.Q_NAME) + GOLD + " -\n"; text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set name\n"; - if (context.getSessionData("askMessage") == null) { + if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) { text += BLUE + "" + BOLD + "2" + RESET + RED + " - Set ask message " + DARKRED + "(Required, none set)\n"; } else { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set ask message (\"" + context.getSessionData("askMessage") + "\")\n"; + text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set ask message (\"" + context.getSessionData(CK.Q_ASK_MESSAGE) + "\")\n"; } - if (context.getSessionData("finishMessage") == null) { + if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) { text += BLUE + "" + BOLD + "3" + RESET + RED + " - Set finish message " + DARKRED + "(Required, none set)\n"; } else { - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Set finish message (\"" + context.getSessionData("finishMessage") + "\")\n"; + text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Set finish message (\"" + context.getSessionData(CK.Q_FINISH_MESSAGE) + "\")\n"; } - if (context.getSessionData("redoDelay") == null) { + if (context.getSessionData(CK.Q_REDO_DELAY) == null) { text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set redo delay (None set)\n"; } else { //something here is throwing an exception try{ - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set redo delay (" + Quests.getTime((Long) context.getSessionData("redoDelay")) + ")\n"; + text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set redo delay (" + Quests.getTime((Long) context.getSessionData(CK.Q_REDO_DELAY)) + ")\n"; }catch(Exception e){ e.printStackTrace(); } @@ -184,13 +185,13 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { // } - if (context.getSessionData("npcStart") == null && quests.citizens != null) { + if (context.getSessionData(CK.Q_START_NPC) == null && quests.citizens != null) { text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set NPC start (None set)\n"; } else if (quests.citizens != null) { - text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set NPC start (" + CitizensAPI.getNPCRegistry().getById((Integer) context.getSessionData("npcStart")).getName() + ")\n"; + text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set NPC start (" + CitizensAPI.getNPCRegistry().getById((Integer) context.getSessionData(CK.Q_START_NPC)).getName() + ")\n"; } - if (context.getSessionData("blockStart") == null) { + if (context.getSessionData(CK.Q_START_BLOCK) == null) { if (quests.citizens != null) { text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set Block start (None set)\n"; @@ -201,17 +202,17 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } else { if (quests.citizens != null) { - Location l = (Location) context.getSessionData("blockStart"); + Location l = (Location) context.getSessionData(CK.Q_START_BLOCK); text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set Block start (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n"; } else { - Location l = (Location) context.getSessionData("blockStart"); + Location l = (Location) context.getSessionData(CK.Q_START_BLOCK); text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set Block start (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n"; } } - if (context.getSessionData("initialEvent") == null) { + if (context.getSessionData(CK.Q_INITIAL_EVENT) == null) { if (quests.citizens != null) { text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - Set initial Event (None set)\n"; @@ -222,10 +223,10 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } else { if (quests.citizens != null) { - String s = (String) context.getSessionData("initialEvent"); + String s = (String) context.getSessionData(CK.Q_INITIAL_EVENT); text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - Set initial Event (" + s + ")\n"; } else { - String s = (String) context.getSessionData("initialEvent"); + String s = (String) context.getSessionData(CK.Q_INITIAL_EVENT); text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set initial Event (" + s + ")\n"; } @@ -448,7 +449,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } - context.setSessionData("questName", input); + context.setSessionData(CK.Q_NAME, input); names.add(input); return new CreateMenuPrompt(); @@ -480,11 +481,11 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { return new SetNpcStartPrompt(); } - context.setSessionData("npcStart", input.intValue()); + context.setSessionData(CK.Q_START_NPC, input.intValue()); return new CreateMenuPrompt(); } else if (input.intValue() == -1) { - context.setSessionData("npcStart", null); + context.setSessionData(CK.Q_START_NPC, null); return new CreateMenuPrompt(); } else if (input.intValue() == -2) { return new CreateMenuPrompt(); @@ -517,7 +518,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { Block block = selectedBlockStarts.get(player); if (block != null) { Location loc = block.getLocation(); - context.setSessionData("blockStart", loc); + context.setSessionData(CK.Q_START_BLOCK, loc); selectedBlockStarts.remove(player); } else { player.sendMessage(ChatColor.RED + "You must select a block first."); @@ -534,7 +535,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } else if (input.equalsIgnoreCase("clear")) { selectedBlockStarts.remove(player); - context.setSessionData("blockStart", null); + context.setSessionData(CK.Q_START_BLOCK, null); return new CreateMenuPrompt(); } @@ -562,8 +563,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (q.name.equalsIgnoreCase(input)) { String s = null; - if (context.getSessionData("edit") != null) { - s = (String) context.getSessionData("edit"); + if (context.getSessionData(CK.ED_QUEST_EDIT) != null) { + s = (String) context.getSessionData(CK.ED_QUEST_EDIT); } if (s != null && s.equalsIgnoreCase(input) == false) { @@ -586,8 +587,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } - names.remove((String) context.getSessionData("questName")); - context.setSessionData("questName", input); + names.remove((String) context.getSessionData(CK.Q_NAME)); + context.setSessionData(CK.Q_NAME, input); names.add(input); } @@ -610,7 +611,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public Prompt acceptInput(ConversationContext context, String input) { if (input.equalsIgnoreCase("cancel") == false) { - context.setSessionData("askMessage", input); + context.setSessionData(CK.Q_ASK_MESSAGE, input); } return new CreateMenuPrompt(); @@ -631,7 +632,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public Prompt acceptInput(ConversationContext context, String input) { if (input.equalsIgnoreCase("cancel") == false) { - context.setSessionData("finishMessage", input); + context.setSessionData(CK.Q_FINISH_MESSAGE, input); } return new CreateMenuPrompt(); @@ -679,12 +680,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { player.sendMessage(RED + input + YELLOW + " is not a valid event name!"); return new InitialEventPrompt(); } else { - context.setSessionData("initialEvent", found.getName()); + context.setSessionData(CK.Q_INITIAL_EVENT, found.getName()); return new CreateMenuPrompt(); } } else if (input.equalsIgnoreCase("clear")) { - context.setSessionData("initialEvent", null); + context.setSessionData(CK.Q_INITIAL_EVENT, null); player.sendMessage(YELLOW + "Initial Event cleared."); return new CreateMenuPrompt(); } else { @@ -709,9 +710,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (input.longValue() < -1) { context.getForWhom().sendRawMessage(ChatColor.RED + "Amount must be a positive number."); } else if (input.longValue() == 0) { - context.setSessionData("redoDelay", null); + context.setSessionData(CK.Q_REDO_DELAY, null); } else if (input.longValue() != -1) { - context.setSessionData("redoDelay", input.longValue()); + context.setSessionData(CK.Q_REDO_DELAY, input.longValue()); } return new CreateMenuPrompt(); @@ -727,7 +728,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { String text = GREEN + "1 - Yes\n" + "2 - No"; - return ChatColor.YELLOW + "Finish and save \"" + AQUA + context.getSessionData("questName") + YELLOW + "\"?\n" + text; + return ChatColor.YELLOW + "Finish and save \"" + AQUA + context.getSessionData(CK.Q_NAME) + YELLOW + "\"?\n" + text; } @@ -736,10 +737,10 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase("Yes")) { - if (context.getSessionData("askMessage") == null) { + if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) { context.getForWhom().sendRawMessage(RED + "You must set an ask message!"); return new CreateMenuPrompt(); - } else if (context.getSessionData("finishMessage") == null) { + } else if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) { context.getForWhom().sendRawMessage(RED + "You must set a finish message!"); return new CreateMenuPrompt(); } else if (StagesPrompt.getStages(context) == 0) { @@ -812,11 +813,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } } - public static void saveQuest(ConversationContext cc, ConfigurationSection cs) { + @SuppressWarnings("unchecked") + public static void saveQuest(ConversationContext cc, ConfigurationSection cs) { String edit = null; - if (cc.getSessionData("edit") != null) { - edit = (String) cc.getSessionData("edit"); + if (cc.getSessionData(CK.ED_QUEST_EDIT) != null) { + edit = (String) cc.getSessionData(CK.ED_QUEST_EDIT); } if (edit != null) { @@ -837,9 +839,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } - String name = (String) cc.getSessionData("questName"); - String desc = (String) cc.getSessionData("askMessage"); - String finish = (String) cc.getSessionData("finishMessage"); + String name = (String) cc.getSessionData(CK.Q_NAME); + String desc = (String) cc.getSessionData(CK.Q_ASK_MESSAGE); + String finish = (String) cc.getSessionData(CK.Q_FINISH_MESSAGE); Long redo = null; Integer npcStart = null; String blockStart = null; @@ -865,82 +867,82 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { - if (cc.getSessionData("redoDelay") != null) { - redo = (Long) cc.getSessionData("redoDelay"); + if (cc.getSessionData(CK.Q_REDO_DELAY) != null) { + redo = (Long) cc.getSessionData(CK.Q_REDO_DELAY); } - if (cc.getSessionData("npcStart") != null) { - npcStart = (Integer) cc.getSessionData("npcStart"); + if (cc.getSessionData(CK.Q_START_NPC) != null) { + npcStart = (Integer) cc.getSessionData(CK.Q_START_NPC); } - if (cc.getSessionData("blockStart") != null) { - blockStart = Quests.getLocationInfo((Location) cc.getSessionData("blockStart")); + if (cc.getSessionData(CK.Q_START_BLOCK) != null) { + blockStart = Quests.getLocationInfo((Location) cc.getSessionData(CK.Q_START_BLOCK)); } - if (cc.getSessionData("moneyReq") != null) { - moneyReq = (Integer) cc.getSessionData("moneyReq"); + if (cc.getSessionData(CK.REQ_MONEY) != null) { + moneyReq = (Integer) cc.getSessionData(CK.REQ_MONEY); } - if (cc.getSessionData("questPointsReq") != null) { - questPointsReq = (Integer) cc.getSessionData("questPointsReq"); + if (cc.getSessionData(CK.REQ_QUEST_POINTS) != null) { + questPointsReq = (Integer) cc.getSessionData(CK.REQ_QUEST_POINTS); } - if (cc.getSessionData("itemReqs") != null) { - itemReqs = (LinkedList) cc.getSessionData("itemReqs"); - removeItemReqs = (LinkedList) cc.getSessionData("removeItemReqs"); + if (cc.getSessionData(CK.REQ_ITEMS) != null) { + itemReqs = (LinkedList) cc.getSessionData(CK.REQ_ITEMS); + removeItemReqs = (LinkedList) cc.getSessionData(CK.REQ_ITEMS_REMOVE); } - if (cc.getSessionData("permissionReqs") != null) { - permReqs = (LinkedList) cc.getSessionData("permissionReqs"); + if (cc.getSessionData(CK.REQ_PERMISSION) != null) { + permReqs = (LinkedList) cc.getSessionData(CK.REQ_PERMISSION); } - if (cc.getSessionData("questReqs") != null) { - questReqs = (LinkedList) cc.getSessionData("questReqs"); + if (cc.getSessionData(CK.REQ_QUEST) != null) { + questReqs = (LinkedList) cc.getSessionData(CK.REQ_QUEST); } - if (cc.getSessionData("questBlocks") != null) { - questBlocks = (LinkedList) cc.getSessionData("questBlocks"); + if (cc.getSessionData(CK.REQ_QUEST_BLOCK) != null) { + questBlocks = (LinkedList) cc.getSessionData(CK.REQ_QUEST_BLOCK); } - if (cc.getSessionData("failMessage") != null) { - failMessage = (String) cc.getSessionData("failMessage"); + if (cc.getSessionData(CK.Q_FAIL_MESSAGE) != null) { + failMessage = (String) cc.getSessionData(CK.Q_FAIL_MESSAGE); } - if (cc.getSessionData("initialEvent") != null) { - initialEvent = (String) cc.getSessionData("initialEvent"); + if (cc.getSessionData(CK.Q_INITIAL_EVENT) != null) { + initialEvent = (String) cc.getSessionData(CK.Q_INITIAL_EVENT); } - if (cc.getSessionData("moneyRew") != null) { - moneyRew = (Integer) cc.getSessionData("moneyRew"); + if (cc.getSessionData(CK.REW_MONEY) != null) { + moneyRew = (Integer) cc.getSessionData(CK.REW_MONEY); } - if (cc.getSessionData("questPointsRew") != null) { - questPointsRew = (Integer) cc.getSessionData("questPointsRew"); + if (cc.getSessionData(CK.REW_QUEST_POINTS) != null) { + questPointsRew = (Integer) cc.getSessionData(CK.REW_QUEST_POINTS); } - if (cc.getSessionData("itemRews") != null) { - for (ItemStack is : (LinkedList) cc.getSessionData("itemRews")) { + if (cc.getSessionData(CK.REW_ITEMS) != null) { + for (ItemStack is : (LinkedList) cc.getSessionData(CK.REW_ITEMS)) { itemRews.add(ItemUtil.serialize(is)); } } - if (cc.getSessionData("expRew") != null) { - expRew = (Integer) cc.getSessionData("expRew"); + if (cc.getSessionData(CK.REW_EXP) != null) { + expRew = (Integer) cc.getSessionData(CK.REW_EXP); } - if (cc.getSessionData("commandRews") != null) { - commandRews = (LinkedList) cc.getSessionData("commandRews"); + if (cc.getSessionData(CK.REW_COMMAND) != null) { + commandRews = (LinkedList) cc.getSessionData(CK.REW_COMMAND); } - if (cc.getSessionData("permissionRews") != null) { - permRews = (LinkedList) cc.getSessionData("permissionRews"); + if (cc.getSessionData(CK.REW_PERMISSION) != null) { + permRews = (LinkedList) cc.getSessionData(CK.REW_PERMISSION); } - if (cc.getSessionData("mcMMOSkillRews") != null) { - mcMMOSkillRews = (LinkedList) cc.getSessionData("mcMMOSkillRews"); - mcMMOSkillAmounts = (LinkedList) cc.getSessionData("mcMMOSkillAmounts"); + if (cc.getSessionData(CK.REW_MCMMO_SKILLS) != null) { + mcMMOSkillRews = (LinkedList) cc.getSessionData(CK.REW_MCMMO_SKILLS); + mcMMOSkillAmounts = (LinkedList) cc.getSessionData(CK.REW_MCMMO_AMOUNTS); } @@ -951,7 +953,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { cs.set("redo-delay", redo); cs.set("ask-message", desc); cs.set("finish-message", finish); - cs.set("event", initialEvent); + cs.set(CK.S_EVENT, initialEvent); if (moneyReq != null || questPointsReq != null || itemReqs != null && itemReqs.isEmpty() == false || permReqs != null && permReqs.isEmpty() == false || (questReqs != null && questReqs.isEmpty() == false) || (questBlocks != null && questBlocks.isEmpty() == false)) { @@ -1104,96 +1106,96 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { - if (cc.getSessionData(pref + "breakIds") != null) { - breakIds = (LinkedList) cc.getSessionData(pref + "breakIds"); - breakAmounts = (LinkedList) cc.getSessionData(pref + "breakAmounts"); + if (cc.getSessionData(pref + CK.S_BREAK_IDS) != null) { + breakIds = (LinkedList) cc.getSessionData(pref + CK.S_BREAK_IDS); + breakAmounts = (LinkedList) cc.getSessionData(pref + CK.S_BREAK_AMOUNTS); } - if (cc.getSessionData(pref + "damageIds") != null) { - damageIds = (LinkedList) cc.getSessionData(pref + "damageIds"); - damageAmounts = (LinkedList) cc.getSessionData(pref + "damageAmounts"); + if (cc.getSessionData(pref + CK.S_DAMAGE_IDS) != null) { + damageIds = (LinkedList) cc.getSessionData(pref + CK.S_DAMAGE_IDS); + damageAmounts = (LinkedList) cc.getSessionData(pref + CK.S_DAMAGE_AMOUNTS); } - if (cc.getSessionData(pref + "placeIds") != null) { - placeIds = (LinkedList) cc.getSessionData(pref + "placeIds"); - placeAmounts = (LinkedList) cc.getSessionData(pref + "placeAmounts"); + if (cc.getSessionData(pref + CK.S_PLACE_IDS) != null) { + placeIds = (LinkedList) cc.getSessionData(pref + CK.S_PLACE_IDS); + placeAmounts = (LinkedList) cc.getSessionData(pref + CK.S_PLACE_AMOUNTS); } - if (cc.getSessionData(pref + "useIds") != null) { - useIds = (LinkedList) cc.getSessionData(pref + "useIds"); - useAmounts = (LinkedList) cc.getSessionData(pref + "useAmounts"); + if (cc.getSessionData(pref + CK.S_USE_IDS) != null) { + useIds = (LinkedList) cc.getSessionData(pref + CK.S_USE_IDS); + useAmounts = (LinkedList) cc.getSessionData(pref + CK.S_USE_AMOUNTS); } - if (cc.getSessionData(pref + "cutIds") != null) { - cutIds = (LinkedList) cc.getSessionData(pref + "cutIds"); - cutAmounts = (LinkedList) cc.getSessionData(pref + "cutAmounts"); + if (cc.getSessionData(pref + CK.S_CUT_IDS) != null) { + cutIds = (LinkedList) cc.getSessionData(pref + CK.S_CUT_IDS); + cutAmounts = (LinkedList) cc.getSessionData(pref + CK.S_CUT_AMOUNTS); } - if (cc.getSessionData(pref + "fish") != null) { - fish = (Integer) cc.getSessionData(pref + "fish"); + if (cc.getSessionData(pref + CK.S_FISH) != null) { + fish = (Integer) cc.getSessionData(pref + CK.S_FISH); } - if (cc.getSessionData(pref + "playerKill") != null) { - players = (Integer) cc.getSessionData(pref + "playerKill"); + if (cc.getSessionData(pref + CK.S_PLAYER_KILL) != null) { + players = (Integer) cc.getSessionData(pref + CK.S_PLAYER_KILL); } - if (cc.getSessionData(pref + "enchantTypes") != null) { - enchantments = (LinkedList) cc.getSessionData(pref + "enchantTypes"); - enchantmentIds = (LinkedList) cc.getSessionData(pref + "enchantIds"); - enchantmentAmounts = (LinkedList) cc.getSessionData(pref + "enchantAmounts"); + if (cc.getSessionData(pref + CK.S_ENCHANT_TYPES) != null) { + enchantments = (LinkedList) cc.getSessionData(pref + CK.S_ENCHANT_TYPES); + enchantmentIds = (LinkedList) cc.getSessionData(pref + CK.S_ENCHANT_IDS); + enchantmentAmounts = (LinkedList) cc.getSessionData(pref + CK.S_ENCHANT_AMOUNTS); } - if (cc.getSessionData(pref + "deliveryItems") != null) { - deliveryItems = (LinkedList) cc.getSessionData(pref + "deliveryItems"); - deliveryNPCIds = (LinkedList) cc.getSessionData(pref + "deliveryNPCs"); - deliveryMessages = (LinkedList) cc.getSessionData(pref + "deliveryMessages"); + if (cc.getSessionData(pref + CK.S_DELIVERY_ITEMS) != null) { + deliveryItems = (LinkedList) cc.getSessionData(pref + CK.S_DELIVERY_ITEMS); + deliveryNPCIds = (LinkedList) cc.getSessionData(pref + CK.S_DELIVERY_NPCS); + deliveryMessages = (LinkedList) cc.getSessionData(pref + CK.S_DELIVERY_MESSAGES); } - if (cc.getSessionData(pref + "npcIdsToTalkTo") != null) { - npcTalkIds = (LinkedList) cc.getSessionData(pref + "npcIdsToTalkTo"); + if (cc.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) != null) { + npcTalkIds = (LinkedList) cc.getSessionData(pref + CK.S_NPCS_TO_TALK_TO); } - if (cc.getSessionData(pref + "npcIdsToKill") != null) { - npcKillIds = (LinkedList) cc.getSessionData(pref + "npcIdsToKill"); - npcKillAmounts = (LinkedList) cc.getSessionData(pref + "npcAmountsToKill"); + if (cc.getSessionData(pref + CK.S_NPCS_TO_KILL) != null) { + npcKillIds = (LinkedList) cc.getSessionData(pref + CK.S_NPCS_TO_KILL); + npcKillAmounts = (LinkedList) cc.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS); } - if (cc.getSessionData(pref + "bossIds") != null) { - bossIds = (LinkedList) cc.getSessionData(pref + "bossIds"); - bossAmounts = (LinkedList) cc.getSessionData(pref + "bossAmounts"); + 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 + "mobTypes") != null) { - mobs = (LinkedList) cc.getSessionData(pref + "mobTypes"); - mobAmounts = (LinkedList) cc.getSessionData(pref + "mobAmounts"); - if (cc.getSessionData(pref + "killLocations") != null) { - mobLocs = (LinkedList) cc.getSessionData(pref + "killLocations"); - mobRadii = (LinkedList) cc.getSessionData(pref + "killLocationRadii"); - mobLocNames = (LinkedList) cc.getSessionData(pref + "killLocationNames"); + 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); + if (cc.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS) != null) { + mobLocs = (LinkedList) cc.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS); + mobRadii = (LinkedList) cc.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS); + mobLocNames = (LinkedList) cc.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES); } } - if (cc.getSessionData(pref + "tameTypes") != null) { - tames = (LinkedList) cc.getSessionData(pref + "tameTypes"); - tameAmounts = (LinkedList) cc.getSessionData(pref + "tameAmounts"); + if (cc.getSessionData(pref + CK.S_TAME_TYPES) != null) { + tames = (LinkedList) cc.getSessionData(pref + CK.S_TAME_TYPES); + tameAmounts = (LinkedList) cc.getSessionData(pref + CK.S_TAME_AMOUNTS); } - if (cc.getSessionData(pref + "shearColors") != null) { - shearColors = (LinkedList) cc.getSessionData(pref + "shearColors"); - shearAmounts = (LinkedList) cc.getSessionData(pref + "shearAmounts"); + if (cc.getSessionData(pref + CK.S_SHEAR_COLORS) != null) { + shearColors = (LinkedList) cc.getSessionData(pref + CK.S_SHEAR_COLORS); + shearAmounts = (LinkedList) cc.getSessionData(pref + CK.S_SHEAR_AMOUNTS); } - if (cc.getSessionData(pref + "event") != null) { - event = (String) cc.getSessionData(pref + "event"); + if (cc.getSessionData(pref + CK.S_EVENT) != null) { + event = (String) cc.getSessionData(pref + CK.S_EVENT); } - if (cc.getSessionData(pref + "delay") != null) { - delay = (Long) cc.getSessionData(pref + "delay"); - delayMessage = (String) cc.getSessionData(pref + "delayMessage"); + if (cc.getSessionData(pref + CK.S_DELAY) != null) { + delay = (Long) cc.getSessionData(pref + CK.S_DELAY); + delayMessage = (String) cc.getSessionData(pref + CK.S_DELAY_MESSAGE); } - if (cc.getSessionData(pref + "denizen") != null) { - script = (String) cc.getSessionData(pref + "denizen"); + if (cc.getSessionData(pref + CK.S_DENIZEN) != null) { + script = (String) cc.getSessionData(pref + CK.S_DENIZEN); } if (breakIds != null && breakIds.isEmpty() == false) { @@ -1254,8 +1256,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { stage.set("sheep-to-shear", shearColors); stage.set("sheep-amounts", shearAmounts); stage.set("script-to-run", script); - stage.set("event", event); - stage.set("delay", delay); + stage.set(CK.S_EVENT, event); + stage.set(CK.S_DELAY, delay); stage.set("delay-message", delayMessage); } @@ -1281,77 +1283,77 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public static void loadQuest(ConversationContext cc, Quest q) { - cc.setSessionData("edit", q.name); - cc.setSessionData("questName", q.name); + cc.setSessionData(CK.ED_QUEST_EDIT, q.name); + cc.setSessionData(CK.Q_NAME, q.name); if (q.npcStart != null) { - cc.setSessionData("npcStart", q.npcStart.getId()); + cc.setSessionData(CK.Q_START_NPC, q.npcStart.getId()); } - cc.setSessionData("blockStart", q.blockStart); + cc.setSessionData(CK.Q_START_BLOCK, q.blockStart); if (q.redoDelay != -1) { - cc.setSessionData("redoDelay", q.redoDelay); + cc.setSessionData(CK.Q_REDO_DELAY, q.redoDelay); } - cc.setSessionData("askMessage", q.description); - cc.setSessionData("finishMessage", q.finished); + cc.setSessionData(CK.Q_ASK_MESSAGE, q.description); + cc.setSessionData(CK.Q_FINISH_MESSAGE, q.finished); if (q.initialEvent != null) { - cc.setSessionData("initialEvent", q.initialEvent.getName()); + cc.setSessionData(CK.Q_INITIAL_EVENT, q.initialEvent.getName()); } //Requirements if (q.moneyReq != 0) { - cc.setSessionData("moneyReq", q.moneyReq); + cc.setSessionData(CK.REQ_MONEY, q.moneyReq); } if (q.questPointsReq != 0) { - cc.setSessionData("questPointsReq", q.questPointsReq); + cc.setSessionData(CK.REQ_QUEST_POINTS, q.questPointsReq); } if (q.items.isEmpty() == false) { - cc.setSessionData("itemReqs", q.items); - cc.setSessionData("removeItemReqs", q.removeItems); + cc.setSessionData(CK.REQ_ITEMS, q.items); + cc.setSessionData(CK.REQ_ITEMS_REMOVE, q.removeItems); } if (q.neededQuests.isEmpty() == false) { - cc.setSessionData("questReqs", q.neededQuests); + cc.setSessionData(CK.REQ_QUEST, q.neededQuests); } if (q.blockQuests.isEmpty() == false) { - cc.setSessionData("questBlocks", q.blockQuests); + cc.setSessionData(CK.REQ_QUEST_BLOCK, q.blockQuests); } if (q.permissionReqs.isEmpty() == false) { - cc.setSessionData("permissionReqs", q.permissionReqs); + cc.setSessionData(CK.REQ_PERMISSION, q.permissionReqs); } if (q.failRequirements != null) { - cc.setSessionData("failMessage", q.failRequirements); + cc.setSessionData(CK.Q_FAIL_MESSAGE, q.failRequirements); } // //Rewards if (q.moneyReward != 0) { - cc.setSessionData("moneyRew", q.moneyReward); + cc.setSessionData(CK.REW_MONEY, q.moneyReward); } if (q.questPoints != 0) { - cc.setSessionData("questPointsRew", q.questPoints); + cc.setSessionData(CK.REW_QUEST_POINTS, q.questPoints); } if (q.exp != 0) { - cc.setSessionData("expRew", q.exp); + cc.setSessionData(CK.REW_EXP, q.exp); } if (q.commands.isEmpty() == false) { - cc.setSessionData("commandRews", q.commands); + cc.setSessionData(CK.REW_COMMAND, q.commands); } if (q.permissions.isEmpty() == false) { - cc.setSessionData("permissionRews", q.permissions); + cc.setSessionData(CK.REW_PERMISSION, q.permissions); } if (q.mcmmoSkills.isEmpty() == false) { - cc.setSessionData("mcMMOSkillRews", q.mcmmoSkills); - cc.setSessionData("mcMMOSkillAmounts", q.mcmmoAmounts); + cc.setSessionData(CK.REW_MCMMO_SKILLS, q.mcmmoSkills); + cc.setSessionData(CK.REW_MCMMO_AMOUNTS, q.mcmmoAmounts); } // @@ -1365,15 +1367,15 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { LinkedList ids = new LinkedList(); LinkedList amnts = new LinkedList(); - for (Entry e : stage.blocksToBreak.entrySet()) { + for (Entry e : stage.blocksToBreak.entrySet()) { ids.add(((Material) e.getKey()).getId()); amnts.add((Integer) e.getValue()); } - cc.setSessionData(pref + "breakIds", ids); - cc.setSessionData(pref + "breakAmounts", amnts); + cc.setSessionData(pref + CK.S_BREAK_IDS, ids); + cc.setSessionData(pref + CK.S_BREAK_AMOUNTS, amnts); } @@ -1383,15 +1385,15 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { LinkedList ids = new LinkedList(); LinkedList amnts = new LinkedList(); - for (Entry e : stage.blocksToDamage.entrySet()) { + for (Entry e : stage.blocksToDamage.entrySet()) { ids.add(((Material) e.getKey()).getId()); amnts.add((Integer) e.getValue()); } - cc.setSessionData(pref + "damageIds", ids); - cc.setSessionData(pref + "damageAmounts", amnts); + cc.setSessionData(pref + CK.S_DAMAGE_IDS, ids); + cc.setSessionData(pref + CK.S_DAMAGE_AMOUNTS, amnts); } @@ -1401,15 +1403,15 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { LinkedList ids = new LinkedList(); LinkedList amnts = new LinkedList(); - for (Entry e : stage.blocksToPlace.entrySet()) { + for (Entry e : stage.blocksToPlace.entrySet()) { ids.add(((Material) e.getKey()).getId()); amnts.add((Integer) e.getValue()); } - cc.setSessionData(pref + "placeIds", ids); - cc.setSessionData(pref + "placeAmounts", amnts); + cc.setSessionData(pref + CK.S_PLACE_IDS, ids); + cc.setSessionData(pref + CK.S_PLACE_AMOUNTS, amnts); } @@ -1418,15 +1420,15 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { LinkedList ids = new LinkedList(); LinkedList amnts = new LinkedList(); - for (Entry e : stage.blocksToUse.entrySet()) { + for (Entry e : stage.blocksToUse.entrySet()) { ids.add(((Material) e.getKey()).getId()); amnts.add((Integer) e.getValue()); } - cc.setSessionData(pref + "useIds", ids); - cc.setSessionData(pref + "useAmounts", amnts); + cc.setSessionData(pref + CK.S_USE_IDS, ids); + cc.setSessionData(pref + CK.S_USE_AMOUNTS, amnts); } @@ -1436,26 +1438,26 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { LinkedList ids = new LinkedList(); LinkedList amnts = new LinkedList(); - for (Entry e : stage.blocksToCut.entrySet()) { + for (Entry e : stage.blocksToCut.entrySet()) { ids.add(((Material) e.getKey()).getId()); amnts.add((Integer) e.getValue()); } - cc.setSessionData(pref + "cutIds", ids); - cc.setSessionData(pref + "cutAmounts", amnts); + cc.setSessionData(pref + CK.S_CUT_IDS, ids); + cc.setSessionData(pref + CK.S_CUT_AMOUNTS, amnts); } if (stage.fishToCatch != null) { - cc.setSessionData(pref + "fish", stage.fishToCatch); + cc.setSessionData(pref + CK.S_FISH, stage.fishToCatch); } if (stage.playersToKill != null) { - cc.setSessionData(pref + "playerKill", stage.playersToKill); + cc.setSessionData(pref + CK.S_PLAYER_KILL, stage.playersToKill); } @@ -1477,9 +1479,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } - cc.setSessionData(pref + "enchantTypes", enchants); - cc.setSessionData(pref + "enchantIds", ids); - cc.setSessionData(pref + "enchantAmounts", amounts); + cc.setSessionData(pref + CK.S_ENCHANT_TYPES, enchants); + cc.setSessionData(pref + CK.S_ENCHANT_IDS, ids); + cc.setSessionData(pref + CK.S_ENCHANT_AMOUNTS, amounts); } @@ -1497,9 +1499,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { npcs.add(n.getId()); } - cc.setSessionData(pref + "deliveryItems", items); - cc.setSessionData(pref + "deliveryNPCs", npcs); - cc.setSessionData(pref + "deliveryMessages", stage.deliverMessages); + cc.setSessionData(pref + CK.S_DELIVERY_ITEMS, items); + cc.setSessionData(pref + CK.S_DELIVERY_NPCS, npcs); + cc.setSessionData(pref + CK.S_DELIVERY_MESSAGES, stage.deliverMessages); } @@ -1511,7 +1513,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { npcs.add(n.getId()); } - cc.setSessionData(pref + "npcIdsToTalkTo", npcs); + cc.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, npcs); } @@ -1523,16 +1525,16 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { npcs.add(n.getId()); } - cc.setSessionData(pref + "npcIdsToKill", npcs); - cc.setSessionData(pref + "npcAmountsToKill", stage.citizenNumToKill); + cc.setSessionData(pref + CK.S_NPCS_TO_KILL, npcs); + cc.setSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS, stage.citizenNumToKill); } if (stage.bossesToKill.isEmpty() == false) { - cc.setSessionData(pref + "bossIds", stage.bossesToKill); - cc.setSessionData(pref + "bossAmounts", stage.bossAmountsToKill); + cc.setSessionData(pref + CK.S_BOSS_IDS, stage.bossesToKill); + cc.setSessionData(pref + CK.S_BOSS_AMOUNTS, stage.bossAmountsToKill); } @@ -1544,8 +1546,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { mobs.add(Quester.prettyMobString(et)); } - cc.setSessionData(pref + "mobTypes", mobs); - cc.setSessionData(pref + "mobAmounts", stage.mobNumToKill); + cc.setSessionData(pref + CK.S_MOB_TYPES, mobs); + cc.setSessionData(pref + CK.S_MOB_AMOUNTS, stage.mobNumToKill); if (stage.locationsToKillWithin.isEmpty() == false) { @@ -1554,9 +1556,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { locs.add(Quests.getLocationInfo(l)); } - cc.setSessionData(pref + "killLocations", locs); - cc.setSessionData(pref + "killLocationRadii", stage.radiiToKillWithin); - cc.setSessionData(pref + "killLocationNames", stage.areaNames); + cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, locs); + cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS, stage.radiiToKillWithin); + cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES, stage.areaNames); } @@ -1570,9 +1572,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { locs.add(Quests.getLocationInfo(l)); } - cc.setSessionData(pref + "reachLocations", locs); - cc.setSessionData(pref + "reachLocationRadii", stage.radiiToReachWithin); - cc.setSessionData(pref + "reachLocationNames", stage.locationNames); + cc.setSessionData(pref + CK.S_REACH_LOCATIONS, locs); + cc.setSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS, stage.radiiToReachWithin); + cc.setSessionData(pref + CK.S_REACH_LOCATIONS_NAMES, stage.locationNames); } @@ -1589,8 +1591,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } - cc.setSessionData(pref + "tameTypes", mobs); - cc.setSessionData(pref + "tameAmounts", amnts); + cc.setSessionData(pref + CK.S_TAME_TYPES, mobs); + cc.setSessionData(pref + CK.S_TAME_AMOUNTS, amnts); } @@ -1605,26 +1607,26 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { amnts.add(e.getValue()); } - cc.setSessionData(pref + "shearColors", colors); - cc.setSessionData(pref + "shearAmounts", amnts); + cc.setSessionData(pref + CK.S_SHEAR_COLORS, colors); + cc.setSessionData(pref + CK.S_SHEAR_AMOUNTS, amnts); } if (stage.event != null) { - cc.setSessionData(pref + "event", stage.event.getName()); + cc.setSessionData(pref + CK.S_EVENT, stage.event.getName()); } if (stage.delay != -1) { - cc.setSessionData(pref + "delay", stage.delay); + cc.setSessionData(pref + CK.S_DELAY, stage.delay); if (stage.delayMessage != null) { - cc.setSessionData(pref + "delayMessage", stage.delayMessage); + cc.setSessionData(pref + CK.S_DELAY_MESSAGE, stage.delayMessage); } } if (stage.script != null) { - cc.setSessionData(pref + "denizen", stage.script); + cc.setSessionData(pref + CK.S_DENIZEN, stage.script); } } @@ -1670,10 +1672,10 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } if (used.isEmpty()) { - context.setSessionData("delQuest", quest.name); + context.setSessionData(CK.ED_QUEST_DELETE, quest.name); return new DeletePrompt(); } else { - ((Player) context.getForWhom()).sendMessage(RED + "The following Quests have \"" + PURPLE + context.getSessionData("delQuest") + RED + "\" as a requirement:"); + ((Player) context.getForWhom()).sendMessage(RED + "The following Quests have \"" + PURPLE + context.getSessionData(CK.ED_QUEST_DELETE) + RED + "\" as a requirement:"); for (String s : used) { ((Player) context.getForWhom()).sendMessage(RED + "- " + DARKRED + s); } @@ -1700,7 +1702,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text = - RED + "Are you sure you want to delete the Quest " + " \"" + GOLD + (String) context.getSessionData("delQuest") + RED + "\"?\n"; + RED + "Are you sure you want to delete the Quest " + " \"" + GOLD + (String) context.getSessionData(CK.ED_QUEST_DELETE) + RED + "\"?\n"; text += YELLOW + Lang.get("yes") + "/" + Lang.get("no"); return text; @@ -1734,7 +1736,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { return; } - String quest = (String) context.getSessionData("delQuest"); + String quest = (String) context.getSessionData(CK.ED_QUEST_DELETE); ConfigurationSection sec = data.getConfigurationSection("quests"); for (String key : sec.getKeys(false)) { diff --git a/src/me/blackvein/quests/prompts/CreateStagePrompt.java b/src/me/blackvein/quests/prompts/CreateStagePrompt.java index cf49019e7..9470768c7 100644 --- a/src/me/blackvein/quests/prompts/CreateStagePrompt.java +++ b/src/me/blackvein/quests/prompts/CreateStagePrompt.java @@ -9,6 +9,7 @@ import me.blackvein.quests.Event; import me.blackvein.quests.QuestFactory; import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; +import me.blackvein.quests.util.CK; import me.blackvein.quests.util.ItemUtil; import me.blackvein.quests.util.Lang; import net.aufdemrand.denizen.scripts.ScriptRegistry; @@ -27,7 +28,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; @@ -42,20 +43,21 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - @Override + @SuppressWarnings("unchecked") + @Override public String getPromptText(ConversationContext context) { context.setSessionData(pref, Boolean.TRUE); - String text = PINK + "- " + AQUA + (String) context.getSessionData("questName") + PINK + " | Stage " + PURPLE + stageNum + PINK + " -\n"; + String text = PINK + "- " + AQUA + (String) context.getSessionData(CK.Q_NAME) + PINK + " | Stage " + PURPLE + stageNum + PINK + " -\n"; - if (context.getSessionData(pref + "breakIds") == null) { + if (context.getSessionData(pref + CK.S_BREAK_IDS) == null) { text += PINK + "" + BOLD + "1 " + RESET + PURPLE + "- Break Blocks " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "1 " + RESET + PURPLE + "- Break Blocks\n"; - LinkedList ids = (LinkedList) context.getSessionData(pref + "breakIds"); - LinkedList amnts = (LinkedList) context.getSessionData(pref + "breakAmounts"); + LinkedList ids = (LinkedList) context.getSessionData(pref + CK.S_BREAK_IDS); + LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_BREAK_AMOUNTS); for (int i = 0; i < ids.size(); i++) { text += GRAY + " - " + BLUE + Quester.prettyItemString(ids.get(i)) + GRAY + " x " + DARKAQUA + amnts.get(i) + "\n"; @@ -64,13 +66,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "damageIds") == null) { + if (context.getSessionData(pref + CK.S_DAMAGE_IDS) == null) { text += PINK + "" + BOLD + "2 " + RESET + PURPLE + "- Damage Blocks " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "2 " + RESET + PURPLE + "- Damage Blocks\n"; - LinkedList ids = (LinkedList) context.getSessionData(pref + "damageIds"); - LinkedList amnts = (LinkedList) context.getSessionData(pref + "damageAmounts"); + LinkedList ids = (LinkedList) context.getSessionData(pref + CK.S_DAMAGE_IDS); + LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_DAMAGE_AMOUNTS); for (int i = 0; i < ids.size(); i++) { text += GRAY + " - " + BLUE + Quester.prettyItemString(ids.get(i)) + GRAY + " x " + DARKAQUA + amnts.get(i) + "\n"; @@ -79,13 +81,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "placeIds") == null) { + if (context.getSessionData(pref + CK.S_PLACE_IDS) == null) { text += PINK + "" + BOLD + "3 " + RESET + PURPLE + "- Place Blocks " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "3 " + RESET + PURPLE + "- Place Blocks\n"; - LinkedList ids = (LinkedList) context.getSessionData(pref + "placeIds"); - LinkedList amnts = (LinkedList) context.getSessionData(pref + "placeAmounts"); + LinkedList ids = (LinkedList) context.getSessionData(pref + CK.S_PLACE_IDS); + LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_PLACE_AMOUNTS); for (int i = 0; i < ids.size(); i++) { text += GRAY + " - " + BLUE + Quester.prettyItemString(ids.get(i)) + GRAY + " x " + DARKAQUA + amnts.get(i) + "\n"; @@ -94,13 +96,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "useIds") == null) { + if (context.getSessionData(pref + CK.S_USE_IDS) == null) { text += PINK + "" + BOLD + "4 " + RESET + PURPLE + "- Use Blocks " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "4 " + RESET + PURPLE + "- Use Blocks\n"; - LinkedList ids = (LinkedList) context.getSessionData(pref + "useIds"); - LinkedList amnts = (LinkedList) context.getSessionData(pref + "useAmounts"); + LinkedList ids = (LinkedList) context.getSessionData(pref + CK.S_USE_IDS); + LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_USE_AMOUNTS); for (int i = 0; i < ids.size(); i++) { text += GRAY + " - " + BLUE + Quester.prettyItemString(ids.get(i)) + GRAY + " x " + DARKAQUA + amnts.get(i) + "\n"; @@ -109,13 +111,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "cutIds") == null) { + if (context.getSessionData(pref + CK.S_CUT_IDS) == null) { text += PINK + "" + BOLD + "5 " + RESET + PURPLE + "- Cut Blocks " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "5 " + RESET + PURPLE + "- Cut Blocks\n"; - LinkedList ids = (LinkedList) context.getSessionData(pref + "cutIds"); - LinkedList amnts = (LinkedList) context.getSessionData(pref + "cutAmounts"); + LinkedList ids = (LinkedList) context.getSessionData(pref + CK.S_CUT_IDS); + LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_CUT_AMOUNTS); for (int i = 0; i < ids.size(); i++) { text += GRAY + " - " + BLUE + Quester.prettyItemString(ids.get(i)) + GRAY + " x " + DARKAQUA + amnts.get(i) + "\n"; @@ -123,28 +125,28 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "fish") == null) { + if (context.getSessionData(pref + CK.S_FISH) == null) { text += PINK + "" + BOLD + "6 " + RESET + PURPLE + "- Catch Fish " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - Integer fish = (Integer) context.getSessionData(pref + "fish"); + Integer fish = (Integer) context.getSessionData(pref + CK.S_FISH); text += PINK + "" + BOLD + "6 " + RESET + PURPLE + "- Catch Fish " + GRAY + "(" + AQUA + fish + " fish" + GRAY + ")\n"; } - if (context.getSessionData(pref + "playerKill") == null) { + if (context.getSessionData(pref + CK.S_PLAYER_KILL) == null) { text += PINK + "" + BOLD + "7 " + RESET + PURPLE + "- Kill Players " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - Integer fish = (Integer) context.getSessionData(pref + "playerKill"); + Integer fish = (Integer) context.getSessionData(pref + CK.S_PLAYER_KILL); text += PINK + "" + BOLD + "7 " + RESET + PURPLE + "- Kill Players " + GRAY + "(" + AQUA + fish + " players" + GRAY + ")\n"; } - if (context.getSessionData(pref + "enchantTypes") == null) { + if (context.getSessionData(pref + CK.S_ENCHANT_TYPES) == null) { text += PINK + "" + BOLD + "8 " + RESET + PURPLE + "- Enchant Items " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "8 " + RESET + PURPLE + "- Enchant Items\n"; - LinkedList enchants = (LinkedList) context.getSessionData(pref + "enchantTypes"); - LinkedList items = (LinkedList) context.getSessionData(pref + "enchantIds"); - LinkedList amnts = (LinkedList) context.getSessionData(pref + "enchantAmounts"); + LinkedList enchants = (LinkedList) context.getSessionData(pref + CK.S_ENCHANT_TYPES); + LinkedList items = (LinkedList) context.getSessionData(pref + CK.S_ENCHANT_IDS); + LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_ENCHANT_AMOUNTS); for (int i = 0; i < enchants.size(); i++) { text += GRAY + " - " + BLUE + Quester.prettyItemString(items.get(i)) + GRAY + " with " + AQUA + Quester.prettyString(enchants.get(i)) + GRAY + " x " + DARKAQUA + amnts.get(i) + "\n"; @@ -154,13 +156,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (questFactory.quests.citizens != null) { - if (context.getSessionData(pref + "deliveryItems") == null) { + if (context.getSessionData(pref + CK.S_DELIVERY_ITEMS) == null) { text += PINK + "" + BOLD + "9 " + RESET + PURPLE + "- Deliver Items " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "9 " + RESET + PURPLE + "- Deliver Items\n"; - LinkedList npcs = (LinkedList) context.getSessionData(pref + "deliveryNPCs"); - LinkedList items = (LinkedList) context.getSessionData(pref + "deliveryItems"); + LinkedList npcs = (LinkedList) context.getSessionData(pref + CK.S_DELIVERY_NPCS); + LinkedList items = (LinkedList) context.getSessionData(pref + CK.S_DELIVERY_ITEMS); for (int i = 0; i < npcs.size(); i++) { text += GRAY + " - " + BLUE + ItemUtil.getName(items.get(i)) + GRAY + " x " + AQUA + items.get(i).getAmount() + GRAY + " to " + DARKAQUA + citizens.getNPCRegistry().getById(npcs.get(i)).getName() + "\n"; @@ -174,12 +176,12 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (questFactory.quests.citizens != null) { - if (context.getSessionData(pref + "npcIdsToTalkTo") == null) { + if (context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) == null) { text += PINK + "" + BOLD + "10 " + RESET + PURPLE + "- Talk to NPCs " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "10 " + RESET + PURPLE + "- Talk to NPCs\n"; - LinkedList npcs = (LinkedList) context.getSessionData(pref + "npcIdsToTalkTo"); + LinkedList npcs = (LinkedList) context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO); for (int i = 0; i < npcs.size(); i++) { text += GRAY + " - " + BLUE + citizens.getNPCRegistry().getById(npcs.get(i)).getName() + "\n"; @@ -193,13 +195,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (questFactory.quests.citizens != null) { - if (context.getSessionData(pref + "npcIdsToKill") == null) { + if (context.getSessionData(pref + CK.S_NPCS_TO_KILL) == null) { text += PINK + "" + BOLD + "11 " + RESET + PURPLE + "- Kill NPCs " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "11 " + RESET + PURPLE + "- Kill NPCs\n"; - LinkedList npcs = (LinkedList) context.getSessionData(pref + "npcIdsToKill"); - LinkedList amounts = (LinkedList) context.getSessionData(pref + "npcAmountsToKill"); + LinkedList npcs = (LinkedList) context.getSessionData(pref + CK.S_NPCS_TO_KILL); + LinkedList amounts = (LinkedList) context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS); for (int i = 0; i < npcs.size(); i++) { text += GRAY + " - " + BLUE + citizens.getNPCRegistry().getById(npcs.get(i)).getName() + GRAY + " x " + AQUA + amounts.get(i) + "\n"; @@ -213,13 +215,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if(Quests.epicBoss != null){ - if (context.getSessionData(pref + "bossIds") == null) { + if (context.getSessionData(pref + CK.S_BOSS_IDS) == null) { text += PINK + "" + BOLD + "12 " + RESET + PURPLE + "- Kill Bosses " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "12 " + RESET + PURPLE + "- Kill Bosses\n"; - LinkedList bosses = (LinkedList) context.getSessionData(pref + "bossIds"); - LinkedList amnts = (LinkedList) context.getSessionData(pref + "bossAmounts"); + 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"; @@ -231,15 +233,15 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { text += GRAY + "" + BOLD + "12 " + RESET + GRAY + "- Kill Bosses " + GRAY + "(EpicBoss not installed)\n"; } - if (context.getSessionData(pref + "mobTypes") == null) { + if (context.getSessionData(pref + CK.S_MOB_TYPES) == null) { text += PINK + "" + BOLD + "13 " + RESET + PURPLE + "- Kill Mobs " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "13 " + RESET + PURPLE + "- Kill Mobs\n"; - LinkedList mobs = (LinkedList) context.getSessionData(pref + "mobTypes"); - LinkedList amnts = (LinkedList) context.getSessionData(pref + "mobAmounts"); + LinkedList mobs = (LinkedList) context.getSessionData(pref + CK.S_MOB_TYPES); + LinkedList amnts = (LinkedList) context.getSessionData(pref + CK.S_MOB_AMOUNTS); - if (context.getSessionData(pref + "killLocations") == null) { + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS) == null) { for (int i = 0; i < mobs.size(); i++) { text += GRAY + " - " + AQUA + Quester.prettyString(mobs.get(i)) + GRAY + " x " + DARKAQUA + amnts.get(i) + "\n"; @@ -247,9 +249,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } else { - LinkedList locs = (LinkedList) context.getSessionData(pref + "killLocations"); - LinkedList radii = (LinkedList) context.getSessionData(pref + "killLocationRadii"); - LinkedList names = (LinkedList) context.getSessionData(pref + "killLocationNames"); + LinkedList locs = (LinkedList) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS); + LinkedList radii = (LinkedList) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS); + LinkedList names = (LinkedList) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES); for (int i = 0; i < mobs.size(); i++) { text += GRAY + " - " + BLUE + Quester.prettyString(mobs.get(i)) + GRAY + " x " + DARKAQUA + amnts.get(i) + GRAY + " within " + PURPLE + radii.get(i) + GRAY + " blocks of " + YELLOW + names.get(i) + " (" + locs.get(i) + ")\n"; @@ -259,14 +261,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "reachLocations") == null) { + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) { text += PINK + "" + BOLD + "14 " + RESET + PURPLE + "- Reach Locations " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "14 " + RESET + PURPLE + "- Reach Locations\n"; - LinkedList locations = (LinkedList) context.getSessionData(pref + "reachLocations"); - LinkedList radii = (LinkedList) context.getSessionData(pref + "reachLocationRadii"); - LinkedList names = (LinkedList) context.getSessionData(pref + "reachLocationNames"); + 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 + " - Reach within " + BLUE + radii.get(i) + GRAY + " blocks of " + AQUA + names.get(i) + GRAY + " (" + DARKAQUA + locations.get(i) + GRAY + ")\n"; @@ -276,14 +278,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "tameTypes") == null) { + if (context.getSessionData(pref + CK.S_TAME_TYPES) == null) { text += PINK + "" + BOLD + "15 " + RESET + PURPLE + "- Tame Mobs " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "15 " + RESET + PURPLE + "- Tame Mobs\n"; - LinkedList mobs = (LinkedList) context.getSessionData(pref + "tameTypes"); - LinkedList amounts = (LinkedList) context.getSessionData(pref + "tameAmounts"); + LinkedList mobs = (LinkedList) context.getSessionData(pref + CK.S_TAME_TYPES); + LinkedList amounts = (LinkedList) context.getSessionData(pref + CK.S_TAME_AMOUNTS); for (int i = 0; i < mobs.size(); i++) { text += GRAY + " - " + BLUE + mobs.get(i) + GRAY + " x " + AQUA + amounts.get(i) + "\n"; @@ -291,13 +293,13 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "shearColors") == null) { + if (context.getSessionData(pref + CK.S_SHEAR_COLORS) == null) { text += PINK + "" + BOLD + "16 " + RESET + PURPLE + "- Shear Sheep " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { text += PINK + "" + BOLD + "16 " + RESET + PURPLE + "- Shear Sheep\n"; - LinkedList colors = (LinkedList) context.getSessionData(pref + "shearColors"); - LinkedList amounts = (LinkedList) context.getSessionData(pref + "shearAmounts"); + LinkedList colors = (LinkedList) context.getSessionData(pref + CK.S_SHEAR_COLORS); + LinkedList amounts = (LinkedList) context.getSessionData(pref + CK.S_SHEAR_AMOUNTS); for (int i = 0; i < colors.size(); i++) { text += GRAY + " - " + BLUE + colors.get(i) + GRAY + " x " + AQUA + amounts.get(i) + "\n"; @@ -305,25 +307,25 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "event") == null) { + if (context.getSessionData(pref + CK.S_EVENT) == null) { text += PINK + "" + BOLD + "17 " + RESET + PURPLE + "- Event " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "17 " + RESET + PURPLE + "- Event " + GRAY + "(" + AQUA + context.getSessionData(pref + "event") + GRAY + ")\n"; + text += PINK + "" + BOLD + "17 " + RESET + PURPLE + "- Event " + GRAY + "(" + AQUA + context.getSessionData(pref + CK.S_EVENT) + GRAY + ")\n"; } - if (context.getSessionData(pref + "delay") == null) { + if (context.getSessionData(pref + CK.S_DELAY) == null) { text += PINK + "" + BOLD + "18 " + RESET + PURPLE + "- Delay " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - long time = (Long) context.getSessionData(pref + "delay"); + long time = (Long) context.getSessionData(pref + CK.S_DELAY); text += PINK + "" + BOLD + "18 " + RESET + PURPLE + "- Delay " + GRAY + "(" + AQUA + Quests.getTime(time) + GRAY + ")\n"; } - if (context.getSessionData(pref + "delay") == null) { + if (context.getSessionData(pref + CK.S_DELAY) == null) { text += GRAY + "" + BOLD + "19 " + RESET + GRAY + "- Delay Message " + GRAY + "(No delay set)\n"; - } else if (context.getSessionData(pref + "delayMessage") == null) { + } else if (context.getSessionData(pref + CK.S_DELAY_MESSAGE) == null) { text += PINK + "" + BOLD + "19 " + RESET + PURPLE + "- Delay Message " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "19 " + RESET + PURPLE + "- Delay Message " + GRAY + "(" + AQUA + "\"" + context.getSessionData(pref + "delayMessage") + "\"" + GRAY + ")\n"; + text += PINK + "" + BOLD + "19 " + RESET + PURPLE + "- Delay Message " + GRAY + "(" + AQUA + "\"" + context.getSessionData(pref + CK.S_DELAY_MESSAGE) + "\"" + GRAY + ")\n"; } @@ -331,10 +333,10 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { text += GRAY + "" + BOLD + "19 " + RESET + GRAY + "- Denizen Script " + GRAY + "(Denizen not installed)\n"; } else { - if (context.getSessionData(pref + "denizen") == null) { + if (context.getSessionData(pref + CK.S_DENIZEN) == null) { text += GRAY + "" + BOLD + "20 " + RESET + PURPLE + "- Denizen Script " + GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += PINK + "" + BOLD + "20 " + RESET + PURPLE + "- Denizen Script " + GRAY + "(" + AQUA + context.getSessionData(pref + "denizen") + GRAY + "\n"; + text += PINK + "" + BOLD + "20 " + RESET + PURPLE + "- Denizen Script " + GRAY + "(" + AQUA + context.getSessionData(pref + CK.S_DENIZEN) + GRAY + "\n"; } } @@ -406,7 +408,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } else if (input.equalsIgnoreCase("18")) { return new DelayPrompt(); } else if (input.equalsIgnoreCase("19")) { - if (context.getSessionData(pref + "delay") == null) { + if (context.getSessionData(pref + CK.S_DELAY) == null) { context.getForWhom().sendRawMessage(RED + "You must set a delay first!"); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { @@ -441,7 +443,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Break Blocks -\n"; - if (context.getSessionData(pref + "breakIds") == null) { + if (context.getSessionData(pref + CK.S_BREAK_IDS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set block IDs (None set)\n"; text += GRAY + "2 - Set block amounts (No IDs set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -455,7 +457,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "breakAmounts") == null) { + if (context.getSessionData(pref + CK.S_BREAK_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set block amounts (None set)\n"; } else { @@ -483,7 +485,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new BreakBlockIdsPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "breakIds") == null) { + if (context.getSessionData(pref + CK.S_BREAK_IDS) == null) { context.getForWhom().sendRawMessage(RED + "You must set block IDs first!"); return new BreakBlockListPrompt(); } else { @@ -491,22 +493,22 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + "Break blocks objective cleared."); - context.setSessionData(pref + "breakIds", null); - context.setSessionData(pref + "breakAmounts", null); + context.setSessionData(pref + CK.S_BREAK_IDS, null); + context.setSessionData(pref + CK.S_BREAK_AMOUNTS, null); return new BreakBlockListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData(pref + "breakIds") != null) { - one = ((List) context.getSessionData(pref + "breakIds")).size(); + if (context.getSessionData(pref + CK.S_BREAK_IDS) != null) { + one = ((List) context.getSessionData(pref + CK.S_BREAK_IDS)).size(); } else { one = 0; } - if (context.getSessionData(pref + "breakAmounts") != null) { - two = ((List) context.getSessionData(pref + "breakAmounts")).size(); + if (context.getSessionData(pref + CK.S_BREAK_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_BREAK_AMOUNTS)).size(); } else { two = 0; } @@ -523,11 +525,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getBlockIds(ConversationContext context) { - return (List) context.getSessionData(pref + "breakIds"); + return (List) context.getSessionData(pref + CK.S_BREAK_IDS); } private List getBlockAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "breakAmounts"); + return (List) context.getSessionData(pref + CK.S_BREAK_AMOUNTS); } } @@ -570,7 +572,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "breakIds", ids); + context.setSessionData(pref + CK.S_BREAK_IDS, ids); } @@ -611,7 +613,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "breakAmounts", amounts); + context.setSessionData(pref + CK.S_BREAK_AMOUNTS, amounts); } @@ -632,7 +634,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Damage Blocks -\n"; - if (context.getSessionData(pref + "damageIds") == null) { + if (context.getSessionData(pref + CK.S_DAMAGE_IDS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set block IDs (None set)\n"; text += GRAY + "2 - Set damage amounts (No IDs set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -646,7 +648,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "damageAmounts") == null) { + if (context.getSessionData(pref + CK.S_DAMAGE_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set damage amounts (None set)\n"; } else { @@ -674,7 +676,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new DamageBlockIdsPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "damageIds") == null) { + if (context.getSessionData(pref + CK.S_DAMAGE_IDS) == null) { context.getForWhom().sendRawMessage(RED + "You must set block IDs first!"); return new DamageBlockListPrompt(); } else { @@ -682,22 +684,22 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + "Damage blocks objective cleared."); - context.setSessionData(pref + "damageIds", null); - context.setSessionData(pref + "damageAmounts", null); + context.setSessionData(pref + CK.S_DAMAGE_IDS, null); + context.setSessionData(pref + CK.S_DAMAGE_AMOUNTS, null); return new DamageBlockListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData(pref + "damageIds") != null) { - one = ((List) context.getSessionData(pref + "damageIds")).size(); + if (context.getSessionData(pref + CK.S_DAMAGE_IDS) != null) { + one = ((List) context.getSessionData(pref + CK.S_DAMAGE_IDS)).size(); } else { one = 0; } - if (context.getSessionData(pref + "damageAmounts") != null) { - two = ((List) context.getSessionData(pref + "damageAmounts")).size(); + if (context.getSessionData(pref + CK.S_DAMAGE_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_DAMAGE_AMOUNTS)).size(); } else { two = 0; } @@ -714,11 +716,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getBlockIds(ConversationContext context) { - return (List) context.getSessionData(pref + "damageIds"); + return (List) context.getSessionData(pref + CK.S_DAMAGE_IDS); } private List getBlockAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "damageAmounts"); + return (List) context.getSessionData(pref + CK.S_DAMAGE_AMOUNTS); } } @@ -761,7 +763,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "damageIds", ids); + context.setSessionData(pref + CK.S_DAMAGE_IDS, ids); } @@ -802,7 +804,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "damageAmounts", amounts); + context.setSessionData(pref + CK.S_DAMAGE_AMOUNTS, amounts); } @@ -823,7 +825,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Place Blocks -\n"; - if (context.getSessionData(pref + "placeIds") == null) { + if (context.getSessionData(pref + CK.S_PLACE_IDS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set block IDs (None set)\n"; text += GRAY + "2 - Set place amounts (No IDs set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -837,7 +839,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "placeAmounts") == null) { + if (context.getSessionData(pref + CK.S_PLACE_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set place amounts (None set)\n"; } else { @@ -865,7 +867,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new PlaceBlockIdsPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "placeIds") == null) { + if (context.getSessionData(pref + CK.S_PLACE_IDS) == null) { context.getForWhom().sendRawMessage(RED + "You must set block IDs first!"); return new PlaceBlockListPrompt(); } else { @@ -873,22 +875,22 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + "Place blocks objective cleared."); - context.setSessionData(pref + "placeIds", null); - context.setSessionData(pref + "placeAmounts", null); + context.setSessionData(pref + CK.S_PLACE_IDS, null); + context.setSessionData(pref + CK.S_PLACE_AMOUNTS, null); return new PlaceBlockListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData(pref + "placeIds") != null) { - one = ((List) context.getSessionData(pref + "placeIds")).size(); + if (context.getSessionData(pref + CK.S_PLACE_IDS) != null) { + one = ((List) context.getSessionData(pref + CK.S_PLACE_IDS)).size(); } else { one = 0; } - if (context.getSessionData(pref + "placeAmounts") != null) { - two = ((List) context.getSessionData(pref + "placeAmounts")).size(); + if (context.getSessionData(pref + CK.S_PLACE_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_PLACE_AMOUNTS)).size(); } else { two = 0; } @@ -905,11 +907,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getBlockIds(ConversationContext context) { - return (List) context.getSessionData(pref + "placeIds"); + return (List) context.getSessionData(pref + CK.S_PLACE_IDS); } private List getBlockAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "placeAmounts"); + return (List) context.getSessionData(pref + CK.S_PLACE_AMOUNTS); } } @@ -952,7 +954,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "placeIds", ids); + context.setSessionData(pref + CK.S_PLACE_IDS, ids); } @@ -993,7 +995,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "placeAmounts", amounts); + context.setSessionData(pref + CK.S_PLACE_AMOUNTS, amounts); } @@ -1014,7 +1016,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Use Blocks -\n"; - if (context.getSessionData(pref + "useIds") == null) { + if (context.getSessionData(pref + CK.S_USE_IDS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set block IDs (None set)\n"; text += GRAY + "2 - Set use amounts (No IDs set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -1028,7 +1030,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "useAmounts") == null) { + if (context.getSessionData(pref + CK.S_USE_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set use amounts (None set)\n"; } else { @@ -1056,7 +1058,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new UseBlockIdsPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "useIds") == null) { + if (context.getSessionData(pref + CK.S_USE_IDS) == null) { context.getForWhom().sendRawMessage(RED + "You must set block IDs first!"); return new UseBlockListPrompt(); } else { @@ -1064,22 +1066,22 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + "Use blocks objective cleared."); - context.setSessionData(pref + "useIds", null); - context.setSessionData(pref + "useAmounts", null); + context.setSessionData(pref + CK.S_USE_IDS, null); + context.setSessionData(pref + CK.S_USE_AMOUNTS, null); return new UseBlockListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData(pref + "useIds") != null) { - one = ((List) context.getSessionData(pref + "useIds")).size(); + if (context.getSessionData(pref + CK.S_USE_IDS) != null) { + one = ((List) context.getSessionData(pref + CK.S_USE_IDS)).size(); } else { one = 0; } - if (context.getSessionData(pref + "useAmounts") != null) { - two = ((List) context.getSessionData(pref + "useAmounts")).size(); + if (context.getSessionData(pref + CK.S_USE_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_USE_AMOUNTS)).size(); } else { two = 0; } @@ -1096,11 +1098,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getBlockIds(ConversationContext context) { - return (List) context.getSessionData(pref + "useIds"); + return (List) context.getSessionData(pref + CK.S_USE_IDS); } private List getBlockAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "useAmounts"); + return (List) context.getSessionData(pref + CK.S_USE_AMOUNTS); } } @@ -1143,7 +1145,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "useIds", ids); + context.setSessionData(pref + CK.S_USE_IDS, ids); } @@ -1184,7 +1186,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "useAmounts", amounts); + context.setSessionData(pref + CK.S_USE_AMOUNTS, amounts); } @@ -1205,7 +1207,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Cut Blocks -\n"; - if (context.getSessionData(pref + "cutIds") == null) { + if (context.getSessionData(pref + CK.S_CUT_IDS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set block IDs (None set)\n"; text += GRAY + "2 - Set cut amounts (No IDs set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -1219,7 +1221,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "cutAmounts") == null) { + if (context.getSessionData(pref + CK.S_CUT_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set cut amounts (None set)\n"; } else { @@ -1247,7 +1249,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new CutBlockIdsPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "cutIds") == null) { + if (context.getSessionData(pref + CK.S_CUT_IDS) == null) { context.getForWhom().sendRawMessage(RED + "You must set block IDs first!"); return new CutBlockListPrompt(); } else { @@ -1255,22 +1257,22 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + "Cut blocks objective cleared."); - context.setSessionData(pref + "cutIds", null); - context.setSessionData(pref + "cutAmounts", null); + context.setSessionData(pref + CK.S_CUT_IDS, null); + context.setSessionData(pref + CK.S_CUT_AMOUNTS, null); return new CutBlockListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData(pref + "cutIds") != null) { - one = ((List) context.getSessionData(pref + "cutIds")).size(); + if (context.getSessionData(pref + CK.S_CUT_IDS) != null) { + one = ((List) context.getSessionData(pref + CK.S_CUT_IDS)).size(); } else { one = 0; } - if (context.getSessionData(pref + "cutAmounts") != null) { - two = ((List) context.getSessionData(pref + "cutAmounts")).size(); + if (context.getSessionData(pref + CK.S_CUT_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_CUT_AMOUNTS)).size(); } else { two = 0; } @@ -1287,11 +1289,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getBlockIds(ConversationContext context) { - return (List) context.getSessionData(pref + "cutIds"); + return (List) context.getSessionData(pref + CK.S_CUT_IDS); } private List getBlockAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "cutAmounts"); + return (List) context.getSessionData(pref + CK.S_CUT_AMOUNTS); } } @@ -1334,7 +1336,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "cutIds", ids); + context.setSessionData(pref + CK.S_CUT_IDS, ids); } @@ -1375,7 +1377,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "cutAmounts", amounts); + context.setSessionData(pref + CK.S_CUT_AMOUNTS, amounts); } @@ -1401,9 +1403,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { player.sendMessage(RED + "You must enter a positive number!"); return new FishPrompt(); } else if (num == 0) { - context.setSessionData(pref + "fish", null); + context.setSessionData(pref + CK.S_FISH, null); } else if (num > 0) { - context.setSessionData(pref + "fish", num); + context.setSessionData(pref + CK.S_FISH, num); } return new CreateStagePrompt(stageNum, questFactory, citizens); @@ -1428,9 +1430,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { player.sendMessage(RED + "You must enter a positive number!"); return new KillPlayerPrompt(); } else if (num == 0) { - context.setSessionData(pref + "playerKill", null); + context.setSessionData(pref + CK.S_PLAYER_KILL, null); } else if (num > 0) { - context.setSessionData(pref + "playerKill", num); + context.setSessionData(pref + CK.S_PLAYER_KILL, num); } return new CreateStagePrompt(stageNum, questFactory, citizens); @@ -1450,7 +1452,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Enchant Items -\n"; - if (context.getSessionData(pref + "enchantTypes") == null) { + if (context.getSessionData(pref + CK.S_ENCHANT_TYPES) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set enchantments (None set)\n"; text += GRAY + "2 - Set item ids (No enchantments set)\n"; text += GRAY + "3 - Set enchant amounts (No enchantments set)\n"; @@ -1465,7 +1467,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "enchantIds") == null) { + if (context.getSessionData(pref + CK.S_ENCHANT_IDS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set item ids (None set)\n"; } else { @@ -1478,7 +1480,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "enchantAmounts") == null) { + if (context.getSessionData(pref + CK.S_ENCHANT_AMOUNTS) == null) { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Set enchant amounts (None set)\n"; } else { @@ -1506,14 +1508,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new EnchantTypesPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "enchantTypes") == null) { + if (context.getSessionData(pref + CK.S_ENCHANT_TYPES) == null) { context.getForWhom().sendRawMessage(RED + "You must set enchantments first!"); return new EnchantmentListPrompt(); } else { return new EnchantItemsPrompt(); } } else if (input.equalsIgnoreCase("3")) { - if (context.getSessionData(pref + "enchantTypes") == null) { + if (context.getSessionData(pref + CK.S_ENCHANT_TYPES) == null) { context.getForWhom().sendRawMessage(RED + "You must set enchantments first!"); return new EnchantmentListPrompt(); } else { @@ -1521,9 +1523,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("4")) { context.getForWhom().sendRawMessage(YELLOW + "Enchantment objective cleared."); - context.setSessionData(pref + "enchantTypes", null); - context.setSessionData(pref + "enchantIds", null); - context.setSessionData(pref + "enchantAmounts", null); + context.setSessionData(pref + CK.S_ENCHANT_TYPES, null); + context.setSessionData(pref + CK.S_ENCHANT_IDS, null); + context.setSessionData(pref + CK.S_ENCHANT_AMOUNTS, null); return new EnchantmentListPrompt(); } else if (input.equalsIgnoreCase("5")) { @@ -1531,20 +1533,20 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { int two; int three; - if (context.getSessionData(pref + "enchantTypes") != null) { - one = ((List) context.getSessionData(pref + "enchantTypes")).size(); + if (context.getSessionData(pref + CK.S_ENCHANT_TYPES) != null) { + one = ((List) context.getSessionData(pref + CK.S_ENCHANT_TYPES)).size(); } else { one = 0; } - if (context.getSessionData(pref + "enchantIds") != null) { - two = ((List) context.getSessionData(pref + "enchantIds")).size(); + if (context.getSessionData(pref + CK.S_ENCHANT_IDS) != null) { + two = ((List) context.getSessionData(pref + CK.S_ENCHANT_IDS)).size(); } else { two = 0; } - if (context.getSessionData(pref + "enchantAmounts") != null) { - three = ((List) context.getSessionData(pref + "enchantAmounts")).size(); + if (context.getSessionData(pref + CK.S_ENCHANT_AMOUNTS) != null) { + three = ((List) context.getSessionData(pref + CK.S_ENCHANT_AMOUNTS)).size(); } else { three = 0; } @@ -1562,15 +1564,15 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getEnchantTypes(ConversationContext context) { - return (List) context.getSessionData(pref + "enchantTypes"); + return (List) context.getSessionData(pref + CK.S_ENCHANT_TYPES); } private List getEnchantItems(ConversationContext context) { - return (List) context.getSessionData(pref + "enchantIds"); + return (List) context.getSessionData(pref + CK.S_ENCHANT_IDS); } private List getEnchantAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "enchantAmounts"); + return (List) context.getSessionData(pref + CK.S_ENCHANT_AMOUNTS); } } @@ -1626,7 +1628,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "enchantTypes", enchs); + context.setSessionData(pref + CK.S_ENCHANT_TYPES, enchs); } @@ -1674,7 +1676,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "enchantIds", ids); + context.setSessionData(pref + CK.S_ENCHANT_IDS, ids); } @@ -1715,7 +1717,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "enchantAmounts", amounts); + context.setSessionData(pref + CK.S_ENCHANT_AMOUNTS, amounts); } @@ -1737,14 +1739,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { // Check/add newly made item if(context.getSessionData("newItem") != null){ - if(context.getSessionData(pref + "deliveryItems") != null){ + if(context.getSessionData(pref + CK.S_DELIVERY_ITEMS) != null){ List itemRews = getItems(context); itemRews.add((ItemStack) context.getSessionData("tempStack")); - context.setSessionData(pref + "deliveryItems", itemRews); + context.setSessionData(pref + CK.S_DELIVERY_ITEMS, itemRews); }else{ LinkedList itemRews = new LinkedList(); itemRews.add((ItemStack) context.getSessionData("tempStack")); - context.setSessionData(pref + "deliveryItems", itemRews); + context.setSessionData(pref + CK.S_DELIVERY_ITEMS, itemRews); } context.setSessionData("newItem", null); @@ -1753,11 +1755,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } String text = GOLD + "- Deliver Items -\n"; - if (context.getSessionData(pref + "deliveryItems") == null) { + if (context.getSessionData(pref + CK.S_DELIVERY_ITEMS) == null) { text += GRAY + " (" + Lang.get("noneSet") + ")\n"; text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Add item\n"; text += GRAY + "2 - Set NPC IDs (No items set)\n"; - if (context.getSessionData(pref + "deliveryMessages") == null) { + if (context.getSessionData(pref + CK.S_DELIVERY_MESSAGES) == null) { text += BLUE + "3 - Set delivery messages (None set)\n"; } else { @@ -1781,7 +1783,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Add item\n"; - if (context.getSessionData(pref + "deliveryNPCs") == null) { + if (context.getSessionData(pref + CK.S_DELIVERY_NPCS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set NPC IDs (None set)\n"; } else { @@ -1794,7 +1796,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "deliveryMessages") == null) { + if (context.getSessionData(pref + CK.S_DELIVERY_MESSAGES) == null) { text += BLUE + "3 - Set delivery messages (None set)\n"; } else { @@ -1822,7 +1824,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new ItemStackPrompt(DeliveryListPrompt.this); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "deliveryItems") == null) { + if (context.getSessionData(pref + CK.S_DELIVERY_ITEMS) == null) { context.getForWhom().sendRawMessage(RED + "You must add items first!"); return new DeliveryListPrompt(); } else { @@ -1832,30 +1834,30 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { return new DeliveryMessagesPrompt(); } else if (input.equalsIgnoreCase("4")) { context.getForWhom().sendRawMessage(YELLOW + "Delivery objective cleared."); - context.setSessionData(pref + "deliveryItems", null); - context.setSessionData(pref + "deliveryNPCs", null); - context.setSessionData(pref + "deliveryMessages", null); + context.setSessionData(pref + CK.S_DELIVERY_ITEMS, null); + context.setSessionData(pref + CK.S_DELIVERY_NPCS, null); + context.setSessionData(pref + CK.S_DELIVERY_MESSAGES, null); return new DeliveryListPrompt(); } else if (input.equalsIgnoreCase("5")) { int one; int two; - if (context.getSessionData(pref + "deliveryItems") != null) { - one = ((List) context.getSessionData(pref + "deliveryItems")).size(); + if (context.getSessionData(pref + CK.S_DELIVERY_ITEMS) != null) { + one = ((List) context.getSessionData(pref + CK.S_DELIVERY_ITEMS)).size(); } else { one = 0; } - if (context.getSessionData(pref + "deliveryNPCs") != null) { - two = ((List) context.getSessionData(pref + "deliveryNPCs")).size(); + if (context.getSessionData(pref + CK.S_DELIVERY_NPCS) != null) { + two = ((List) context.getSessionData(pref + CK.S_DELIVERY_NPCS)).size(); } else { two = 0; } if (one == two) { - if (context.getSessionData(pref + "deliveryMessages") == null && one != 0) { + if (context.getSessionData(pref + CK.S_DELIVERY_MESSAGES) == null && one != 0) { context.getForWhom().sendRawMessage(RED + "You must set at least one delivery message!"); return new DeliveryListPrompt(); } else { @@ -1873,15 +1875,15 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getItems(ConversationContext context) { - return (List) context.getSessionData(pref + "deliveryItems"); + return (List) context.getSessionData(pref + CK.S_DELIVERY_ITEMS); } private List getDeliveryNPCs(ConversationContext context) { - return (List) context.getSessionData(pref + "deliveryNPCs"); + return (List) context.getSessionData(pref + CK.S_DELIVERY_NPCS); } private List getDeliveryMessages(ConversationContext context) { - return (List) context.getSessionData(pref + "deliveryMessages"); + return (List) context.getSessionData(pref + CK.S_DELIVERY_MESSAGES); } } @@ -1922,7 +1924,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "deliveryNPCs", npcs); + context.setSessionData(pref + CK.S_DELIVERY_NPCS, npcs); } @@ -1949,7 +1951,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { LinkedList messages = new LinkedList(); messages.addAll(Arrays.asList(args)); - context.setSessionData(pref + "deliveryMessages", messages); + context.setSessionData(pref + CK.S_DELIVERY_MESSAGES, messages); } @@ -1995,11 +1997,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "npcIdsToTalkTo", npcs); + context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, npcs); } else if (input.equalsIgnoreCase("clear")) { - context.setSessionData(pref + "npcIdsToTalkTo", null); + context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, null); } @@ -2020,7 +2022,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Kill NPCs -\n"; - if (context.getSessionData(pref + "npcIdsToKill") == null) { + if (context.getSessionData(pref + CK.S_NPCS_TO_KILL) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set NPC IDs (None set)\n"; text += GRAY + "2 - Set kill amounts (No IDs set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -2034,7 +2036,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "npcAmountsToKill") == null) { + if (context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set kill amounts (None set)\n"; } else { @@ -2062,7 +2064,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new npcIdsToKillPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "npcIdsToKill") == null) { + if (context.getSessionData(pref + CK.S_NPCS_TO_KILL) == null) { context.getForWhom().sendRawMessage(RED + "You must set NPC IDs first!"); return new NPCKillListPrompt(); } else { @@ -2070,22 +2072,22 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + "Kill NPCs objective cleared."); - context.setSessionData(pref + "npcIdsToKill", null); - context.setSessionData(pref + "npcAmountsToKill", null); + context.setSessionData(pref + CK.S_NPCS_TO_KILL, null); + context.setSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS, null); return new NPCKillListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData(pref + "npcIdsToKill") != null) { - one = ((List) context.getSessionData(pref + "npcIdsToKill")).size(); + if (context.getSessionData(pref + CK.S_NPCS_TO_KILL) != null) { + one = ((List) context.getSessionData(pref + CK.S_NPCS_TO_KILL)).size(); } else { one = 0; } - if (context.getSessionData(pref + "npcAmountsToKill") != null) { - two = ((List) context.getSessionData(pref + "npcAmountsToKill")).size(); + if (context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS)).size(); } else { two = 0; } @@ -2102,11 +2104,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getNPCIds(ConversationContext context) { - return (List) context.getSessionData(pref + "npcIdsToKill"); + return (List) context.getSessionData(pref + CK.S_NPCS_TO_KILL); } private List getKillAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "npcAmountsToKill"); + return (List) context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS); } } @@ -2147,7 +2149,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "npcIdsToKill", npcs); + context.setSessionData(pref + CK.S_NPCS_TO_KILL, npcs); } @@ -2188,7 +2190,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "npcAmountsToKill", amounts); + context.setSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS, amounts); } @@ -2209,7 +2211,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Kill Mobs -\n"; - if (context.getSessionData(pref + "mobTypes") == null) { + if (context.getSessionData(pref + CK.S_MOB_TYPES) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set mob types (None set)\n"; text += GRAY + "2 - Set mob amounts (No mob types set)\n"; text += DARKGRAY + "|---------Optional---------|"; @@ -2228,7 +2230,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "mobAmounts") == null) { + if (context.getSessionData(pref + CK.S_MOB_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set mob amounts (None set)\n"; } else { @@ -2243,7 +2245,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { text += DARKGRAY + "|---------Optional---------|"; - if (context.getSessionData(pref + "killLocations") == null) { + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS) == null) { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Set kill locations (None set)\n"; } else { @@ -2256,7 +2258,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "killLocationRadii") == null) { + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS) == null) { text += BLUE + "4 - Set kill location radii (None set)\n"; } else { @@ -2269,7 +2271,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "killLocationNames") == null) { + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES) == null) { text += BLUE + "5 - Set kill location names (None set)\n"; } else { @@ -2299,14 +2301,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new MobTypesPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "mobTypes") == null) { + if (context.getSessionData(pref + CK.S_MOB_TYPES) == null) { context.getForWhom().sendRawMessage(RED + "You must set mob types first!"); return new MobListPrompt(); } else { return new MobAmountsPrompt(); } } else if (input.equalsIgnoreCase("3")) { - if (context.getSessionData(pref + "mobTypes") == null) { + if (context.getSessionData(pref + CK.S_MOB_TYPES) == null) { context.getForWhom().sendRawMessage(RED + "You must set mob types first!"); return new MobListPrompt(); } else { @@ -2314,14 +2316,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { return new MobLocationPrompt(); } } else if (input.equalsIgnoreCase("4")) { - if (context.getSessionData(pref + "killLocations") == null) { + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS) == null) { context.getForWhom().sendRawMessage(RED + "You must set kill locations first!"); return new MobListPrompt(); } else { return new MobRadiiPrompt(); } } else if (input.equalsIgnoreCase("5")) { - if (context.getSessionData(pref + "killLocations") == null) { + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS) == null) { context.getForWhom().sendRawMessage(RED + "You must set kill locations first!"); return new MobListPrompt(); } else { @@ -2329,11 +2331,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("6")) { context.getForWhom().sendRawMessage(YELLOW + "Kill Mobs objective cleared."); - context.setSessionData(pref + "mobTypes", null); - context.setSessionData(pref + "mobAmounts", null); - context.setSessionData(pref + "killLocations", null); - context.setSessionData(pref + "killLocationRadii", null); - context.setSessionData(pref + "killLocationNames", null); + context.setSessionData(pref + CK.S_MOB_TYPES, null); + context.setSessionData(pref + CK.S_MOB_AMOUNTS, null); + context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, null); + context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS, null); + context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES, null); return new MobListPrompt(); } else if (input.equalsIgnoreCase("7")) { @@ -2344,32 +2346,32 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { int four; int five; - if (context.getSessionData(pref + "mobTypes") != null) { - one = ((List) context.getSessionData(pref + "mobTypes")).size(); + if (context.getSessionData(pref + CK.S_MOB_TYPES) != null) { + one = ((List) context.getSessionData(pref + CK.S_MOB_TYPES)).size(); } else { one = 0; } - if (context.getSessionData(pref + "mobAmounts") != null) { - two = ((List) context.getSessionData(pref + "mobAmounts")).size(); + if (context.getSessionData(pref + CK.S_MOB_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_MOB_AMOUNTS)).size(); } else { two = 0; } - if (context.getSessionData(pref + "killLocations") != null) { - three = ((List) context.getSessionData(pref + "killLocations")).size(); + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS) != null) { + three = ((List) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS)).size(); } else { three = 0; } - if (context.getSessionData(pref + "killLocationRadii") != null) { - four = ((List) context.getSessionData(pref + "killLocationRadii")).size(); + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS) != null) { + four = ((List) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS)).size(); } else { four = 0; } - if (context.getSessionData(pref + "killLocationNames") != null) { - five = ((List) context.getSessionData(pref + "killLocationNames")).size(); + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES) != null) { + five = ((List) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES)).size(); } else { five = 0; } @@ -2402,23 +2404,23 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getMobTypes(ConversationContext context) { - return (List) context.getSessionData(pref + "mobTypes"); + return (List) context.getSessionData(pref + CK.S_MOB_TYPES); } private List getMobAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "mobAmounts"); + return (List) context.getSessionData(pref + CK.S_MOB_AMOUNTS); } private List getKillLocations(ConversationContext context) { - return (List) context.getSessionData(pref + "killLocations"); + return (List) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS); } private List getKillRadii(ConversationContext context) { - return (List) context.getSessionData(pref + "killLocationRadii"); + return (List) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS); } private List getKillLocationNames(ConversationContext context) { - return (List) context.getSessionData(pref + "killLocationNames"); + return (List) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES); } } @@ -2474,7 +2476,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (Quests.getMobType(s) != null) { mobTypes.add(Quester.prettyMobString(Quests.getMobType(s))); - context.setSessionData(pref + "mobTypes", mobTypes); + context.setSessionData(pref + CK.S_MOB_TYPES, mobTypes); } else { player.sendMessage(PINK + s + " " + RED + "is not a valid mob name!"); @@ -2528,7 +2530,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "mobAmounts", mobAmounts); + context.setSessionData(pref + CK.S_MOB_AMOUNTS, mobAmounts); } @@ -2559,14 +2561,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { Location loc = block.getLocation(); LinkedList locs; - if (context.getSessionData(pref + "killLocations") != null) { - locs = (LinkedList) context.getSessionData(pref + "killLocations"); + if (context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS) != null) { + locs = (LinkedList) context.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS); } else { locs = new LinkedList(); } locs.add(Quests.getLocationInfo(loc)); - context.setSessionData(pref + "killLocations", locs); + context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, locs); questFactory.selectedKillLocations.remove(player); } else { @@ -2626,7 +2628,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "killLocationRadii", radii); + context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS, radii); } @@ -2652,7 +2654,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { LinkedList locNames = new LinkedList(); locNames.addAll(Arrays.asList(input.split(","))); - context.setSessionData(pref + "killLocationNames", locNames); + context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES, locNames); } @@ -2673,7 +2675,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Reach Locations -\n"; - if (context.getSessionData(pref + "reachLocations") == null) { + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set locations (None set)\n"; text += GRAY + "2 - Set location radii (No locations set)\n"; text += GRAY + "3 - Set location names (No locations set)\n"; @@ -2688,7 +2690,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "reachLocationRadii") == null) { + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set location radii (None set)\n"; } else { @@ -2701,7 +2703,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "reachLocationNames") == null) { + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS_NAMES) == null) { text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Set location names (None set)\n"; } else { @@ -2730,14 +2732,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { questFactory.selectedReachLocations.put((Player) context.getForWhom(), null); return new ReachLocationPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "reachLocations") == null) { + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) { context.getForWhom().sendRawMessage(RED + "You must set locations first!"); return new ReachListPrompt(); } else { return new ReachRadiiPrompt(); } } else if (input.equalsIgnoreCase("3")) { - if (context.getSessionData(pref + "reachLocations") == null) { + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) == null) { context.getForWhom().sendRawMessage(RED + "You must set locations first!"); return new ReachListPrompt(); } else { @@ -2745,9 +2747,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("4")) { context.getForWhom().sendRawMessage(YELLOW + "Reach Locations objective cleared."); - context.setSessionData(pref + "reachLocations", null); - context.setSessionData(pref + "reachLocationRadii", null); - context.setSessionData(pref + "reachLocationNames", null); + context.setSessionData(pref + CK.S_REACH_LOCATIONS, null); + context.setSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS, null); + context.setSessionData(pref + CK.S_REACH_LOCATIONS_NAMES, null); return new ReachListPrompt(); } else if (input.equalsIgnoreCase("5")) { @@ -2755,20 +2757,20 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { int two; int three; - if (context.getSessionData(pref + "reachLocations") != null) { - one = ((List) context.getSessionData(pref + "reachLocations")).size(); + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) != null) { + one = ((List) context.getSessionData(pref + CK.S_REACH_LOCATIONS)).size(); } else { one = 0; } - if (context.getSessionData(pref + "reachLocationRadii") != null) { - two = ((List) context.getSessionData(pref + "reachLocationRadii")).size(); + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS) != null) { + two = ((List) context.getSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS)).size(); } else { two = 0; } - if (context.getSessionData(pref + "reachLocationNames") != null) { - three = ((List) context.getSessionData(pref + "reachLocationNames")).size(); + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS_NAMES) != null) { + three = ((List) context.getSessionData(pref + CK.S_REACH_LOCATIONS_NAMES)).size(); } else { three = 0; } @@ -2788,15 +2790,15 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getLocations(ConversationContext context) { - return (List) context.getSessionData(pref + "reachLocations"); + return (List) context.getSessionData(pref + CK.S_REACH_LOCATIONS); } private List getLocationRadii(ConversationContext context) { - return (List) context.getSessionData(pref + "reachLocationRadii"); + return (List) context.getSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS); } private List getLocationNames(ConversationContext context) { - return (List) context.getSessionData(pref + "reachLocationNames"); + return (List) context.getSessionData(pref + CK.S_REACH_LOCATIONS_NAMES); } } @@ -2822,14 +2824,14 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { Location loc = block.getLocation(); LinkedList locs; - if (context.getSessionData(pref + "reachLocations") != null) { - locs = (LinkedList) context.getSessionData(pref + "reachLocations"); + if (context.getSessionData(pref + CK.S_REACH_LOCATIONS) != null) { + locs = (LinkedList) context.getSessionData(pref + CK.S_REACH_LOCATIONS); } else { locs = new LinkedList(); } locs.add(Quests.getLocationInfo(loc)); - context.setSessionData(pref + "reachLocations", locs); + context.setSessionData(pref + CK.S_REACH_LOCATIONS, locs); questFactory.selectedReachLocations.remove(player); } else { @@ -2889,7 +2891,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "reachLocationRadii", radii); + context.setSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS, radii); } @@ -2915,7 +2917,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { LinkedList locNames = new LinkedList(); locNames.addAll(Arrays.asList(input.split(","))); - context.setSessionData(pref + "reachLocationNames", locNames); + context.setSessionData(pref + CK.S_REACH_LOCATIONS_NAMES, locNames); } @@ -2936,7 +2938,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Tame Mobs -\n"; - if (context.getSessionData(pref + "tameTypes") == null) { + if (context.getSessionData(pref + CK.S_TAME_TYPES) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set mob types (None set)\n"; text += GRAY + "2 - Set tame amounts (No mob types set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -2950,7 +2952,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "tameAmounts") == null) { + if (context.getSessionData(pref + CK.S_TAME_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set tame amounts (None set)\n"; } else { @@ -2978,7 +2980,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new TameTypesPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "tameTypes") == null) { + if (context.getSessionData(pref + CK.S_TAME_TYPES) == null) { context.getForWhom().sendRawMessage(RED + "You must set mob types first!"); return new TameListPrompt(); } else { @@ -2986,22 +2988,22 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + "Tame Mobs objective cleared."); - context.setSessionData(pref + "tameTypes", null); - context.setSessionData(pref + "tameAmounts", null); + context.setSessionData(pref + CK.S_TAME_TYPES, null); + context.setSessionData(pref + CK.S_TAME_AMOUNTS, null); return new TameListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData(pref + "tameTypes") != null) { - one = ((List) context.getSessionData(pref + "tameTypes")).size(); + if (context.getSessionData(pref + CK.S_TAME_TYPES) != null) { + one = ((List) context.getSessionData(pref + CK.S_TAME_TYPES)).size(); } else { one = 0; } - if (context.getSessionData(pref + "tameAmounts") != null) { - two = ((List) context.getSessionData(pref + "tameAmounts")).size(); + if (context.getSessionData(pref + CK.S_TAME_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_TAME_AMOUNTS)).size(); } else { two = 0; } @@ -3020,11 +3022,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getTameTypes(ConversationContext context) { - return (List) context.getSessionData(pref + "tameTypes"); + return (List) context.getSessionData(pref + CK.S_TAME_TYPES); } private List getTameAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "tameAmounts"); + return (List) context.getSessionData(pref + CK.S_TAME_AMOUNTS); } } @@ -3080,7 +3082,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (Quests.getMobType(s) != null) { mobTypes.add(Quester.prettyMobString(Quests.getMobType(s))); - context.setSessionData(pref + "tameTypes", mobTypes); + context.setSessionData(pref + CK.S_TAME_TYPES, mobTypes); } else { player.sendMessage(PINK + s + " " + RED + "is not a valid mob name!"); @@ -3133,7 +3135,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "tameAmounts", mobAmounts); + context.setSessionData(pref + CK.S_TAME_AMOUNTS, mobAmounts); } @@ -3154,7 +3156,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Shear Sheeps -\n"; - if (context.getSessionData(pref + "shearColors") == null) { + if (context.getSessionData(pref + CK.S_SHEAR_COLORS) == null) { text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set sheep colors (None set)\n"; text += GRAY + "2 - Set shear amounts (No colors set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -3168,7 +3170,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - if (context.getSessionData(pref + "shearAmounts") == null) { + if (context.getSessionData(pref + CK.S_SHEAR_AMOUNTS) == null) { text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set shear amounts (None set)\n"; } else { @@ -3196,7 +3198,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("1")) { return new ShearColorsPrompt(); } else if (input.equalsIgnoreCase("2")) { - if (context.getSessionData(pref + "shearColors") == null) { + if (context.getSessionData(pref + CK.S_SHEAR_COLORS) == null) { context.getForWhom().sendRawMessage(RED + "You must set colors first!"); return new ShearListPrompt(); } else { @@ -3204,22 +3206,22 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("3")) { context.getForWhom().sendRawMessage(YELLOW + "Shear Sheep objective cleared."); - context.setSessionData(pref + "shearColors", null); - context.setSessionData(pref + "shearAmounts", null); + context.setSessionData(pref + CK.S_SHEAR_COLORS, null); + context.setSessionData(pref + CK.S_SHEAR_AMOUNTS, null); return new ShearListPrompt(); } else if (input.equalsIgnoreCase("4")) { int one; int two; - if (context.getSessionData(pref + "shearColors") != null) { - one = ((List) context.getSessionData(pref + "shearColors")).size(); + if (context.getSessionData(pref + CK.S_SHEAR_COLORS) != null) { + one = ((List) context.getSessionData(pref + CK.S_SHEAR_COLORS)).size(); } else { one = 0; } - if (context.getSessionData(pref + "shearAmounts") != null) { - two = ((List) context.getSessionData(pref + "shearAmounts")).size(); + if (context.getSessionData(pref + CK.S_SHEAR_AMOUNTS) != null) { + two = ((List) context.getSessionData(pref + CK.S_SHEAR_AMOUNTS)).size(); } else { two = 0; } @@ -3238,11 +3240,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } private List getShearColors(ConversationContext context) { - return (List) context.getSessionData(pref + "shearColors"); + return (List) context.getSessionData(pref + CK.S_SHEAR_COLORS); } private List getShearAmounts(ConversationContext context) { - return (List) context.getSessionData(pref + "shearAmounts"); + return (List) context.getSessionData(pref + CK.S_SHEAR_AMOUNTS); } } @@ -3286,7 +3288,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (Quests.getDyeColor(s) != null) { colors.add(Quests.getDyeString(Quests.getDyeColor(s))); - context.setSessionData(pref + "shearColors", colors); + context.setSessionData(pref + CK.S_SHEAR_COLORS, colors); } else { player.sendMessage(PINK + s + " " + RED + "is not a valid dye color!"); @@ -3339,7 +3341,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } - context.setSessionData(pref + "shearAmounts", shearAmounts); + context.setSessionData(pref + CK.S_SHEAR_AMOUNTS, shearAmounts); } @@ -3388,12 +3390,12 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { player.sendMessage(RED + input + YELLOW + " is not a valid event name!"); return new EventPrompt(); } else { - context.setSessionData(pref + "event", found.getName()); + context.setSessionData(pref + CK.S_EVENT, found.getName()); return new CreateStagePrompt(stageNum, questFactory, citizens); } } else if (input.equalsIgnoreCase("clear")) { - context.setSessionData(pref + "event", null); + context.setSessionData(pref + CK.S_EVENT, null); player.sendMessage(YELLOW + "Event cleared."); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { @@ -3435,12 +3437,12 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { player.sendMessage(YELLOW + "Delay must be at least one second!"); return new DelayPrompt(); } else { - context.setSessionData(pref + "delay", l); + context.setSessionData(pref + CK.S_DELAY, l); return new CreateStagePrompt(stageNum, questFactory, citizens); } } else if (input.equalsIgnoreCase("clear")) { - context.setSessionData(pref + "delay", null); + context.setSessionData(pref + CK.S_DELAY, null); player.sendMessage(YELLOW + "Delay cleared."); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { @@ -3466,11 +3468,11 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (input.equalsIgnoreCase("cancel") == false && input.equalsIgnoreCase("clear") == false) { - context.setSessionData(pref + "delayMessage", input); + context.setSessionData(pref + CK.S_DELAY_MESSAGE, input); return new CreateStagePrompt(stageNum, questFactory, citizens); } else if (input.equalsIgnoreCase("clear")) { - context.setSessionData(pref + "delayMessage", null); + context.setSessionData(pref + CK.S_DELAY_MESSAGE, null); player.sendMessage(YELLOW + "Delay message cleared."); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { @@ -3504,7 +3506,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { if (ScriptRegistry.containsScript(input)) { - context.setSessionData(pref + "denizen", ScriptRegistry.getScriptContainer(input).getName()); + context.setSessionData(pref + CK.S_DENIZEN, ScriptRegistry.getScriptContainer(input).getName()); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { @@ -3515,7 +3517,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { } } else if (input.equalsIgnoreCase("clear")) { - context.setSessionData(pref + "denizen", null); + context.setSessionData(pref + CK.S_DENIZEN, null); player.sendMessage(YELLOW + "Denizen script cleared."); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { @@ -3724,7 +3726,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { String text = GREEN + "" + BOLD + "1" + RESET + "" + GREEN + " - Yes\n"; text += GREEN + "" + BOLD + "2" + RESET + "" + GREEN + " - No"; - return RED + "Are you sure you want to delete " + YELLOW + "Stage " + stageNum + RED + " of " + GOLD + context.getSessionData("questName") + RED + "?\n(Any Stages after will be shifted back one spot)\n" + text; + return RED + "Are you sure you want to delete " + YELLOW + "Stage " + stageNum + RED + " of " + GOLD + context.getSessionData(CK.Q_NAME) + RED + "?\n(Any Stages after will be shifted back one spot)\n" + text; } diff --git a/src/me/blackvein/quests/prompts/RequirementsPrompt.java b/src/me/blackvein/quests/prompts/RequirementsPrompt.java index 27948d29c..ecdd3e5fd 100644 --- a/src/me/blackvein/quests/prompts/RequirementsPrompt.java +++ b/src/me/blackvein/quests/prompts/RequirementsPrompt.java @@ -5,15 +5,20 @@ import java.util.Collections; import java.util.Comparator; import java.util.LinkedList; import java.util.List; + import me.blackvein.quests.ColorUtil; import me.blackvein.quests.Quest; import me.blackvein.quests.QuestFactory; -import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; +import me.blackvein.quests.util.CK; import me.blackvein.quests.util.ItemUtil; import me.blackvein.quests.util.Lang; -import org.bukkit.Material; -import org.bukkit.conversations.*; + +import org.bukkit.conversations.ConversationContext; +import org.bukkit.conversations.FixedSetPrompt; +import org.bukkit.conversations.NumericPrompt; +import org.bukkit.conversations.Prompt; +import org.bukkit.conversations.StringPrompt; import org.bukkit.inventory.ItemStack; @@ -36,28 +41,28 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ String text; - text = DARKAQUA + "- " + AQUA + context.getSessionData("questName") + AQUA + " | Requirements -\n"; + text = DARKAQUA + "- " + AQUA + context.getSessionData(CK.Q_NAME) + AQUA + " | Requirements -\n"; - if(context.getSessionData("moneyReq") == null) + if(context.getSessionData(CK.REQ_MONEY) == null) text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set money requirement " + GRAY + " (" + Lang.get("noneSet") + ")\n"; else{ - int moneyReq = (Integer) context.getSessionData("moneyReq"); + int moneyReq = (Integer) context.getSessionData(CK.REQ_MONEY); text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set money requirement (" + moneyReq + " " + (moneyReq > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n"; } - if(context.getSessionData("questPointsReq") == null) + if(context.getSessionData(CK.REQ_QUEST_POINTS) == null) text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set Quest Points requirement " + GRAY + " (" + Lang.get("noneSet") + ")\n"; else{ - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set Quest Points requirement " + GRAY + "(" + AQUA + context.getSessionData("questPointsReq") + " Quest Points" + GRAY + ")\n"; + text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set Quest Points requirement " + GRAY + "(" + AQUA + context.getSessionData(CK.REQ_QUEST_POINTS) + " Quest Points" + GRAY + ")\n"; } text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Set item requirements\n"; - if(context.getSessionData("permissionReqs") == null) + if(context.getSessionData(CK.REQ_PERMISSION) == null) text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set permission requirements " + GRAY + " (" + Lang.get("noneSet") + ")\n"; else{ text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set permission requirements\n"; - List perms = (List) context.getSessionData("permissionReqs"); + List perms = (List) context.getSessionData(CK.REQ_PERMISSION); for(String s : perms){ @@ -66,11 +71,11 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ } } - if(context.getSessionData("questReqs") == null) + if(context.getSessionData(CK.REQ_QUEST) == null) text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set Quest requirements " + GRAY + " (" + Lang.get("noneSet") + ")\n"; else{ text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set Quest requirements\n"; - List qs = (List) context.getSessionData("questReqs"); + List qs = (List) context.getSessionData(CK.REQ_QUEST); for(String s : qs){ @@ -79,11 +84,11 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ } } - if(context.getSessionData("questBlocks") == null) + if(context.getSessionData(CK.REQ_QUEST_BLOCK) == null) text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set Quest that mustn't be done " + GRAY + " (" + Lang.get("noneSet") + ")\n"; else{ text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set Quest requirements\n"; - List qs = (List) context.getSessionData("questBlocks"); + List qs = (List) context.getSessionData(CK.REQ_QUEST_BLOCK); for(String s : qs){ @@ -92,12 +97,12 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ } } - if(context.getSessionData("moneyReq") == null && context.getSessionData("questPointsReq") == null && context.getSessionData("itemReqs") == null && context.getSessionData("permissionReqs") == null && context.getSessionData("questReqs") == null && context.getSessionData("questBlocks") == null){ + if(context.getSessionData(CK.REQ_MONEY) == null && context.getSessionData(CK.REQ_QUEST_BLOCK) == null && context.getSessionData(CK.REQ_ITEMS) == null && context.getSessionData(CK.REQ_PERMISSION) == null && context.getSessionData(CK.REQ_QUEST) == null && context.getSessionData(CK.REQ_QUEST_BLOCK) == null){ text += GRAY + "" + BOLD + "7 - " + RESET + GRAY + "Set fail requirements message (No requirements set)\n"; - }else if(context.getSessionData("failMessage") == null){ + }else if(context.getSessionData(CK.Q_FAIL_MESSAGE) == null){ text += RED + "" + BOLD + "7 - " + RESET + RED + "Set fail requirements message (Required)\n"; }else{ - text += BLUE + "" + BOLD + "7 - " + RESET + YELLOW + "Set fail requirements message" + GRAY + "(" + AQUA + "\"" + context.getSessionData("failMessage") + "\"" + GRAY + ")\n"; + text += BLUE + "" + BOLD + "7 - " + RESET + YELLOW + "Set fail requirements message" + GRAY + "(" + AQUA + "\"" + context.getSessionData(CK.Q_FAIL_MESSAGE) + "\"" + GRAY + ")\n"; } text += GREEN + "" + BOLD + "8" + RESET + YELLOW + " - Done"; @@ -125,9 +130,9 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ }else if(input.equalsIgnoreCase("7")){ return new FailMessagePrompt(); }else if(input.equalsIgnoreCase("8")){ - if(context.getSessionData("moneyReq") != null || context.getSessionData("questPointsReq") != null || context.getSessionData("itemReqs") != null || context.getSessionData("permissionReqs") != null || context.getSessionData("questReqs") != null || context.getSessionData("questBlocks") != null){ + if(context.getSessionData(CK.REQ_MONEY) != null || context.getSessionData(CK.REQ_QUEST_POINTS) != null || context.getSessionData(CK.REQ_ITEMS) != null || context.getSessionData(CK.REQ_PERMISSION) != null || context.getSessionData(CK.REQ_QUEST) != null || context.getSessionData(CK.REQ_QUEST_BLOCK) != null){ - if(context.getSessionData("failMessage") == null){ + if(context.getSessionData(CK.Q_FAIL_MESSAGE) == null){ context.getForWhom().sendRawMessage(RED + "You must set a fail requirements message!"); return new RequirementsPrompt(quests, factory); } @@ -158,11 +163,11 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ }else if(input.intValue() == -1){ return new RequirementsPrompt(quests, factory); }else if(input.intValue() == 0){ - context.setSessionData("moneyReq", null); + context.setSessionData(CK.REQ_MONEY, null); return new RequirementsPrompt(quests, factory); } - context.setSessionData("moneyReq", input.intValue()); + context.setSessionData(CK.REQ_MONEY, input.intValue()); return new RequirementsPrompt(quests, factory); } @@ -187,11 +192,11 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ }else if(input.intValue() == -1){ return new RequirementsPrompt(quests, factory); }else if(input.intValue() == 0){ - context.setSessionData("questPointsReq", null); + context.setSessionData(CK.REQ_QUEST_POINTS, null); return new RequirementsPrompt(quests, factory); } - context.setSessionData("questPointsReq", input.intValue()); + context.setSessionData(CK.REQ_QUEST_POINTS, input.intValue()); return new RequirementsPrompt(quests, factory); } @@ -276,17 +281,17 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ }); if (isRequiredQuest) { - context.setSessionData("questReqs", questNames); + context.setSessionData(CK.REQ_QUEST, questNames); } else { - context.setSessionData("questBlocks", questNames); + context.setSessionData(CK.REQ_QUEST_BLOCK, questNames); } }else if(input.equalsIgnoreCase("clear")){ if (isRequiredQuest) { - context.setSessionData("questReqs", null); + context.setSessionData(CK.REQ_QUEST, null); } else { - context.setSessionData("questBlocks", null); + context.setSessionData(CK.REQ_QUEST_BLOCK, null); } } @@ -310,14 +315,14 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ // Check/add newly made item if(context.getSessionData("newItem") != null){ - if(context.getSessionData("itemReqs") != null){ + if(context.getSessionData(CK.REQ_ITEMS) != null){ List itemRews = getItems(context); itemRews.add((ItemStack) context.getSessionData("tempStack")); - context.setSessionData("itemReqs", itemRews); + context.setSessionData(CK.REQ_ITEMS, itemRews); }else{ LinkedList itemRews = new LinkedList(); itemRews.add((ItemStack) context.getSessionData("tempStack")); - context.setSessionData("itemReqs", itemRews); + context.setSessionData(CK.REQ_ITEMS, itemRews); } context.setSessionData("newItem", null); @@ -326,7 +331,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ } String text = GOLD + "- Item Requirements -\n"; - if(context.getSessionData("itemReqs") == null){ + if(context.getSessionData(CK.REQ_ITEMS) == null){ text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Add item\n"; text += GRAY + "2 - Set remove items (No items set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -342,7 +347,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Add item\n"; - if(context.getSessionData("removeItemReqs") == null){ + if(context.getSessionData(CK.REQ_ITEMS_REMOVE) == null){ text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set remove items (No values set)\n"; }else{ @@ -370,7 +375,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ if(input.equalsIgnoreCase("1")){ return new ItemStackPrompt(ItemListPrompt.this); }else if(input.equalsIgnoreCase("2")){ - if(context.getSessionData("itemReqs") == null){ + if(context.getSessionData(CK.REQ_ITEMS) == null){ context.getForWhom().sendRawMessage(RED + "You must add at least one item first!"); return new ItemListPrompt(); }else{ @@ -378,21 +383,21 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ } }else if(input.equalsIgnoreCase("3")){ context.getForWhom().sendRawMessage(YELLOW + "Item requirements cleared."); - context.setSessionData("itemReqs", null); - context.setSessionData("removeItemReqs", null); + context.setSessionData(CK.REQ_ITEMS, null); + context.setSessionData(CK.REQ_ITEMS_REMOVE, null); return new ItemListPrompt(); }else if(input.equalsIgnoreCase("4")){ int one; int two; - if(context.getSessionData("itemReqs") != null) - one = ((List) context.getSessionData("itemReqs")).size(); + if(context.getSessionData(CK.REQ_ITEMS) != null) + one = ((List) context.getSessionData(CK.REQ_ITEMS)).size(); else one = 0; - if(context.getSessionData("removeItemReqs") != null) - two = ((List) context.getSessionData("removeItemReqs")).size(); + if(context.getSessionData(CK.REQ_ITEMS_REMOVE) != null) + two = ((List) context.getSessionData(CK.REQ_ITEMS_REMOVE)).size(); else two = 0; @@ -408,11 +413,11 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ } private List getItems(ConversationContext context){ - return (List) context.getSessionData("itemReqs"); + return (List) context.getSessionData(CK.REQ_ITEMS); } private List getRemoveItems(ConversationContext context){ - return (List) context.getSessionData("removeItemReqs"); + return (List) context.getSessionData(CK.REQ_ITEMS_REMOVE); } } @@ -445,7 +450,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ } - context.setSessionData("removeItemReqs", booleans); + context.setSessionData(CK.REQ_ITEMS_REMOVE, booleans); } @@ -472,10 +477,10 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ LinkedList permissions = new LinkedList(); permissions.addAll(Arrays.asList(args)); - context.setSessionData("permissionReqs", permissions); + context.setSessionData(CK.REQ_PERMISSION, permissions); }else if(input.equalsIgnoreCase("clear")){ - context.setSessionData("permissionReqs", null); + context.setSessionData(CK.REQ_PERMISSION, null); } return new RequirementsPrompt(quests, factory); @@ -495,7 +500,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ public Prompt acceptInput(ConversationContext context, String input){ if(input.equalsIgnoreCase("cancel") == false) - context.setSessionData("failMessage", input); + context.setSessionData(CK.Q_FAIL_MESSAGE, input); return new RequirementsPrompt(quests, factory); diff --git a/src/me/blackvein/quests/prompts/RewardsPrompt.java b/src/me/blackvein/quests/prompts/RewardsPrompt.java index 0b95ef958..1ff3216ff 100644 --- a/src/me/blackvein/quests/prompts/RewardsPrompt.java +++ b/src/me/blackvein/quests/prompts/RewardsPrompt.java @@ -3,13 +3,20 @@ package me.blackvein.quests.prompts; import java.util.Arrays; import java.util.LinkedList; import java.util.List; + import me.blackvein.quests.ColorUtil; import me.blackvein.quests.QuestFactory; import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; +import me.blackvein.quests.util.CK; import me.blackvein.quests.util.ItemUtil; import me.blackvein.quests.util.Lang; -import org.bukkit.conversations.*; + +import org.bukkit.conversations.ConversationContext; +import org.bukkit.conversations.FixedSetPrompt; +import org.bukkit.conversations.NumericPrompt; +import org.bukkit.conversations.Prompt; +import org.bukkit.conversations.StringPrompt; import org.bukkit.inventory.ItemStack; @@ -32,34 +39,34 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ String text; - text = DARKAQUA + "- " + AQUA + context.getSessionData("questName") + AQUA + " | Rewards -\n"; + text = DARKAQUA + "- " + AQUA + context.getSessionData(CK.Q_NAME) + AQUA + " | Rewards -\n"; - if(context.getSessionData("moneyRew") == null) + if(context.getSessionData(CK.REW_MONEY) == null) text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set money reward (None set)\n"; else{ - int moneyRew = (Integer) context.getSessionData("moneyRew"); + int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY); text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set money reward (" + moneyRew + " " + (moneyRew > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n"; } - if(context.getSessionData("questPointsRew") == null) + if(context.getSessionData(CK.REW_QUEST_POINTS) == null) text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set Quest Points reward (None set)\n"; else{ - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set Quest Points reward (" + context.getSessionData("questPointsRew") + " Quest Points)\n"; + text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set Quest Points reward (" + context.getSessionData(CK.REW_QUEST_POINTS) + " Quest Points)\n"; } text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Set item rewards\n"; - if(context.getSessionData("expRew") == null) + if(context.getSessionData(CK.REW_EXP) == null) text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set experience reward (None set)\n"; else{ - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set experience reward (" + context.getSessionData("expRew") + " points)\n"; + text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set experience reward (" + context.getSessionData(CK.REW_EXP) + " points)\n"; } - if(context.getSessionData("commandRews") == null) + if(context.getSessionData(CK.REW_COMMAND) == null) text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set command rewards (None set)\n"; else{ text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set command rewards\n"; - List commands = (List) context.getSessionData("commandRews"); + List commands = (List) context.getSessionData(CK.REW_COMMAND); for(String cmd : commands){ @@ -68,11 +75,11 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } } - if(context.getSessionData("permissionRews") == null) + if(context.getSessionData(CK.REW_PERMISSION) == null) text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set permission rewards (None set)\n"; else{ text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set permission rewards\n"; - List permissions = (List) context.getSessionData("permissionRews"); + List permissions = (List) context.getSessionData(CK.REW_PERMISSION); for(String perm : permissions){ @@ -85,12 +92,12 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ if(Quests.mcmmo != null){ - if(context.getSessionData("mcMMOSkillRews") == null) + if(context.getSessionData(CK.REW_MCMMO_SKILLS) == null) text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - Set mcMMO skill rewards (None set)\n"; else{ text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - Set mcMMO skill rewards\n"; - List skills = (List) context.getSessionData("mcMMOSkillRews"); - List amounts = (List) context.getSessionData("mcMMOSkillAmounts"); + List skills = (List) context.getSessionData(CK.REW_MCMMO_SKILLS); + List amounts = (List) context.getSessionData(CK.REW_MCMMO_AMOUNTS); for(String skill : skills){ @@ -159,9 +166,9 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ context.getForWhom().sendRawMessage(RED + "Amount must be positive!"); return new MoneyPrompt(); }else if(input.intValue() == 0) - context.setSessionData("moneyRew", null); + context.setSessionData(CK.REW_MONEY, null); else if(input.intValue() != -1) - context.setSessionData("moneyRew", input.intValue()); + context.setSessionData(CK.REW_MONEY, input.intValue()); return new RewardsPrompt(quests, factory); @@ -185,9 +192,9 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ context.getForWhom().sendRawMessage(RED + "Amount must be positive!"); return new ExperiencePrompt(); }else if(input.intValue() == -1) - context.setSessionData("expRew", null); + context.setSessionData(CK.REW_EXP, null); else if(input.intValue() != 0) - context.setSessionData("expRew", input.intValue()); + context.setSessionData(CK.REW_EXP, input.intValue()); return new RewardsPrompt(quests, factory); @@ -211,16 +218,16 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ context.getForWhom().sendRawMessage(RED + "Amount must be positive!"); return new QuestPointsPrompt(); }else if(input.intValue() == -1) - context.setSessionData("questPointsRew", null); + context.setSessionData(CK.REW_QUEST_POINTS, null); else if(input.intValue() != 0) - context.setSessionData("questPointsRew", input.intValue()); + context.setSessionData(CK.REW_QUEST_POINTS, input.intValue()); return new RewardsPrompt(quests, factory); } - } + } private class ItemListPrompt extends FixedSetPrompt { public ItemListPrompt(){ @@ -234,14 +241,14 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ // Check/add newly made item if(context.getSessionData("newItem") != null){ - if(context.getSessionData("itemRews") != null){ + if(context.getSessionData(CK.REW_ITEMS) != null){ List itemRews = getItems(context); itemRews.add((ItemStack) context.getSessionData("tempStack")); - context.setSessionData("itemRews", itemRews); + context.setSessionData(CK.REW_ITEMS, itemRews); }else{ LinkedList itemRews = new LinkedList(); itemRews.add((ItemStack) context.getSessionData("tempStack")); - context.setSessionData("itemRews", itemRews); + context.setSessionData(CK.REW_ITEMS, itemRews); } context.setSessionData("newItem", null); @@ -250,7 +257,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } String text = GOLD + "- Item Rewards -\n"; - if(context.getSessionData("itemRews") == null){ + if(context.getSessionData(CK.REW_ITEMS) == null){ text += GRAY + " (" + Lang.get("noneSet") + ")\n"; text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Add item\n"; text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Clear\n"; @@ -280,7 +287,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ return new ItemStackPrompt(ItemListPrompt.this); }else if(input.equalsIgnoreCase("2")){ context.getForWhom().sendRawMessage(YELLOW + "Item rewards cleared."); - context.setSessionData("itemRews", null); + context.setSessionData(CK.REW_ITEMS, null); return new ItemListPrompt(); }else if(input.equalsIgnoreCase("3")){ return new RewardsPrompt(quests, factory); @@ -290,7 +297,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } private List getItems(ConversationContext context){ - return (List) context.getSessionData("itemRews"); + return (List) context.getSessionData(CK.REW_ITEMS); } } @@ -411,10 +418,10 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } - context.setSessionData("commandRews", commands); + context.setSessionData(CK.REW_COMMAND, commands); }else if(input.equalsIgnoreCase("clear")){ - context.setSessionData("commandRews", null); + context.setSessionData(CK.REW_COMMAND, null); } return new RewardsPrompt(quests, factory); @@ -439,10 +446,10 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ LinkedList permissions = new LinkedList(); permissions.addAll(Arrays.asList(args)); - context.setSessionData("permissionRews", permissions); + context.setSessionData(CK.REW_PERMISSION, permissions); }else if(input.equalsIgnoreCase("clear")){ - context.setSessionData("permissionRews", null); + context.setSessionData(CK.REW_PERMISSION, null); } return new RewardsPrompt(quests, factory); @@ -469,7 +476,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ public String getPromptText(ConversationContext context){ String text = GOLD + "- mcMMO Rewards -\n"; - if(context.getSessionData("mcMMOSkillRews") == null){ + if(context.getSessionData(CK.REW_MCMMO_SKILLS) == null){ text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set skills (None set)\n"; text += GRAY + "2 - Set skill amounts (No skills set)\n"; text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Clear\n"; @@ -483,7 +490,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } - if(context.getSessionData("mcMMOAmountRews") == null){ + if(context.getSessionData(CK.REW_MCMMO_AMOUNTS) == null){ text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set skill amounts (None set)\n"; }else{ @@ -511,7 +518,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ if(input.equalsIgnoreCase("1")){ return new mcMMOSkillsPrompt(); }else if(input.equalsIgnoreCase("2")){ - if(context.getSessionData("mcMMOSkillRews") == null){ + if(context.getSessionData(CK.REW_MCMMO_SKILLS) == null){ context.getForWhom().sendRawMessage(RED + "You must set skills first!"); return new mcMMOListPrompt(); }else{ @@ -519,21 +526,21 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } }else if(input.equalsIgnoreCase("3")){ context.getForWhom().sendRawMessage(YELLOW + "mcMMO rewards cleared."); - context.setSessionData("mcMMOSkillRews", null); - context.setSessionData("mcMMOAmountRews", null); + context.setSessionData(CK.REW_MCMMO_SKILLS, null); + context.setSessionData(CK.REW_MCMMO_AMOUNTS, null); return new mcMMOListPrompt(); }else if(input.equalsIgnoreCase("4")){ int one; int two; - if(context.getSessionData("mcMMOSkillRews") != null) - one = ((List) context.getSessionData("mcMMOSkillRews")).size(); + if(context.getSessionData(CK.REW_MCMMO_SKILLS) != null) + one = ((List) context.getSessionData(CK.REW_MCMMO_SKILLS)).size(); else one = 0; - if(context.getSessionData("mcMMOAmountRews") != null) - two = ((List) context.getSessionData("mcMMOAmountRews")).size(); + if(context.getSessionData(CK.REW_MCMMO_AMOUNTS) != null) + two = ((List) context.getSessionData(CK.REW_MCMMO_AMOUNTS)).size(); else two = 0; @@ -549,11 +556,11 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } private List getSkills(ConversationContext context){ - return (List) context.getSessionData("mcMMOSkillRews"); + return (List) context.getSessionData(CK.REW_MCMMO_SKILLS); } private List getSkillAmounts(ConversationContext context){ - return (List) context.getSessionData("mcMMOAmountRews"); + return (List) context.getSessionData(CK.REW_MCMMO_AMOUNTS); } } @@ -607,7 +614,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } - context.setSessionData("mcMMOSkillRews", skills); + context.setSessionData(CK.REW_MCMMO_SKILLS, skills); } @@ -649,7 +656,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil{ } - context.setSessionData("mcMMOSkillAmounts", amounts); + context.setSessionData(CK.REW_MCMMO_AMOUNTS, amounts); } diff --git a/src/me/blackvein/quests/prompts/StagesPrompt.java b/src/me/blackvein/quests/prompts/StagesPrompt.java index 21e7f02da..f93cb6ca8 100644 --- a/src/me/blackvein/quests/prompts/StagesPrompt.java +++ b/src/me/blackvein/quests/prompts/StagesPrompt.java @@ -2,6 +2,8 @@ package me.blackvein.quests.prompts; import me.blackvein.quests.ColorUtil; import me.blackvein.quests.QuestFactory; +import me.blackvein.quests.util.CK; + import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.Prompt; import org.bukkit.conversations.StringPrompt; @@ -105,118 +107,118 @@ public class StagesPrompt extends StringPrompt implements ColorUtil{ pref = "stage" + current; newPref = "stage" + (current - 1); - cc.setSessionData(newPref + "breakIds", cc.getSessionData(pref + "breakIds")); - cc.setSessionData(newPref + "breakAmounts", cc.getSessionData(pref + "breakAmounts")); + cc.setSessionData(newPref + "breakIds", cc.getSessionData(pref + CK.S_BREAK_IDS)); + cc.setSessionData(newPref + "breakAmounts", cc.getSessionData(pref + CK.S_BREAK_AMOUNTS)); - cc.setSessionData(newPref + "damageIds", cc.getSessionData(pref + "damageIds")); - cc.setSessionData(newPref + "damageAmounts", cc.getSessionData(pref + "damageAmounts")); + cc.setSessionData(newPref + "damageIds", cc.getSessionData(pref + CK.S_DAMAGE_IDS)); + cc.setSessionData(newPref + "damageAmounts", cc.getSessionData(pref + CK.S_DAMAGE_AMOUNTS)); - cc.setSessionData(newPref + "placeIds", cc.getSessionData(pref + "placeIds")); - cc.setSessionData(newPref + "placeAmounts", cc.getSessionData(pref + "placeAmounts")); + cc.setSessionData(newPref + "placeIds", cc.getSessionData(pref + CK.S_PLACE_IDS)); + cc.setSessionData(newPref + "placeAmounts", cc.getSessionData(pref + CK.S_PLACE_AMOUNTS)); - cc.setSessionData(newPref + "useIds", cc.getSessionData(pref + "useIds")); - cc.setSessionData(newPref + "useAmounts", cc.getSessionData(pref + "useAmounts")); + cc.setSessionData(newPref + "useIds", cc.getSessionData(pref + CK.S_USE_IDS)); + cc.setSessionData(newPref + "useAmounts", cc.getSessionData(pref + CK.S_USE_AMOUNTS)); - cc.setSessionData(newPref + "cutIds", cc.getSessionData(pref + "cutIds")); - cc.setSessionData(newPref + "cutAmounts", cc.getSessionData(pref + "cutAmounts")); + cc.setSessionData(newPref + "cutIds", cc.getSessionData(pref + CK.S_CUT_IDS)); + cc.setSessionData(newPref + "cutAmounts", cc.getSessionData(pref + CK.S_CUT_AMOUNTS)); - cc.setSessionData(newPref + "fish", cc.getSessionData(pref + "fish")); + cc.setSessionData(newPref + "fish", cc.getSessionData(pref + CK.S_FISH)); - cc.setSessionData(newPref + "playerKill", cc.getSessionData(pref + "playerKill")); + cc.setSessionData(newPref + "playerKill", cc.getSessionData(pref + CK.S_PLAYER_KILL)); - cc.setSessionData(newPref + "enchantTypes", cc.getSessionData(pref + "enchantTypes")); - cc.setSessionData(newPref + "enchantIds", cc.getSessionData(pref + "enchantIds")); - cc.setSessionData(newPref + "enchantAmounts", cc.getSessionData(pref + "enchantAmounts")); + cc.setSessionData(newPref + "enchantTypes", cc.getSessionData(pref + CK.S_ENCHANT_TYPES)); + cc.setSessionData(newPref + "enchantIds", cc.getSessionData(pref + CK.S_ENCHANT_IDS)); + cc.setSessionData(newPref + "enchantAmounts", cc.getSessionData(pref + CK.S_ENCHANT_AMOUNTS)); - cc.setSessionData(newPref + "deliveryItems", cc.getSessionData(pref + "deliveryItems")); - cc.setSessionData(newPref + "deliveryNPCs", cc.getSessionData(pref + "deliveryNPCs")); - cc.setSessionData(newPref + "deliveryMessages", cc.getSessionData(pref + "deliveryMessages")); + cc.setSessionData(newPref + "deliveryItems", cc.getSessionData(pref + CK.S_DELIVERY_ITEMS)); + cc.setSessionData(newPref + "deliveryNPCs", cc.getSessionData(pref + CK.S_DELIVERY_NPCS)); + cc.setSessionData(newPref + "deliveryMessages", cc.getSessionData(pref + CK.S_DELIVERY_MESSAGES)); - cc.setSessionData(newPref + "npcIdsToTalkTo", cc.getSessionData(pref + "npcIdsToTalkTo")); + cc.setSessionData(newPref + "npcIdsToTalkTo", cc.getSessionData(pref + CK.S_NPCS_TO_TALK_TO)); - cc.setSessionData(newPref + "npcIdsToKill", cc.getSessionData(pref + "npcIdsToKill")); - cc.setSessionData(newPref + "npcAmountsToKill", cc.getSessionData(pref + "npcAmountsToKill")); + cc.setSessionData(newPref + "npcIdsToKill", cc.getSessionData(pref + CK.S_NPCS_TO_KILL)); + cc.setSessionData(newPref + "npcAmountsToKill", cc.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS)); - cc.setSessionData(newPref + "mobTypes", cc.getSessionData(pref + "mobTypes")); - cc.setSessionData(newPref + "mobAmounts", cc.getSessionData(pref + "mobAmounts")); - cc.setSessionData(newPref + "killLocations", cc.getSessionData(pref + "killLocations")); - cc.setSessionData(newPref + "killLocationRadii", cc.getSessionData(pref + "killLocationRadii")); - cc.setSessionData(newPref + "killLocationNames", cc.getSessionData(pref + "killLocationNames")); + cc.setSessionData(newPref + "mobTypes", cc.getSessionData(pref + CK.S_MOB_TYPES)); + cc.setSessionData(newPref + "mobAmounts", cc.getSessionData(pref + CK.S_MOB_AMOUNTS)); + cc.setSessionData(newPref + "killLocations", cc.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS)); + cc.setSessionData(newPref + "killLocationRadii", cc.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS)); + cc.setSessionData(newPref + "killLocationNames", cc.getSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES)); - cc.setSessionData(newPref + "reachLocations", cc.getSessionData(pref + "reachLocations")); - cc.setSessionData(newPref + "reachLocationRadii", cc.getSessionData(pref + "reachLocationRadii")); - cc.setSessionData(newPref + "reachLocationNames", cc.getSessionData(pref + "reachLocationNames")); + cc.setSessionData(newPref + "reachLocations", cc.getSessionData(pref + CK.S_REACH_LOCATIONS)); + cc.setSessionData(newPref + "reachLocationRadii", cc.getSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS)); + cc.setSessionData(newPref + "reachLocationNames", cc.getSessionData(pref + CK.S_REACH_LOCATIONS_NAMES)); - cc.setSessionData(newPref + "tameTypes", cc.getSessionData(pref + "tameTypes")); - cc.setSessionData(newPref + "tameAmounts", cc.getSessionData(pref + "tameAmounts")); + cc.setSessionData(newPref + "tameTypes", cc.getSessionData(pref + CK.S_TAME_TYPES)); + cc.setSessionData(newPref + "tameAmounts", cc.getSessionData(pref + CK.S_TAME_AMOUNTS)); - cc.setSessionData(newPref + "shearColors", cc.getSessionData(pref + "shearColors")); - cc.setSessionData(newPref + "shearAmounts", cc.getSessionData(pref + "shearAmounts")); + cc.setSessionData(newPref + "shearColors", cc.getSessionData(pref + CK.S_SHEAR_COLORS)); + cc.setSessionData(newPref + "shearAmounts", cc.getSessionData(pref + CK.S_SHEAR_AMOUNTS)); - cc.setSessionData(newPref + "event", cc.getSessionData(pref + "event")); + cc.setSessionData(newPref + "event", cc.getSessionData(pref + CK.S_EVENT)); - cc.setSessionData(newPref + "delay", cc.getSessionData(pref + "delay")); - cc.setSessionData(newPref + "delayMessage", cc.getSessionData(pref + "delayMessage")); + cc.setSessionData(newPref + "delay", cc.getSessionData(pref + CK.S_DELAY)); + cc.setSessionData(newPref + "delayMessage", cc.getSessionData(pref + CK.S_DELAY_MESSAGE)); - cc.setSessionData(newPref + "denizen", cc.getSessionData(pref + "denizen")); + cc.setSessionData(newPref + "denizen", cc.getSessionData(pref + CK.S_DENIZEN)); } - cc.setSessionData(pref + "breakIds", null); - cc.setSessionData(pref + "breakAmounts", null); + cc.setSessionData(pref + CK.S_BREAK_IDS, null); + cc.setSessionData(pref + CK.S_BREAK_AMOUNTS, null); - cc.setSessionData(pref + "damageIds", null); - cc.setSessionData(pref + "damageAmounts", null); + cc.setSessionData(pref + CK.S_DAMAGE_IDS, null); + cc.setSessionData(pref + CK.S_DAMAGE_AMOUNTS, null); - cc.setSessionData(pref + "placeIds", null); - cc.setSessionData(pref + "placeAmounts", null); + cc.setSessionData(pref + CK.S_PLACE_IDS, null); + cc.setSessionData(pref + CK.S_PLACE_AMOUNTS, null); - cc.setSessionData(pref + "useIds", null); - cc.setSessionData(pref + "useAmounts", null); + cc.setSessionData(pref + CK.S_USE_IDS, null); + cc.setSessionData(pref + CK.S_USE_AMOUNTS, null); - cc.setSessionData(pref + "cutIds", null); - cc.setSessionData(pref + "cutAmounts", null); + cc.setSessionData(pref + CK.S_CUT_IDS, null); + cc.setSessionData(pref + CK.S_CUT_AMOUNTS, null); - cc.setSessionData(pref + "fish", null); + cc.setSessionData(pref + CK.S_FISH, null); - cc.setSessionData(pref + "playerKill", null); + cc.setSessionData(pref + CK.S_PLAYER_KILL, null); - cc.setSessionData(pref + "enchantTypes", null); - cc.setSessionData(pref + "enchantIds", null); - cc.setSessionData(pref + "enchantAmounts", null); + cc.setSessionData(pref + CK.S_ENCHANT_TYPES, null); + cc.setSessionData(pref + CK.S_ENCHANT_IDS, null); + cc.setSessionData(pref + CK.S_ENCHANT_AMOUNTS, null); - cc.setSessionData(pref + "deliveryItems", null); - cc.setSessionData(pref + "deliveryNPCs", null); - cc.setSessionData(pref + "deliveryMessages", null); + cc.setSessionData(pref + CK.S_DELIVERY_ITEMS, null); + cc.setSessionData(pref + CK.S_DELIVERY_NPCS, null); + cc.setSessionData(pref + CK.S_DELIVERY_MESSAGES, null); - cc.setSessionData(pref + "npcIdsToTalkTo", null); + cc.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, null); - cc.setSessionData(pref + "npcIdsToKill", null); - cc.setSessionData(pref + "npcAmountsToKill", null); + cc.setSessionData(pref + CK.S_NPCS_TO_KILL, null); + cc.setSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS, null); - cc.setSessionData(pref + "mobTypes", null); - cc.setSessionData(pref + "mobAmounts", null); - cc.setSessionData(pref + "killLocations", null); - cc.setSessionData(pref + "killLocationRadii", null); - cc.setSessionData(pref + "killLocationNames", null); + cc.setSessionData(pref + CK.S_MOB_TYPES, null); + cc.setSessionData(pref + CK.S_MOB_AMOUNTS, null); + cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, null); + cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS, null); + cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES, null); - cc.setSessionData(pref + "reachLocations", null); - cc.setSessionData(pref + "reachLocationRadii", null); - cc.setSessionData(pref + "reachLocationNames", null); + cc.setSessionData(pref + CK.S_REACH_LOCATIONS, null); + cc.setSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS, null); + cc.setSessionData(pref + CK.S_REACH_LOCATIONS_NAMES, null); - cc.setSessionData(pref + "tameTypes", null); - cc.setSessionData(pref + "tameAmounts", null); + cc.setSessionData(pref + CK.S_TAME_TYPES, null); + cc.setSessionData(pref + CK.S_TAME_AMOUNTS, null); - cc.setSessionData(pref + "shearColors", null); - cc.setSessionData(pref + "shearAmounts", null); + cc.setSessionData(pref + CK.S_SHEAR_COLORS, null); + cc.setSessionData(pref + CK.S_SHEAR_AMOUNTS, null); - cc.setSessionData(pref + "event", null); + cc.setSessionData(pref + CK.S_EVENT, null); - cc.setSessionData(pref + "delay", null); - cc.setSessionData(pref + "delayMessage", null); + cc.setSessionData(pref + CK.S_DELAY, null); + cc.setSessionData(pref + CK.S_DELAY_MESSAGE, null); - cc.setSessionData(pref + "denizen", null); + cc.setSessionData(pref + CK.S_DENIZEN, null); if(last) break; diff --git a/src/me/blackvein/quests/util/CK.java b/src/me/blackvein/quests/util/CK.java new file mode 100644 index 000000000..bb675be27 --- /dev/null +++ b/src/me/blackvein/quests/util/CK.java @@ -0,0 +1,111 @@ +package me.blackvein.quests.util; + +import me.blackvein.quests.Quests; + +public class CK { + + public static String ED_QUEST_EDIT = "edit"; + public static String ED_QUEST_DELETE = "delQuest"; + public static String ED_EVENT_DELETE = "delEvent"; + + //Quests + public static String Q_NAME = "questName"; + public static String Q_ASK_MESSAGE = "askMessage"; + public static String Q_FINISH_MESSAGE = "finishMessage"; + public static String Q_REDO_DELAY = "redoDelay"; + public static String Q_START_NPC = "npcStart"; + public static String Q_START_BLOCK= "blockStart"; + public static String Q_FAIL_MESSAGE = "failMessage"; + public static String Q_INITIAL_EVENT = "initialEvent"; + + //Requirements + public static String REQ_MONEY = "moneyReq"; + public static String REQ_QUEST_POINTS = "questPointsReq"; + public static String REQ_ITEMS = "itemReqs"; + public static String REQ_ITEMS_REMOVE = "removeItemReqs"; + public static String REQ_PERMISSION = "permissionReqs"; + public static String REQ_QUEST = "questReqs"; + public static String REQ_QUEST_BLOCK= "questBlocks"; + + //Rewards + public static String REW_MONEY = "moneyRew"; + public static String REW_QUEST_POINTS = "questPointsRew"; + public static String REW_ITEMS = "itemRews"; + public static String REW_EXP = "expRew"; + public static String REW_COMMAND = "commandRews"; + public static String REW_PERMISSION = "permissionRews"; + public static String REW_MCMMO_SKILLS = "mcMMOSkillRews"; + public static String REW_MCMMO_AMOUNTS = "mcMMOSkillAmounts"; + + //Stages + public static String S_BREAK_IDS = "breakIds"; + public static String S_BREAK_AMOUNTS = "breakAmounts"; + public static String S_DAMAGE_IDS = "damageIds"; + public static String S_DAMAGE_AMOUNTS = "damageAmounts"; + public static String S_PLACE_IDS = "placeIds"; + public static String S_PLACE_AMOUNTS = "placeAmounts"; + public static String S_USE_IDS = "useIds"; + public static String S_USE_AMOUNTS = "useAmounts"; + public static String S_CUT_IDS = "useIds"; + public static String S_CUT_AMOUNTS = "cutAmounts"; + public static String S_FISH = "fish"; + public static String S_PLAYER_KILL = "playerKill"; + public static String S_ENCHANT_TYPES = "enchantTypes"; + public static String S_ENCHANT_IDS = "enchantIds"; + public static String S_ENCHANT_AMOUNTS = "enchantAmounts"; + public static String S_DELIVERY_ITEMS = "deliveryItems"; + public static String S_DELIVERY_NPCS = "deliveryNPCs"; + public static String S_DELIVERY_MESSAGES = "deliveryMessages"; + public static String S_NPCS_TO_TALK_TO = "npcIdsToTalkTo"; + public static String S_NPCS_TO_KILL = "npcIdsToKill"; + public static String S_NPCS_TO_KILL_AMOUNTS = "npcAmountsToKill"; + public static String S_BOSS_IDS = "bossIds"; + public static String S_BOSS_AMOUNTS = "bossAmounts"; + public static String S_MOB_TYPES = "mobTypes"; + public static String S_MOB_AMOUNTS = "mobAmounts"; + public static String S_MOB_KILL_LOCATIONS = "killLocations"; + public static String S_MOB_KILL_LOCATIONS_RADIUS = "killLocationRadii"; + public static String S_MOB_KILL_LOCATIONS_NAMES = "killLocationNames"; + public static String S_REACH_LOCATIONS = "reachLocations"; + public static String S_REACH_LOCATIONS_RADIUS = "reachLocationRadii"; + public static String S_REACH_LOCATIONS_NAMES = "reachLocationNames"; + public static String S_TAME_TYPES = "tameTypes"; + public static String S_TAME_AMOUNTS = "tameAmounts"; + public static String S_SHEAR_COLORS = "shearColors"; + public static String S_SHEAR_AMOUNTS = "shearAmounts"; + public static String S_EVENT = "event"; + public static String S_DELAY = "delay"; + public static String S_DELAY_MESSAGE = "delayMessage"; + public static String S_DENIZEN = "denizen"; + + //Events + public static String E_OLD_EVENT = "oldEvent"; + public static String E_NAME = "evtName"; + public static String E_MESSAGE = "evtMessage"; + public static String E_CLEAR_INVENTORY = "evtClearInv"; + public static String E_ITEMS = "evtItems"; + public static String E_ITEMS_AMOUNTS = "evtItemAmounts"; + public static String E_EXPLOSIONS = "evtExplosions"; + public static String E_EFFECTS = "evtEffects"; + public static String E_EFFECTS_LOCATIONS = "evtEffectLocations"; + public static String E_WORLD_STORM = "evtStormWorld"; + public static String E_WORLD_STORM_DURATION = "evtStormDuration"; + public static String E_WORLD_THUNDER = "evtThunderWorld"; + public static String E_WORLD_THUNDER_DURATION = "evtThunderDuration"; + public static String E_MOB_TYPES = "evtMobTypes"; + public static String E_MOB_AMOUNTS = "evtMobAmounts"; + public static String E_MOB_LOCATIONS = "evtMobLocations"; + public static String E_LIGHTNING = "evtLightningStrikes"; + public static String E_POTION_TYPES = "evtPotionTypes"; + public static String E_POTION_DURATIONS = "evtPotionDurations"; + public static String E_POTION_STRENGHT = "evtPotionMagnitudes"; + public static String E_HUNGER = "evtHunger"; + public static String E_SATURATION = "evtSaturation"; + public static String E_HEALTH = "evtHealth"; + public static String E_TELEPORT = "evtTeleportLocation"; + public static String E_COMMANDS = "evtCommands"; + + //Party + public static String P_INVITER = "inviter"; + +}