03-22-2013, 04:11 PM
КОД1
[SRC="java"] public final L2Object[] getTargetList(L2Character activeChar, boolean onlyFirst)
{
// Init to null the target of the skill
L2Character target = null;
// Get the L2Objcet targeted by the user of the skill at this moment
L2Object objTarget = activeChar.getTarget();
// If the L2Object targeted is a L2Character, it becomes the L2Character target
if (objTarget instanceof L2Character)
{
target = (L2Character) objTarget;
}
return getTargetList(activeChar, onlyFirst, target);
}[/SRC]
{
// Init to null the target of the skill
L2Character target = null;
// Get the L2Objcet targeted by the user of the skill at this moment
L2Object objTarget = activeChar.getTarget();
// If the L2Object targeted is a L2Character, it becomes the L2Character target
if (objTarget instanceof L2Character)
{
target = (L2Character) objTarget;
}
return getTargetList(activeChar, onlyFirst, target);
}[/SRC]
Конечный код
[SRC="java"] public final L2Object[] getTargetList(L2Character activeChar, boolean onlyFirst)
{
// Init to null the target of the skill
L2Character target = null;
// Get the L2Objcet targeted by the user of the skill at this moment
L2Object objTarget = activeChar.getTarget();
// If the L2Object targeted is a L2Character, it becomes the L2Character target
if (objTarget instanceof L2Character)
{
target = (L2Character) objTarget;
}
if (target instanceof L2PcInstance)
{
if (((L2PcInstance) activeChar).isGood() && ((L2PcInstance) target).isGood())
{
return _emptyTargetList;
}
if (((L2PcInstance) activeChar).isGood() && ((L2PcInstance) target).isGood())
{
return _emptyTargetList;
}
}
return getTargetList(activeChar, onlyFirst, target);
}[/SRC]
{
// Init to null the target of the skill
L2Character target = null;
// Get the L2Objcet targeted by the user of the skill at this moment
L2Object objTarget = activeChar.getTarget();
// If the L2Object targeted is a L2Character, it becomes the L2Character target
if (objTarget instanceof L2Character)
{
target = (L2Character) objTarget;
}
if (target instanceof L2PcInstance)
{
if (((L2PcInstance) activeChar).isGood() && ((L2PcInstance) target).isGood())
{
return _emptyTargetList;
}
if (((L2PcInstance) activeChar).isGood() && ((L2PcInstance) target).isGood())
{
return _emptyTargetList;
}
}
return getTargetList(activeChar, onlyFirst, target);
}[/SRC]
Исходники l2jserver.
КОД ОШИБКИ
[SRC="java"]мар 22, 2013 1:14:25 PM com.l2jserver.gameserver.model.actor.L2Character callSkill
WARNING: L2PcInstance: callSkill() failed.
java.lang.ClassCastException: [Lcom.l2jserver.gameserver.model.L2Object; cannot be cast to [Lcom.l2jserver.gameserver.model.actor.L2Character;
at handlers.skillhandlers.Continuous.useSkill(Continuous.java:78)
at com.l2jserver.gameserver.model.actor.L2Character.callSkill(L2Character.java:6886)
at com.l2jserver.gameserver.model.actor.L2Character.onMagicHitTimer(L2Character.java:6583)
at com.l2jserver.gameserver.model.actor.L2Character$MagicUseTask.run(L2Character.java:3037)
at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:86)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)[/SRC]
WARNING: L2PcInstance: callSkill() failed.
java.lang.ClassCastException: [Lcom.l2jserver.gameserver.model.L2Object; cannot be cast to [Lcom.l2jserver.gameserver.model.actor.L2Character;
at handlers.skillhandlers.Continuous.useSkill(Continuous.java:78)
at com.l2jserver.gameserver.model.actor.L2Character.callSkill(L2Character.java:6886)
at com.l2jserver.gameserver.model.actor.L2Character.onMagicHitTimer(L2Character.java:6583)
at com.l2jserver.gameserver.model.actor.L2Character$MagicUseTask.run(L2Character.java:3037)
at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:86)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)[/SRC]