Loc.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package handlers.usercommandhandlers;
  16. import com.l2jserver.gameserver.datatables.MapRegionTable;
  17. import com.l2jserver.gameserver.handler.IUserCommandHandler;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. import com.l2jserver.gameserver.network.SystemMessageId;
  20. import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  21. public class Loc implements IUserCommandHandler
  22. {
  23. private static final int[] COMMAND_IDS =
  24. {
  25. 0
  26. };
  27. /**
  28. *
  29. * @see com.l2jserver.gameserver.handler.IUserCommandHandler#useUserCommand(int, com.l2jserver.gameserver.model.actor.instance.L2PcInstance)
  30. */
  31. public boolean useUserCommand(int id, L2PcInstance activeChar)
  32. {
  33. int _nearestTown = MapRegionTable.getInstance().getClosestTownNumber(activeChar);
  34. SystemMessageId msg;
  35. switch (_nearestTown)
  36. {
  37. case 0:
  38. msg = SystemMessageId.LOC_TI_S1_S2_S3;
  39. break;
  40. case 1:
  41. msg = SystemMessageId.LOC_ELVEN_S1_S2_S3;
  42. break;
  43. case 2:
  44. msg = SystemMessageId.LOC_DARK_ELVEN_S1_S2_S3;
  45. break;
  46. case 3:
  47. msg = SystemMessageId.LOC_ORC_S1_S2_S3;
  48. break;
  49. case 4:
  50. msg = SystemMessageId.LOC_DWARVEN_S1_S2_S3;
  51. break;
  52. case 5:
  53. msg = SystemMessageId.LOC_GLUDIO_S1_S2_S3;
  54. break;
  55. case 6:
  56. msg = SystemMessageId.LOC_GLUDIN_S1_S2_S3;
  57. break;
  58. case 7:
  59. msg = SystemMessageId.LOC_DION_S1_S2_S3;
  60. break;
  61. case 8:
  62. msg = SystemMessageId.LOC_GIRAN_S1_S2_S3;
  63. break;
  64. case 9:
  65. msg = SystemMessageId.LOC_OREN_S1_S2_S3;
  66. break;
  67. case 10:
  68. msg = SystemMessageId.LOC_ADEN_S1_S2_S3;
  69. break;
  70. case 11:
  71. msg = SystemMessageId.LOC_HUNTER_S1_S2_S3;
  72. break;
  73. case 12:
  74. msg = SystemMessageId.LOC_GIRAN_HARBOR_S1_S2_S3;
  75. break;
  76. case 13:
  77. msg = SystemMessageId.LOC_HEINE_S1_S2_S3;
  78. break;
  79. case 14:
  80. msg = SystemMessageId.LOC_RUNE_S1_S2_S3;
  81. break;
  82. case 15:
  83. msg = SystemMessageId.LOC_GODDARD_S1_S2_S3;
  84. break;
  85. case 16:
  86. msg = SystemMessageId.LOC_SCHUTTGART_S1_S2_S3;
  87. break;
  88. case 17:
  89. msg = SystemMessageId.LOC_FLORAN_S1_S2_S3;
  90. break;
  91. case 18:
  92. msg = SystemMessageId.LOC_PRIMEVAL_ISLE_S1_S2_S3;
  93. break;
  94. case 19:
  95. msg = SystemMessageId.LOC_KAMAEL_VILLAGE_S1_S2_S3;
  96. break;
  97. case 20:
  98. msg = SystemMessageId.LOC_WASTELANDS_CAMP_S1_S2_S3;
  99. break;
  100. case 21:
  101. msg = SystemMessageId.LOC_FANTASY_ISLAND_S1_S2_S3;
  102. break;
  103. case 22:
  104. msg = SystemMessageId.LOC_NETRAL_ZONE_S1_S2_S3;
  105. break;
  106. case 23:
  107. msg = SystemMessageId.LOC_COLISEUM_S1_S2_S3;
  108. break;
  109. case 24:
  110. msg = SystemMessageId.LOC_GM_CONSULATION_SERVICE_S1_S2_S3;
  111. break;
  112. case 25:
  113. msg = SystemMessageId.LOC_DIMENSIONAL_GAP_S1_S2_S3;
  114. break;
  115. case 26:
  116. msg = SystemMessageId.LOC_CEMETARY_OF_THE_EMPIRE_S1_S2_S3;
  117. break;
  118. case 27:
  119. msg = SystemMessageId.LOC_STEEL_CITADEL_S1_S2_S3;
  120. break;
  121. case 28:
  122. msg = SystemMessageId.LOC_STEEL_CITADEL_RESISTANCE;
  123. break;
  124. case 29:
  125. msg = SystemMessageId.LOC_KAMALOKA;
  126. break;
  127. case 30:
  128. msg = SystemMessageId.LOC_NIA_KAMALOKA;
  129. break;
  130. case 31:
  131. msg = SystemMessageId.LOC_RIM_KAMALOKA;
  132. break;
  133. case 32:
  134. msg = SystemMessageId.LOC_KEUCEREUS_S1_S2_S3;
  135. break;
  136. case 33:
  137. msg = SystemMessageId.LOC_IN_SEED_INFINITY_S1_S2_S3;
  138. break;
  139. case 34:
  140. msg = SystemMessageId.LOC_OUT_SEED_INFINITY_S1_S2_S3;
  141. break;
  142. case 35:
  143. msg = SystemMessageId.LOC_CLEFT_S1_S2_S3;
  144. break;
  145. default:
  146. msg = SystemMessageId.LOC_ADEN_S1_S2_S3;
  147. }
  148. SystemMessage sm = SystemMessage.getSystemMessage(msg);
  149. if(msg.getParamCount() == 3)
  150. {
  151. sm.addNumber(activeChar.getX());
  152. sm.addNumber(activeChar.getY());
  153. sm.addNumber(activeChar.getZ());
  154. }
  155. activeChar.sendPacket(sm);
  156. return true;
  157. }
  158. /**
  159. *
  160. * @see com.l2jserver.gameserver.handler.IUserCommandHandler#getUserCommandList()
  161. */
  162. public int[] getUserCommandList()
  163. {
  164. return COMMAND_IDS;
  165. }
  166. }