diff --git a/L2J_DataPack_BETA/dist/game/data/html/teleporter/31111.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/31111-no.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/html/teleporter/31111.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/31111-no.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/dawn.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/31111.html similarity index 80% rename from L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/dawn.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/31111.html index bffdf2bf08ebffda2ad1ebc00747061864744b67..2d134fcd4995ad2e46ea842c298bfa0984ee1684 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/dawn.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/31111.html @@ -1,5 +1,5 @@ <html><body>Gatekeeper Spirit:<br> Behold, the sphere speaks...<br> You have entered the Forbidden Sanctum, resting place of <font color="LEVEL">Lilith</font> and <font color="LEVEL">Anakim</font>. I guard the path to the Sanctum. The Seal of Avarice may only be breached when the eye is open.<br> -<a action="bypass -h npc_%objectId%_goto 451">Teleport</a> +<a action="bypass -h Quest GatekeeperSpirit TeleportIn">Teleport.</a> </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/teleporter/31112.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/31112.html similarity index 60% rename from L2J_DataPack_BETA/dist/game/data/html/teleporter/31112.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/31112.html index 7c2660a0a04b77e1546591ad4b7d786547c49a31..7b390991574e6a7158e8c82e28908893ce7c80d2 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/teleporter/31112.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/31112.html @@ -1,5 +1,5 @@ <html><body>Gatekeeper Spirit:<br> Behold, the sphere speaks...<br> You must leave this place!<br> -<a action="bypass -h npc_%objectId%_goto 452">Teleport</a> +<a action="bypass -h Quest GatekeeperSpirit TeleportOut">Teleport.</a> </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/GatekeeperSpirit.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/GatekeeperSpirit.java index 1f98d7103b9dc4cc18ef33da9953db1a5f9cb7c3..fe8052cd8c94c11e7254f01825c0a58ea94dc1cc 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/GatekeeperSpirit.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/GatekeeperSpirit.java @@ -27,7 +27,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; /** * Gatekeeper Spirit AI. - * @author Charus, lion + * @author Zoey76 */ public class GatekeeperSpirit extends AbstractNpcAI { @@ -39,46 +39,87 @@ public class GatekeeperSpirit extends AbstractNpcAI // Exit gatekeeper spawn locations private static final Location SPAWN_LILITH_GATEKEEPER = new Location(184410, -10111, -5488); private static final Location SPAWN_ANAKIM_GATEKEEPER = new Location(184410, -13102, -5488); + // Teleport + private static final Location TELEPORT_DUSK = new Location(184464, -13104, -5504); + private static final Location TELEPORT_DAWN = new Location(184448, -10112, -5504); + private static final Location EXIT = new Location(182960, -11904, -4897); private GatekeeperSpirit() { super(GatekeeperSpirit.class.getSimpleName(), "ai/npc/Teleports"); addStartNpc(GATEKEEPER_SPIRIT_ENTER); addFirstTalkId(GATEKEEPER_SPIRIT_ENTER); + addTalkId(GATEKEEPER_SPIRIT_ENTER); addKillId(LILITH, ANAKIM); } @Override - public String onFirstTalk(L2Npc npc, L2PcInstance player) + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { - int playerCabal = SevenSigns.getInstance().getPlayerCabal(player.getObjectId()); - int sealOfAvariceOwner = SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_AVARICE); - int compWinner = SevenSigns.getInstance().getCabalHighestScore(); - - if ((playerCabal == sealOfAvariceOwner) && (playerCabal == compWinner) && (sealOfAvariceOwner != SevenSigns.CABAL_NULL)) + String htmltext = null; + switch (event) { - return (sealOfAvariceOwner == SevenSigns.CABAL_DUSK) ? "dusk.htm" : "dawn.htm"; + case "ANAKIM": + { + addSpawn(GATEKEEPER_SPIRIT_EXIT, SPAWN_ANAKIM_GATEKEEPER, false, 900000); + break; + } + case "LILITH": + { + addSpawn(GATEKEEPER_SPIRIT_EXIT, SPAWN_LILITH_GATEKEEPER, false, 900000); + break; + } + case "TeleportIn": + { + final int playerCabal = SevenSigns.getInstance().getPlayerCabal(player.getObjectId()); + final int sealOfAvariceOwner = SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_AVARICE); + final int compWinner = SevenSigns.getInstance().getCabalHighestScore(); + if (!SevenSigns.getInstance().isSealValidationPeriod()) + { + htmltext = "31111-no.html"; + } + else if ((compWinner == SevenSigns.CABAL_DUSK) && (playerCabal == SevenSigns.CABAL_DUSK) && (sealOfAvariceOwner == SevenSigns.CABAL_DUSK)) + { + player.teleToLocation(TELEPORT_DUSK, false); + } + else if ((compWinner == SevenSigns.CABAL_DAWN) && (playerCabal == SevenSigns.CABAL_DAWN) && (sealOfAvariceOwner == SevenSigns.CABAL_DAWN)) + { + player.teleToLocation(TELEPORT_DAWN, false); + } + else + { + htmltext = "31111-no.html"; + } + break; + } + case "TeleportOut": + { + player.teleToLocation(EXIT, true); + break; + } } - - npc.showChatWindow(player); - return super.onFirstTalk(npc, player); + return htmltext; } @Override public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { - startQuestTimer(Integer.toString(npc.getId()), 10000, npc, killer); + switch (npc.getId()) + { + case ANAKIM: + { + startQuestTimer("ANAKIM", 10000, npc, killer); + break; + } + case LILITH: + { + startQuestTimer("LILITH", 10000, npc, killer); + break; + } + } return super.onKill(npc, killer, isSummon); } - @Override - public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) - { - Location loc = (event.equals(Integer.toString(LILITH)) ? SPAWN_LILITH_GATEKEEPER : SPAWN_ANAKIM_GATEKEEPER); - addSpawn(GATEKEEPER_SPIRIT_EXIT, loc, false, 900000); - return super.onAdvEvent(event, npc, player); - } - public static void main(String[] args) { new GatekeeperSpirit(); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/dusk.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/dusk.htm deleted file mode 100644 index 3435a86f780db7c9b817403b0b3ce46b2ee18fcf..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/GatekeeperSpirit/dusk.htm +++ /dev/null @@ -1,5 +0,0 @@ -<html><body>Gatekeeper Spirit:<br> -Behold, the sphere speaks...<br> -You have entered the Forbidden Sanctum, resting place of <font color="LEVEL">Lilith</font> and <font color="LEVEL">Anakim</font>. I guard the path to the Sanctum. The Seal of Avarice may only be breached when the eye is open.<br> -<a action="bypass -h npc_%objectId%_goto 450">Teleport</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/sql/game/teleport.sql b/L2J_DataPack_BETA/dist/sql/game/teleport.sql index c11cbc1e1eb2307e749ba19f25e7a708e5906679..7dc2cb77aa7c60a37b666ec0fb1f828d8a4b9384 100644 --- a/L2J_DataPack_BETA/dist/sql/game/teleport.sql +++ b/L2J_DataPack_BETA/dist/sql/game/teleport.sql @@ -234,8 +234,6 @@ INSERT INTO `teleport` VALUES ('Aden(hall) -> out)',415,147723,7916,-475,0,0,57), ('Aden(hall) -> in)',416,148580,4578,-408,0,0,57), ('Aden(hall) -> outofcastle)',417,147582,8753,-496,0,0,57), -('Disciples Necropolis -> Anakim (DUSK)',450,185065,-12612,-5104,0,0,57), -('Disciples Necropolis -> Lilith (DAWN)',451,185060,-9622,-5104,0,0,57), ('Anakim/Lilith -> Disciples Necropolis',452,183225,-11911,-4897,0,0,57), ('TI -> DE Village',1005,9709,15566,-4568,24000,0,57), ('TI -> Dwarven Village',1006,115120,-178224,-880,46000,0,57),