Fixed probable NPE in useMagic.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment 2021-02-06 21:19:03 +00:00
parent fa04eff2fa
commit 80bb705157
17 changed files with 204 additions and 119 deletions

View File

@ -53,6 +53,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8478,15 +8479,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -53,6 +53,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8485,15 +8486,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -53,6 +53,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8487,15 +8488,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8482,15 +8483,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8465,15 +8466,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8465,15 +8466,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8466,15 +8467,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8474,15 +8475,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8502,15 +8503,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8365,15 +8366,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8365,15 +8366,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8351,15 +8352,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -53,6 +53,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8378,15 +8379,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -53,6 +53,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8378,15 +8379,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -54,6 +54,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8322,15 +8323,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8367,15 +8368,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}

View File

@ -54,6 +54,7 @@ import org.l2jmobius.gameserver.ItemsAutoDestroy;
import org.l2jmobius.gameserver.LoginServerThread;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.CreatureAI.IntentionCommand;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.ai.PlayerAI;
import org.l2jmobius.gameserver.ai.SummonAI;
@ -8401,15 +8402,19 @@ public class PlayerInstance extends Playable
sendPacket(ActionFailed.STATIC_PACKET);
// Upon failed conditions, next action is called.
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this) && ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)))
if ((usedSkill.getNextAction() != NextActionType.NONE) && (target != this) && target.isAutoAttackable(this))
{
if (usedSkill.getNextAction() == NextActionType.ATTACK)
final IntentionCommand nextIntention = getAI().getNextIntention();
if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
if (usedSkill.getNextAction() == NextActionType.ATTACK)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
}
else if (usedSkill.getNextAction() == NextActionType.CAST)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, usedSkill, target, item, false, false);
}
}
}