diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 6b8dd15bdd4e42197fad68f7833864bc1f614b90..74bcb3d93454427666321a1e939f7103b575bb50 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -55,6 +55,7 @@ ai/group_template/FairyTrees.java ai/group_template/FeedableBeasts.java ai/group_template/GiantScouts.java ai/group_template/Monastery.java +ai/group_template/NonLethalableNpcs.java ai/group_template/PavelArchaic.java ai/group_template/PlainsOfLizardman.java ai/group_template/PolymorphingAngel.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/NonLethalableNpcs.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/NonLethalableNpcs.java new file mode 100644 index 0000000000000000000000000000000000000000..85cf96009deaa51f85660813b56e313b877c4f22 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/NonLethalableNpcs.java @@ -0,0 +1,63 @@ +/* + * 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 <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; +import com.l2jserver.gameserver.util.Util; + +/** + * @author UnAfraid + */ +public class NonLethalableNpcs extends AbstractNpcAI +{ + private static final int[] NPCS = new int[] + { + 35062, // Headquarters + }; + + /** + * @param name + * @param descr + */ + public NonLethalableNpcs(String name, String descr) + { + super(name, descr); + addSpawnId(NPCS); + + for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable()) + { + if (Util.contains(NPCS, spawn.getNpcid())) + { + onSpawn(spawn.getLastSpawn()); + } + } + } + + @Override + public String onSpawn(L2Npc npc) + { + npc.setLethalable(false); + return super.onSpawn(npc); + } + + public static void main(String[] args) + { + new NonLethalableNpcs(NonLethalableNpcs.class.getSimpleName(), "ai/group_template"); + } +}