SetupGauge.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.network.serverpackets;
  16. /**
  17. *
  18. *
  19. * sample
  20. * 0000: 85 00 00 00 00 f0 1a 00 00
  21. *
  22. * @version $Revision: 1.4.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
  23. */
  24. public final class SetupGauge extends L2GameServerPacket
  25. {
  26. private static final String _S__85_SETUPGAUGE = "[S] 6b SetupGauge";
  27. public static final int BLUE = 0;
  28. public static final int RED = 1;
  29. public static final int CYAN = 2;
  30. private int _dat1;
  31. private int _time;
  32. private int _time2;
  33. private int _charObjId;
  34. public SetupGauge(int dat1, int time)
  35. {
  36. _dat1 = dat1;// color 0-blue 1-red 2-cyan 3-green
  37. _time = time;
  38. _time2 = time;
  39. }
  40. public SetupGauge (int color, int currentTime, int maxTime)
  41. {
  42. _dat1 = color;// color 0-blue 1-red 2-cyan 3-green
  43. _time = currentTime;
  44. _time2 = maxTime;
  45. }
  46. @Override
  47. protected final void writeImpl()
  48. {
  49. writeC(0x6b);
  50. writeD(_charObjId);
  51. writeD(_dat1);
  52. writeD(_time);
  53. writeD(_time2);
  54. }
  55. /* (non-Javadoc)
  56. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  57. */
  58. @Override
  59. public String getType()
  60. {
  61. return _S__85_SETUPGAUGE;
  62. }
  63. @Override
  64. public void runImpl()
  65. {
  66. _charObjId = getClient().getActiveChar().getObjectId();
  67. }
  68. }