CrumaTower.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 ai.npc.Teleports.CrumaTower;
  20. import ai.npc.AbstractNpcAI;
  21. import com.l2jserver.gameserver.model.Location;
  22. import com.l2jserver.gameserver.model.actor.L2Npc;
  23. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  24. /**
  25. * Cruma Tower teleport AI.
  26. * @author Plim
  27. */
  28. public final class CrumaTower extends AbstractNpcAI
  29. {
  30. // NPC
  31. private static final int MOZELLA = 30483;
  32. // Locations
  33. private static final Location TELEPORT_LOC1 = new Location(17776, 113968, -11671);
  34. private static final Location TELEPORT_LOC2 = new Location(17680, 113968, -11671);
  35. // Misc
  36. private static final int MAX_LEVEL = 55;
  37. private CrumaTower()
  38. {
  39. super(CrumaTower.class.getSimpleName(), "ai/npc/Teleports");
  40. addFirstTalkId(MOZELLA);
  41. addStartNpc(MOZELLA);
  42. addTalkId(MOZELLA);
  43. }
  44. @Override
  45. public String onTalk(L2Npc npc, L2PcInstance talker)
  46. {
  47. if (talker.getLevel() <= MAX_LEVEL)
  48. {
  49. talker.teleToLocation(getRandomBoolean() ? TELEPORT_LOC1 : TELEPORT_LOC2);
  50. return null;
  51. }
  52. return "30483-1.html";
  53. }
  54. public static void main(String[] args)
  55. {
  56. new CrumaTower();
  57. }
  58. }