diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DragonValley/DragonValleySummoners.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DragonValley/DragonValleySummoners.java new file mode 100644 index 0000000000..3307852b1d --- /dev/null +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DragonValley/DragonValleySummoners.java @@ -0,0 +1,86 @@ +/* + * 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.enums.ChatType; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.network.NpcStringId; + +import ai.AbstractNpcAI; + +/** + * Dragon Valley summoner NPC AI + * @author Gigi, Mobius + */ +public final class DragonValleySummoners extends AbstractNpcAI +{ + // NPCs + private static final int BLOODY_GRAVE_WARRIOR = 23441; + private static final int DARK_GRAVE_WARRIOR = 23442; + private static final int CAVE_SERVANT_ARCHER = 23436; + private static final int CAVE_SERVANT_WARRIOR = 23437; + // Config + private static final int CHANCE = 15; + + private DragonValleySummoners() + { + addKillId(BLOODY_GRAVE_WARRIOR, DARK_GRAVE_WARRIOR, CAVE_SERVANT_ARCHER, CAVE_SERVANT_WARRIOR); + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + if (getRandom(100) < CHANCE) + { + switch (npc.getId()) + { + case BLOODY_GRAVE_WARRIOR: + { + final L2Npc summon1 = addSpawn(BLOODY_GRAVE_WARRIOR, npc.getX() + 40, npc.getY() + 40, npc.getZ(), npc.getHeading(), false, 120000, true); + addAttackPlayerDesire(summon1, killer); + break; + } + case DARK_GRAVE_WARRIOR: + { + final L2Npc summon2 = addSpawn(DARK_GRAVE_WARRIOR, npc.getX() + 40, npc.getY() + 40, npc.getZ(), npc.getHeading(), false, 120000, true); + addAttackPlayerDesire(summon2, killer); + break; + } + case CAVE_SERVANT_ARCHER: + { + final L2Npc summon3 = addSpawn(CAVE_SERVANT_ARCHER, npc.getX() + 40, npc.getY() + 40, npc.getZ(), npc.getHeading(), false, 120000, true); + addAttackPlayerDesire(summon3, killer); + break; + } + case CAVE_SERVANT_WARRIOR: + { + final L2Npc summon4 = addSpawn(CAVE_SERVANT_WARRIOR, npc.getX() + 40, npc.getY() + 40, npc.getZ(), npc.getHeading(), false, 120000, true); + addAttackPlayerDesire(summon4, killer); + break; + } + } + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_DEAD_ARE_CALLING_AND_I_ANSWER); + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new DragonValleySummoners(); + } +} \ No newline at end of file