From 1304c34d2f268372ac70749efe25ad4e9851faad Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 26 Sep 2020 10:13:05 +0000 Subject: [PATCH] Using skills with shift or /useskillstand auto attack should not be executed. Contributed by Sahar. --- .../l2jmobius/gameserver/model/actor/Creature.java | 14 +++++++++++++- .../l2jmobius/gameserver/model/actor/Creature.java | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java index 3a89492e5e..a169883384 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5511,7 +5511,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final IntentionCommand nextIntention = getAI().getNextIntention(); if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)) { - getAI().setIntention(AI_INTENTION_ATTACK, target); + if (isPlayer()) + { + final PlayerInstance currPlayer = getActingPlayer(); + final SkillUseHolder currSkill = currPlayer.getCurrentSkill(); + if ((currSkill == null) || !currSkill.isShiftPressed()) + { + getAI().setIntention(AI_INTENTION_ATTACK, target); + } + } + else + { + getAI().setIntention(AI_INTENTION_ATTACK, target); + } } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java index 32a333342e..e68d880e53 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5513,7 +5513,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final IntentionCommand nextIntention = getAI().getNextIntention(); if ((nextIntention == null) || (nextIntention.getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)) { - getAI().setIntention(AI_INTENTION_ATTACK, target); + if (isPlayer()) + { + final PlayerInstance currPlayer = getActingPlayer(); + final SkillUseHolder currSkill = currPlayer.getCurrentSkill(); + if ((currSkill == null) || !currSkill.isShiftPressed()) + { + getAI().setIntention(AI_INTENTION_ATTACK, target); + } + } + else + { + getAI().setIntention(AI_INTENTION_ATTACK, target); + } } }