Dice.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. * This class ...
  18. *
  19. * @version $Revision: 1.1.4.2 $ $Date: 2005/03/27 15:29:40 $
  20. */
  21. public class Dice extends L2GameServerPacket
  22. {
  23. private static final String _S__D4_Dice = "[S] da Dice";
  24. private int _charObjId;
  25. private int _itemId;
  26. private int _number;
  27. private int _x;
  28. private int _y;
  29. private int _z;
  30. /**
  31. * 0xd4 Dice dddddd
  32. * @param _characters
  33. */
  34. public Dice(int charObjId, int itemId, int number, int x , int y , int z)
  35. {
  36. _charObjId = charObjId;
  37. _itemId = itemId;
  38. _number = number;
  39. _x =x;
  40. _y =y;
  41. _z =z;
  42. }
  43. @Override
  44. protected final void writeImpl()
  45. {
  46. writeC(0xda);
  47. writeD(_charObjId); //object id of player
  48. writeD(_itemId); // item id of dice (spade) 4625,4626,4627,4628
  49. writeD(_number); //number rolled
  50. writeD(_x); //x
  51. writeD(_y); //y
  52. writeD(_z); //z
  53. }
  54. /* (non-Javadoc)
  55. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  56. */
  57. @Override
  58. public String getType()
  59. {
  60. return _S__D4_Dice;
  61. }
  62. }