JiniaGuildHideout2.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.JiniaGuildHideout2;
  20. import instances.AbstractInstance;
  21. import quests.Q10285_MeetingSirra.Q10285_MeetingSirra;
  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. import com.l2jserver.gameserver.model.quest.QuestState;
  27. /**
  28. * Jinia Guild Hideout instance zone.
  29. * @author Adry_85
  30. */
  31. public final class JiniaGuildHideout2 extends AbstractInstance
  32. {
  33. protected class JGH2World extends InstanceWorld
  34. {
  35. }
  36. // NPC
  37. private static final int RAFFORTY = 32020;
  38. // Location
  39. private static final Location START_LOC = new Location(-23530, -8963, -5413, 0, 0);
  40. // Misc
  41. private static final int TEMPLATE_ID = 141;
  42. public JiniaGuildHideout2()
  43. {
  44. super(JiniaGuildHideout2.class.getSimpleName());
  45. addStartNpc(RAFFORTY);
  46. addTalkId(RAFFORTY);
  47. }
  48. @Override
  49. public String onTalk(L2Npc npc, L2PcInstance talker)
  50. {
  51. final QuestState qs = talker.getQuestState(Q10285_MeetingSirra.class.getSimpleName());
  52. if ((qs != null) && qs.isMemoState(1))
  53. {
  54. enterInstance(talker, new JGH2World(), "JiniaGuildHideout2.xml", TEMPLATE_ID);
  55. qs.setCond(2, true);
  56. }
  57. return super.onTalk(npc, talker);
  58. }
  59. @Override
  60. public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
  61. {
  62. if (firstEntrance)
  63. {
  64. world.addAllowed(player.getObjectId());
  65. }
  66. teleportPlayer(player, START_LOC, world.getInstanceId(), false);
  67. }
  68. }