From 91cb38a7d17e3ab24f6bf186f6bf3b184c84d974 Mon Sep 17 00:00:00 2001 From: Adry85 <adrya85@hotmail.it> Date: Fri, 22 Sep 2017 10:52:56 +0200 Subject: [PATCH] Added Ghost Chamberlain of Elmoreden AI. Reported by: ShinichiYao --- dist/game/data/html/SepulcherNpc/31919.htm | 8 -- dist/game/data/html/SepulcherNpc/31920.htm | 8 -- dist/game/data/scripts.cfg | 1 + .../GhostChamberlainOfElmoreden/31919-01.html | 4 + .../GhostChamberlainOfElmoreden/31919.html | 8 ++ .../GhostChamberlainOfElmoreden/31920-01.html | 4 + .../GhostChamberlainOfElmoreden/31920.html | 8 ++ .../GhostChamberlainOfElmoreden.java | 94 +++++++++++++++++++ 8 files changed, 119 insertions(+), 16 deletions(-) delete mode 100644 dist/game/data/html/SepulcherNpc/31919.htm delete mode 100644 dist/game/data/html/SepulcherNpc/31920.htm create mode 100644 dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31919-01.html create mode 100644 dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31919.html create mode 100644 dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31920-01.html create mode 100644 dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31920.html create mode 100644 dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/GhostChamberlainOfElmoreden.java diff --git a/dist/game/data/html/SepulcherNpc/31919.htm b/dist/game/data/html/SepulcherNpc/31919.htm deleted file mode 100644 index 5b35d4b09d..0000000000 --- a/dist/game/data/html/SepulcherNpc/31919.htm +++ /dev/null @@ -1,8 +0,0 @@ -<html><body>Ghost Chamberlain of Elmoreden:<br> -Greetings! I am a chamberlain of the ancient Elmoreden empire! When I was a mortal being I worked at the cemetery of the Elmoreden empire. Now I'm here, serving those who are traveling to the cemetery.<br> -My assistant also assists such travelers. He can be found near the entrance of Argos' Wall.<br> -Do you plan to visit the Elmoreden Cemetery?<br> -<a action="bypass -h Quest 620_FourGoblets 15">"I want to visit the 4th sepulcher."</a><br> -<a action="bypass -h Quest 620_FourGoblets 16">"I want to visit the entrance to the Elmoreden Cemetery."</a><br> -<a action="bypass -h npc_%objectId%_Quest">Quest</a> -</body></html> \ No newline at end of file diff --git a/dist/game/data/html/SepulcherNpc/31920.htm b/dist/game/data/html/SepulcherNpc/31920.htm deleted file mode 100644 index e59f187108..0000000000 --- a/dist/game/data/html/SepulcherNpc/31920.htm +++ /dev/null @@ -1,8 +0,0 @@ -<html><body>Ghost Chamberlain of Elmoreden:<br> -Woooo! I'm a ghost page of the ancient Elmoreden Empire! I worked in the cemetery when I was a mortal being. Now I'm here to help travelers going to the Elmoreden Cemetery.<br> -My boss is in the Pilgrim's Necropolis. He also helps people visit the cemetery.<br> -Would you like to visit the cemetery of the Elmoreden empire?<br> -<a action="bypass -h Quest 620_FourGoblets 15">"I want to visit the 4th sepulcher."</a><br> -<a action="bypass -h Quest 620_FourGoblets 16">"I want to visit the entrance to the Elmoreden Cemetery."</a><br> -<a action="bypass -h npc_%objectId%_Quest">Quest</a> -</body></html> \ No newline at end of file diff --git a/dist/game/data/scripts.cfg b/dist/game/data/scripts.cfg index 08a553beb8..65fb672989 100644 --- a/dist/game/data/scripts.cfg +++ b/dist/game/data/scripts.cfg @@ -65,6 +65,7 @@ ai/npc/Teleports/CrumaTower/CrumaTower.java ai/npc/Teleports/DelusionTeleport/DelusionTeleport.java ai/npc/Teleports/ElrokiTeleporters/ElrokiTeleporters.java ai/npc/Teleports/GatekeeperSpirit/GatekeeperSpirit.java +ai/npc/Teleports/GhostChamberlainOfElmoreden/GhostChamberlainOfElmoreden.java ai/npc/Teleports/GrandBossTeleporters/GrandBossTeleporters.java ai/npc/Teleports/HuntingGroundsTeleport/HuntingGroundsTeleport.java ai/npc/Teleports/Klemis/Klemis.java diff --git a/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31919-01.html b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31919-01.html new file mode 100644 index 0000000000..982cd29f43 --- /dev/null +++ b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31919-01.html @@ -0,0 +1,4 @@ +<html><body>Ghost Chamberlain of Elmoreden:<br> +I teleport travelers to the Imperial Tomb. Only those who have visited the Four Sepulchers in the past may go there.<br> +To teleport, the traveler must carry a used pass for the sepulcher. I can also teleport those who possess any document that proves that they are directly connected to the Imperial Tomb. +</body></html> \ No newline at end of file diff --git a/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31919.html b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31919.html new file mode 100644 index 0000000000..21fc253f9d --- /dev/null +++ b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31919.html @@ -0,0 +1,8 @@ +<html><body>Elmoreden Chamberlain's Ghost:<br> +Greetings! I am a chamberlain of the ancient Elmoreden empire! When I was a mortal being, I worked at the cemetery of the Elmoreden empire. Now I'm here, serving those who are traveling to the cemetery.<br> +My assistant also assists such travelers. He can be found near the entrance of Argos' Wall<br> +Do you plan to visit the Imperial Tomb?<br> +<a action="bypass -h Quest GhostChamberlainOfElmoreden FOUR_SEPULCHERS">"I want to visit the Four Sepulchers."</a><br> +<a action="bypass -h Quest GhostChamberlainOfElmoreden IMPERIAL_TOMB">"I want to visit the entrance to the Imperial Tomb."</a><br> +<a action="bypass -h npc_%objectId%_Quest">Quest</a> +</body></html> \ No newline at end of file diff --git a/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31920-01.html b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31920-01.html new file mode 100644 index 0000000000..5f8c08a172 --- /dev/null +++ b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31920-01.html @@ -0,0 +1,4 @@ +<html><body>Ghost Page of Elmoreden:<br> +I teleport travelers to the Imperial Tomb. Only those who have visited the Four Sepulchers in the past may go there.<br> +To teleport, the traveler must carry a used pass for the sepulcher. I can also teleport those who possess any document that proves that they are directly connected to the Imperial Tomb. +</body></html> \ No newline at end of file diff --git a/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31920.html b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31920.html new file mode 100644 index 0000000000..a5b6571445 --- /dev/null +++ b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/31920.html @@ -0,0 +1,8 @@ +<html><body>Elmoreden Servant's Ghost:<br> +Woooo! I'm a ghost servant of the ancient Elmoreden Empire! I worked in the cemetery when I was a mortal being. Now I'm here to help travelers going to the Imperial Tomb.<br> +My boss is in the Pilgrim's Temple. He also helps people visit the cemetery.<br> +Would you like to visit the Imperial Tomb of Elmoreden?<br> +<a action="bypass -h Quest GhostChamberlainOfElmoreden FOUR_SEPULCHERS">"I want to visit the Four Sepulchers."</a><br> +<a action="bypass -h Quest GhostChamberlainOfElmoreden IMPERIAL_TOMB">"I want to visit the entrance to the Imperial Tomb."</a><br> +<a action="bypass -h npc_%objectId%_Quest">Quest</a> +</body></html> \ No newline at end of file diff --git a/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/GhostChamberlainOfElmoreden.java b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/GhostChamberlainOfElmoreden.java new file mode 100644 index 0000000000..1c55de90e5 --- /dev/null +++ b/dist/game/data/scripts/ai/npc/Teleports/GhostChamberlainOfElmoreden/GhostChamberlainOfElmoreden.java @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2004-2017 L2J DataPack + * + * This file is part of L2J DataPack. + * + * L2J DataPack is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * L2J DataPack is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package ai.npc.Teleports.GhostChamberlainOfElmoreden; + +import com.l2jserver.gameserver.model.Location; +import com.l2jserver.gameserver.model.actor.L2Npc; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; + +import ai.npc.AbstractNpcAI; + +/** + * Ghost Chamberlain of Elmoreden AI. + * @author Adry_85 + * @since 2.6.0.0 + */ +public class GhostChamberlainOfElmoreden extends AbstractNpcAI +{ + // NPCs + private static final int GHOST_CHAMBERLAIN_OF_ELMOREDEN_1 = 31919; + private static final int GHOST_CHAMBERLAIN_OF_ELMOREDEN_2 = 31920; + // Items + private static final int USED_GRAVE_PASS = 7261; + private static final int ANTIQUE_BROOCH = 7262; + // Locations + private static final Location FOUR_SEPULCHERS_LOC = new Location(178127, -84435, -7215); + private static final Location IMPERIAL_TOMB_LOC = new Location(186699, -75915, -2826); + + private GhostChamberlainOfElmoreden() + { + super(GhostChamberlainOfElmoreden.class.getSimpleName(), "ai/npc/Teleports"); + addStartNpc(GHOST_CHAMBERLAIN_OF_ELMOREDEN_1, GHOST_CHAMBERLAIN_OF_ELMOREDEN_2); + addTalkId(GHOST_CHAMBERLAIN_OF_ELMOREDEN_1, GHOST_CHAMBERLAIN_OF_ELMOREDEN_2); + addFirstTalkId(GHOST_CHAMBERLAIN_OF_ELMOREDEN_1, GHOST_CHAMBERLAIN_OF_ELMOREDEN_2); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (event.equals("FOUR_SEPULCHERS")) + { + if (hasQuestItems(player, USED_GRAVE_PASS)) + { + takeItems(player, USED_GRAVE_PASS, 1); + player.teleToLocation(FOUR_SEPULCHERS_LOC); + } + else if (hasQuestItems(player, ANTIQUE_BROOCH)) + { + player.teleToLocation(FOUR_SEPULCHERS_LOC); + } + else + { + return npc.getId() + "-01.html"; + } + } + else if (event.equals("IMPERIAL_TOMB")) + { + if (hasQuestItems(player, USED_GRAVE_PASS)) + { + takeItems(player, USED_GRAVE_PASS, 1); + player.teleToLocation(IMPERIAL_TOMB_LOC); + } + else if (hasQuestItems(player, ANTIQUE_BROOCH)) + { + player.teleToLocation(IMPERIAL_TOMB_LOC); + } + else + { + return npc.getId() + "-01.html"; + } + } + return super.onAdvEvent(event, npc, player); + } + + public static void main(String[] args) + { + new GhostChamberlainOfElmoreden(); + } +} \ No newline at end of file -- GitLab