Pārlūkot izejas kodu

BETA: Updated AIs:
* '''!ElrokiTeleporters''' AI.
* Reviewed by: Adry_85, malyelfik

* '''!CrumaTower''' AI.
* Reviewed by: Adry_85, malyelfik

St3eT 11 gadi atpakaļ
vecāks
revīzija
4b57a42add

+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483-1.htm → L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483-1.html


+ 2 - 2
L2J_DataPack_BETA/dist/game/data/html/teleporter/30483.htm → L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483.html

@@ -1,6 +1,6 @@
 <html><body>Gatekeeper Mozella:<br>
 My name is Mozella. I am one of the researchers dispatched from Oren's Ivory Tower to search for the secrets lost in the Tower of the Giants. We recently discovered what we think is a device used by the Giants in a bygone age to travel through space and time, and we are trying to unlock its secrets. Fortunately, this place was untouched by the outside world during the long years, so the mysteries of the Giants have remained undisturbed until our arrival. Unfortunately, however, the Tower is also inhabited by a number of frightful monsters.<br>
 If you wish to brave the dangers to explore these mysterious ruins, however, I will open the door of space and time and admit you to the Tower's interior.<br>
-<a action="bypass -h npc_%objectId%_Quest CrumaTower">Teleport into the Tower.</a><br>
-<a action="bypass -h npc_%objectId%_Quest">Quest.</a>
+<a action="bypass -h Quest CrumaTower">Teleport into the Tower.</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
 </body></html>

+ 16 - 14
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/CrumaTower.java

@@ -32,31 +32,33 @@ public final class CrumaTower extends AbstractNpcAI
 {
 	// NPC
 	private static final int MOZELLA = 30483;
-	// Location
-	private static final Location TELEPORT_LOC = new Location(17724, 114004, -11672);
+	// Locations
+	private static final Location TELEPORT_LOC1 = new Location(17776, 113968, -11671);
+	private static final Location TELEPORT_LOC2 = new Location(17680, 113968, -11671);
 	// Misc
 	private static final int MAX_LEVEL = 55;
 	
-	@Override
-	public String onTalk(L2Npc npc, L2PcInstance player)
-	{
-		if (player.getLevel() <= MAX_LEVEL)
-		{
-			player.teleToLocation(TELEPORT_LOC);
-			return null;
-		}
-		return "30483-1.htm";
-	}
-	
 	private CrumaTower()
 	{
 		super(CrumaTower.class.getSimpleName(), "ai/npc/Teleports");
+		addFirstTalkId(MOZELLA);
 		addStartNpc(MOZELLA);
 		addTalkId(MOZELLA);
 	}
 	
+	@Override
+	public String onTalk(L2Npc npc, L2PcInstance talker)
+	{
+		if (talker.getLevel() <= MAX_LEVEL)
+		{
+			talker.teleToLocation(getRandomBoolean() ? TELEPORT_LOC1 : TELEPORT_LOC2);
+			return null;
+		}
+		return "30483-1.html";
+	}
+	
 	public static void main(String[] args)
 	{
 		new CrumaTower();
 	}
-}
+}

+ 0 - 3
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.htm

@@ -1,3 +0,0 @@
-<html><body>Orahochin<br>
-Oh ho -- you have sought me out while battling the dinosaurs, have you? And now you ask me to teleport you to that place? That island was created as a sancturary; it is my duty to protect its inhabitants from external harm. I certainly have no intention of making that place a refuge for reckless adventurers! It is my policy to not teleport any who are engaged in battle, so return after the battle has ended.
-</body></html>

+ 3 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.html

@@ -0,0 +1,3 @@
+<html><body>Orahochin:<br>
+Oh ho -- you have sought me out while battling the dinosaurs, have you? And now you ask me to teleport you to that place? That island was created as as a sanctuary; it is my duty is to protect its inhabitants from external harm. I certainly have no intention of making that place a refuge for reckless adventurers! It is my policy not to teleport any who are engaged in battle, so return after the battle has ended.
+</body></html>

+ 0 - 0
L2J_DataPack_BETA/dist/game/data/html/default/32111.htm → L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111.html


+ 3 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32112-no.html

