Browse Source

BETA: Core part for [L5755]

VlLight 12 years ago
parent
commit
c7b2da3155

+ 9 - 0
L2J_DataPack_BETA/dist/game/data/Routes.xml

@@ -18,23 +18,27 @@
 	<!-- Hellbound Town routes for Patrols -->
 	<!-- castletownguard01 -->
 	<route id="2" repeat="true" repeatStyle="random">
+		<target id="22360" spawnX="14840" spawnY="251949" spawnZ="-2009" />	<!-- Town Patrolman -->
 		<point string="" X="14840" Y="251949" Z="-1992" delay="0" run="false" />
 		<point string="" X="14679" Y="253399" Z="-2016" delay="0" run="false" />
 	</route>
 	<!-- castletownguard02 -->
 	<route id="3" repeat="true" repeatStyle="random">
+		<target id="22360" spawnX="16082" spawnY="251790" spawnZ="-2000" />	<!-- Town Patrolman -->
 		<point string="" X="16082" Y="251790" Z="-1992" delay="0" run="false" />
 		<point string="" X="16388" Y="252456" Z="-2000" delay="0" run="false" />
 		<point string="" X="16093" Y="254443" Z="-2064" delay="0" run="false" />
 	</route>
 	<!-- castletownguard03 -->
 	<route id="4" repeat="true" repeatStyle="random">
+		<target id="22360" spawnX="16524" spawnY="255244" spawnZ="-2080" />	<!-- Town Patrolman -->
 		<point string="" X="16524" Y="255244" Z="-2072" delay="0" run="false" />
 		<point string="" X="17211" Y="256290" Z="-2064" delay="0" run="false" />
 		<point string="" X="18805" Y="256302" Z="-2088" delay="0" run="false" />
 	</route>
 	<!-- castletownguard04 -->
 	<route id="5" repeat="true" repeatStyle="random">
+		<target id="22360" spawnX="17670" spawnY="252256" spawnZ="-2022" />	<!-- Town Patrolman -->
 		<point string="" X="17344" Y="251070" Z="-1952" delay="0" run="false" />
 		<point string="" X="18708" Y="250659" Z="-1992" delay="0" run="false" />
 		<point string="" X="19533" Y="250667" Z="-2016" delay="0" run="false" />
@@ -42,6 +46,7 @@
 	<!-- Anomic Foundry routes for Lesser and Greater Evil -->
 	<!-- malign_conveyor_1_1 -->
 	<route id="6" repeat="true" repeatStyle="conveyor">
+		<target id="22398" spawnX="27883" spawnY="248613" spawnZ="-3209" />	<!-- Lesser Evil -->
 		<point string="" X="27886" Y="248609" Z="-3208" delay="0" run="true" />
 		<point string="" X="28150" Y="247726" Z="-3272" delay="0" run="true" />
 		<point string="" X="27340" Y="246649" Z="-3680" delay="0" run="true" />
@@ -56,6 +61,7 @@
 	</route>
 	<!-- malign_conveyor_1_2 -->
 	<route id="7" repeat="true" repeatStyle="conveyor">
+		<target id="22398" spawnX="26142" spawnY="246442" spawnZ="-3216" />	<!-- Lesser Evil -->
 		<point string="" X="26144" Y="246444" Z="-3208" delay="0" run="true" />
 		<point string="" X="28063" Y="247940" Z="-3248" delay="0" run="true" />
 		<point string="" X="28276" Y="247756" Z="-3272" delay="0" run="true" />
@@ -66,6 +72,7 @@
 	</route>
 	<!-- malign_conveyor_1_3 -->
 	<route id="8" repeat="true" repeatStyle="conveyor">
+		<target id="22398" spawnX="27335" spawnY="246217" spawnZ="-3668" />	<!-- Lesser Evil -->
 		<point string="" X="27336" Y="246216" Z="-3656" delay="0" run="true" />
 		<point string="" X="27645" Y="245921" Z="-3672" delay="0" run="true" />
 		<!-- <point string="" X="28245" Y="245904" Z="-2552" delay="0" run="true" /> --> <!-- retail -->
@@ -73,6 +80,7 @@
 	</route>
 	<!-- malign_conveyor_1_4 -->
 	<route id="9" repeat="true" repeatStyle="conveyor">
+		<target id="22398" spawnX="28486" spawnY="245913" spawnZ="-3698" />	<!-- Lesser Evil -->
 		<point string="" X="28476" Y="245914" Z="-3696" delay="0" run="true" />
 		<point string="" X="29058" Y="245894" Z="-3672" delay="0" run="true" />
 		<point string="" X="29433" Y="245216" Z="-3688" delay="0" run="true" />
@@ -80,6 +88,7 @@
 	</route>
 	<!-- malign_conveyor_2_1 -->
 	<route id="10" repeat="true" repeatStyle="conveyor">
+		<target id="22399" spawnX="28684" spawnY="244118" spawnZ="-3700" />	<!-- Greater Evil -->
 		<point string="" X="28771" Y="244251" Z="-2496" delay="0" run="true" />
 		<point string="" X="28495" Y="243839" Z="-3696" delay="0" run="true" />
 		<point string="" X="28727" Y="242939" Z="-3592" delay="0" run="true" />

+ 6 - 31
L2J_DataPack_BETA/dist/game/data/scripts/hellbound/AnomicFoundry/AnomicFoundry.java

@@ -25,7 +25,6 @@ import javolution.util.FastMap;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.datatables.SpawnTable;
 import com.l2jserver.gameserver.instancemanager.HellboundManager;
-import com.l2jserver.gameserver.instancemanager.WalkingManager;
 import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Spawn;
 import com.l2jserver.gameserver.model.actor.L2Attackable;
