HideoutOfTheDawn.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (C) 2004-2015 L2J DataPack
  3. *
  4. * This file is part of L2J DataPack.
  5. *
  6. * L2J DataPack is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J DataPack is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package instances.HideoutOfTheDawn;
  20. import instances.AbstractInstance;
  21. import com.l2jserver.gameserver.instancemanager.InstanceManager;
  22. import com.l2jserver.gameserver.model.Location;
  23. import com.l2jserver.gameserver.model.actor.L2Npc;
  24. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  25. import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
  26. /**
  27. * Hideout of the Dawn instance zone.
  28. * @author Adry_85
  29. */
  30. public final class HideoutOfTheDawn extends AbstractInstance
  31. {
  32. protected class HotDWorld extends InstanceWorld
  33. {
  34. }
  35. // NPCs
  36. private static final int WOOD = 32593;
  37. private static final int JAINA = 32617;
  38. // Location
  39. private static final Location WOOD_LOC = new Location(-23758, -8959, -5384, 0, 0);
  40. private static final Location JAINA_LOC = new Location(147072, 23743, -1984, 0);
  41. // Misc
  42. private static final int TEMPLATE_ID = 113;
  43. public HideoutOfTheDawn()
  44. {
  45. super(HideoutOfTheDawn.class.getSimpleName());
  46. addStartNpc(WOOD);
  47. addTalkId(WOOD, JAINA);
  48. }
  49. @Override
  50. public String onTalk(L2Npc npc, L2PcInstance talker)
  51. {
  52. switch (npc.getId())
  53. {
  54. case WOOD:
  55. {
  56. enterInstance(talker, new HotDWorld(), "HideoutOfTheDawn.xml", TEMPLATE_ID);
  57. return "32593-01.htm";
  58. }
  59. case JAINA:
  60. {
  61. final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
  62. world.removeAllowed(talker.getObjectId());
  63. talker.setInstanceId(0);
  64. talker.teleToLocation(JAINA_LOC);
  65. return "32617-01.htm";
  66. }
  67. }
  68. return super.onTalk(npc, talker);
  69. }
  70. @Override
  71. public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
  72. {
  73. if (firstEntrance)
  74. {
  75. world.addAllowed(player.getObjectId());
  76. }
  77. teleportPlayer(player, WOOD_LOC, world.getInstanceId(), false);
  78. }
  79. }