L2NpcWalkerNode.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 com.l2jserver.gameserver.model;
  16. /**
  17. *
  18. * @author Rayan RPG, JIV
  19. * @since 927
  20. *
  21. */
  22. public class L2NpcWalkerNode
  23. {
  24. private int _routeId;
  25. private String _chatText;
  26. private int _chatId = 0;
  27. private int _moveX;
  28. private int _moveY;
  29. private int _moveZ;
  30. private int _delay;
  31. private boolean _running;
  32. public L2NpcWalkerNode(int routeId, String chatText, int moveX, int moveY, int moveZ, int delay, boolean running)
  33. {
  34. super();
  35. this._routeId = routeId;
  36. this._chatText = chatText;
  37. if (_chatText.startsWith("#"))
  38. {
  39. _chatId = Integer.parseInt(_chatText.substring(1));
  40. }
  41. else if (_chatText.trim().isEmpty())
  42. _chatText = null;
  43. this._moveX = moveX;
  44. this._moveY = moveY;
  45. this._moveZ = moveZ;
  46. this._delay = delay;
  47. this._running = running;
  48. }
  49. public int getRouteId()
  50. {
  51. return _routeId;
  52. }
  53. public String getChatText()
  54. {
  55. if (_chatId != 0)
  56. throw new IllegalStateException("Chat id is defined for walker route!");
  57. return _chatText;
  58. }
  59. public int getMoveX()
  60. {
  61. return _moveX;
  62. }
  63. public int getMoveY()
  64. {
  65. return _moveY;
  66. }
  67. public int getMoveZ()
  68. {
  69. return _moveZ;
  70. }
  71. public int getDelay()
  72. {
  73. return _delay;
  74. }
  75. public boolean getRunning()
  76. {
  77. return _running;
  78. }
  79. public int getChatId()
  80. {
  81. return _chatId;
  82. }
  83. }