Prechádzať zdrojové kódy

DP-Part for L2J/L2J_Server@cef5f170c4d832ea1d5842bd73a5252559526338

NosBit 10 rokov pred
rodič
commit
fdbdd632e0

+ 1 - 10
L2J_DataPack/dist/game/data/scripts/ai/group_template/FleeMonsters.java

@@ -20,7 +20,6 @@ package ai.group_template;
 
 import ai.npc.AbstractNpcAI;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.model.Location;
@@ -74,15 +73,7 @@ public final class FleeMonsters extends AbstractNpcAI
 		final int posY = (int) (npc.getY() + (FLEE_DISTANCE * Math.sin(radians)));
 		final int posZ = npc.getZ();
 		
-		final Location destination;
-		if (Config.GEODATA > 0)
-		{
-			destination = GeoData.getInstance().moveCheck(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, attacker.getInstanceId());
-		}
-		else
-		{
-			destination = new Location(posX, posY, posZ);
-		}
+		final Location destination = GeoData.getInstance().moveCheck(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, attacker.getInstanceId());
 		npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
 		return super.onAttack(npc, attacker, damage, isSummon);
 	}

+ 2 - 18
L2J_DataPack/dist/game/data/scripts/handlers/actionhandlers/L2PcInstanceAction.java

@@ -18,7 +18,6 @@
  */
 package handlers.actionhandlers;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.enums.InstanceType;
