Package l2p.gameserver.clientpackets

Source Code of l2p.gameserver.clientpackets.RequestSiegeDefenderList

package l2p.gameserver.clientpackets;

import l2p.gameserver.instancemanager.CastleManager;
import l2p.gameserver.instancemanager.ClanHallManager;
import l2p.gameserver.instancemanager.FortressManager;
import l2p.gameserver.model.entity.residence.Residence;
import l2p.gameserver.serverpackets.SiegeDefenderList;

public class RequestSiegeDefenderList extends L2GameClientPacket
{
  private int _unitId;

  @Override
  public void readImpl()
  {
    _unitId = readD();
  }

  @Override
  public void runImpl()
  {
    Residence unit = CastleManager.getInstance().getCastleByIndex(_unitId);
    if(unit == null)
    {
      unit = FortressManager.getInstance().getFortressByIndex(_unitId);
    }
    if(unit == null)
    {
      unit = ClanHallManager.getInstance().getClanHall(_unitId);
    }
    if(unit != null)
    {
      sendPacket(new SiegeDefenderList(unit));
    }
  }
}
TOP

Related Classes of l2p.gameserver.clientpackets.RequestSiegeDefenderList

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.