From 30812bf42953eb806460e23c60ac5a0fdd1d7c3c Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 6 Jun 2021 22:44:48 +0000 Subject: [PATCH] Addition of level difference for homunculus kill count. --- .../dist/game/data/scripts/ai/others/HomunculusKillCount.java | 4 +++- .../dist/game/data/scripts/ai/others/HomunculusKillCount.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/HomunculusKillCount.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/HomunculusKillCount.java index 845c9b7481..ff541e7e9c 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/HomunculusKillCount.java +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/others/HomunculusKillCount.java @@ -33,6 +33,8 @@ import ai.AbstractNpcAI; */ public class HomunculusKillCount extends AbstractNpcAI { + private static final int LEVEL_DIFFERENCE = 5; + @RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterType(ListenerRegisterType.GLOBAL_MONSTERS) public void onAttackableKill(OnAttackableKill event) @@ -41,7 +43,7 @@ public class HomunculusKillCount extends AbstractNpcAI if ((creature != null) && creature.isMonster()) { final PlayerInstance player = event.getAttacker().getActingPlayer(); - if (player != null) + if ((player != null) && (Math.abs(player.getLevel() - creature.getLevel()) <= LEVEL_DIFFERENCE)) { final int killedMobs = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_KILLED_MOBS, 0); if (killedMobs < 500) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/HomunculusKillCount.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/HomunculusKillCount.java index 845c9b7481..ff541e7e9c 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/HomunculusKillCount.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/HomunculusKillCount.java @@ -33,6 +33,8 @@ import ai.AbstractNpcAI; */ public class HomunculusKillCount extends AbstractNpcAI { + private static final int LEVEL_DIFFERENCE = 5; + @RegisterEvent(EventType.ON_ATTACKABLE_KILL) @RegisterType(ListenerRegisterType.GLOBAL_MONSTERS) public void onAttackableKill(OnAttackableKill event) @@ -41,7 +43,7 @@ public class HomunculusKillCount extends AbstractNpcAI if ((creature != null) && creature.isMonster()) { final PlayerInstance player = event.getAttacker().getActingPlayer(); - if (player != null) + if ((player != null) && (Math.abs(player.getLevel() - creature.getLevel()) <= LEVEL_DIFFERENCE)) { final int killedMobs = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_KILLED_MOBS, 0); if (killedMobs < 500)