From 25fa038127b03e8a4a4d59f62916c5670448a0f3 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 4 Jan 2017 13:22:09 +0000 Subject: [PATCH] Apherus Lookout AI. Contributed by gigilo1968. --- .../GardenOfGenesis/ApherusLookout/19001.html | 4 + .../ApherusLookout/ApherusLookout.java | 80 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/ApherusLookout/19001.html create mode 100644 L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/ApherusLookout/ApherusLookout.java diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/ApherusLookout/19001.html b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/ApherusLookout/19001.html new file mode 100644 index 0000000000..5a7f7f5997 --- /dev/null +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/ApherusLookout/19001.html @@ -0,0 +1,4 @@ +Apherus Package
+If you are lucky in this bag can be found the Apherus Garden Door Key.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/ApherusLookout/ApherusLookout.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/ApherusLookout/ApherusLookout.java new file mode 100644 index 0000000000..3e715155d6 --- /dev/null +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/GardenOfGenesis/ApherusLookout/ApherusLookout.java @@ -0,0 +1,80 @@ +/* + * This program 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. + * + * This program 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 . + */ + +package ai.areas.GardenOfGenesis.ApherusLookout; + +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.network.NpcStringId; +import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import ai.AbstractNpcAI; + +/** + * @author Gigi + */ +public class ApherusLookout extends AbstractNpcAI +{ + private static final int APHERUS_LOOKOUT = 22964; + private static final int APHERUS_PACKAGE = 19001; + private static final int APHERUS_PACKAGE1 = 19002; + private static final int APHERUS_PACKAGE2 = 19003; + private static final int APERUS_KEY = 17373; + + public ApherusLookout() + { + addKillId(APHERUS_LOOKOUT); + addFirstTalkId(APHERUS_PACKAGE, APHERUS_PACKAGE1, APHERUS_PACKAGE2); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + String htmltext = null; + if (event.equals("open_bag")) + { + if (getRandom(100) < 7) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.MOVED_TO_APHERUS_DIMENSION, ExShowScreenMessage.TOP_CENTER, 3000, true)); + giveItems(player, APERUS_KEY, 1); + } + npc.deleteMe(); + } + return htmltext; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) + { + L2Npc aPackage = addSpawn(APHERUS_PACKAGE, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false); + aPackage.setIsImmobilized(true); + L2Npc bPackage = addSpawn(APHERUS_PACKAGE1, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false); + bPackage.setIsImmobilized(true); + L2Npc cPackage = addSpawn(APHERUS_PACKAGE2, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false); + cPackage.setIsImmobilized(true); + return super.onKill(npc, killer, isPet); + } + + @Override + public String onFirstTalk(L2Npc npc, L2PcInstance player) + { + return "19001.html"; + } + + public static void main(String[] args) + { + new ApherusLookout(); + } +} \ No newline at end of file