Working implementation of hasRandomAnimation method.

This commit is contained in:
MobiusDevelopment
2021-10-25 23:03:46 +00:00
parent fe146ca4e4
commit eff982c293
4 changed files with 4 additions and 6 deletions

View File

@@ -35,7 +35,6 @@ import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Playable; import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Summon; 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.DoorInstance;
import org.l2jmobius.gameserver.model.actor.instance.FestivalMonsterInstance; import org.l2jmobius.gameserver.model.actor.instance.FestivalMonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.FolkInstance; 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) // 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 x1;
int y1; int y1;

View File

@@ -2743,7 +2743,7 @@ public class Attackable extends NpcInstance
@Override @Override
public boolean hasRandomAnimation() 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) protected void setCommandChannelTimer(CommandChannelTimer commandChannelTimer)

View File

@@ -35,7 +35,6 @@ import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Playable; import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Summon; 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.DoorInstance;
import org.l2jmobius.gameserver.model.actor.instance.FestivalMonsterInstance; import org.l2jmobius.gameserver.model.actor.instance.FestivalMonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.FolkInstance; 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) // 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 x1;
int y1; int y1;

View File

@@ -3095,7 +3095,7 @@ public class Attackable extends NpcInstance
@Override @Override
public boolean hasRandomAnimation() 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) protected void setCommandChannelTimer(CommandChannelTimer commandChannelTimer)