}
if(player.isInParty())
{
if(player.getParty().isInReflection())
{
player.sendPacket(new SystemMessage(SystemMessage.C1_MAY_NOT_RE_ENTER_YET).addName(player));
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;
}
}
if(!player.getParty().isLeader(player))
{
player.sendPacket(Msg.ONLY_A_PARTY_LEADER_CAN_TRY_TO_ENTER);
return;
}
if(player.getParty().getMemberCount() > maxParty)
{
player.sendPacket(Msg.YOU_CANNOT_ENTER_DUE_TO_THE_PARTY_HAVING_EXCEEDED_THE_LIMIT);
return;
}
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;
}
if(member.getClassId().getLevel() > 1 || member.isCursedWeaponEquipped())
{
player.sendPacket(new SystemMessage(SystemMessage.C1S_QUEST_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addName(member));
return;
}
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;
}
}
}
Reflection r = new Reflection(name);
r.setInstancedZoneId(instancedZoneId);
for(InstancedZone i : ils.values())
{
if(r.getReturnLoc() == null)
{
r.setReturnLoc(i.getReturnCoords());
}
if(r.getTeleportLoc() == null)
{
r.setTeleportLoc(i.getTeleportCoords());
}
r.FillSpawns(i.getSpawnsInfo());
r.FillDoors(i.getDoors());
}
World world = new World();
world.instanceId = r.getId();
worlds.put(r.getId(), world);
for(L2Player member : player.getParty().getPartyMembers())
{
npc.makeSupportMagic(player);
if(member != player)
{
newQuestState(member, STARTED);
}
member.setReflection(r);
member.teleToLocation(il.getTeleportCoords());
member.setVar("backCoords", r.getReturnLoc().toXYZString());
member.setVar(name, String.valueOf(System.currentTimeMillis()));
}
player.getParty().setReflection(r);
r.setParty(player.getParty());
r.startCollapseTimer(timelimit * 60 * 1000L);
player.getParty().broadcastToPartyMembers(new SystemMessage(SystemMessage.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTES).addNumber(timelimit));
}