return true;
}
private String enterPrison(L2Player player)
{
Castle castle = CastleManager.getInstance().getCastleByObject(player);
if(castle == null || castle.getOwner() != player.getClan())
{
return "gludio_prison_keeper_q0512_01a.htm";
}
InstancedZoneManager ilm = InstancedZoneManager.getInstance();
FastMap<Integer, InstancedZone> ils = ilm.getById(201);
if(ils == null)
{
player.sendPacket(Msg.SYSTEM_ERROR);
return null;
}
InstancedZone il = ils.get(0);
assert il != null;
String name = il.getName();
int timelimit = il.getTimelimit();
int min_level = il.getMinLevel();
int max_level = il.getMaxLevel();
int minParty = il.getMinParty();
int maxParty = il.getMaxParty();
if(minParty > 1 && !player.isInParty())
{
player.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
return null;
}
if(player.isInParty())
{
if(player.getParty().isInReflection())
{
player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
return null;
}
for(L2Player member : player.getParty().getPartyMembers())
{
if(ilm.getTimeToNextEnterInstance(name, member) > 0)
{
player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(member));
return null;
}
}
if(!player.getParty().isLeader(player))
{
player.sendPacket(Msg.ONLY_A_PARTY_LEADER_CAN_TRY_TO_ENTER);
return null;
}
if(player.getParty().getMemberCount() > maxParty)
{
player.sendPacket(Msg.YOU_CANNOT_ENTER_DUE_TO_THE_PARTY_HAVING_EXCEEDED_THE_LIMIT);
return null;
}
for(L2Player member : player.getParty().getPartyMembers())
{
if(member.getLevel() < min_level || member.getLevel() > max_level)
{
SystemMessage sm = new SystemMessage(SystemMessage.C1S_LEVEL_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(member);
member.sendPacket(sm);
player.sendPacket(sm);
return null;
}
if(member.getClan() != player.getClan())
{
return "gludio_prison_keeper_q0512_01a.htm";
}
if(!player.isInRange(member, 500))
{
member.sendPacket(Msg.ITS_TOO_FAR_FROM_THE_NPC_TO_WORK);
player.sendPacket(Msg.ITS_TOO_FAR_FROM_THE_NPC_TO_WORK);
return null;
}
}
}
Prison prison = null;
if(!_prisons.isEmpty())
{
prison = _prisons.get(castle.getId());
if(prison != null && prison.isLocked())
{
// TODO правильное сообщение
player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
return null;
}
}
prison = new Prison(castle.getId(), ils);
_prisons.put(prison.getCastleId(), prison);
Reflection r = ReflectionTable.getInstance().get(prison.getReflectionId());
r.setReturnLoc(player.getLoc());
for(L2Player member : player.getParty().getPartyMembers())
{