2
0

DoorStatusUpdate.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 net.sf.l2j.gameserver.serverpackets;
  16. import net.sf.l2j.gameserver.model.actor.instance.L2DoorInstance;
  17. /**
  18. * 61
  19. * d6 6d c0 4b door id
  20. * 8f 14 00 00 x
  21. * b7 f1 00 00 y
  22. * 60 f2 ff ff z
  23. * 00 00 00 00 ??
  24. *
  25. * format dddd rev 377 ID:%d X:%d Y:%d Z:%d
  26. * ddddd rev 419
  27. *
  28. * @version $Revision: 1.3.2.2.2.3 $ $Date: 2005/03/27 15:29:57 $
  29. */
  30. public final class DoorStatusUpdate extends L2GameServerPacket
  31. {
  32. private static final String _S__61_DOORSTATUSUPDATE = "[S] 4d DoorStatusUpdate";
  33. private L2DoorInstance _door;
  34. public DoorStatusUpdate(L2DoorInstance door)
  35. {
  36. _door=door;
  37. }
  38. @Override
  39. protected final void writeImpl()
  40. {
  41. writeC(0x4d);
  42. writeD(_door.getObjectId());
  43. writeD(_door.getOpen());
  44. writeD(_door.getDamage());
  45. writeD(_door.isEnemyOf(getClient().getActiveChar()) ? 1 : 0);
  46. writeD(_door.getDoorId());
  47. writeD(_door.getMaxHp());
  48. writeD((int)_door.getCurrentHp());
  49. }
  50. /* (non-Javadoc)
  51. * @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#getType()
  52. */
  53. @Override
  54. public String getType()
  55. {
  56. return _S__61_DOORSTATUSUPDATE;
  57. }
  58. }