浏览代码

Stop caster autoattack after using Hide skill.

_DS_ 15 年之前
父节点
当前提交
b325613847

+ 8 - 3
L2_GameServer/java/net/sf/l2j/gameserver/ai/L2CharacterAI.java

@@ -64,10 +64,10 @@ import net.sf.l2j.util.Rnd;
  */
 public class L2CharacterAI extends AbstractAI
 {
-	class IntentionCommand
+	public class IntentionCommand
 	{
-		protected CtrlIntention _crtlIntention;
-		protected Object _arg0, _arg1;
+		protected final CtrlIntention _crtlIntention;
+		protected final Object _arg0, _arg1;
 		
 		protected IntentionCommand(CtrlIntention pIntention, Object pArg0, Object pArg1)
 		{
@@ -75,6 +75,11 @@ public class L2CharacterAI extends AbstractAI
 			_arg0 = pArg0;
 			_arg1 = pArg1;
 		}
+
+		public CtrlIntention getCtrlIntention()
+		{
+			return _crtlIntention;
+		}
 	}
 	
 	/**

+ 4 - 0
L2_GameServer/java/net/sf/l2j/gameserver/skills/effects/EffectHide.java

@@ -64,6 +64,10 @@ public class EffectHide extends L2Effect
 			activeChar.getAppearance().setInvisible();
 			activeChar.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_STEALTH);
 
+			if (activeChar.getAI().getNextIntention() != null
+					&& activeChar.getAI().getNextIntention().getCtrlIntention() == CtrlIntention.AI_INTENTION_ATTACK)
+				activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
+
 			L2GameServerPacket del = new DeleteObject(activeChar);
 			for (L2Character target : activeChar.getKnownList().getKnownCharacters())
 			{