diff --git a/Server/src/plugin/tutorial/TutorialCompletionDialogue.java b/Server/src/plugin/tutorial/TutorialCompletionDialogue.java index c50fa1c11..821d77fea 100644 --- a/Server/src/plugin/tutorial/TutorialCompletionDialogue.java +++ b/Server/src/plugin/tutorial/TutorialCompletionDialogue.java @@ -20,7 +20,7 @@ import org.crandor.plugin.InitializablePlugin; * Handles the tutorial completition dialogue (skippy, magic instructor) * @author Vexia * @author Splinter - * + * */ @InitializablePlugin public class TutorialCompletionDialogue extends DialoguePlugin { @@ -73,33 +73,33 @@ public class TutorialCompletionDialogue extends DialoguePlugin { //Magic Instructor Dialogue if (npc.getId() == 946) { switch (TutorialSession.getExtension(player).getStage()) { - case 67: - interpreter.sendDialogues(player, null, "Hello."); - stage = 0; - return true; - case 69: - interpreter.sendDialogues(946, null, "Good. This is a list of your spells. Currently you can", "only cast one offensive spell called Wind Strike. Let's", "try it out on one of those chickens."); - stage = 0; - return true; - case 70: - if (!player.getInventory().contains(556, 1) && !player.getInventory().contains(558, 1)) { - if (player.getInventory().hasSpaceFor(RUNES[0]) && player.getInventory().hasSpaceFor(RUNES[1])) { - interpreter.sendDoubleItemMessage(RUNES[0], RUNES[1], "Terrova gives you five air runes and five mind runes!"); - player.getInventory().add(RUNES); - stage = 3; + case 67: + interpreter.sendDialogues(player, null, "Hello."); + stage = 0; + return true; + case 69: + interpreter.sendDialogues(946, null, "Good. This is a list of your spells. Currently you can", "only cast one offensive spell called Wind Strike. Let's", "try it out on one of those chickens."); + stage = 0; + return true; + case 70: + if (!player.getInventory().contains(556, 1) && !player.getInventory().contains(558, 1)) { + if (player.getInventory().hasSpaceFor(RUNES[0]) && player.getInventory().hasSpaceFor(RUNES[1])) { + interpreter.sendDoubleItemMessage(RUNES[0], RUNES[1], "Terrova gives you five air runes and five mind runes!"); + player.getInventory().add(RUNES); + stage = 3; + } else { + GroundItemManager.create(RUNES, player.getLocation(), player); + stage = 3; + } } else { - GroundItemManager.create(RUNES, player.getLocation(), player); - stage = 3; + end(); + TutorialStage.load(player, 70, false); } - } else { - end(); - TutorialStage.load(player, 70, false); - } - return true; - case 71: - interpreter.sendDialogues(946, null, "Well you're all finished here now. I'll give you a", "reasonable number of runes when you leave."); - stage = -2; - return true; + return true; + case 71: + interpreter.sendDialogues(946, null, "Well you're all finished here now. I'll give you a", "reasonable number of runes when you leave."); + stage = -2; + return true; } } @@ -186,23 +186,28 @@ public class TutorialCompletionDialogue extends DialoguePlugin { break; case 3: player("No, thanks."); - stage = 533; + stage = 534; break; } break; case 506: - interpreter.sendOptions("Select a Mode", "Standard", "Ultimate", "Go back."); + interpreter.sendOptions("Select a Mode", "Standard", "Hardcore", "Ultimate", "Go back."); stage++; break; case 507: switch (buttonId) { case 1: case 2: - npc("You have chosen the " + (buttonId == 1 ? "Standard" : "Ultimate") + " mode."); + npc("You have chosen the " + (buttonId == 1 ? "Standard" : "Hardcore" + " Ironman mode.")); player.setAttribute("ironMode", IronmanMode.values()[buttonId]); stage = 516; break; case 3: + npc("You have chosen the Ultimate Ironman mode."); + player.setAttribute("ironMode", IronmanMode.ULTIMATE); + stage = 516; + break; + case 4: player.removeAttribute("ironMode"); player.removeAttribute("ironPermanent"); options("Yes, please.", "What is an Ironman account?", "No, thanks."); @@ -211,7 +216,7 @@ public class TutorialCompletionDialogue extends DialoguePlugin { } break; case 516: - player.getIronmanManager().setMode(player.getAttribute("ironMode", IronmanMode.NONE)); + player.getIronmanManager().setMode(player.getAttribute("ironMode")); MSPacketRepository.sendInfoUpdate(player); //Split Dialogue depending on if the Player is talking to the Magic Instructor or Skippy. @@ -224,19 +229,26 @@ public class TutorialCompletionDialogue extends DialoguePlugin { stage = 1204; break; } + + //About Ironman mode case 530: - npc("An Ironman account is a style of playing where players", "are completely self-sufficient."); + npc("An Iron Man account is a style of playing where players", "are completely self-sufficient."); stage++; break; case 531: - npc("A standard Ironman does not receive items or", "assistance from other players. They cannot trade, stake,", "receieve PK loot, scavenge dropped items, nor player", "certain minigames."); + npc("A Standard Ironman does not receive items or", "assistance from other players. They cannot trade, stake,", "receive PK loot, scavenge dropped items, nor play", "certain minigames."); stage++; break; case 532: - npc("In addition to the standard Ironman rules. An", "Ultimate Ironman cannot use banks, nor retain any", "items on death in dangerous areas."); - stage = 501; + npc("In addition to Standard Ironman restrictions,", "Hardcore Ironmen only have one life. In the event of","a dangerous death, a player will be downgraded to a", "Standard Ironman, and their stats frozen on the hiscores."); + stage++; break; case 533: + npc("For the ultimate challenge, players who choose the", "Ultimate Ironman mode cannot use banks, nor", "retain any items on death in dangerous areas."); + stage = 501; + break; + + case 534: // From saying no thanks to being an ironman. //Split Dialogue depending on if the Player is talking to the Magic Instructor or Skippy. if (npc.getId() == 946) { @@ -248,136 +260,136 @@ public class TutorialCompletionDialogue extends DialoguePlugin { stage = 1204; break; } - //Final Regards from the Magic Instructor - case 1199: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "When you get to the mainland you will find yourself in", "the town of Lumbridge. If you want some ideas on", "where to go next talk to my friend the Lumbridge", "Guide. You can't miss him; he's holding a big staff with"); - stage++; - break; - case 1200: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "a question mark on the end. He also has a white beard","and carries a rucksack full of scrolls. There are also","many tutors willing to teach you about the many skills","you could learn."); - stage++; - break; - case 1201: //Needs to be the Lumbridge Guide Icon... Not sure of the ID or interface. - interpreter.sendItemMessage(RUNES[1], "When you get to Lumbridge, look for this icon on you","mini-map. The Lumbridge Guide or one of the other","tutors should be near there. The Lumbridge","Guide should be standing slightly to the north-east of"); - stage++; - break; - case 1202: //Needs to be the Lumbridge Guide Icon... Not sure of the ID or interface. - interpreter.sendItemMessage(RUNES[1], "the castle's courtyard and the others you will find","scattered around Lumbridge."); - stage++; - break; - case 1203: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "If all else fails, visit the "+ GameWorld.getName()+ " website for a whole","chestload of information on quests, skills, and minigames","as well as a very good starter's guide."); - stage++; - break; - - //Final words, if using Skippy it should go straight to this - //Could be removed to try and keep the 'nostalgic' feeling of Tutorial Island. - case 1204: - npc("Keep in mind: our server has more content than any other", "server ever released. There's hundreds of hours of", "exciting and flawless gameplay awaiting you, "+player.getUsername()+".", "Enjoy your time playing "+GameWorld.getName()+"!"); - stage++; - break; - - //End of Tutorial - case 1205: - stage = 7; //Next Stage force ends any conversations? - - //Removing Tutorial Island properties on the account (?) and sending the Player to Lumbridge - player.removeAttribute("tut-island"); - player.getConfigManager().set(1021, 0); - player.getProperties().setTeleportLocation(new Location(3233, 3230)); - TutorialSession.getExtension(player).setStage(72); - player.getInterfaceManager().closeOverlay(); - - //Clears and Resets the Player's account and focuses the default interface to their Inventory - player.getInventory().clear(); - player.getEquipment().clear(); - player.getBank().clear(); - player.getInterfaceManager().restoreTabs(); //This still hides the Attack (double swords) in the player menu until Player wields a weapon. - player.getInterfaceManager().setViewedTab(3); - player.getInventory().add(STARTER_PACK); - player.getBank().add(STARTER_BANK); - - //This overwrites the stuck dialogue after teleporting to Lumbridge for some reason - //Dialogue from 2007 or thereabouts - //Original is five lines, but if the same is done here it will break. Need to find another way of showing all this information. - interpreter.sendDialogue("Welcome to Lumbridge! To get more help, simply click on the","Lumbridge Guide or one of the Tutors - these can be found by looking","for the question mark icon on your mini-map. If you find you are","lost at any time, look for a signpost or use the Lumbridge Home Port Spell."); - - //Appending the welcome message and some other stuff - player.getPacketDispatch().sendMessage("Welcome to " + GameWorld.getName() + "."); - - - - player.unlock(); - TutorialSession.getExtension(player).setStage(TutorialSession.MAX_STAGE + 1); - if (player.getIronmanManager().isIronman() && player.getSettings().isAcceptAid()) { - player.getSettings().toggleAcceptAid(); - } - if (WorldCommunicator.isEnabled()) { - MSPacketRepository.sendInfoUpdate(player); - } - int slot = player.getAttribute("tut-island:hi_slot", -1); - if (slot < 0 || slot >= HintIconManager.MAXIMUM_SIZE) { + //Final Regards from the Magic Instructor + case 1199: + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "When you get to the mainland you will find yourself in", "the town of Lumbridge. If you want some ideas on", "where to go next talk to my friend the Lumbridge", "Guide. You can't miss him; he's holding a big staff with"); + stage++; + break; + case 1200: + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "a question mark on the end. He also has a white beard","and carries a rucksack full of scrolls. There are also","many tutors willing to teach you about the many skills","you could learn."); + stage++; + break; + case 1201: //Needs to be the Lumbridge Guide Icon... Not sure of the ID or interface. + interpreter.sendItemMessage(RUNES[1], "When you get to Lumbridge, look for this icon on you","mini-map. The Lumbridge Guide or one of the other","tutors should be near there. The Lumbridge","Guide should be standing slightly to the north-east of"); + stage++; + break; + case 1202: //Needs to be the Lumbridge Guide Icon... Not sure of the ID or interface. + interpreter.sendItemMessage(RUNES[1], "the castle's courtyard and the others you will find","scattered around Lumbridge."); + stage++; + break; + case 1203: + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "If all else fails, visit the "+ GameWorld.getName()+ " website for a whole","chestload of information on quests, skills, and minigames","as well as a very good starter's guide."); + stage++; break; - } - player.removeAttribute("tut-island:hi_slot"); - HintIconManager.removeHintIcon(player, slot); - break; - case 7: - end(); - break; - case 99: - end(); - TutorialStage.load(player, TutorialSession.getExtension(player).getStage(), false); - break; + //Final words, if using Skippy it should go straight to this + //Could be removed to try and keep the 'nostalgic' feeling of Tutorial Island. + case 1204: + npc("Keep in mind: our server has more content than any other", "server ever released. There's hundreds of hours of", "exciting and flawless gameplay awaiting you, "+player.getUsername()+".", "Enjoy your time playing "+GameWorld.getName()+"!"); + stage++; + break; + + //End of Tutorial + case 1205: + stage = 7; //Next Stage force ends any conversations? + + //Removing Tutorial Island properties on the account (?) and sending the Player to Lumbridge + player.removeAttribute("tut-island"); + player.getConfigManager().set(1021, 0); + player.getProperties().setTeleportLocation(new Location(3233, 3230)); + TutorialSession.getExtension(player).setStage(72); + player.getInterfaceManager().closeOverlay(); + + //Clears and Resets the Player's account and focuses the default interface to their Inventory + player.getInventory().clear(); + player.getEquipment().clear(); + player.getBank().clear(); + player.getInterfaceManager().restoreTabs(); //This still hides the Attack (double swords) in the player menu until Player wields a weapon. + player.getInterfaceManager().setViewedTab(3); + player.getInventory().add(STARTER_PACK); + player.getBank().add(STARTER_BANK); + + //This overwrites the stuck dialogue after teleporting to Lumbridge for some reason + //Dialogue from 2007 or thereabouts + //Original is five lines, but if the same is done here it will break. Need to find another way of showing all this information. + interpreter.sendDialogue("Welcome to Lumbridge! To get more help, simply click on the","Lumbridge Guide or one of the Tutors - these can be found by looking","for the question mark icon on your mini-map. If you find you are","lost at any time, look for a signpost or use the Lumbridge Home Port Spell."); + + //Appending the welcome message and some other stuff + player.getPacketDispatch().sendMessage("Welcome to " + GameWorld.getName() + "."); + + + + player.unlock(); + TutorialSession.getExtension(player).setStage(TutorialSession.MAX_STAGE + 1); + if (player.getIronmanManager().isIronman() && player.getSettings().isAcceptAid()) { + player.getSettings().toggleAcceptAid(); + } + if (WorldCommunicator.isEnabled()) { + MSPacketRepository.sendInfoUpdate(player); + } + int slot = player.getAttribute("tut-island:hi_slot", -1); + if (slot < 0 || slot >= HintIconManager.MAXIMUM_SIZE) { + break; + } + + player.removeAttribute("tut-island:hi_slot"); + HintIconManager.removeHintIcon(player, slot); + break; + case 7: + end(); + break; + case 99: + end(); + TutorialStage.load(player, TutorialSession.getExtension(player).getStage(), false); + break; } return true; } //Magic Instructor Dialogue during the Tutorial, Repeated from above? switch (TutorialSession.getExtension(player).getStage()) { - case 67: - switch (stage) { - case 0: - interpreter.sendDialogues(946, null, "Good day, newcomer. My name is Terrova. I'm here", "to tell you about Magic. Let's start by opening your", "spell list."); - stage = 1; - break; - case 1: - end(); - TutorialStage.load(player, 68, false); - break; - } - break; - case 69: - switch (stage) { - case 0: - if (!player.getInventory().contains(556, 1) && !player.getInventory().contains(558, 1)) { - if (player.getInventory().freeSlots() > 2) { - interpreter.sendDoubleItemMessage(RUNES[0], RUNES[1], "Terrova gives you five air runes and five mind runes!"); - player.getInventory().add(RUNES[0], RUNES[1]); - stage = 3; - } - } else { - end(); - TutorialStage.load(player, 70, false); + case 67: + switch (stage) { + case 0: + interpreter.sendDialogues(946, null, "Good day, newcomer. My name is Terrova. I'm here", "to tell you about Magic. Let's start by opening your", "spell list."); + stage = 1; + break; + case 1: + end(); + TutorialStage.load(player, 68, false); + break; } break; - case 3: - end(); - TutorialStage.load(player, 70, false); + case 69: + switch (stage) { + case 0: + if (!player.getInventory().contains(556, 1) && !player.getInventory().contains(558, 1)) { + if (player.getInventory().freeSlots() > 2) { + interpreter.sendDoubleItemMessage(RUNES[0], RUNES[1], "Terrova gives you five air runes and five mind runes!"); + player.getInventory().add(RUNES[0], RUNES[1]); + stage = 3; + } + } else { + end(); + TutorialStage.load(player, 70, false); + } + break; + case 3: + end(); + TutorialStage.load(player, 70, false); + break; + } break; - } - break; - case 70: - switch (stage) { - case 0: + case 70: + switch (stage) { + case 0: + break; + case 3: + end(); + TutorialStage.load(player, 70, false); + break; + } break; - case 3: - end(); - TutorialStage.load(player, 70, false); - break; - } - break; } return true; }