From eff982c2934a572357bfcebd5a93823ee7103935 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 25 Oct 2021 23:03:46 +0000 Subject: [PATCH] Working implementation of hasRandomAnimation method. --- .../java/org/l2jmobius/gameserver/ai/AttackableAI.java | 3 +-- .../java/org/l2jmobius/gameserver/model/actor/Attackable.java | 2 +- .../java/org/l2jmobius/gameserver/ai/AttackableAI.java | 3 +-- .../java/org/l2jmobius/gameserver/model/actor/Attackable.java | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java index f27b69da2e..7d498c9ba7 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -35,7 +35,6 @@ import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Playable; import org.l2jmobius.gameserver.model.actor.Summon; -import org.l2jmobius.gameserver.model.actor.instance.ChestInstance; import org.l2jmobius.gameserver.model.actor.instance.DoorInstance; import org.l2jmobius.gameserver.model.actor.instance.FestivalMonsterInstance; import org.l2jmobius.gameserver.model.actor.instance.FolkInstance; @@ -540,7 +539,7 @@ public class AttackableAI extends CreatureAI } } // Order to the MonsterInstance to random walk (1/100) - else if (!(npc instanceof ChestInstance) && (npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0)) + else if (npc.hasRandomAnimation() && (npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0)) { int x1; int y1; diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2f6e951d83..b6fb46c713 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -2743,7 +2743,7 @@ public class Attackable extends NpcInstance @Override public boolean hasRandomAnimation() { - return (Config.MAX_MONSTER_ANIMATION > 0) && !(this instanceof GrandBossInstance); + return (Config.MAX_MONSTER_ANIMATION > 0) && isMonster() && !(this instanceof GrandBossInstance); } protected void setCommandChannelTimer(CommandChannelTimer commandChannelTimer) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java index f27b69da2e..7d498c9ba7 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -35,7 +35,6 @@ import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Playable; import org.l2jmobius.gameserver.model.actor.Summon; -import org.l2jmobius.gameserver.model.actor.instance.ChestInstance; import org.l2jmobius.gameserver.model.actor.instance.DoorInstance; import org.l2jmobius.gameserver.model.actor.instance.FestivalMonsterInstance; import org.l2jmobius.gameserver.model.actor.instance.FolkInstance; @@ -540,7 +539,7 @@ public class AttackableAI extends CreatureAI } } // Order to the MonsterInstance to random walk (1/100) - else if (!(npc instanceof ChestInstance) && (npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0)) + else if (npc.hasRandomAnimation() && (npc.getSpawn() != null) && (Rnd.get(RANDOM_WALK_RATE) == 0)) { int x1; int y1; diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 4ffd4957e2..7562e6ddcb 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -3095,7 +3095,7 @@ public class Attackable extends NpcInstance @Override public boolean hasRandomAnimation() { - return (Config.MAX_MONSTER_ANIMATION > 0) && !(this instanceof GrandBossInstance); + return (Config.MAX_MONSTER_ANIMATION > 0) && isMonster() && !(this instanceof GrandBossInstance); } protected void setCommandChannelTimer(CommandChannelTimer commandChannelTimer)