@@ -101,15 +100,7 @@ public class L2PcInstanceAction implements IActionHandler
 					}
 					else
 					{
-						if (Config.GEODATA > 0)
-						{
-							if (GeoData.getInstance().canSeeTarget(activeChar, target))
-							{
-								activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
-								activeChar.onActionRequest();
-							}
-						}
-						else
+						if (GeoData.getInstance().canSeeTarget(activeChar, target))
 						{
 							activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
 							activeChar.onActionRequest();
@@ -120,14 +111,7 @@ public class L2PcInstanceAction implements IActionHandler
 				{
 					// This Action Failed packet avoids activeChar getting stuck when clicking three or more times
 					activeChar.sendPacket(ActionFailed.STATIC_PACKET);
-					if (Config.GEODATA > 0)
-					{
-						if (GeoData.getInstance().canSeeTarget(activeChar, target))
-						{
-							activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
-						}
-					}
-					else
+					if (GeoData.getInstance().canSeeTarget(activeChar, target))
 					{
 						activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
 					}

+ 3 - 20
L2J_DataPack/dist/game/data/scripts/handlers/actionhandlers/L2PetInstanceAction.java

@@ -18,7 +18,6 @@
  */
 package handlers.actionhandlers;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.enums.InstanceType;
@@ -61,32 +60,16 @@ public class L2PetInstanceAction implements IActionHandler
 			// Check if the pet is attackable (without a forced attack) and isn't dead
 			if (target.isAutoAttackable(activeChar) && !isOwner)
 			{
-				if (Config.GEODATA > 0)
-				{
-					if (GeoData.getInstance().canSeeTarget(activeChar, target))
-					{
-						// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
-						activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
-						activeChar.onActionRequest();
-					}
-				}
-				else
+				if (GeoData.getInstance().canSeeTarget(activeChar, target))
 				{
+					// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
 					activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
 					activeChar.onActionRequest();
 				}
 			}
 			else if (!((L2Character) target).isInsideRadius(activeChar, 150, false, false))
 			{
-				if (Config.GEODATA > 0)
-				{
-					if (GeoData.getInstance().canSeeTarget(activeChar, target))
-					{
-						activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
-						activeChar.onActionRequest();
-					}
-				}
-				else
+				if (GeoData.getInstance().canSeeTarget(activeChar, target))
 				{
 					activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
 					activeChar.onActionRequest();

+ 2 - 15
L2J_DataPack/dist/game/data/scripts/handlers/actionhandlers/L2SummonAction.java

@@ -18,7 +18,6 @@
  */
 package handlers.actionhandlers;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.enums.InstanceType;
@@ -61,15 +60,7 @@ public class L2SummonAction implements IActionHandler
 		{
 			if (target.isAutoAttackable(activeChar))
 			{
-				if (Config.GEODATA > 0)
-				{
-					if (GeoData.getInstance().canSeeTarget(activeChar, target))
-					{
-						activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
-						activeChar.onActionRequest();
-					}
-				}
-				else
+				if (GeoData.getInstance().canSeeTarget(activeChar, target))
 				{
 					activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
 					activeChar.onActionRequest();
@@ -83,17 +74,13 @@ public class L2SummonAction implements IActionHandler
 				{
 					activeChar.updateNotMoveUntil();
 				}
-				else if (Config.GEODATA > 0)
+				else
 				{
 					if (GeoData.getInstance().canSeeTarget(activeChar, target))
 					{
 						activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
 					}
 				}
-				else
-				{
-					activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
-				}
 			}
 		}
 		return true;

+ 2 - 2
L2J_DataPack/dist/game/data/scripts/handlers/admincommandhandlers/AdminPathNode.java

@@ -69,9 +69,9 @@ public class AdminPathNode implements IAdminCommandHandler
 		}
 		else if (command.equals("admin_find_path"))
 		{
-			if (Config.GEODATA < 2)
+			if (Config.PATHFINDING == 0)
 			{
-				activeChar.sendMessage("PathFinding has not been enabled.");
+				activeChar.sendMessage("PathFinding is disabled.");
 				return true;
 			}
 			if (activeChar.getTarget() != null)

+ 4 - 8
L2J_DataPack/dist/game/data/scripts/handlers/effecthandlers/Blink.java

@@ -18,7 +18,6 @@
  */
 package handlers.effecthandlers;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.model.Location;
@@ -72,17 +71,14 @@ public final class Blink extends AbstractEffect
 		int x = effected.getX() + x1;
 		int y = effected.getY() + y1;
 		int z = effected.getZ();
-		Location loc = new Location(x, y, z);
-		if (Config.GEODATA > 0)
-		{
-			loc = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceId());
-		}
+		
+		final Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceId());
 		
 		effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
-		effected.broadcastPacket(new FlyToLocation(effected, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
+		effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.DUMMY));
 		effected.abortAttack();
 		effected.abortCast();
-		effected.setXYZ(loc);
+		effected.setXYZ(destination);
 		effected.broadcastPacket(new ValidateLocation(effected));
 	}
 }

+ 4 - 9
L2J_DataPack/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java

@@ -18,7 +18,6 @@
  */
 package handlers.effecthandlers;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.StatsSet;
@@ -94,16 +93,12 @@ public final class EnemyCharge extends AbstractEffect
 		int y = curY + (int) ((distance - offset) * sin);
 		int z = info.getEffected().getZ();
 		
-		if (Config.GEODATA > 0)
-		{
-			Location destiny = GeoData.getInstance().moveCheck(info.getEffector().getX(), info.getEffector().getY(), info.getEffector().getZ(), x, y, z, info.getEffector().getInstanceId());
-			x = destiny.getX();
-			y = destiny.getY();
-		}
-		info.getEffector().broadcastPacket(new FlyToLocation(info.getEffector(), x, y, z, FlyType.CHARGE));
+		final Location destination = GeoData.getInstance().moveCheck(info.getEffector().getX(), info.getEffector().getY(), info.getEffector().getZ(), x, y, z, info.getEffector().getInstanceId());
+		
+		info.getEffector().broadcastPacket(new FlyToLocation(info.getEffector(), destination, FlyType.CHARGE));
 		
 		// maybe is need force set X,Y,Z
-		info.getEffector().setXYZ(x, y, z);
+		info.getEffector().setXYZ(destination);
 		info.getEffector().broadcastPacket(new ValidateLocation(info.getEffector()));
 	}
 }

+ 2 - 9
L2J_DataPack/dist/game/data/scripts/handlers/effecthandlers/Fear.java

@@ -18,7 +18,6 @@
  */
 package handlers.effecthandlers;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.ai.CtrlEvent;
 import com.l2jserver.gameserver.ai.CtrlIntention;
