VehicleDeparture.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.L2BoatInstance;
  17. /**
  18. * @author Maktakien
  19. *
  20. */
  21. public class VehicleDeparture extends L2GameServerPacket
  22. {
  23. // Store parameters because they can be changed during broadcast
  24. private final int _objId, _x, _y, _z, _moveSpeed, _rotationSpeed;
  25. /**
  26. * @param _boat
  27. */
  28. public VehicleDeparture(L2BoatInstance boat)
  29. {
  30. _objId = boat.getObjectId();
  31. _x = boat.getXdestination();
  32. _y = boat.getYdestination();
  33. _z = boat.getZdestination();
  34. _moveSpeed = (int)boat.getStat().getMoveSpeed();
  35. _rotationSpeed = boat.getStat().getRotationSpeed();
  36. }
  37. @Override
  38. protected
  39. void writeImpl()
  40. {
  41. writeC(0x6c);
  42. writeD(_objId);
  43. writeD(_moveSpeed);
  44. writeD(_rotationSpeed);
  45. writeD(_x);
  46. writeD(_y);
  47. writeD(_z);
  48. }
  49. @Override
  50. public String getType()
  51. {
  52. return "[S] 5A VehicleDeparture";
  53. }
  54. }