}
private void enterInstance(L2Player player)
{
int instancedZoneId = 78;
InstancedZoneManager ilm = InstancedZoneManager.getInstance();
FastMap<Integer, InstancedZone> ils = ilm.getById(instancedZoneId);
if(ils == null)
{
player.sendPacket(Msg.SYSTEM_ERROR);
return;
}
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;
}
if(player.isInParty())
{
// TODO возможно, лучше запретить повторный вход "вылетевших"
if(player.getParty().isInReflection())
{
Reflection old_ref = ReflectionTable.getInstance().get(player.getParty().getReflection().getId());
if(old_ref != null && worlds.containsKey(old_ref.getId()))
{
player.setReflection(old_ref);
player.teleToLocation(old_ref.getTeleportLoc());
return;
}
}
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;
}
}