From 4b57a42add86def4689806dfe4d9a5621919ee8a Mon Sep 17 00:00:00 2001 From: St3eT <St3eT@users.noreply.github.com> Date: Fri, 14 Feb 2014 21:36:07 +0000 Subject: [PATCH] BETA: Updated AIs: * '''!ElrokiTeleporters''' AI. * Reviewed by: Adry_85, malyelfik * '''!CrumaTower''' AI. * Reviewed by: Adry_85, malyelfik --- .../CrumaTower/{30483-1.htm => 30483-1.html} | 0 .../ai/npc/Teleports/CrumaTower/30483.html} | 4 +- .../npc/Teleports/CrumaTower/CrumaTower.java | 30 +++++++------ .../Teleports/ElrokiTeleporters/32111-no.htm | 3 -- .../Teleports/ElrokiTeleporters/32111-no.html | 3 ++ .../Teleports/ElrokiTeleporters/32111.html} | 0 .../Teleports/ElrokiTeleporters/32112-no.html | 3 ++ .../Teleports/ElrokiTeleporters/32112.html} | 4 +- .../ElrokiTeleporters/ElrokiTeleporters.java | 43 ++++++++----------- .../dist/game/data/stats/npcs/30400-30500.xml | 9 +--- 10 files changed, 44 insertions(+), 55 deletions(-) rename L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/{30483-1.htm => 30483-1.html} (100%) rename L2J_DataPack_BETA/dist/game/data/{html/teleporter/30483.htm => scripts/ai/npc/Teleports/CrumaTower/30483.html} (83%) delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.htm create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.html rename L2J_DataPack_BETA/dist/game/data/{html/default/32111.htm => scripts/ai/npc/Teleports/ElrokiTeleporters/32111.html} (100%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32112-no.html rename L2J_DataPack_BETA/dist/game/data/{html/default/32112.htm => scripts/ai/npc/Teleports/ElrokiTeleporters/32112.html} (85%) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483-1.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483-1.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483-1.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483-1.html diff --git a/L2J_DataPack_BETA/dist/game/data/html/teleporter/30483.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483.html similarity index 83% rename from L2J_DataPack_BETA/dist/game/data/html/teleporter/30483.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/30483.html index 24c0aa223c..3fa2544759 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/teleporter/30483.htm +++ b/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> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/CrumaTower.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/CrumaTower.java index f461f66992..116b8b7455 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/CrumaTower/CrumaTower.java +++ b/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(); } -} +} \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.htm deleted file mode 100644 index b1cb28556b..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.htm +++ /dev/null @@ -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> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111-no.html new file mode 100644 index 0000000000..b44e54fe41 --- /dev/null +++ b/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> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/default/32111.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/html/default/32111.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32111.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32112-no.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32112-no.html new file mode 100644 index 0000000000..94ce39a48d --- /dev/null +++ b/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> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/default/32112.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32112.html similarity index 85% rename from L2J_DataPack_BETA/dist/game/data/html/default/32112.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/32112.html index 85d1b300ac..828ed06a98 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/default/32112.htm +++ b/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> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/ElrokiTeleporters.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/ElrokiTeleporters.java index df45d06c39..05e3a8cb35 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ElrokiTeleporters/ElrokiTeleporters.java +++ b/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(); } -} +} \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/30400-30500.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/30400-30500.xml index df26bdbddf..067a9e8334 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/30400-30500.xml +++ b/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> -- GitLab