@@ -258,14 +257,10 @@ public class AnomicFoundry extends Quest
 				npc.setIsNoRndWalk(true);
 			}
 		}
-		
-		if ((getSpawnGroup(npc) >= 0) && (getSpawnGroup(npc) <= 2))
+
+		else
 		{
-			if (!npc.isTeleporting())
-			{
-				WalkingManager.getInstance().startMoving(npc, getRoute(npc));
-			}
-			else
+			if ((getSpawnGroup(npc) >= 0) && (getSpawnGroup(npc) <= 2))
 			{
 				_spawned[getSpawnGroup(npc)]--;
 				SpawnTable.getInstance().deleteSpawn(npc.getSpawn(), false);
@@ -275,15 +270,7 @@ public class AnomicFoundry extends Quest
 					addSpawn(SPAWNS[3][0], SPAWNS[3][1], SPAWNS[3][2], SPAWNS[3][3], SPAWNS[3][4], false, 0, false);
 				}
 			}
-		}
-		
-		else if (getSpawnGroup(npc) == 3)
-		{
-			if (!npc.isTeleporting())
-			{
-				WalkingManager.getInstance().startMoving(npc, getRoute(npc));
-			}
-			else
+			else if (getSpawnGroup(npc) == 3)
 			{
 				// Announcements.getInstance().announceToAll("Greater spawn is added");
 				startQuestTimer("make_spawn_2", respawnTime * 2, null, null);
@@ -292,12 +279,7 @@ public class AnomicFoundry extends Quest
 				npc.scheduleDespawn(100);
 			}
 		}
-		
-		else if ((getSpawnGroup(npc) == 4) && !npc.isTeleporting())
-		{
-			WalkingManager.getInstance().startMoving(npc, getRoute(npc));
-		}
-		
+
 		return super.onSpawn(npc);
 	}
 	
@@ -316,14 +298,7 @@ public class AnomicFoundry extends Quest
 		}
 		return -1;
 	}
-	
-	private static int getRoute(L2Npc npc)
-	{
-		final int ret = getSpawnGroup(npc);
-		
-		return ret >= 0 ? ret + 6 : -1;
-	}
-	
+
 	private static void requestHelp(L2Npc requester, L2PcInstance agressor, int range)
 	{
 		for (L2Spawn npcSpawn : SpawnTable.getInstance().getSpawnTable())

+ 3 - 46
L2J_DataPack_BETA/dist/game/data/scripts/instances/HellboundTown/HellboundTown.java

@@ -23,7 +23,6 @@ import java.util.concurrent.ScheduledFuture;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.instancemanager.HellboundManager;
 import com.l2jserver.gameserver.instancemanager.InstanceManager;
-import com.l2jserver.gameserver.instancemanager.WalkingManager;
 import com.l2jserver.gameserver.model.L2Party;
 import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.L2Npc;
@@ -71,27 +70,7 @@ public class HellboundTown extends Quest
 		NpcStringId.GUARDS_ARE_COMING_RUN,
 		NpcStringId.NOW_I_CAN_ESCAPE_ON_MY_OWN
 	};
-	
-	private static final int[][] ROUTE_DATA =
-	{
-		{
-			14840,
-			251949
-		},
-		{
-			16082,
-			251790
-		},
-		{
-			16524,
-			255244
-		},
-		{
-			17670,
-			252256
-		}
-	};
-	
+
 	private static final int TOMBSTONE = 32343;
 	private static final int KANAF = 32346;
 	private static final int KEYMASTER = 22361;
@@ -270,10 +249,7 @@ public class HellboundTown extends Quest
 			npc.setBusy(false);
 			npc.setBusyMessage("");
 		}
-		else if ((npc.getNpcId() == TOWN_PATROL) && (getRoute(npc) > 0))
-		{
-			WalkingManager.getInstance().startMoving(npc, getRoute(npc));
-		}
+
 		return super.onSpawn(npc);
 	}
 	
@@ -489,26 +465,7 @@ public class HellboundTown extends Quest
 			}
 		}
 	}
-	
-	private static int getRoute(L2Npc npc)
-	{
-		int ret = -1;
-		int[] coords = new int[2];
-		coords[0] = npc.getSpawn().getLocx();
-		coords[1] = npc.getSpawn().getLocy();
-		
-		for (int i = 0; i < 4; i++)
-		{
-			if ((ROUTE_DATA[i][0] == coords[0]) && (ROUTE_DATA[i][1] == coords[1]))
-			{
-				ret = i;
-				break;
-			}
-		}
-		
-		return ret >= 0 ? ret + 2 : -1;
-	}
-	
+
 	private class ExitInstance implements Runnable
 	{
 		private final L2Party _party;

+ 8 - 0
L2J_DataPack_BETA/dist/game/data/xsd/Routes.xsd

@@ -6,6 +6,14 @@
 				<xs:element name="route" minOccurs="1" maxOccurs="unbounded">
 					<xs:complexType>
 						<xs:sequence minOccurs="1" maxOccurs="1">
+							<xs:element name="target" minOccurs="0" maxOccurs="unbounded">
+								<xs:complexType>
+									<xs:attribute name="id" type="xs:positiveInteger" use="required" />
+									<xs:attribute name="spawnX" type="xs:integer" use="required" />
+									<xs:attribute name="spawnY" type="xs:integer" use="required" />
+									<xs:attribute name="spawnZ" type="xs:integer" use="required" />
+								</xs:complexType>
+							</xs:element>
 							<xs:element name="point" minOccurs="1" maxOccurs="unbounded">
 								<xs:complexType>
 									<xs:attribute name="string" type="xs:normalizedString" use="required" />