diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java new file mode 100644 index 0000000000..952fce3102 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java @@ -0,0 +1,85 @@ +/* + * 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.ForestOfTheDead; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.events.EventType; +import com.l2jmobius.gameserver.model.events.ListenerRegisterType; +import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; +import com.l2jmobius.gameserver.model.events.annotations.RegisterType; +import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; + +import ai.AbstractNpcAI; + +/** + * @author Mobius + */ +public final class EilhalderVonHellmann extends AbstractNpcAI +{ + private static final int EILHALDER_VON_HELLMANN = 25328; + private static final Location SPAWN_LOCATION = new Location(59090, -42188, -3003); + private static L2Npc npcInstance; + + private EilhalderVonHellmann() + { + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (npc != null) + { + if (npc.isInCombat()) + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + else + { + npc.deleteMe(); + } + } + return super.onAdvEvent(event, npc, player); + } + + @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) + @RegisterType(ListenerRegisterType.GLOBAL) + public void onDayNightChange(OnDayNightChange event) + { + if (!event.isNight() && (npcInstance != null) && !npcInstance.isDead()) + { + if (!npcInstance.isInCombat()) + { + npcInstance.deleteMe(); + } + else + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + } + else if ((npcInstance == null) || npcInstance.isDead()) + { + npcInstance = addSpawn(EILHALDER_VON_HELLMANN, SPAWN_LOCATION); + } + } + + public static void main(String[] args) + { + new EilhalderVonHellmann(); + } +} diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java deleted file mode 100644 index e251eaa15e..0000000000 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.others.Spawns; - -import java.util.logging.Logger; - -import com.l2jmobius.gameserver.GameTimeController; -import com.l2jmobius.gameserver.instancemanager.DBSpawnManager; -import com.l2jmobius.gameserver.model.actor.L2Npc; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.events.EventType; -import com.l2jmobius.gameserver.model.events.ListenerRegisterType; -import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import com.l2jmobius.gameserver.model.events.annotations.RegisterType; -import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; -import com.l2jmobius.gameserver.model.spawns.SpawnGroup; -import com.l2jmobius.gameserver.model.spawns.SpawnTemplate; - -import ai.AbstractNpcAI; - -/** - * @author UnAfraid - */ -public final class EilhalderVonHellmann extends AbstractNpcAI -{ - private static final Logger LOGGER = Logger.getLogger(EilhalderVonHellmann.class.getName()); - private static final int EILHALDER_VON_HELLMANN = 25328; - private NpcSpawnTemplate _template; - - private EilhalderVonHellmann() - { - addSpawnId(EILHALDER_VON_HELLMANN); - } - - @Override - public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) - { - if (event.equals("delete") && (npc != null)) - { - npc.deleteMe(); - } - return super.onAdvEvent(event, npc, player); - } - - @Override - public String onSpawn(L2Npc npc) - { - // Spawn that comes from RaidBossSpawnManager - if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null)) - { - startQuestTimer("delete", 1000, npc, null); - } - return super.onSpawn(npc); - } - - @Override - public void onSpawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Spawning Night Raid Boss " + npc.getName()); - DBSpawnManager.getInstance().notifySpawnNightNpc(npc); - } - - @Override - public void onSpawnDespawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Despawning Night Raid Boss " + npc.getName()); - } - - @Override - public void onSpawnActivate(SpawnTemplate template) - { - OUT: for (SpawnGroup group : template.getGroups()) - { - for (NpcSpawnTemplate npc : group.getSpawns()) - { - if (npc.getId() == EILHALDER_VON_HELLMANN) - { - _template = npc; - break OUT; - } - } - } - - handleBoss(GameTimeController.getInstance().isNight()); - } - - @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) - @RegisterType(ListenerRegisterType.GLOBAL) - public void onDayNightChange(OnDayNightChange event) - { - handleBoss(event.isNight()); - } - - /** - * @param isNight - */ - private void handleBoss(boolean isNight) - { - if (_template == null) - { - return; - } - - if (isNight) - { - _template.spawn(null); - } - else - { - _template.despawn(); - } - } - - public static void main(String[] args) - { - new EilhalderVonHellmann(); - } -} diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/spawns/RaidbossSpawns.xml index 5c86e7cbfd..8327c3b938 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/spawns/RaidbossSpawns.xml @@ -142,29 +142,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java new file mode 100644 index 0000000000..952fce3102 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java @@ -0,0 +1,85 @@ +/* + * 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.ForestOfTheDead; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.events.EventType; +import com.l2jmobius.gameserver.model.events.ListenerRegisterType; +import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; +import com.l2jmobius.gameserver.model.events.annotations.RegisterType; +import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; + +import ai.AbstractNpcAI; + +/** + * @author Mobius + */ +public final class EilhalderVonHellmann extends AbstractNpcAI +{ + private static final int EILHALDER_VON_HELLMANN = 25328; + private static final Location SPAWN_LOCATION = new Location(59090, -42188, -3003); + private static L2Npc npcInstance; + + private EilhalderVonHellmann() + { + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (npc != null) + { + if (npc.isInCombat()) + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + else + { + npc.deleteMe(); + } + } + return super.onAdvEvent(event, npc, player); + } + + @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) + @RegisterType(ListenerRegisterType.GLOBAL) + public void onDayNightChange(OnDayNightChange event) + { + if (!event.isNight() && (npcInstance != null) && !npcInstance.isDead()) + { + if (!npcInstance.isInCombat()) + { + npcInstance.deleteMe(); + } + else + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + } + else if ((npcInstance == null) || npcInstance.isDead()) + { + npcInstance = addSpawn(EILHALDER_VON_HELLMANN, SPAWN_LOCATION); + } + } + + public static void main(String[] args) + { + new EilhalderVonHellmann(); + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java deleted file mode 100644 index e251eaa15e..0000000000 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.others.Spawns; - -import java.util.logging.Logger; - -import com.l2jmobius.gameserver.GameTimeController; -import com.l2jmobius.gameserver.instancemanager.DBSpawnManager; -import com.l2jmobius.gameserver.model.actor.L2Npc; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.events.EventType; -import com.l2jmobius.gameserver.model.events.ListenerRegisterType; -import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import com.l2jmobius.gameserver.model.events.annotations.RegisterType; -import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; -import com.l2jmobius.gameserver.model.spawns.SpawnGroup; -import com.l2jmobius.gameserver.model.spawns.SpawnTemplate; - -import ai.AbstractNpcAI; - -/** - * @author UnAfraid - */ -public final class EilhalderVonHellmann extends AbstractNpcAI -{ - private static final Logger LOGGER = Logger.getLogger(EilhalderVonHellmann.class.getName()); - private static final int EILHALDER_VON_HELLMANN = 25328; - private NpcSpawnTemplate _template; - - private EilhalderVonHellmann() - { - addSpawnId(EILHALDER_VON_HELLMANN); - } - - @Override - public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) - { - if (event.equals("delete") && (npc != null)) - { - npc.deleteMe(); - } - return super.onAdvEvent(event, npc, player); - } - - @Override - public String onSpawn(L2Npc npc) - { - // Spawn that comes from RaidBossSpawnManager - if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null)) - { - startQuestTimer("delete", 1000, npc, null); - } - return super.onSpawn(npc); - } - - @Override - public void onSpawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Spawning Night Raid Boss " + npc.getName()); - DBSpawnManager.getInstance().notifySpawnNightNpc(npc); - } - - @Override - public void onSpawnDespawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Despawning Night Raid Boss " + npc.getName()); - } - - @Override - public void onSpawnActivate(SpawnTemplate template) - { - OUT: for (SpawnGroup group : template.getGroups()) - { - for (NpcSpawnTemplate npc : group.getSpawns()) - { - if (npc.getId() == EILHALDER_VON_HELLMANN) - { - _template = npc; - break OUT; - } - } - } - - handleBoss(GameTimeController.getInstance().isNight()); - } - - @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) - @RegisterType(ListenerRegisterType.GLOBAL) - public void onDayNightChange(OnDayNightChange event) - { - handleBoss(event.isNight()); - } - - /** - * @param isNight - */ - private void handleBoss(boolean isNight) - { - if (_template == null) - { - return; - } - - if (isNight) - { - _template.spawn(null); - } - else - { - _template.despawn(); - } - } - - public static void main(String[] args) - { - new EilhalderVonHellmann(); - } -} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_2.5_Underground/dist/game/data/spawns/RaidbossSpawns.xml index b781219277..534516df6e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/spawns/RaidbossSpawns.xml @@ -142,29 +142,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java new file mode 100644 index 0000000000..952fce3102 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java @@ -0,0 +1,85 @@ +/* + * 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.ForestOfTheDead; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.events.EventType; +import com.l2jmobius.gameserver.model.events.ListenerRegisterType; +import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; +import com.l2jmobius.gameserver.model.events.annotations.RegisterType; +import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; + +import ai.AbstractNpcAI; + +/** + * @author Mobius + */ +public final class EilhalderVonHellmann extends AbstractNpcAI +{ + private static final int EILHALDER_VON_HELLMANN = 25328; + private static final Location SPAWN_LOCATION = new Location(59090, -42188, -3003); + private static L2Npc npcInstance; + + private EilhalderVonHellmann() + { + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (npc != null) + { + if (npc.isInCombat()) + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + else + { + npc.deleteMe(); + } + } + return super.onAdvEvent(event, npc, player); + } + + @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) + @RegisterType(ListenerRegisterType.GLOBAL) + public void onDayNightChange(OnDayNightChange event) + { + if (!event.isNight() && (npcInstance != null) && !npcInstance.isDead()) + { + if (!npcInstance.isInCombat()) + { + npcInstance.deleteMe(); + } + else + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + } + else if ((npcInstance == null) || npcInstance.isDead()) + { + npcInstance = addSpawn(EILHALDER_VON_HELLMANN, SPAWN_LOCATION); + } + } + + public static void main(String[] args) + { + new EilhalderVonHellmann(); + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java deleted file mode 100644 index e251eaa15e..0000000000 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.others.Spawns; - -import java.util.logging.Logger; - -import com.l2jmobius.gameserver.GameTimeController; -import com.l2jmobius.gameserver.instancemanager.DBSpawnManager; -import com.l2jmobius.gameserver.model.actor.L2Npc; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.events.EventType; -import com.l2jmobius.gameserver.model.events.ListenerRegisterType; -import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import com.l2jmobius.gameserver.model.events.annotations.RegisterType; -import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; -import com.l2jmobius.gameserver.model.spawns.SpawnGroup; -import com.l2jmobius.gameserver.model.spawns.SpawnTemplate; - -import ai.AbstractNpcAI; - -/** - * @author UnAfraid - */ -public final class EilhalderVonHellmann extends AbstractNpcAI -{ - private static final Logger LOGGER = Logger.getLogger(EilhalderVonHellmann.class.getName()); - private static final int EILHALDER_VON_HELLMANN = 25328; - private NpcSpawnTemplate _template; - - private EilhalderVonHellmann() - { - addSpawnId(EILHALDER_VON_HELLMANN); - } - - @Override - public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) - { - if (event.equals("delete") && (npc != null)) - { - npc.deleteMe(); - } - return super.onAdvEvent(event, npc, player); - } - - @Override - public String onSpawn(L2Npc npc) - { - // Spawn that comes from RaidBossSpawnManager - if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null)) - { - startQuestTimer("delete", 1000, npc, null); - } - return super.onSpawn(npc); - } - - @Override - public void onSpawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Spawning Night Raid Boss " + npc.getName()); - DBSpawnManager.getInstance().notifySpawnNightNpc(npc); - } - - @Override - public void onSpawnDespawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Despawning Night Raid Boss " + npc.getName()); - } - - @Override - public void onSpawnActivate(SpawnTemplate template) - { - OUT: for (SpawnGroup group : template.getGroups()) - { - for (NpcSpawnTemplate npc : group.getSpawns()) - { - if (npc.getId() == EILHALDER_VON_HELLMANN) - { - _template = npc; - break OUT; - } - } - } - - handleBoss(GameTimeController.getInstance().isNight()); - } - - @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) - @RegisterType(ListenerRegisterType.GLOBAL) - public void onDayNightChange(OnDayNightChange event) - { - handleBoss(event.isNight()); - } - - /** - * @param isNight - */ - private void handleBoss(boolean isNight) - { - if (_template == null) - { - return; - } - - if (isNight) - { - _template.spawn(null); - } - else - { - _template.despawn(); - } - } - - public static void main(String[] args) - { - new EilhalderVonHellmann(); - } -} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_3.0_Helios/dist/game/data/spawns/RaidbossSpawns.xml index b781219277..534516df6e 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/spawns/RaidbossSpawns.xml @@ -142,29 +142,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java new file mode 100644 index 0000000000..952fce3102 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java @@ -0,0 +1,85 @@ +/* + * 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.ForestOfTheDead; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.events.EventType; +import com.l2jmobius.gameserver.model.events.ListenerRegisterType; +import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; +import com.l2jmobius.gameserver.model.events.annotations.RegisterType; +import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; + +import ai.AbstractNpcAI; + +/** + * @author Mobius + */ +public final class EilhalderVonHellmann extends AbstractNpcAI +{ + private static final int EILHALDER_VON_HELLMANN = 25328; + private static final Location SPAWN_LOCATION = new Location(59090, -42188, -3003); + private static L2Npc npcInstance; + + private EilhalderVonHellmann() + { + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (npc != null) + { + if (npc.isInCombat()) + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + else + { + npc.deleteMe(); + } + } + return super.onAdvEvent(event, npc, player); + } + + @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) + @RegisterType(ListenerRegisterType.GLOBAL) + public void onDayNightChange(OnDayNightChange event) + { + if (!event.isNight() && (npcInstance != null) && !npcInstance.isDead()) + { + if (!npcInstance.isInCombat()) + { + npcInstance.deleteMe(); + } + else + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + } + else if ((npcInstance == null) || npcInstance.isDead()) + { + npcInstance = addSpawn(EILHALDER_VON_HELLMANN, SPAWN_LOCATION); + } + } + + public static void main(String[] args) + { + new EilhalderVonHellmann(); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java deleted file mode 100644 index e251eaa15e..0000000000 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.others.Spawns; - -import java.util.logging.Logger; - -import com.l2jmobius.gameserver.GameTimeController; -import com.l2jmobius.gameserver.instancemanager.DBSpawnManager; -import com.l2jmobius.gameserver.model.actor.L2Npc; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.events.EventType; -import com.l2jmobius.gameserver.model.events.ListenerRegisterType; -import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import com.l2jmobius.gameserver.model.events.annotations.RegisterType; -import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; -import com.l2jmobius.gameserver.model.spawns.SpawnGroup; -import com.l2jmobius.gameserver.model.spawns.SpawnTemplate; - -import ai.AbstractNpcAI; - -/** - * @author UnAfraid - */ -public final class EilhalderVonHellmann extends AbstractNpcAI -{ - private static final Logger LOGGER = Logger.getLogger(EilhalderVonHellmann.class.getName()); - private static final int EILHALDER_VON_HELLMANN = 25328; - private NpcSpawnTemplate _template; - - private EilhalderVonHellmann() - { - addSpawnId(EILHALDER_VON_HELLMANN); - } - - @Override - public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) - { - if (event.equals("delete") && (npc != null)) - { - npc.deleteMe(); - } - return super.onAdvEvent(event, npc, player); - } - - @Override - public String onSpawn(L2Npc npc) - { - // Spawn that comes from RaidBossSpawnManager - if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null)) - { - startQuestTimer("delete", 1000, npc, null); - } - return super.onSpawn(npc); - } - - @Override - public void onSpawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Spawning Night Raid Boss " + npc.getName()); - DBSpawnManager.getInstance().notifySpawnNightNpc(npc); - } - - @Override - public void onSpawnDespawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Despawning Night Raid Boss " + npc.getName()); - } - - @Override - public void onSpawnActivate(SpawnTemplate template) - { - OUT: for (SpawnGroup group : template.getGroups()) - { - for (NpcSpawnTemplate npc : group.getSpawns()) - { - if (npc.getId() == EILHALDER_VON_HELLMANN) - { - _template = npc; - break OUT; - } - } - } - - handleBoss(GameTimeController.getInstance().isNight()); - } - - @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) - @RegisterType(ListenerRegisterType.GLOBAL) - public void onDayNightChange(OnDayNightChange event) - { - handleBoss(event.isNight()); - } - - /** - * @param isNight - */ - private void handleBoss(boolean isNight) - { - if (_template == null) - { - return; - } - - if (isNight) - { - _template.spawn(null); - } - else - { - _template.despawn(); - } - } - - public static void main(String[] args) - { - new EilhalderVonHellmann(); - } -} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/spawns/RaidbossSpawns.xml index 61cd0436bd..af090e6048 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/spawns/RaidbossSpawns.xml @@ -142,29 +142,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java new file mode 100644 index 0000000000..b6042c5eb1 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java @@ -0,0 +1,85 @@ +/* + * 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.ForestOfTheDead; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.events.EventType; +import com.l2jmobius.gameserver.model.events.ListenerRegisterType; +import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; +import com.l2jmobius.gameserver.model.events.annotations.RegisterType; +import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; + +import ai.AbstractNpcAI; + +/** + * @author Mobius + */ +public final class EilhalderVonHellmann extends AbstractNpcAI +{ + private static final int EILHALDER_VON_HELLMANN = 25328; + private static final Location SPAWN_LOCATION = new Location(59090, -42188, -3003); + private static L2Npc npcInstance; + + private EilhalderVonHellmann() + { + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (npc != null) + { + if (npc.isInCombat()) + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + else + { + npc.deleteMe(); + } + } + return super.onAdvEvent(event, npc, player); + } + + @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) + @RegisterType(ListenerRegisterType.GLOBAL) + public void onDayNightChange(OnDayNightChange event) + { + if (!event.isNight() && (npcInstance != null) && !npcInstance.isDead()) + { + if (!npcInstance.isInCombat()) + { + npcInstance.deleteMe(); + } + else + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + } + else if ((npcInstance == null) || npcInstance.isDead()) + { + npcInstance = addSpawn(EILHALDER_VON_HELLMANN, SPAWN_LOCATION); + } + } + + public static void main(String[] args) + { + new EilhalderVonHellmann(); + } +} diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java deleted file mode 100644 index e251eaa15e..0000000000 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.others.Spawns; - -import java.util.logging.Logger; - -import com.l2jmobius.gameserver.GameTimeController; -import com.l2jmobius.gameserver.instancemanager.DBSpawnManager; -import com.l2jmobius.gameserver.model.actor.L2Npc; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.events.EventType; -import com.l2jmobius.gameserver.model.events.ListenerRegisterType; -import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import com.l2jmobius.gameserver.model.events.annotations.RegisterType; -import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; -import com.l2jmobius.gameserver.model.spawns.SpawnGroup; -import com.l2jmobius.gameserver.model.spawns.SpawnTemplate; - -import ai.AbstractNpcAI; - -/** - * @author UnAfraid - */ -public final class EilhalderVonHellmann extends AbstractNpcAI -{ - private static final Logger LOGGER = Logger.getLogger(EilhalderVonHellmann.class.getName()); - private static final int EILHALDER_VON_HELLMANN = 25328; - private NpcSpawnTemplate _template; - - private EilhalderVonHellmann() - { - addSpawnId(EILHALDER_VON_HELLMANN); - } - - @Override - public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) - { - if (event.equals("delete") && (npc != null)) - { - npc.deleteMe(); - } - return super.onAdvEvent(event, npc, player); - } - - @Override - public String onSpawn(L2Npc npc) - { - // Spawn that comes from RaidBossSpawnManager - if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null)) - { - startQuestTimer("delete", 1000, npc, null); - } - return super.onSpawn(npc); - } - - @Override - public void onSpawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Spawning Night Raid Boss " + npc.getName()); - DBSpawnManager.getInstance().notifySpawnNightNpc(npc); - } - - @Override - public void onSpawnDespawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Despawning Night Raid Boss " + npc.getName()); - } - - @Override - public void onSpawnActivate(SpawnTemplate template) - { - OUT: for (SpawnGroup group : template.getGroups()) - { - for (NpcSpawnTemplate npc : group.getSpawns()) - { - if (npc.getId() == EILHALDER_VON_HELLMANN) - { - _template = npc; - break OUT; - } - } - } - - handleBoss(GameTimeController.getInstance().isNight()); - } - - @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) - @RegisterType(ListenerRegisterType.GLOBAL) - public void onDayNightChange(OnDayNightChange event) - { - handleBoss(event.isNight()); - } - - /** - * @param isNight - */ - private void handleBoss(boolean isNight) - { - if (_template == null) - { - return; - } - - if (isNight) - { - _template.spawn(null); - } - else - { - _template.despawn(); - } - } - - public static void main(String[] args) - { - new EilhalderVonHellmann(); - } -} diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/spawns/RaidbossSpawns.xml index 61cd0436bd..af090e6048 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/spawns/RaidbossSpawns.xml @@ -142,29 +142,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java new file mode 100644 index 0000000000..952fce3102 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/ForestOfTheDead/EilhalderVonHellmann.java @@ -0,0 +1,85 @@ +/* + * 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.ForestOfTheDead; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.events.EventType; +import com.l2jmobius.gameserver.model.events.ListenerRegisterType; +import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; +import com.l2jmobius.gameserver.model.events.annotations.RegisterType; +import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; + +import ai.AbstractNpcAI; + +/** + * @author Mobius + */ +public final class EilhalderVonHellmann extends AbstractNpcAI +{ + private static final int EILHALDER_VON_HELLMANN = 25328; + private static final Location SPAWN_LOCATION = new Location(59090, -42188, -3003); + private static L2Npc npcInstance; + + private EilhalderVonHellmann() + { + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (npc != null) + { + if (npc.isInCombat()) + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + else + { + npc.deleteMe(); + } + } + return super.onAdvEvent(event, npc, player); + } + + @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) + @RegisterType(ListenerRegisterType.GLOBAL) + public void onDayNightChange(OnDayNightChange event) + { + if (!event.isNight() && (npcInstance != null) && !npcInstance.isDead()) + { + if (!npcInstance.isInCombat()) + { + npcInstance.deleteMe(); + } + else + { + startQuestTimer("despawn", 30000, npcInstance, null); + } + } + else if ((npcInstance == null) || npcInstance.isDead()) + { + npcInstance = addSpawn(EILHALDER_VON_HELLMANN, SPAWN_LOCATION); + } + } + + public static void main(String[] args) + { + new EilhalderVonHellmann(); + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java deleted file mode 100644 index e251eaa15e..0000000000 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/Spawns/EilhalderVonHellmann.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.others.Spawns; - -import java.util.logging.Logger; - -import com.l2jmobius.gameserver.GameTimeController; -import com.l2jmobius.gameserver.instancemanager.DBSpawnManager; -import com.l2jmobius.gameserver.model.actor.L2Npc; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.events.EventType; -import com.l2jmobius.gameserver.model.events.ListenerRegisterType; -import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import com.l2jmobius.gameserver.model.events.annotations.RegisterType; -import com.l2jmobius.gameserver.model.events.impl.OnDayNightChange; -import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; -import com.l2jmobius.gameserver.model.spawns.SpawnGroup; -import com.l2jmobius.gameserver.model.spawns.SpawnTemplate; - -import ai.AbstractNpcAI; - -/** - * @author UnAfraid - */ -public final class EilhalderVonHellmann extends AbstractNpcAI -{ - private static final Logger LOGGER = Logger.getLogger(EilhalderVonHellmann.class.getName()); - private static final int EILHALDER_VON_HELLMANN = 25328; - private NpcSpawnTemplate _template; - - private EilhalderVonHellmann() - { - addSpawnId(EILHALDER_VON_HELLMANN); - } - - @Override - public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) - { - if (event.equals("delete") && (npc != null)) - { - npc.deleteMe(); - } - return super.onAdvEvent(event, npc, player); - } - - @Override - public String onSpawn(L2Npc npc) - { - // Spawn that comes from RaidBossSpawnManager - if ((npc.getSpawn() == null) || (npc.getSpawn().getNpcSpawnTemplate() == null)) - { - startQuestTimer("delete", 1000, npc, null); - } - return super.onSpawn(npc); - } - - @Override - public void onSpawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Spawning Night Raid Boss " + npc.getName()); - DBSpawnManager.getInstance().notifySpawnNightNpc(npc); - } - - @Override - public void onSpawnDespawnNpc(SpawnTemplate template, SpawnGroup group, L2Npc npc) - { - LOGGER.info("Despawning Night Raid Boss " + npc.getName()); - } - - @Override - public void onSpawnActivate(SpawnTemplate template) - { - OUT: for (SpawnGroup group : template.getGroups()) - { - for (NpcSpawnTemplate npc : group.getSpawns()) - { - if (npc.getId() == EILHALDER_VON_HELLMANN) - { - _template = npc; - break OUT; - } - } - } - - handleBoss(GameTimeController.getInstance().isNight()); - } - - @RegisterEvent(EventType.ON_DAY_NIGHT_CHANGE) - @RegisterType(ListenerRegisterType.GLOBAL) - public void onDayNightChange(OnDayNightChange event) - { - handleBoss(event.isNight()); - } - - /** - * @param isNight - */ - private void handleBoss(boolean isNight) - { - if (_template == null) - { - return; - } - - if (isNight) - { - _template.spawn(null); - } - else - { - _template.despawn(); - } - } - - public static void main(String[] args) - { - new EilhalderVonHellmann(); - } -} diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/spawns/RaidbossSpawns.xml index 61cd0436bd..af090e6048 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/spawns/RaidbossSpawns.xml @@ -142,29 +142,6 @@ - - - - - - - - - - - - - - - - - - - - - - -