* @param instancedZoneId int
* @return boolean
*/
public boolean canEnterInstance(int instancedZoneId)
{
InstantZone iz = InstantZoneHolder.getInstance().getInstantZone(instancedZoneId);
if (isDead())
{
return false;
}
if (ReflectionManager.getInstance().size() > Config.MAX_REFLECTIONS_COUNT)
{
sendPacket(SystemMsg.THE_MAXIMUM_NUMBER_OF_INSTANCE_ZONES_HAS_BEEN_EXCEEDED);
return false;
}
if (iz == null)
{
sendPacket(SystemMsg.SYSTEM_ERROR);
return false;
}
if (ReflectionManager.getInstance().getCountByIzId(instancedZoneId) >= iz.getMaxChannels())
{
sendPacket(SystemMsg.THE_MAXIMUM_NUMBER_OF_INSTANCE_ZONES_HAS_BEEN_EXCEEDED);
return false;
}
return iz.getEntryType().canEnter(this, iz);
}