From e3f4946acc6413928ac2156003447f0fb2cdf298 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 20 Nov 2016 11:37:45 +0000 Subject: [PATCH] FlowerBud AI. Contributed by gigilo1968. --- .../ai/areas/EnchantedValley/FlowerBud.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/EnchantedValley/FlowerBud.java diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/EnchantedValley/FlowerBud.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/EnchantedValley/FlowerBud.java new file mode 100644 index 0000000000..a841690390 --- /dev/null +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/EnchantedValley/FlowerBud.java @@ -0,0 +1,74 @@ +/* + * 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.EnchantedValley; + +import java.util.ArrayList; +import java.util.List; + +import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; + +import ai.AbstractNpcAI; + +/** + * AI from Flower Bud in Enchanted Valley, after kill random spawn
+ * [Nymph Rose (Elegant), Nymph Lily (Elegant), Nymph Tulip (Elegant), Nymph Cosmos (Elegant)] + * @author Gigi + */ +public final class FlowerBud extends AbstractNpcAI +{ + // NPCs + private static final int FLOWER_BUD = 19600; + private static final List FLOWER_SPAWNS = new ArrayList<>(); + static + { + FLOWER_SPAWNS.add(23582); + FLOWER_SPAWNS.add(23583); + FLOWER_SPAWNS.add(23584); + FLOWER_SPAWNS.add(23585); + } + + private FlowerBud() + { + addKillId(FLOWER_BUD); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (event.equals("spawn") && npc.isDead()) + { + final L2Npc elegant = addSpawn(FLOWER_SPAWNS.get(Rnd.get(FLOWER_SPAWNS.size())), npc, false, 120000, false); + addAttackPlayerDesire(elegant, player); + } + return event; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + + startQuestTimer("spawn", 3000, npc, killer); + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new FlowerBud(); + } +} \ No newline at end of file