From 0e21c44fa091461c0b41efb4a30b81128f7fb6d1 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 9 Sep 2017 01:45:23 +0000 Subject: [PATCH] Use GeoEngine for Friendly NPC movement paths. --- .../com/l2jmobius/gameserver/model/actor/L2Character.java | 4 +++- .../com/l2jmobius/gameserver/model/actor/L2Character.java | 4 +++- .../com/l2jmobius/gameserver/model/actor/L2Character.java | 4 +++- .../com/l2jmobius/gameserver/model/actor/L2Character.java | 3 ++- .../com/l2jmobius/gameserver/model/actor/L2Character.java | 4 +++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 5ff1e1bc9c..257cc931d2 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -79,8 +79,10 @@ import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.PcCondOverride; import com.l2jmobius.gameserver.model.TeleportWhereType; import com.l2jmobius.gameserver.model.TimeStamp; +import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance; import com.l2jmobius.gameserver.model.actor.stat.CharStat; import com.l2jmobius.gameserver.model.actor.status.CharStatus; import com.l2jmobius.gameserver.model.actor.tasks.character.HitTask; @@ -3629,7 +3631,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle) { // Path calculation -- overrides previous movement check - if (isPlayable() || isMinion() || isInCombat()) + if (isPlayable() || isMinion() || isInCombat() || (this instanceof FriendlyNpcInstance) || (this instanceof L2QuestGuardInstance)) { m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 5ff1e1bc9c..257cc931d2 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -79,8 +79,10 @@ import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.PcCondOverride; import com.l2jmobius.gameserver.model.TeleportWhereType; import com.l2jmobius.gameserver.model.TimeStamp; +import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance; import com.l2jmobius.gameserver.model.actor.stat.CharStat; import com.l2jmobius.gameserver.model.actor.status.CharStatus; import com.l2jmobius.gameserver.model.actor.tasks.character.HitTask; @@ -3629,7 +3631,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle) { // Path calculation -- overrides previous movement check - if (isPlayable() || isMinion() || isInCombat()) + if (isPlayable() || isMinion() || isInCombat() || (this instanceof FriendlyNpcInstance) || (this instanceof L2QuestGuardInstance)) { m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 5ff1e1bc9c..257cc931d2 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -79,8 +79,10 @@ import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.PcCondOverride; import com.l2jmobius.gameserver.model.TeleportWhereType; import com.l2jmobius.gameserver.model.TimeStamp; +import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance; import com.l2jmobius.gameserver.model.actor.stat.CharStat; import com.l2jmobius.gameserver.model.actor.status.CharStatus; import com.l2jmobius.gameserver.model.actor.tasks.character.HitTask; @@ -3629,7 +3631,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle) { // Path calculation -- overrides previous movement check - if (isPlayable() || isMinion() || isInCombat()) + if (isPlayable() || isMinion() || isInCombat() || (this instanceof FriendlyNpcInstance) || (this instanceof L2QuestGuardInstance)) { m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 4eef55dfff..f9dd1b3bd5 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -66,6 +66,7 @@ import com.l2jmobius.gameserver.model.TeleportWhereType; import com.l2jmobius.gameserver.model.TimeStamp; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance; +import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance; import com.l2jmobius.gameserver.model.actor.instance.L2RiftInvaderInstance; import com.l2jmobius.gameserver.model.actor.knownlist.CharKnownList; import com.l2jmobius.gameserver.model.actor.stat.CharStat; @@ -4450,7 +4451,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isInVehicle) { // Path calculation -- overrides previous movement check - if (isPlayable() || isMinion() || isInCombat()) + if (isPlayable() || isMinion() || isInCombat() || (this instanceof L2QuestGuardInstance)) { m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 5ff1e1bc9c..257cc931d2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -79,8 +79,10 @@ import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.PcCondOverride; import com.l2jmobius.gameserver.model.TeleportWhereType; import com.l2jmobius.gameserver.model.TimeStamp; +import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance; import com.l2jmobius.gameserver.model.actor.stat.CharStat; import com.l2jmobius.gameserver.model.actor.status.CharStatus; import com.l2jmobius.gameserver.model.actor.tasks.character.HitTask; @@ -3629,7 +3631,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle) { // Path calculation -- overrides previous movement check - if (isPlayable() || isMinion() || isInCombat()) + if (isPlayable() || isMinion() || isInCombat() || (this instanceof FriendlyNpcInstance) || (this instanceof L2QuestGuardInstance)) { m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found