@@ -101,18 +100,12 @@ public final class Fear extends AbstractEffect
 		int posY = (int) (info.getEffected().getY() + (FEAR_RANGE * Math.sin(radians)));
 		int posZ = info.getEffected().getZ();
 		
-		if (Config.GEODATA > 0)
-		{
-			Location destiny = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), posX, posY, posZ, info.getEffected().getInstanceId());
-			posX = destiny.getX();
-			posY = destiny.getY();
-		}
-		
 		if (!info.getEffected().isPet())
 		{
 			info.getEffected().setRunning();
 		}
 		
-		info.getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, posZ));
+		final Location destination = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), posX, posY, posZ, info.getEffected().getInstanceId());
+		info.getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
 	}
 }

+ 2 - 6
L2J_DataPack/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java

@@ -18,7 +18,6 @@
  */
 package handlers.effecthandlers;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.model.Location;
@@ -80,11 +79,8 @@ public final class TeleportToTarget extends AbstractEffect
 		int x = (int) (px + (25 * Math.cos(ph)));
 		int y = (int) (py + (25 * Math.sin(ph)));
 		int z = target.getZ();
-		Location loc = new Location(x, y, z);
-		if (Config.GEODATA > 0)
-		{
-			loc = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceId());
-		}
+		
+		final Location loc = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceId());
 		
 		activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
 		activeChar.broadcastPacket(new FlyToLocation(activeChar, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));

+ 3 - 9
L2J_DataPack/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java

@@ -18,7 +18,6 @@
  */
 package handlers.effecthandlers;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.StatsSet;
@@ -98,16 +97,11 @@ public final class ThrowUp extends AbstractEffect
 		int y = info.getEffector().getY() - (int) (offset * sin);
 		int z = info.getEffected().getZ();
 		
-		if (Config.GEODATA > 0)
-		{
-			Location destiny = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), x, y, z, info.getEffected().getInstanceId());
-			x = destiny.getX();
-			y = destiny.getY();
-		}
+		final Location destination = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), x, y, z, info.getEffected().getInstanceId());
 		
-		info.getEffected().broadcastPacket(new FlyToLocation(info.getEffected(), x, y, z, FlyType.THROW_UP));
+		info.getEffected().broadcastPacket(new FlyToLocation(info.getEffected(), destination, FlyType.THROW_UP));
 		// TODO: Review.
-		info.getEffected().setXYZ(x, y, z);
+		info.getEffected().setXYZ(destination);
 		info.getEffected().broadcastPacket(new ValidateLocation(info.getEffected()));
 	}
 }

+ 1 - 2
L2J_DataPack/dist/game/data/scripts/handlers/targethandlers/AreaFriendly.java

@@ -24,7 +24,6 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
-import com.l2jserver.Config;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.handler.ITargetTypeHandler;
 import com.l2jserver.gameserver.model.L2Object;
@@ -99,7 +98,7 @@ public class AreaFriendly implements ITargetTypeHandler
 	
 	private boolean checkTarget(L2Character activeChar, L2Character target)
 	{
-		if ((Config.GEODATA > 0) && !GeoData.getInstance().canSeeTarget(activeChar, target))
+		if (!GeoData.getInstance().canSeeTarget(activeChar, target))
 		{
 			return false;
 		}

+ 4 - 8
L2J_DataPack/dist/game/data/scripts/instances/CrystalCaverns/CrystalCaverns.java

@@ -1642,16 +1642,12 @@ public final class CrystalCaverns extends Quest
 		int _y = effector.getY() - (int) (offset * sin);
 		int _z = effected.getZ();
 		
-		if (Config.GEODATA > 0)
-		{
-			Location destiny = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), _x, _y, _z, effected.getInstanceId());
-			_x = destiny.getX();
-			_y = destiny.getY();
-		}
-		effected.broadcastPacket(new FlyToLocation(effected, _x, _y, _z, FlyType.THROW_UP));
+		Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), _x, _y, _z, effected.getInstanceId());
+		
+		effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
 		
 		// maybe is need force set X,Y,Z
-		effected.setXYZ(_x, _y, _z);
+		effected.setXYZ(destination);
 		effected.broadcastPacket(new ValidateLocation(effected));
 	}