From b8b144c2ef82fb540a9f0df7a4df89546b80ee16 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 25 Apr 2018 10:21:26 +0000 Subject: [PATCH] Zealot of Shilen AI improvement. --- .../AI/NPC/ZealotOfShilen/ZealotOfShilen.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/AI/NPC/ZealotOfShilen/ZealotOfShilen.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/AI/NPC/ZealotOfShilen/ZealotOfShilen.java index 4b2263f1b5..75d967bbb0 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/AI/NPC/ZealotOfShilen/ZealotOfShilen.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/AI/NPC/ZealotOfShilen/ZealotOfShilen.java @@ -19,7 +19,6 @@ package ai.areas.Gracia.AI.NPC.ZealotOfShilen; import com.l2jmobius.gameserver.ai.CtrlIntention; import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Attackable; -import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; @@ -58,17 +57,17 @@ public final class ZealotOfShilen extends AbstractNpcAI startQuestTimer("WATCHING", 10000, npc, null, true); if (event.equalsIgnoreCase("WATCHING") && !npc.isAttackingNow()) { - for (L2Character monster : L2World.getInstance().getVisibleObjects(npc, L2MonsterInstance.class)) + L2World.getInstance().forEachVisibleObject(npc, L2MonsterInstance.class, character -> { - if (!monster.isDead() && !((L2Attackable) monster).isDecayed()) + if (!character.isDead() && !character.isDecayed()) { npc.setRunning(); - ((L2Attackable) npc).addDamageHate(monster, 0, 999); - npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, monster, null); + ((L2Attackable) npc).addDamageHate(character, 0, 999); + npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null); } - } + }); } - return null; + return super.onAdvEvent(event, npc, player); } @Override