瀏覽代碼

Allow control of the monsters attacking enemy clan. Attacking is possible only if target is auto-attackable (true by default).
For example, slaves in Hellbound Quarry should not be attacked by guards until they follow player.

_DS_ 15 年之前
父節點
當前提交
d05488d0dc

+ 4 - 1
L2_GameServer/java/com/l2jserver/gameserver/ai/L2AttackableAI.java

@@ -257,7 +257,10 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 			{
 				if (((L2Attackable)_actor).getEnemyClan() == null || ((L2Attackable)target).getClan() == null)
 					return false;
-				
+
+				if (!target.isAutoAttackable(_actor))
+					return false;
+
 				if (((L2Attackable)_actor).getEnemyClan().equals(((L2Attackable)target).getClan()))
 				{
 					if (_actor.isInsideRadius(target, ((L2Attackable)_actor).getEnemyRange(), false, false))

+ 0 - 3
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2MonsterInstance.java

@@ -87,9 +87,6 @@ public class L2MonsterInstance extends L2Attackable
 	@Override
 	public boolean isAutoAttackable(L2Character attacker)
 	{
-		if (attacker instanceof L2MonsterInstance)
-			return false;
-
 		return super.isAutoAttackable(attacker) && !isEventMob;
 	}