From 327b9b4d2723ecb7af4ac364a7915e29478bfe4b Mon Sep 17 00:00:00 2001 From: St3eT <St3eT@users.noreply.github.com> Date: Sun, 4 May 2014 20:14:59 +0000 Subject: [PATCH] BETA: Reworked Non-talking NPCs. * Reviewed by: Zoey76, Adry_85, !UnAfraid, Nos --- L2J_DataPack_BETA/dist/game/data/scripts.cfg | 1 + .../ai/group_template/NonTalkingNpcs.java | 83 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/NonTalkingNpcs.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 134bcfa19a..4f1fd895ae 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -106,6 +106,7 @@ ai/group_template/LairOfAntharas.java ai/group_template/MithrilMines.java ai/group_template/MonasteryOfSilence.java ai/group_template/NonLethalableNpcs.java +ai/group_template/NonTalkingNpcs.java ai/group_template/PavelArchaic.java ai/group_template/PlainsOfDion.java ai/group_template/PlainsOfLizardman.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/NonTalkingNpcs.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/NonTalkingNpcs.java new file mode 100644 index 0000000000..60743b3a61 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/NonTalkingNpcs.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2004-2014 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.group_template; + +import ai.npc.AbstractNpcAI; + +import com.l2jserver.gameserver.datatables.SpawnTable; +import com.l2jserver.gameserver.model.L2Spawn; +import com.l2jserver.gameserver.model.actor.L2Npc; + +/** + * AI for handle Non-Talking NPCs. + * @author St3eT + */ +public final class NonTalkingNpcs extends AbstractNpcAI +{ + // @formatter:off + private static final int[] NONTALKINGNPCS = + { + 18684, 18685, 18686, // Red Star Stone + 18687, 18688, 18689, // Blue Star Stone + 18690, 18691, 18692, // Green Star Stone + 18848, 18849, 18926, // Jinia Guild + 18927, // Fire + 18933, // Fire Feed + 31202, 31203, 31204, 31205, 31206, 31207, 31208, 31209, 31266, 31593, 31758, 31955, // Town pets + 31557, // Mercenary Sentry + 31606, // Alice de Catrina + 31671, 31672, 31673, 31674, // Patrol + 32026, // Hestui Guard + 32030, // Garden Sculpture + 32031, // Ice Fairy Sculpture + 32032, // Strange Machine + 32306, // Native's Corpse + 32619, 32620, 32621, // NPC's without name + 32715, 32716, 32717, // Lilith's group + 32718, 32719, 32720, 32721, // Anakim's group + 18839, // Wild Maguen + }; + // @formatter:on + + public NonTalkingNpcs() + { + super(NonTalkingNpcs.class.getSimpleName(), "ai/group_template"); + addSpawnId(NONTALKINGNPCS); + + for (int npcId : NONTALKINGNPCS) + { + for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(npcId)) + { + onSpawn(spawn.getLastSpawn()); + } + } + } + + @Override + public String onSpawn(L2Npc npc) + { + npc.setTalking(false); + return super.onSpawn(npc); + } + + public static void main(String[] args) + { + new NonTalkingNpcs(); + } +} \ No newline at end of file -- GitLab