ExCubeGameExtendedChangePoints.java 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  17. /**
  18. * Format: (chd) dddddd
  19. * d: Time Left
  20. * d: Blue Points
  21. * d: Red Points
  22. * d: Player Team
  23. * d: Player Object ID
  24. * d: Player Points
  25. *
  26. * @author mrTJO
  27. */
  28. public class ExCubeGameExtendedChangePoints extends L2GameServerPacket
  29. {
  30. private static final String _S__FE_98_00_EXCUBEGAMEEXTENDEDCHANGEPOINTS = "[S] FE:98:00 ExCubeGameExtendedChangePoints";
  31. int _timeLeft;
  32. int _bluePoints;
  33. int _redPoints;
  34. boolean _isRedTeam;
  35. L2PcInstance _player;
  36. int _playerPoints;
  37. /**
  38. * Update a Secret Point Counter (used by client when receive ExCubeGameEnd)
  39. *
  40. * @param timeLeft Time Left before Minigame's End
  41. * @param bluePoints Current Blue Team Points
  42. * @param redPoints Current Blue Team points
  43. * @param isRedTeam Is Player from Red Team?
  44. * @param player Player Instance
  45. * @param playerPoints Current Player Points
  46. */
  47. public ExCubeGameExtendedChangePoints(int timeLeft, int bluePoints, int redPoints,
  48. boolean isRedTeam, L2PcInstance player, int playerPoints)
  49. {
  50. _timeLeft = timeLeft;
  51. _bluePoints = bluePoints;
  52. _redPoints = redPoints;
  53. _isRedTeam = isRedTeam;
  54. _player = player;
  55. _playerPoints = playerPoints;
  56. }
  57. /* (non-Javadoc)
  58. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
  59. */
  60. @Override
  61. protected void writeImpl()
  62. {
  63. writeC(0xfe);
  64. writeH(0x98);
  65. writeD(0x00);
  66. writeD(_timeLeft);
  67. writeD(_bluePoints);
  68. writeD(_redPoints);
  69. writeD(_isRedTeam ? 0x01 : 0x00);
  70. writeD(_player.getObjectId());
  71. writeD(_playerPoints);
  72. }
  73. /* (non-Javadoc)
  74. * @see com.l2jserver.gameserver.BasePacket#getType()
  75. */
  76. @Override
  77. public String getType()
  78. {
  79. return _S__FE_98_00_EXCUBEGAMEEXTENDEDCHANGEPOINTS;
  80. }
  81. }