From c747a95354116d86f96479682606679ba90e9809 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 6 Mar 2018 07:07:40 +0000 Subject: [PATCH] Dragon Valley monster AIs. Contributed by quangnguyen. --- .../ai/areas/DragonValley/CaveMaiden.java | 58 +++++++++++++++++++ .../ai/areas/LairOfAntharas/Pytan.java | 57 ++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/DragonValley/CaveMaiden.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/LairOfAntharas/Pytan.java diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/DragonValley/CaveMaiden.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/DragonValley/CaveMaiden.java new file mode 100644 index 0000000000..d0b6f2c3f3 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/DragonValley/CaveMaiden.java @@ -0,0 +1,58 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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.DragonValley; + +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.L2Playable; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; + +import ai.AbstractNpcAI; + +/** + * Cave Maiden, Keeper AI. + * @author proGenitor + */ +public final class CaveMaiden extends AbstractNpcAI +{ + // NPCs + private static final int CAVEMAIDEN = 20134; + private static final int CAVEKEEPER = 20246; + private static final int BANSHEE = 20412; + + private CaveMaiden() + { + addKillId(CAVEMAIDEN, CAVEKEEPER); + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + if (getRandom(100) < 20) + { + final L2Npc spawnBanshee = addSpawn(BANSHEE, npc, false, 300000); + final L2Playable attacker = isSummon ? killer.getServitors().values().stream().findFirst().orElse(killer.getPet()) : killer; + addAttackPlayerDesire(spawnBanshee, attacker); + npc.deleteMe(); + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new CaveMaiden(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/LairOfAntharas/Pytan.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/LairOfAntharas/Pytan.java new file mode 100644 index 0000000000..c9608824b7 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/LairOfAntharas/Pytan.java @@ -0,0 +1,57 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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.LairOfAntharas; + +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.L2Playable; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; + +import ai.AbstractNpcAI; + +/** + * Pytan, Knorkiks AI. + * @author Quangnguyen + */ +public final class Pytan extends AbstractNpcAI +{ + // NPCs + private static final int PYTAN = 20761; + private static final int KNORIKS = 20405; + + private Pytan() + { + addKillId(PYTAN); + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + if (getRandom(100) < 5) + { + final L2Npc spawnBanshee = addSpawn(KNORIKS, npc, false, 300000); + final L2Playable attacker = isSummon ? killer.getServitors().values().stream().findFirst().orElse(killer.getPet()) : killer; + addAttackPlayerDesire(spawnBanshee, attacker); + npc.deleteMe(); + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new Pytan(); + } +} \ No newline at end of file