From f953a9dc95a0d3d4e10dd0e7ffb146847e04158b Mon Sep 17 00:00:00 2001 From: Adry_85 <Adrya85@hotmail.it> Date: Thu, 19 Dec 2013 08:51:52 +0000 Subject: [PATCH] BETA: Sailren AI. Patch by: St3eT Tested by: St3eT, !FinalDestination Reviewed by: Adry_85 '''NOTE:''' Interlude Feature. * Minor improvement for Giant's Cave AI. Patch by: St3eT Reported by: jurchiks --- .../dist/game/data/html/default/32107.htm | 3 + L2J_DataPack_BETA/dist/game/data/scripts.cfg | 3 +- .../scripts/ai/group_template/GiantsCave.java | 5 +- .../ai/individual/Sailren/32109-01.html | 4 + .../ai/individual/Sailren/32109-01a.html} | 14 +- .../ai/individual/Sailren/32109-02.html | 4 + .../ai/individual/Sailren/32109-02a.html} | 10 +- .../ai/individual/Sailren/32109-03.html | 5 + .../ai/individual/Sailren/32109-03a.html} | 10 +- .../ai/individual/Sailren/32109-04.html | 5 + .../ai/individual/Sailren/32109-05.html | 4 + .../ai/individual/Sailren/32109.html} | 14 +- .../ai/individual/Sailren/Sailren.java | 331 ++++++++++++++++++ .../dist/game/data/zones/no_restart.xml | 20 +- 14 files changed, 385 insertions(+), 47 deletions(-) create mode 100644 L2J_DataPack_BETA/dist/game/data/html/default/32107.htm create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-01.html rename L2J_DataPack_BETA/dist/game/data/{html/default/32109-1.htm => scripts/ai/individual/Sailren/32109-01a.html} (79%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-02.html rename L2J_DataPack_BETA/dist/game/data/{html/default/32109-2.htm => scripts/ai/individual/Sailren/32109-02a.html} (59%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-03.html rename L2J_DataPack_BETA/dist/game/data/{html/default/32109-3.htm => scripts/ai/individual/Sailren/32109-03a.html} (92%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-04.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-05.html rename L2J_DataPack_BETA/dist/game/data/{html/default/32109.htm => scripts/ai/individual/Sailren/32109.html} (65%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/Sailren.java diff --git a/L2J_DataPack_BETA/dist/game/data/html/default/32107.htm b/L2J_DataPack_BETA/dist/game/data/html/default/32107.htm new file mode 100644 index 0000000000..31ad8bc9e0 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/html/default/32107.htm @@ -0,0 +1,3 @@ +<html><body>Teleport Cube:<br> +<a action="bypass -h npc_%objectId%_Quest Sailren teleportOut">Teleport out of Sailren's Nest.</a> +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 3dbbb382bb..12ab8441ba 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -124,6 +124,8 @@ ai/group_template/VarkaKetra.java ai/group_template/WarriorFishingBlock.java # Individual +ai/individual/Sailren/Sailren.java +ai/individual/Venom/Venom.java ai/individual/Amaskari.java ai/individual/Anais.java ai/individual/Antharas.java @@ -153,7 +155,6 @@ ai/individual/SinWardens.java ai/individual/Sprigant.java ai/individual/Typhoon.java ai/individual/Valakas.java -ai/individual/Venom/Venom.java ai/individual/Zaken.java # Village Master diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/GiantsCave.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/GiantsCave.java index a839d27712..b608b2f670 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/GiantsCave.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/GiantsCave.java @@ -26,7 +26,6 @@ import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.NpcStringId; import com.l2jserver.gameserver.network.clientpackets.Say2; -import com.l2jserver.gameserver.network.serverpackets.NpcSay; /** * Giant's Cave AI. @@ -98,11 +97,11 @@ public final class GiantsCave extends AbstractNpcAI npc.setScriptValue(1); if (getRandomBoolean()) { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getId(), NpcStringId.YOU_GUYS_ARE_DETECTED)); + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.YOU_GUYS_ARE_DETECTED); } else { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getId(), NpcStringId.WHAT_KIND_OF_CREATURES_ARE_YOU)); + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.WHAT_KIND_OF_CREATURES_ARE_YOU); } startQuestTimer("ATTACK", 6000, npc, player); startQuestTimer("CLEAR", 120000, npc, null); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-01.html new file mode 100644 index 0000000000..571b396a93 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-01.html @@ -0,0 +1,4 @@ +<html><body>Shilen's Stone Statue:<br> +Wait.. It doesn't seem as though you are the one destined for the front lines in this battle. I was supposed to open a passage to Sailren's lair only to the leader of one party. If you wish to teleport, bring your party leader to me or return here as a party leader.<br> +<a action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">Prep for battle.</a> +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/html/default/32109-1.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-01a.html similarity index 79% rename from L2J_DataPack_BETA/dist/game/data/html/default/32109-1.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-01a.html index c73b66c69a..a144981242 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/default/32109-1.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-01a.html @@ -1,8 +1,8 @@ -<html><body>Stone Statue of Shilen:<br> -You know that in the past, Mother Shilen paid a great sacrifice to lock Sailren here.<br> -Afterward, she created a stone likeness of herself and bestowed upon it the power to seal, making it a guardian of this place to ensure that Sailren remained imprisoned.<br> -I am that stone statue of Shilen.<br> -Mother Shilen also entrusted the power to seal to those who wield the sacred ax Gazkh.<br> -I will only open the gate for those who have Gazkh and their friends. When the seal is at its weakest, however, I allow a warrior to enter in order to minimize the sacrifice.<br> -<a action="bypass -h npc_%objectId%_Chat 2">Listen to the conditions to enter in detail.</a> +<html><body>Shilen's Stone Statue:<br> +You know that in the past, Mother Shilen paid a great sacrifice to lock Sailren here.<br> +Afterward, she created a stone likeness of herself and bestowed upon it the power to seal, making it a guardian of this place to ensure that Sailren remained imprisoned.<br> +I am that stone statue of Shilen.<br> +Mother Shilen also entrusted the power to seal to those who wield the sacred ax Gazkh.<br> +I will only open the gate for those who have Gazkh and their friends. When the seal is at its weakest, however, I allow a warrior to enter in order to minimize the sacrifice.<br> +<a action="bypass -h npc_%objectId%_Quest Sailren 32109-02a.html">Listen to the conditions to enter in detail.</a> </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-02.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-02.html new file mode 100644 index 0000000000..ac29b89318 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-02.html @@ -0,0 +1,4 @@ +<html><body>Shilen's Stone Statue:<br> +You have the heart to fight Sailren, of that there can be no doubt. But if you do not have Gazkh given to you by Shilen, Sailren will certainly kill you. If you want to teleport within, complete my quest and obtain Gazkh.<br> +<a action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">Prep for battle.</a> +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/html/default/32109-2.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-02a.html similarity index 59% rename from L2J_DataPack_BETA/dist/game/data/html/default/32109-2.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-02a.html index 5645f0439b..a41c6e08b9 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/default/32109-2.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-02a.html @@ -1,5 +1,5 @@ -<html><body>Stone Statue of Shilen:<br> -Only a party whose leader weilds Gazkh can enter Sailren's Stronghold and battle the creature.<br> -Be aware that any party member who is far away at the time of entry cannot enter the Stronghold. Nor can another party enter until the first party has exited.<br> -<a action="bypass -h npc_%objectId%_Chat 3">Learn more about Sailren's power and how to fight it.</a> -</body></html> \ No newline at end of file +<html><body>Shilen's Stone Statue:<br> +Only a party whose leader weilds Gazkh can enter Sailren's Stronghold and battle the creature.<br> +Be aware that any party member who is far away at the time of entry cannot enter the Stronghold. Nor can another party enter until the first party has exited.<br> +<a action="bypass -h npc_%objectId%_Quest Sailren 32109-03a.html">Learn more about Sailren's power and how to fight it.</a> +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-03.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-03.html new file mode 100644 index 0000000000..a5fb23a774 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-03.html @@ -0,0 +1,5 @@ +<html><body>Shilen's Stone Statue:<br> +Shilen's protection is not with you -- go away! You are not qualified to fight against Sailren...<br> +If you want to enter Sailren's nest, then you should find a party leader who can fight against Sailren and join his party. Or you can complete my quest to become a party leader, form your own party, and then return here.<br> +<a action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">Listen to the entry requirements and battle method.</a> +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/html/default/32109-3.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-03a.html similarity index 92% rename from L2J_DataPack_BETA/dist/game/data/html/default/32109-3.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-03a.html index 85fcef35cb..fa050e429e 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/default/32109-3.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-03a.html @@ -1,5 +1,5 @@ -<html><body>Stone Statue of Shilen:<br> -There are not many of them, but Sailren is protected by its dinosaur followers. Combined with my enchantment and the power of the other statues, we are restraining Sailren and its followers from escaping. But as they begin to break free of our control, their power and magic also begins to extend beyond the Lost Nest, affecting even the Primeval Plains!<br> -If the powers of the Stone Statues are completely broken, Sailren and its followers will escape and this island and everything on it will perish.<br> -Alas, Shilen is not here to protect us! In order to re-seal that horrifying dinosaur, you must defeat its followers first, and then work as a team to defeat Sailren. -</body></html> \ No newline at end of file +<html><body>Shilen's Stone Statue:<br> +There are not many of them, but Sailren is protected by its dinosaur followers. Combined with my enchantment and the power of the other statues, we are restraining Sailren and its followers from escaping. But as they begin to break free of our control, their power and magic also begins to extend beyond the Lost Nest, affecting even the Primeval Plains!<br> +If the powers of the Stone Statues are completely broken, Sailren and its followers will escape and this island and everything on it will perish.<br> +Alas, Shilen is not here to protect us! In order to re-seal that horrifying dinosaur, you must defeat its followers first, and then work as a team to defeat Sailren. +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-04.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-04.html new file mode 100644 index 0000000000..1dc0db50da --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-04.html @@ -0,0 +1,5 @@ +<html><body>Shilen's Stone Statue:<br> +Currently the magic power of Sailren and its followers is very strong. I do not think you can win solely with your own power, especially given how weak the seal stones have become.<br> +My counsel is that you first recover the power to seal and wait 'til Sailren's strength lessens a bit. Then you will have your best chance of entering the nest and defeating this ancient evil.<br> +<a action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">Prep for battle.</a> +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-05.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-05.html new file mode 100644 index 0000000000..6f175347d9 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109-05.html @@ -0,0 +1,4 @@ +<html><body>Shilen's Stone Statue:<br> +There is another brave party fighting against Sailren right now, so I cannot teleport you into the nest. When they return, I will teleport you.<br> +<a action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">Prep for battle.</a> +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/html/default/32109.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109.html similarity index 65% rename from L2J_DataPack_BETA/dist/game/data/html/default/32109.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109.html index 178296a88e..2665b6fea9 100644 --- a/L2J_DataPack_BETA/dist/game/data/html/default/32109.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/32109.html @@ -1,7 +1,7 @@ -<html><body>Stone Statue of Shilen:<br> -(The statue is worn in places by wind and rain -- proof that it has stood guard here a long, long time. Despite its weatherbeaten appearance, it feels somehow dignified and majestic. Standing before it, you sense a presence.)<br> -You, outsider... Why have you come here to this statue? For I am Mother Shilen's avatar and the last guard of Sailren!<br> -<a action="bypass -h npc_%objectId%_Chat 1">Prep for battle.</a><br> -<a action="bypass -h npc_%objectId%_Chat 0">"I wish to participate in clearing out Sailren and its followers."</a><br> -<a action="bypass -h npc_%objectId%_Quest">Quest.</a> -</body></html> \ No newline at end of file +<html><body>Stone Statue of Shilen:<br> +(The statue is worn in places by wind and rain -- proof that it has stood guard here a long, long time. Despite its weatherbeaten appearance, it feels somehow dignified and majestic. Standing before it, you sense a presence.)<br> +You, outsider... Why have you come here to this statue? For I am Mother Shilen's avatar and the last guard of Sailren!<br> +<a action="bypass -h npc_%objectId%_Quest Sailren 32109-01.html">Prep for battle.</a><br> +<a action="bypass -h npc_%objectId%_Quest Sailren enter">"I wish to participate in clearing out Sailren and its followers."</a><br> +<a action="bypass -h npc_%objectId%_Quest">Quest.</a> +</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/Sailren.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/Sailren.java new file mode 100644 index 0000000000..dfe729688e --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Sailren/Sailren.java @@ -0,0 +1,331 @@ +/* + * Copyright (C) 2004-2013 L2J DataPack + * + * This file is part of L2J DataPack. + * + * L2J DataPack 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. + * + * L2J DataPack 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.individual.Sailren; + +import ai.npc.AbstractNpcAI; + +import com.l2jserver.gameserver.instancemanager.GlobalVariablesManager; +import com.l2jserver.gameserver.instancemanager.ZoneManager; +import com.l2jserver.gameserver.model.TeleportWhereType; +import com.l2jserver.gameserver.model.actor.L2Attackable; +import com.l2jserver.gameserver.model.actor.L2Character; +import com.l2jserver.gameserver.model.actor.L2Npc; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.actor.instance.L2RaidBossInstance; +import com.l2jserver.gameserver.model.holders.SkillHolder; +import com.l2jserver.gameserver.model.zone.type.L2NoRestartZone; +import com.l2jserver.gameserver.network.serverpackets.SpecialCamera; + +/** + * Sailren AI. + * @author St3eT + */ +public final class Sailren extends AbstractNpcAI +{ + // NPCs + private static final int STATUE = 32109; // Shilen's Stone Statue + private static final int MOVIE_NPC = 32110; // Invisible NPC for movie + private static final int SAILREN = 29065; // Sailren + private static final int VELOCIRAPTOR = 22218; // Velociraptor + private static final int PTEROSAUR = 22199; // Pterosaur + private static final int TREX = 22217; // Tyrannosaurus + private static final int CUBIC = 32107; // Teleportation Cubic + // Item + private static final int GAZKH = 8784; // Gazkh + // Skill + private static final SkillHolder ANIMATION = new SkillHolder(5090, 1); + // Zone + private static final L2NoRestartZone zone = ZoneManager.getInstance().getZoneById(70049, L2NoRestartZone.class); + // Misc + private static final int RESPAWN = 1; // Respawn time (in hours) + private static final int MAX_TIME = 3200; // Max time for Sailren fight (in minutes) + private static Status STATUS = Status.ALIVE; + private static int _killCount = 0; + private static long _lastAttack = 0; + + private static enum Status + { + ALIVE, + IN_FIGHT, + DEAD + } + + private Sailren() + { + super(Sailren.class.getSimpleName(), "ai/individual"); + addStartNpc(STATUE, CUBIC); + addTalkId(STATUE, CUBIC); + addFirstTalkId(STATUE); + addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN); + addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN); + + final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis(); + if (remain > 0) + { + STATUS = Status.DEAD; + startQuestTimer("CLEAR_STATUS", remain, null, null); + } + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "32109-01.html": + case "32109-01a.html": + case "32109-02a.html": + case "32109-03a.html": + { + return event; + } + case "enter": + { + String htmltext = null; + if (!player.isInParty()) + { + htmltext = "32109-01.html"; + } + else if (STATUS == Status.DEAD) + { + htmltext = "32109-04.html"; + } + else if (STATUS == Status.IN_FIGHT) + { + htmltext = "32109-05.html"; + } + else if (!player.getParty().isLeader(player)) + { + htmltext = "32109-03.html"; + } + else if (!hasQuestItems(player, GAZKH)) + { + htmltext = "32109-02.html"; + } + else + { + takeItems(player, 1, GAZKH); + STATUS = Status.IN_FIGHT; + _lastAttack = System.currentTimeMillis(); + for (L2PcInstance member : player.getParty().getMembers()) + { + if (member.isInsideRadius(npc, 1000, true, false)) + { + member.teleToLocation(27549, -6638, -2008); + } + } + startQuestTimer("SPAWN_VELOCIRAPTOR", 60000, null, null); + startQuestTimer("TIME_OUT", MAX_TIME * 1000, null, null); + startQuestTimer("CHECK_ATTACK", 120000, null, null); + } + return htmltext; + } + case "teleportOut": + { + player.teleToLocation(TeleportWhereType.TOWN); + break; + } + case "SPAWN_VELOCIRAPTOR": + { + for (int i = 0; i < 3; i++) + { + addSpawn(VELOCIRAPTOR, 27313 + getRandom(150), -6766 + getRandom(150), -1975, 0, false, 0); + } + break; + } + case "SPAWN_SAILREN": + { + final L2RaidBossInstance sailren = (L2RaidBossInstance) addSpawn(SAILREN, 27549, -6638, -2008, 0, false, 0); + final L2Npc movieNpc = addSpawn(MOVIE_NPC, sailren.getX(), sailren.getY(), sailren.getZ() + 30, 0, false, 26000); + sailren.setIsInvul(true); + sailren.setIsImmobilized(true); + zone.broadcastPacket(new SpecialCamera(movieNpc, 60, 110, 30, 4000, 1500, 20000, 0, 65, 1, 0, 0)); + + startQuestTimer("ATTACK", 24600, sailren, null); + startQuestTimer("ANIMATION", 2000, movieNpc, null); + startQuestTimer("CAMERA_1", 4100, movieNpc, null); + break; + } + case "ANIMATION": + { + if (npc != null) + { + npc.setTarget(npc); + npc.doCast(ANIMATION.getSkill()); + startQuestTimer("ANIMATION", 2000, npc, null); + } + break; + } + case "CAMERA_1": + { + zone.broadcastPacket(new SpecialCamera(npc, 100, 180, 30, 3000, 1500, 20000, 0, 50, 1, 0, 0)); + startQuestTimer("CAMERA_2", 3000, npc, null); + break; + } + case "CAMERA_2": + { + zone.broadcastPacket(new SpecialCamera(npc, 150, 270, 25, 3000, 1500, 20000, 0, 30, 1, 0, 0)); + startQuestTimer("CAMERA_3", 3000, npc, null); + break; + } + case "CAMERA_3": + { + zone.broadcastPacket(new SpecialCamera(npc, 160, 360, 20, 3000, 1500, 20000, 10, 15, 1, 0, 0)); + startQuestTimer("CAMERA_4", 3000, npc, null); + break; + } + case "CAMERA_4": + { + zone.broadcastPacket(new SpecialCamera(npc, 160, 450, 10, 3000, 1500, 20000, 0, 10, 1, 0, 0)); + startQuestTimer("CAMERA_5", 3000, npc, null); + break; + } + case "CAMERA_5": + { + zone.broadcastPacket(new SpecialCamera(npc, 160, 560, 0, 3000, 1500, 20000, 0, 10, 1, 0, 0)); + startQuestTimer("CAMERA_6", 7000, npc, null); + break; + } + case "CAMERA_6": + { + zone.broadcastPacket(new SpecialCamera(npc, 70, 560, 0, 500, 1500, 7000, -15, 20, 1, 0, 0)); + break; + } + case "ATTACK": + { + npc.setIsInvul(false); + npc.setIsImmobilized(false); + break; + } + case "CLEAR_STATUS": + { + STATUS = Status.ALIVE; + break; + } + case "TIME_OUT": + { + if (STATUS == Status.IN_FIGHT) + { + STATUS = Status.ALIVE; + } + for (L2Character charInside : zone.getCharactersInside()) + { + if (charInside != null) + { + if (charInside.isPlayer()) + { + charInside.teleToLocation(TeleportWhereType.TOWN); + } + else if (charInside.isNpc()) + { + charInside.deleteMe(); + } + } + } + break; + } + case "CHECK_ATTACK": + { + if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis())) + { + cancelQuestTimer("TIME_OUT", null, null); + notifyEvent("TIME_OUT", null, null); + } + else + { + startQuestTimer("CHECK_ATTACK", 120000, null, null); + } + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon) + { + if (zone.isCharacterInZone(attacker)) + { + _lastAttack = System.currentTimeMillis(); + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + if (zone.isCharacterInZone(killer)) + { + switch (npc.getId()) + { + case SAILREN: + { + STATUS = Status.DEAD; + addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000); + final long respawnTime = RESPAWN * 3600000; + GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime); + cancelQuestTimer("CHECK_ATTACK", null, null); + cancelQuestTimer("TIME_OUT", null, null); + startQuestTimer("CLEAR_STATUS", respawnTime, null, null); + startQuestTimer("TIME_OUT", 300000, null, null); + break; + } + case VELOCIRAPTOR: + { + _killCount++; + if (_killCount == 3) + { + final L2Attackable pterosaur = (L2Attackable) addSpawn(PTEROSAUR, 27313, -6766, -1975, 0, false, 0); + attackPlayer(pterosaur, killer); + _killCount = 0; + } + break; + } + case PTEROSAUR: + { + final L2Attackable trex = (L2Attackable) addSpawn(TREX, 27313, -6766, -1975, 0, false, 0); + attackPlayer(trex, killer); + break; + } + case TREX: + { + startQuestTimer("SPAWN_SAILREN", 180000, null, null); + break; + } + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public boolean unload(boolean removeFromList) + { + if (STATUS == Status.IN_FIGHT) + { + _log.info(getClass().getSimpleName() + ": Script is being unloaded while Sailren is active, clearing zone."); + notifyEvent("TIME_OUT", null, null); + } + return super.unload(removeFromList); + } + + public static void main(String[] args) + { + new Sailren(); + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/zones/no_restart.xml b/L2J_DataPack_BETA/dist/game/data/zones/no_restart.xml index 17d5f1afb9..a3ececf1b4 100644 --- a/L2J_DataPack_BETA/dist/game/data/zones/no_restart.xml +++ b/L2J_DataPack_BETA/dist/game/data/zones/no_restart.xml @@ -9,7 +9,6 @@ <node X="57669" Y="221683" /> <node X="50773" Y="221632" /> </zone> - <zone name="antaras_no_restart" type="NoRestartZone" shape="NPoly" minZ="-8380" maxZ="-4880"> <!-- 25_21 --> <stat name="restartTime" val="1800" /> <stat name="restartAllowedTime" val="600" /> @@ -18,7 +17,6 @@ <node X="188132" Y="119249" /> <node X="173386" Y="119391" /> </zone> - <zone name="baium_no_restart" type="NoRestartZone" shape="NPoly" minZ="10061" maxZ="11061"> <!-- 23_18 --> <stat name="restartTime" val="1800" /> <stat name="restartAllowedTime" val="600" /> @@ -27,7 +25,6 @@ <node X="118194" Y="15790" /> <node X="114825" Y="19589" /> </zone> - <zone name="anakimNlilith" type="NoRestartZone" shape="NPoly" minZ="-5504" maxZ="-5104"> <!-- 25_17 --> <stat name="restartTime" val="1800" /> <stat name="restartAllowedTime" val="600" /> @@ -36,7 +33,6 @@ <node X="186176" Y="-8513" /> <node X="183920" Y="-8513" /> </zone> - <zone name="fire_no_restart1" type="NoRestartZone" shape="NPoly" minZ="-3326" maxZ="-1326"> <!-- 25_14 --> <stat name="restartTime" val="1800" /> <stat name="restartAllowedTime" val="600" /> @@ -56,7 +52,6 @@ <node X="196377" Y="-103657" /> <node X="187161" Y="-103538" /> </zone> - <zone name="royal_rush_no_restart1" type="NoRestartZone" shape="NPoly" minZ="-7263" maxZ="-7063"> <!-- 25_15 --> <stat name="default_enabled" val="true" /> <stat name="restartTime" val="0" /> @@ -89,7 +84,6 @@ <node X="174301" Y="-75214" /> <node X="172174" Y="-75213" /> </zone> - <zone name="space_of_dimension_no_restart1" type="NoRestartZone" shape="NPoly" minZ="-6964" maxZ="-6064"> <!-- 16_12 --> <stat name="default_enabled" val="true" /> <stat name="restartTime" val="0" /> @@ -138,7 +132,6 @@ <node X="-113293" Y="-182247" /> <node X="-116217" Y="-182247" /> </zone> - <zone name="balakas_no_restart" type="NoRestartZone" shape="NPoly" minZ="-2572" maxZ="5428"> <!-- 26_14 --> <stat name="restartTime" val="1800" /> <node X="196866" Y="-130845" /> @@ -146,8 +139,7 @@ <node X="229176" Y="-98508" /> <node X="196880" Y="-98498" /> </zone> - - <zone name="sailen_no_restart" type="NoRestartZone" shape="NPoly" minZ="-2560" maxZ="440"> <!-- 20_17 --> + <zone name="sailen_no_restart" id="70049" type="NoRestartZone" shape="NPoly" minZ="-2560" maxZ="440"> <!-- 20_17 --> <stat name="restartTime" val="0" /> <node X="29177" Y="-7187" /> <node X="28958" Y="-5798" /> @@ -158,7 +150,6 @@ <node X="26846" Y="-8117" /> <node X="28231" Y="-8163" /> </zone> - <zone name="25_15_frintessa_Restart01" type="NoRestartZone" shape="NPoly" minZ="-5200" maxZ="-4680"> <stat name="restartTime" val="1800" /> <node X="172031" Y="-90127" /> @@ -166,7 +157,6 @@ <node X="176428" Y="-74051" /> <node X="172057" Y="-74108" /> </zone> - <zone name="23_14_ice_fairy_no_restart01" type="NoRestartZone" shape="NPoly" minZ="-5136" maxZ="864"> <stat name="restartTime" val="1800" /> <node X="101450" Y="-130042" /> @@ -195,7 +185,6 @@ <node X="114035" Y="-125527" /> <node X="113804" Y="-125437" /> </zone> - <zone name="heretic_shrine_no_restart1" type="NoRestartZone" shape="NPoly" minZ="-10749" maxZ="-10249"> <!-- 19_16 --> <stat name="restartTime" val="1800" /> <stat name="restartAllowedTime" val="600" /> @@ -211,7 +200,6 @@ <node X="-15353" Y="-52161" /> <node X="-15755" Y="-52134" /> </zone> - <zone name="rainbow_spring_no_restart1" type="NoRestartZone" shape="NPoly" minZ="-2963" maxZ="2037"> <!-- 24_14 --> <stat name="restartTime" val="1800" /> <stat name="restartAllowedTime" val="600" /> @@ -221,7 +209,6 @@ <node X="156442" Y="-124858" /> <node X="150697" Y="-123935" /> </zone> - <zone name="nornildg_nr1" type="NoRestartZone" shape="NPoly" minZ="-15873" maxZ="-6373"> <!-- 16_20 --> <stat name="restartTime" val="0" /> <stat name="instanceId" val="11" /> @@ -255,7 +242,6 @@ <node X="20463" Y="256722" /> <node X="13413" Y="256719" /> </zone> - <zone name="20_25_tower_top_no_restart_01" type="NoRestartZone" shape="NPoly" minZ="10850" maxZ="11850"> <stat name="restartTime" val="1800" /> <stat name="restartAllowedTime" val="600" /> @@ -271,7 +257,6 @@ <node X="20808" Y="244101" /> <node X="17900" Y="244403" /> </zone> - <zone name="20_26_basetower_inner_restart_01" type="NoRestartZone" shape="NPoly" minZ="-10736" maxZ="-5736"> <stat name="restartTime" val="1800" /> <stat name="restartAllowedTime" val="600" /> @@ -311,7 +296,6 @@ <node X="20648" Y="220271" /> <node X="11172" Y="220271" /> </zone> - <zone name="14_24_undying_norestart1" type="NoRestartZone" shape="NPoly" minZ="-16233" maxZ="-6233"> <stat name="restartTime" val="0" /> <node X="-182265" Y="204880" /> @@ -323,7 +307,6 @@ <node X="-184536" Y="206967" /> <node X="-182259" Y="206962" /> </zone> - <zone name="18_16_etc08_norestart1" type="NoRestartZone" shape="NPoly" minZ="-2425" maxZ="-2225"> <stat name="restartTime" val="0" /> <node X="-58571" Y="-64074" /> @@ -331,7 +314,6 @@ <node X="-56370" Y="-61896" /> <node X="-58565" Y="-61904" /> </zone> - <zone name="12_24_destruction_norestart1" type="NoRestartZone" shape="NPoly" minZ="-13736" maxZ="-5736"> <stat name="restartTime" val="1800" /> <node X="-253773" Y="204988" /> -- GitLab