GameClient client = getClient();
Player activeChar = client.getActiveChar();
Player newMentee = World.getPlayer(_newMentee);
if (newMentee == null)
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.THAT_PLAYER_IS_NOT_ONLINE));
return;
}
if (activeChar.getClassId().getId() < 139)
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.YOU_MUST_AWAKEN_IN_ORDER_TO_BECOME_A_MENTOR));
return;
}
if (activeChar.getMenteeMentorList().getList().size() == 3)
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.A_MENTOR_CAN_HAVE_UP_TO_3_MENTEES_AT_THE_SAME_TIME));
return;
}
if (newMentee.getMenteeMentorList().getMentor() != 0)
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_ALREADY_HAS_A_MENTOR).addName(newMentee));
return;
}
for (Map.Entry<Integer, MenteeMentor> entry : activeChar.getMenteeMentorList().getList().entrySet())
{
if (entry.getValue().getName().equals(_newMentee))
{
return;
}
}
if (activeChar.getName().equals(_newMentee))
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.YOU_CANNOT_BECOME_YOUR_OWN_MENTEE));
return;
}
if (newMentee.getLevel() > 85)
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_IS_ABOVE_LEVEL_86_AND_CANNOT_BECOME_A_MENTEE).addName(newMentee));
return;
}
if (!newMentee.getInventory().validateCapacity(33800, 1))
{
activeChar.sendPacket(new SystemMessage2(SystemMsg.S1_DOES_NOT_HAVE_THE_ITEM_NEDEED_TO_BECOME_A_MENTEE).addName(newMentee));
return;
}
long mentorPenalty = activeChar.getVarLong("mentorPenalty", 0L);
if (mentorPenalty > System.currentTimeMillis())
{
long milisPenalty = mentorPenalty - System.currentTimeMillis();
double numSecs = (milisPenalty / 1000) % 60;
double countDown = ((milisPenalty / 1000) - numSecs) / 60;
int numMins = (int) Math.floor(countDown % 60);
countDown = (countDown - numMins) / 60;
int numHours = (int) Math.floor(countDown % 24);
int numDays = (int) Math.floor((countDown - numHours) / 24);
activeChar.sendPacket(new SystemMessage2(SystemMsg.YOU_CAN_BOND_WITH_A_NEW_MENTEE_IN_S1_DAYS_S2_HOUR_S3_MINUTE).addInteger(numDays).addInteger(numHours).addInteger(numMins));
return;
}
new Request(L2RequestType.MENTEE, activeChar, newMentee).setTimeout(10000L);
activeChar.sendPacket(new SystemMessage2(SystemMsg.YOU_HAVE_OFFERED_TO_BECOME_S1_MENTOR).addName(newMentee));
newMentee.sendPacket(new ExMentorAdd(activeChar));
}