|
@@ -23,99 +23,90 @@ import com.l2jserver.gameserver.network.serverpackets.UserInfo;
|
|
public final class RequestEvaluate extends L2GameClientPacket
|
|
public final class RequestEvaluate extends L2GameClientPacket
|
|
{
|
|
{
|
|
private static final String _C__B9_REQUESTEVALUATE = "[C] B9 RequestEvaluate";
|
|
private static final String _C__B9_REQUESTEVALUATE = "[C] B9 RequestEvaluate";
|
|
-
|
|
|
|
- //private static Logger _log = Logger.getLogger(RequestEvaluate.class.getName());
|
|
|
|
-
|
|
|
|
|
|
+
|
|
@SuppressWarnings("unused")
|
|
@SuppressWarnings("unused")
|
|
- private int _targetId;
|
|
|
|
-
|
|
|
|
|
|
+ private int _targetId;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
protected void readImpl()
|
|
protected void readImpl()
|
|
{
|
|
{
|
|
_targetId = readD();
|
|
_targetId = readD();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
protected void runImpl()
|
|
protected void runImpl()
|
|
{
|
|
{
|
|
- SystemMessage sm;
|
|
|
|
L2PcInstance activeChar = getClient().getActiveChar();
|
|
L2PcInstance activeChar = getClient().getActiveChar();
|
|
if (activeChar == null)
|
|
if (activeChar == null)
|
|
- return;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (!(activeChar.getTarget() instanceof L2PcInstance))
|
|
|
|
- {
|
|
|
|
- sm = new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT);
|
|
|
|
- activeChar.sendPacket(sm);
|
|
|
|
- sm =null;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (activeChar.getLevel() < 10)
|
|
|
|
- {
|
|
|
|
- sm = new SystemMessage(SystemMessageId.ONLY_LEVEL_SUP_10_CAN_RECOMMEND);
|
|
|
|
- activeChar.sendPacket(sm);
|
|
|
|
- sm =null;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (activeChar.getTarget() == activeChar)
|
|
|
|
- {
|
|
|
|
- sm = new SystemMessage(SystemMessageId.YOU_CANNOT_RECOMMEND_YOURSELF);
|
|
|
|
- activeChar.sendPacket(sm);
|
|
|
|
- sm =null;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (activeChar.getRecomLeft() <= 0)
|
|
|
|
- {
|
|
|
|
- sm = new SystemMessage(SystemMessageId.NO_MORE_RECOMMENDATIONS_TO_HAVE);
|
|
|
|
- activeChar.sendPacket(sm);
|
|
|
|
- sm =null;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- L2PcInstance target = (L2PcInstance)activeChar.getTarget();
|
|
|
|
-
|
|
|
|
- if (target.getRecomHave() >= 255)
|
|
|
|
- {
|
|
|
|
- sm = new SystemMessage(SystemMessageId.YOUR_TARGET_NO_LONGER_RECEIVE_A_RECOMMENDATION);
|
|
|
|
- activeChar.sendPacket(sm);
|
|
|
|
- sm =null;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!activeChar.canRecom(target))
|
|
|
|
- {
|
|
|
|
- sm = new SystemMessage(SystemMessageId.THAT_CHARACTER_IS_RECOMMENDED);
|
|
|
|
- activeChar.sendPacket(sm);
|
|
|
|
- sm =null;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- activeChar.giveRecom(target);
|
|
|
|
-
|
|
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ L2PcInstance target = (L2PcInstance) activeChar.getTarget();
|
|
|
|
+ if (target == null)
|
|
|
|
+ {
|
|
|
|
+ activeChar.sendPacket(new SystemMessage(SystemMessageId.SELECT_TARGET));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!(activeChar.getTarget() instanceof L2PcInstance))
|
|
|
|
+ {
|
|
|
|
+ activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (activeChar.getLevel() < 10)
|
|
|
|
+ {
|
|
|
|
+ activeChar.sendPacket(new SystemMessage(SystemMessageId.ONLY_LEVEL_SUP_10_CAN_RECOMMEND));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (activeChar.getTarget() == activeChar)
|
|
|
|
+ {
|
|
|
|
+ activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_RECOMMEND_YOURSELF));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (activeChar.getRecomLeft() <= 0)
|
|
|
|
+ {
|
|
|
|
+ activeChar.sendPacket(new SystemMessage(SystemMessageId.NO_MORE_RECOMMENDATIONS_TO_HAVE));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (target.getRecomHave() >= 255)
|
|
|
|
+ {
|
|
|
|
+ activeChar.sendPacket(new SystemMessage(SystemMessageId.YOUR_TARGET_NO_LONGER_RECEIVE_A_RECOMMENDATION));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!activeChar.canRecom(target))
|
|
|
|
+ {
|
|
|
|
+ activeChar.sendPacket(new SystemMessage(SystemMessageId.THAT_CHARACTER_IS_RECOMMENDED));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ activeChar.giveRecom(target);
|
|
|
|
+
|
|
|
|
+ SystemMessage sm = null;
|
|
sm = new SystemMessage(SystemMessageId.YOU_HAVE_RECOMMENDED_C1_YOU_HAVE_S2_RECOMMENDATIONS_LEFT);
|
|
sm = new SystemMessage(SystemMessageId.YOU_HAVE_RECOMMENDED_C1_YOU_HAVE_S2_RECOMMENDATIONS_LEFT);
|
|
sm.addPcName(target);
|
|
sm.addPcName(target);
|
|
- sm.addNumber(activeChar.getRecomLeft());
|
|
|
|
|
|
+ sm.addNumber(activeChar.getRecomLeft());
|
|
activeChar.sendPacket(sm);
|
|
activeChar.sendPacket(sm);
|
|
-
|
|
|
|
|
|
+
|
|
sm = new SystemMessage(SystemMessageId.YOU_HAVE_BEEN_RECOMMENDED_BY_C1);
|
|
sm = new SystemMessage(SystemMessageId.YOU_HAVE_BEEN_RECOMMENDED_BY_C1);
|
|
sm.addPcName(activeChar);
|
|
sm.addPcName(activeChar);
|
|
target.sendPacket(sm);
|
|
target.sendPacket(sm);
|
|
- sm =null;
|
|
|
|
-
|
|
|
|
- activeChar.sendPacket(new UserInfo(activeChar));
|
|
|
|
- sendPacket(new ExBrExtraUserInfo(activeChar));
|
|
|
|
|
|
+ sm = null;
|
|
|
|
+
|
|
|
|
+ activeChar.sendPacket(new UserInfo(activeChar));
|
|
|
|
+ sendPacket(new ExBrExtraUserInfo(activeChar));
|
|
target.broadcastUserInfo();
|
|
target.broadcastUserInfo();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/* (non-Javadoc)
|
|
/* (non-Javadoc)
|
|
* @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType()
|
|
* @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType()
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public String getType() {
|
|
|
|
|
|
+ public String getType()
|
|
|
|
+ {
|
|
return _C__B9_REQUESTEVALUATE;
|
|
return _C__B9_REQUESTEVALUATE;
|
|
}
|
|
}
|
|
}
|
|
}
|