@@ -0,0 +1,3 @@
+<html><body>Gariachin:<br>
+Oh, no! This is not good, not good at all. My sincerest apologies -- I cannot tell you what happened in detail -- but I cannot teleport you to your destination at the moment. I'm terribly sorry for the inconvenience.
+</body></html>

+ 2 - 2
L2J_DataPack_BETA/dist/game/data/html/default/32112.htm → L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32112.html

@@ -1,5 +1,5 @@
 <html><body>Gariachin:<br>
 Welcome! I am Gariachin. I am entrusted with the teleportation of visitors to this island. It may sound strange to you, but I've come to love this island and respect its people. It is a precious place, housing the hope, wisdom and future of the Elroki tribe.<br>
-I will transport you to the southern beach of the Primeval plains. If you have the chance, will you send my regards to my friend, Orahochin?<br>
-<a action="bypass -h npc_%objectId%_Quest ElrokiTeleporters">Teleport</a>
+I will transport you to the southern beach of the Primeval Plains. If you have the chance, will you send my regards to my friend, Orahochin?<br>
+<a action="bypass -h npc_%objectId%_Quest ElrokiTeleporters">Teleport.</a>
 </body></html>

+ 17 - 26
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/ElrokiTeleporters.java

@@ -25,8 +25,7 @@ import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 
 /**
- * Elroki teleport AI.<br>
- * Original Jython script by kerberos_20
+ * Elroki teleport AI.
  * @author Plim
  */
 public final class ElrokiTeleporters extends AbstractNpcAI
@@ -38,38 +37,30 @@ public final class ElrokiTeleporters extends AbstractNpcAI
 	private static final Location TELEPORT_ORAHOCIN = new Location(4990, -1879, -3178);
 	private static final Location TELEPORT_GARIACHIN = new Location(7557, -5513, -3221);
 	
-	@Override
-	public String onTalk(L2Npc npc, L2PcInstance player)
-	{
-		switch (npc.getId())
-		{
-			case ORAHOCHIN:
-			{
-				if (player.isInCombat())
-				{
-					return "32111-no.htm";
-				}
-				player.teleToLocation(TELEPORT_ORAHOCIN);
-				break;
-			}
-			case GARIACHIN:
-			{
-				player.teleToLocation(TELEPORT_GARIACHIN);
-				break;
-			}
-		}
-		return super.onTalk(npc, player);
-	}
-	
 	private ElrokiTeleporters()
 	{
 		super(ElrokiTeleporters.class.getSimpleName(), "ai/npc/Teleports");
+		addFirstTalkId(ORAHOCHIN, GARIACHIN);
 		addStartNpc(ORAHOCHIN, GARIACHIN);
 		addTalkId(ORAHOCHIN, GARIACHIN);
 	}
 	
+	@Override
+	public String onTalk(L2Npc npc, L2PcInstance talker)
+	{
+		if (!talker.isInCombat())
+		{
+			talker.teleToLocation((npc.getId() == ORAHOCHIN) ? TELEPORT_ORAHOCIN : TELEPORT_GARIACHIN);
+		}
+		else
+		{
+			return npc.getId() + "-no.html";
+		}
+		return super.onTalk(npc, talker);
+	}
+	
 	public static void main(String[] args)
 	{
 		new ElrokiTeleporters();
 	}
-}
+}

+ 1 - 8
L2J_DataPack_BETA/dist/game/data/stats/npcs/30400-30500.xml

@@ -2307,18 +2307,11 @@
 			<height normal="24" />
 		</collision>
 	</npc>
-	<npc id="30483" level="70" type="L2Teleporter" name="Mozella" title="Gatekeeper">
+	<npc id="30483" level="70" type="L2Npc" name="Mozella" title="Gatekeeper">
 		<!-- Confirmed CT2.5 -->
 		<parameters>
 			<param name="MoveAroundSocial" value="0" />
 			<param name="MoveAroundSocial1" value="90" />
-			<param name="higher_lv" value="56" />
-			<param name="PosX1" value="17776" />
-			<param name="PosY1" value="113968" />
-			<param name="PosZ1" value="-11671" />
-			<param name="PosX2" value="17680" />
-			<param name="PosY2" value="113968" />
-			<param name="PosZ2" value="-11671" />
 		</parameters>
 		<race>HUMAN</race>
 		<sex>FEMALE</sex>