From 8bb697fb2f8cd9cad4f3d506de89aebd9e3be41d Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 31 Dec 2016 16:12:39 +0000 Subject: [PATCH] Fixed Sel Mahum drill AI. Contributed by gigilo1968. --- .../SelMahumTrainingGrounds/SelMahumDrill.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/SelMahumTrainingGrounds/SelMahumDrill.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/SelMahumTrainingGrounds/SelMahumDrill.java index 7696cc884a..30b0a619c6 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/SelMahumTrainingGrounds/SelMahumDrill.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/SelMahumTrainingGrounds/SelMahumDrill.java @@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.datatables.SpawnTable; import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.L2Spawn; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Npc; @@ -156,10 +157,17 @@ public final class SelMahumDrill extends AbstractNpcAI npc.broadcastSocialAction(CHIEF_SOCIAL_ACTIONS[idx]); npc.getVariables().set("SOCIAL_ACTION_NEXT_INDEX", idx); // Pass social action index to soldiers via script value npc.broadcastEvent("do_social_action", TRAINING_RANGE, null); + + L2World.getInstance().forEachVisibleObjectInRange(npc, L2Npc.class, 1000, soldier -> + { + if (CommonUtil.contains(MAHUM_SOLDIERS, soldier.getId())) + { + soldier.broadcastSocialAction(CHIEF_SOCIAL_ACTIONS[idx]); + } + }); } } - - startQuestTimer("do_social_action", 15000, npc, null); + startQuestTimer("do_social_action", 10000, npc, null); } else if (CommonUtil.contains(MAHUM_SOLDIERS, npc.getId())) { @@ -269,7 +277,7 @@ public final class SelMahumDrill extends AbstractNpcAI { if (CommonUtil.contains(MAHUM_CHIEFS, npc.getId())) { - startQuestTimer("do_social_action", 15000, npc, null); + startQuestTimer("do_social_action", 10000, npc, null); } else if ((getRandom(18) < 1) && CommonUtil.contains(MAHUM_SOLDIERS, npc.getId()))