From 2a548608621d096a08a1ff11ab2aacb52be25ffc Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 8 Jan 2023 22:14:34 +0000 Subject: [PATCH] Addition of DragonValleyDayNightMonsters AI. Contributed by CostyKiller. --- .../DragonValleyDayNightMonsters.java | 62 +++++++++++++++++++ .../DragonValleyDayNightMonsters.java | 62 +++++++++++++++++++ .../DragonValleyDayNightMonsters.java | 62 +++++++++++++++++++ 3 files changed, 186 insertions(+) create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java create mode 100644 L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java new file mode 100644 index 0000000000..8b3086e899 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java @@ -0,0 +1,62 @@ +/* + * 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 org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +import ai.AbstractNpcAI; + +/** + * Dragon Valley Area Mobs AI. + * @info When you kill certain monsters within the zone at a certain time, special monsters will appear. The type of the monster depends on the time of day. Daytime: Behemoth Dragon Nighttime: Soul Hunter + * @author CostyKiller + */ +public final class DragonValleyDayNightMonsters extends AbstractNpcAI +{ + // Trigger Mobs + private static final int DRAGON_PELTAST = 24617; // Dragon Peltast + private static final int DRAGON_OFFICER = 24618; // Dragon Officer + // Special Mobs + private static final int BEHEMOTH_DRAGON = 24619; // Behemoth Dragon + private static final int SOUL_HUNTER = 24620; // Soul Hunter + + // Misc + private static final int MOB_SPAWN_CHANCE = 1; // 1% chance to spawn + + private DragonValleyDayNightMonsters() + { + super(); + addKillId(DRAGON_PELTAST, DRAGON_OFFICER); + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + if (getRandom(100) < MOB_SPAWN_CHANCE) + { + addSpawn(GameTimeTaskManager.getInstance().isNight() ? SOUL_HUNTER : BEHEMOTH_DRAGON, npc, true, 0, true); + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new DragonValleyDayNightMonsters(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java new file mode 100644 index 0000000000..8b3086e899 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java @@ -0,0 +1,62 @@ +/* + * 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 org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +import ai.AbstractNpcAI; + +/** + * Dragon Valley Area Mobs AI. + * @info When you kill certain monsters within the zone at a certain time, special monsters will appear. The type of the monster depends on the time of day. Daytime: Behemoth Dragon Nighttime: Soul Hunter + * @author CostyKiller + */ +public final class DragonValleyDayNightMonsters extends AbstractNpcAI +{ + // Trigger Mobs + private static final int DRAGON_PELTAST = 24617; // Dragon Peltast + private static final int DRAGON_OFFICER = 24618; // Dragon Officer + // Special Mobs + private static final int BEHEMOTH_DRAGON = 24619; // Behemoth Dragon + private static final int SOUL_HUNTER = 24620; // Soul Hunter + + // Misc + private static final int MOB_SPAWN_CHANCE = 1; // 1% chance to spawn + + private DragonValleyDayNightMonsters() + { + super(); + addKillId(DRAGON_PELTAST, DRAGON_OFFICER); + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + if (getRandom(100) < MOB_SPAWN_CHANCE) + { + addSpawn(GameTimeTaskManager.getInstance().isNight() ? SOUL_HUNTER : BEHEMOTH_DRAGON, npc, true, 0, true); + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new DragonValleyDayNightMonsters(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java b/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java new file mode 100644 index 0000000000..8b3086e899 --- /dev/null +++ b/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/ai/areas/DragonValley/DragonValleyDayNightMonsters.java @@ -0,0 +1,62 @@ +/* + * 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 org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager; + +import ai.AbstractNpcAI; + +/** + * Dragon Valley Area Mobs AI. + * @info When you kill certain monsters within the zone at a certain time, special monsters will appear. The type of the monster depends on the time of day. Daytime: Behemoth Dragon Nighttime: Soul Hunter + * @author CostyKiller + */ +public final class DragonValleyDayNightMonsters extends AbstractNpcAI +{ + // Trigger Mobs + private static final int DRAGON_PELTAST = 24617; // Dragon Peltast + private static final int DRAGON_OFFICER = 24618; // Dragon Officer + // Special Mobs + private static final int BEHEMOTH_DRAGON = 24619; // Behemoth Dragon + private static final int SOUL_HUNTER = 24620; // Soul Hunter + + // Misc + private static final int MOB_SPAWN_CHANCE = 1; // 1% chance to spawn + + private DragonValleyDayNightMonsters() + { + super(); + addKillId(DRAGON_PELTAST, DRAGON_OFFICER); + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + if (getRandom(100) < MOB_SPAWN_CHANCE) + { + addSpawn(GameTimeTaskManager.getInstance().isNight() ? SOUL_HUNTER : BEHEMOTH_DRAGON, npc, true, 0, true); + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new DragonValleyDayNightMonsters(); + } +} \ No newline at end of file