Package l2p.gameserver.clientpackets

Source Code of l2p.gameserver.clientpackets.RequestGetOffVehicle

package l2p.gameserver.clientpackets;

import l2p.gameserver.model.L2Player;
import l2p.gameserver.model.entity.vehicle.L2Ship;
import l2p.gameserver.model.entity.vehicle.L2VehicleManager;
import l2p.gameserver.serverpackets.GetOffVehicle;

public class RequestGetOffVehicle extends L2GameClientPacket
{
  // Format: cdddd
  private int _id, _x, _y, _z;

  @Override
  public void readImpl()
  {
    _id = readD();
    _x = readD();
    _y = readD();
    _z = readD();
  }

  @Override
  public void runImpl()
  {
    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    L2Ship boat = (L2Ship) L2VehicleManager.getInstance().getBoat(_id);
    if(boat == null || boat.isMoving) // Не даем слезть с лодки на ходу
    {
      activeChar.sendActionFailed();
      return;
    }
    activeChar.setLastClientPosition(null);
    activeChar.setLastServerPosition(null);
    activeChar.setVehicle(null);
    activeChar.broadcastPacket(new GetOffVehicle(activeChar, boat, _x, _y, _z));
  }
}
TOP

Related Classes of l2p.gameserver.clientpackets.RequestGetOffVehicle

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.