MoveToLocationInVehicle.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.L2CharPosition;
  17. import com.l2jserver.gameserver.model.actor.L2Character;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. /**
  20. * @author Maktakien
  21. *
  22. */
  23. public class MoveToLocationInVehicle extends L2GameServerPacket
  24. {
  25. private int _charObjId;
  26. private int _boatId;
  27. private L2CharPosition _destination;
  28. private L2CharPosition _origin;
  29. /**
  30. * @param actor
  31. * @param destination
  32. * @param origin
  33. */
  34. public MoveToLocationInVehicle(L2Character actor, L2CharPosition destination, L2CharPosition origin)
  35. {
  36. if (!(actor instanceof L2PcInstance)) return;
  37. L2PcInstance player = (L2PcInstance)actor;
  38. if (player.getBoat() == null) return;
  39. _charObjId = player.getObjectId();
  40. _boatId = player.getBoat().getObjectId();
  41. _destination = destination;
  42. _origin = origin;
  43. /* _pci.sendMessage("_destination : x " + x +" y " + y + " z " + z);
  44. _pci.sendMessage("_boat : x " + _pci.getBoat().getX() +" y " + _pci.getBoat().getY() + " z " + _pci.getBoat().getZ());
  45. _pci.sendMessage("-----------");*/
  46. }
  47. /* (non-Javadoc)
  48. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
  49. */
  50. @Override
  51. protected void writeImpl()
  52. {
  53. writeC(0x7e);
  54. writeD(_charObjId);
  55. writeD(_boatId);
  56. writeD(_destination.x);
  57. writeD(_destination.y);
  58. writeD(_destination.z);
  59. writeD(_origin.x);
  60. writeD(_origin.y);
  61. writeD(_origin.z);
  62. }
  63. /* (non-Javadoc)
  64. * @see com.l2jserver.gameserver.BasePacket#getType()
  65. */
  66. @Override
  67. public String getType()
  68. {
  69. return "[S] 7e MoveToLocationInVehicle";
  70. }
  71. }