Skip to content

Instantly share code, notes, and snippets.

@ChaosPaladin
Forked from St3eT/Valakas_not_done.diff
Created February 25, 2016 15:25
Show Gist options
  • Save ChaosPaladin/6397c50cce68666f5918 to your computer and use it in GitHub Desktop.
Save ChaosPaladin/6397c50cce68666f5918 to your computer and use it in GitHub Desktop.
### Eclipse Workspace Patch 1.0
#P L2J_DataPack_BETA
Index: dist/game/data/scripts/ai/npc/Klein/31540-09.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540-09.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540-09.htm (working copy)
@@ -0,0 +1,3 @@
+<html><body>Watcher of Valakas Klein:<br>
+In order to enter the Hall of Flames, you'll need a Vacualite Floating Stone. To obtain one, you must do a small favor for me. Agreed?
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-02.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-02.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-02.htm (working copy)
@@ -1,4 +0,0 @@
-<html><body>Watcher of Valakas Klein:<br>
-So far, between 50 and 100 people have entered the Hall of Flames. Do you wish to enter?<br>
-<a action="bypass -h Quest GrandBossTeleporters 31540">Enter</A>
-</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-06.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-06.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-06.htm (working copy)
@@ -1,3 +0,0 @@
-<html><body>Watcher of Valakas Klein:<br>
-In order to enter the Hall of Flames, you'll need a Floating Stone. To obtain one, you must do a small favor for me. Agreed?
-</body></html>
\ No newline at end of file
Index: dist/game/data/zones/custom_boss.xml
===================================================================
--- dist/game/data/zones/custom_boss.xml (revision 10248)
+++ dist/game/data/zones/custom_boss.xml (working copy)
@@ -62,13 +62,6 @@
<node X="174301" Y="-75214" />
<node X="172174" Y="-75213" />
</zone>
- <zone name="Valakas Boss" id="12010" type="BossZone" shape="NPoly" minZ="-2572" maxZ="5428">
- <stat name="InvadeTime" val="1800000" />
- <node X="196866" Y="-130845" />
- <node X="229289" Y="-130860" />
- <node X="229176" Y="-98508" />
- <node X="196880" Y="-98498" />
- </zone>
<zone name="Queen Ant Boss" id="12012" type="BossZone" shape="NPoly" minZ="-5947" maxZ="-5547"> <!-- Not Verified -->
<stat name="default_enabled" val="false" />
<node X="-21490" Y="178613" />
Index: dist/game/data/scripts/ai/npc/Klein/31540-05.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540-05.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540-05.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+So far, between 100 and 150 people have entered the Hall of Flames. Do you wish to enter?<br>
+<a action="bypass -h npc_%objectId%_Quest Klein teleportInside">Enter</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-04.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-04.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-04.htm (working copy)
@@ -1,4 +0,0 @@
-<html><body>Watcher of Valakas Klein:<br>
-So far, between 150 and 200 people have entered the Hall of Flames. Do you wish to enter?<br>
-<a action="bypass -h Quest GrandBossTeleporters 31540">Enter</A>
-</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-03.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-03.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-03.htm (working copy)
@@ -1,3 +0,0 @@
-<html><body>[Whispering]<br>
-<font color="LEVEL">Too many have entered, I can't let you go in.</font>
-</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Klein/31540-06.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540-06.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540-06.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+So far, between 150 and 200 people have entered the Hall of Flames. Do you wish to enter?<br>
+<a action="bypass -h npc_%objectId%_Quest Klein teleportInside">Enter</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/html/admin/grandboss_valakas.htm
===================================================================
--- dist/game/data/html/admin/grandboss_valakas.htm (revision 10248)
+++ dist/game/data/html/admin/grandboss_valakas.htm (working copy)
@@ -19,9 +19,16 @@
<td>Respawn time:</td>
<td>%respawnTime%</td>
</tr>
+ <tr>
+ <td>Players inside:</td>
+ <td>%playersInside%</td>
+ </tr>
</table>
<br>
<br>
+<button value="Respawn Valakas" action="bypass -h admin_grandboss_respawn 29028" width=200 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td><br1>
+<button value="Skip waiting time" action="bypass -h admin_grandboss_skip 29028" width=200 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td><br1>
+<button value="Abort Fight" action="bypass -h admin_grandboss_abort 29028" width=200 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td><br1>
<button value="Teleport to Klein" action="bypass -h admin_move_to 183632 -114891 -3337" width=200 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td><br1>
<button value="Teleport to Heart of Volcano" action="bypass -h admin_move_to 189865 -105364 -786" width=200 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td><br1>
<button value="Teleport to Valakas Nest" action="bypass -h admin_move_to 213896 -115436 -1644" width=200 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td><br1>
Index: dist/game/data/stats/npcs/31600-31700.xml
===================================================================
--- dist/game/data/stats/npcs/31600-31700.xml (revision 10248)
+++ dist/game/data/stats/npcs/31600-31700.xml (working copy)
@@ -3518,13 +3518,11 @@
<height normal="20" grown="24" />
</collision>
</npc>
- <npc id="31686" level="70" type="L2Npc" name="Gatekeeper of Fire Dragon">
+ <npc id="31686" level="70" type="L2Doormen" name="Gatekeeper of Fire Dragon">
<!-- Confirmed CT2.5 -->
<parameters>
<param name="MoveAroundSocial" value="215" />
<param name="MoveAroundSocial1" value="215" />
- <param name="SDoorName" value="valakas_door_03" />
- <param name="close_time" value="3600000" />
</parameters>
<race>UNDEAD</race>
<sex>MALE</sex>
@@ -3562,13 +3560,11 @@
<height normal="25" />
</collision>
</npc>
- <npc id="31687" level="70" type="L2Npc" name="Gatekeeper of Fire Dragon">
+ <npc id="31687" level="70" type="L2Doormen" name="Gatekeeper of Fire Dragon">
<!-- Confirmed CT2.5 -->
<parameters>
<param name="MoveAroundSocial" value="215" />
<param name="MoveAroundSocial1" value="215" />
- <param name="SDoorName" value="valakas_door_02" />
- <param name="close_time" value="3600000" />
</parameters>
<race>UNDEAD</race>
<sex>MALE</sex>
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-01.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-01.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-01.htm (working copy)
@@ -1,4 +0,0 @@
-<html><body>Watcher of Valakas Klein:<br>
-Until now, less than 50 people have attempted the Hall of Flames. Are you sure you want to enter it?<br>
-<a action="bypass -h Quest GrandBossTeleporters 31540">Enter</A>
-</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-04.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-04.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-04.htm (working copy)
@@ -1,3 +0,0 @@
-<html><body>[Whispering]<br>
-You cannot enter.
-</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/GrandBossTeleporters.java
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/GrandBossTeleporters.java (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/GrandBossTeleporters.java (working copy)
@@ -1,214 +0,0 @@
-/*
- * Copyright (C) 2004-2014 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.npc.Teleports.GrandBossTeleporters;
-
-import ai.individual.Valakas;
-import ai.npc.AbstractNpcAI;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.datatables.DoorTable;
-import com.l2jserver.gameserver.instancemanager.GrandBossManager;
-import com.l2jserver.gameserver.instancemanager.QuestManager;
-import com.l2jserver.gameserver.model.Location;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.quest.Quest;
-import com.l2jserver.gameserver.model.quest.QuestState;
-import com.l2jserver.gameserver.model.zone.type.L2BossZone;
-
-/**
- * Grand Bosses teleport AI.<br>
- * Original python script by Emperorc.
- * @author Plim
- */
-public final class GrandBossTeleporters extends AbstractNpcAI
-{
- // NPCs
- private static final int[] NPCs =
- {
- 31384, // Gatekeeper of Fire Dragon : Opening some doors
- 31385, // Heart of Volcano : Teleport into Lair of Valakas
- 31540, // Watcher of Valakas Klein : Teleport into Hall of Flames
- 31686, // Gatekeeper of Fire Dragon : Opens doors to Heart of Volcano
- 31687, // Gatekeeper of Fire Dragon : Opens doors to Heart of Volcano
- 31759, // Teleportation Cubic : Teleport out of Lair of Valakas
- };
- // Items
- private static final int VACUALITE_FLOATING_STONE = 7267;
- private static final Location ENTER_HALL_OF_FLAMES = new Location(183813, -115157, -3303);
- private static final Location TELEPORT_INTO_VALAKAS_LAIR = new Location(204328, -111874, 70);
- private static final Location TELEPORT_OUT_OF_VALAKAS_LAIR = new Location(150037, -57720, -2976);
-
- private static int playerCount = 0;
-
- private GrandBossTeleporters()
- {
- super(GrandBossTeleporters.class.getSimpleName(), "ai/npc/Teleports");
- addStartNpc(NPCs);
- addTalkId(NPCs);
- }
-
- @Override
- public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- {
- String htmltext = "";
- QuestState st = player.getQuestState(getName());
-
- if (st == null)
- {
- st = newQuestState(player);
- }
-
- if (st.hasQuestItems(VACUALITE_FLOATING_STONE))
- {
- player.teleToLocation(ENTER_HALL_OF_FLAMES);
- st.set("allowEnter", "1");
- }
- else
- {
- htmltext = "31540-06.htm";
- }
- return htmltext;
- }
-
- @Override
- public String onTalk(L2Npc npc, L2PcInstance player)
- {
- String htmltext = "";
- QuestState st = player.getQuestState(getName());
-
- if (st == null)
- {
- return null;
- }
-
- switch (npc.getId())
- {
- case 31385:
- {
- if (valakasAI() != null)
- {
- int status = GrandBossManager.getInstance().getBossStatus(29028);
-
- if ((status == 0) || (status == 1))
- {
- if (playerCount >= 200)
- {
- htmltext = "31385-03.htm";
- }
- else if (st.getInt("allowEnter") == 1)
- {
- st.unset("allowEnter");
- L2BossZone zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632);
-
- if (zone != null)
- {
- zone.allowPlayerEntry(player, 30);
- }
-
- player.teleToLocation(TELEPORT_INTO_VALAKAS_LAIR.getX() + getRandom(600), TELEPORT_INTO_VALAKAS_LAIR.getY() + getRandom(600), TELEPORT_INTO_VALAKAS_LAIR.getZ());
-
- playerCount++;
-
- if (status == 0)
- {
- L2GrandBossInstance valakas = GrandBossManager.getInstance().getBoss(29028);
- valakasAI().startQuestTimer("beginning", Config.VALAKAS_WAIT_TIME * 60000, valakas, null);
- GrandBossManager.getInstance().setBossStatus(29028, 1);
- }
- }
- else
- {
- htmltext = "31385-04.htm";
- }
- }
- else if (status == 2)
- {
- htmltext = "31385-02.htm";
- }
- else
- {
- htmltext = "31385-01.htm";
- }
- }
- else
- {
- htmltext = "31385-01.htm";
- }
- break;
- }
- case 31384:
- {
- DoorTable.getInstance().getDoor(24210004).openMe();
- break;
- }
- case 31686:
- {
- DoorTable.getInstance().getDoor(24210006).openMe();
- break;
- }
- case 31687:
- {
- DoorTable.getInstance().getDoor(24210005).openMe();
- break;
- }
- case 31540:
- {
- if (playerCount < 50)
- {
- htmltext = "31540-01.htm";
- }
- else if (playerCount < 100)
- {
- htmltext = "31540-02.htm";
- }
- else if (playerCount < 150)
- {
- htmltext = "31540-03.htm";
- }
- else if (playerCount < 200)
- {
- htmltext = "31540-04.htm";
- }
- else
- {
- htmltext = "31540-05.htm";
- }
- break;
- }
- case 31759:
- {
- player.teleToLocation(TELEPORT_OUT_OF_VALAKAS_LAIR.getX() + getRandom(500), TELEPORT_OUT_OF_VALAKAS_LAIR.getY() + getRandom(500), TELEPORT_OUT_OF_VALAKAS_LAIR.getZ());
- break;
- }
- }
- return htmltext;
- }
-
- private Quest valakasAI()
- {
- return QuestManager.getInstance().getQuest(Valakas.class.getSimpleName());
- }
-
- public static void main(String[] args)
- {
- new GrandBossTeleporters();
- }
-}
Index: dist/game/data/scripts/ai/npc/Klein/31540-07.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540-07.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540-07.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+So far, over 200 people have entered the Hall of Flames. Do you wish to enter?<br>
+<a action="bypass -h npc_%objectId%_Quest Klein teleportInside">Enter</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Klein/31540-04.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540-04.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540-04.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+So far, between 50 and 100 people have entered the Hall of Flames. Do you wish to enter?<br>
+<a action="bypass -h npc_%objectId%_Quest Klein teleportInside">Enter</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/html/doormen/31687.htm
===================================================================
--- dist/game/data/html/doormen/31687.htm (revision 0)
+++ dist/game/data/html/doormen/31687.htm (working copy)
@@ -0,0 +1,6 @@
+<html><body>Gatekeeper of the Fire Dragon:<br>
+Congratulations on making it this far! I'm sorry, but this door can only be opened by the gatekeeper of the fire dragon on the other side of the crossroads you just passed. The door I control is behind him.<br>
+If you made it this far, you should be alright. Remember, if you have a companion, you can open both doors simultaneously.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 24210005">"Please open the door."</a><br>
+<a action="bypass -h talk_select">Quest </a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts.cfg
===================================================================
--- dist/game/data/scripts.cfg (revision 10248)
+++ dist/game/data/scripts.cfg (working copy)
@@ -38,6 +38,7 @@
ai/npc/FreyasSteward/FreyasSteward.java
ai/npc/Jinia/Jinia.java
ai/npc/KetraOrcSupport/KetraOrcSupport.java
+ai/npc/Klein/Klein.java
ai/npc/MercenaryCaptain/MercenaryCaptain.java
ai/npc/Minigame/Minigame.java
ai/npc/MonumentOfHeroes/MonumentOfHeroes.java
Index: dist/game/data/scripts/ai/npc/Klein/31540-02.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540-02.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540-02.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+You must triumph over the family or gatekeepers of Valakas inside the Hall of Flames if you expect to obtain the charm of blessing or charm of relief.<br>
+Either one of them will help you deal with Valakas.
+</body></html>
\ No newline at end of file
Index: dist/game/data/stats/npcs/31500-31600.xml
===================================================================
--- dist/game/data/stats/npcs/31500-31600.xml (revision 10248)
+++ dist/game/data/stats/npcs/31500-31600.xml (working copy)
@@ -1638,7 +1638,6 @@
<parameters>
<param name="MoveAroundSocial" value="80" />
<param name="MoveAroundSocial1" value="80" />
- <param name="ItemNeeded" value="7267" /> <!-- Vacualite Floating Stone -->
</parameters>
<race>UNDEAD</race>
<sex>MALE</sex>
Index: dist/game/data/stats/npcs/31300-31400.xml
===================================================================
--- dist/game/data/stats/npcs/31300-31400.xml (revision 10248)
+++ dist/game/data/stats/npcs/31300-31400.xml (working copy)
@@ -3418,13 +3418,11 @@
<height normal="39.5" />
</collision>
</npc>
- <npc id="31384" level="70" type="L2Npc" name="Gatekeeper of Fire Dragon">
+ <npc id="31384" level="70" type="L2Doormen" name="Gatekeeper of Fire Dragon">
<!-- Confirmed CT2.5 -->
<parameters>
<param name="MoveAroundSocial" value="215" />
<param name="MoveAroundSocial1" value="215" />
- <param name="SDoorName" value="valakas_door_01" />
- <param name="close_time" value="3600000" />
</parameters>
<race>UNDEAD</race>
<sex>MALE</sex>
Index: dist/game/data/html/doormen/31384.htm
===================================================================
--- dist/game/data/html/doormen/31384.htm (revision 0)
+++ dist/game/data/html/doormen/31384.htm (working copy)
@@ -0,0 +1,5 @@
+<html><body>Gatekeeper of the Fire Dragon:<br>
+Good job finding this road! It may be rough, but you'll reach your destination much sooner. Do you wish to enter this door behind me?<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 24210004">"Yes."</a><br>
+<a action="bypass -h talk_select">Quest </a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Klein/31540-01.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540-01.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540-01.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+The Hall of Flames leads to Valakas, the fire dragon. It's guarded by the minions of Valakas! If you get past them, you can meet Valakas. To prevent people from entering this dangerous place, no one may actually walk the path...<br>
+After all this, you still want to enter the Hall of Flames? Bring me a Vacualite Floating Stone! Remember, it can be used only once.
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/individual/Valakas/Valakas.java
===================================================================
--- dist/game/data/scripts/ai/individual/Valakas/Valakas.java (revision 0)
+++ dist/game/data/scripts/ai/individual/Valakas/Valakas.java (working copy)
@@ -0,0 +1,586 @@
+/*
+ * Copyright (C) 2004-2014 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.Valakas;
+
+import java.util.List;
+
+import ai.npc.AbstractNpcAI;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.instancemanager.GrandBossManager;
+import com.l2jserver.gameserver.instancemanager.ZoneManager;
+import com.l2jserver.gameserver.model.L2Party;
+import com.l2jserver.gameserver.model.Location;
+import com.l2jserver.gameserver.model.StatsSet;
+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.L2GrandBossInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
+import com.l2jserver.gameserver.model.skills.Skill;
+import com.l2jserver.gameserver.model.zone.type.L2NoRestartZone;
+import com.l2jserver.gameserver.network.NpcStringId;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
+import com.l2jserver.gameserver.network.serverpackets.PlaySound;
+import com.l2jserver.gameserver.network.serverpackets.SpecialCamera;
+
+/**
+ * Valakas AI.
+ * @author St3eT
+ */
+public final class Valakas extends AbstractNpcAI
+{
+ // NPC
+ private static final int VALAKAS = 29028;
+ private static final int VOLCANO = 31385;
+ private static final int CUBE = 31759;
+ // Locations
+ private static final Location REST_ROOM = new Location(-105200, -253104, -15264);
+ private static final Location ENTRANCE = new Location(204187, -111864, 34);
+ private static final Location VALAKAS_SPAWN = new Location(212852, -114842, -1632);
+ private static final Location OUT_LOC = new Location(150037, -57720, -2976);
+ private static final Location[] CUBE_LOC =
+ {
+ new Location(214880, -116144, -1644),
+ new Location(213696, -116592, -1644),
+ new Location(212112, -116688, -1644),
+ new Location(211184, -115472, -1664),
+ new Location(210336, -114592, -1644),
+ new Location(211360, -113904, -1644),
+ new Location(213152, -112352, -1644),
+ new Location(214032, -113232, -1644),
+ new Location(214752, -114592, -1644),
+ new Location(209824, -115568, -1421),
+ new Location(210528, -112192, -1403),
+ new Location(213120, -111136, -1408),
+ new Location(215184, -111504, -1392),
+ new Location(215456, -117328, -1392),
+ new Location(213200, -118160, -1424),
+ };
+ // Skills
+ private static final SkillHolder VALAKAS_REGEN1 = new SkillHolder(4691, 1);
+ private static final SkillHolder VALAKAS_REGEN2 = new SkillHolder(4691, 2);
+ private static final SkillHolder VALAKAS_REGEN3 = new SkillHolder(4691, 3);
+ private static final SkillHolder VALAKAS_REGEN4 = new SkillHolder(4691, 4);
+ private static final SkillHolder VALAKAS_REGEN5 = new SkillHolder(4691, 5);
+ private static final SkillHolder LAVA_SKIN = new SkillHolder(4680, 1); // PowerUp
+ // Status
+ private static final int ALIVE = 0;
+ private static final int WAITING = 1;
+ private static final int IN_FIGHT = 2;
+ private static final int DEAD = 3;
+ // Zone
+ private static final L2NoRestartZone zone = ZoneManager.getInstance().getZoneById(70052, L2NoRestartZone.class); // Valakas Nest zone
+ // Misc
+ private static final int MAX_PEOPLE = 200; // Max allowed players
+ private L2GrandBossInstance _valakas = null;
+ private static long _lastAttack = 0;
+
+ private Valakas()
+ {
+ super(Valakas.class.getSimpleName(), "ai/individual");
+ addStartNpc(VOLCANO, CUBE);
+ addFirstTalkId(VOLCANO, CUBE);
+ addTalkId(VOLCANO, CUBE);
+ addKillId(VALAKAS);
+
+ final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
+ final int curr_hp = info.getInt("currentHP");
+ final int curr_mp = info.getInt("currentMP");
+ final int loc_x = info.getInt("loc_x");
+ final int loc_y = info.getInt("loc_y");
+ final int loc_z = info.getInt("loc_z");
+ final int heading = info.getInt("heading");
+ final long respawnTime = info.getLong("respawn_time");
+
+ switch (getStatus())
+ {
+ case ALIVE:
+ {
+ _valakas = (L2GrandBossInstance) addSpawn(VALAKAS, REST_ROOM, false, 0);
+ _valakas.setCurrentHpMp(curr_hp, curr_mp);
+ addBoss(_valakas);
+ break;
+ }
+ case WAITING:
+ {
+ _valakas = (L2GrandBossInstance) addSpawn(VALAKAS, REST_ROOM, false, 0);
+ _valakas.setCurrentHpMp(curr_hp, curr_mp);
+ addBoss(_valakas);
+ startQuestTimer("SPAWN_VALAKAS", Config.VALAKAS_WAIT_TIME * 60000, null, null);
+ break;
+ }
+ case IN_FIGHT:
+ {
+ _valakas = (L2GrandBossInstance) addSpawn(VALAKAS, loc_x, loc_y, loc_z, heading, false, 0);
+ _valakas.setCurrentHpMp(curr_hp, curr_mp);
+ addBoss(_valakas);
+ _lastAttack = System.currentTimeMillis();
+ startQuestTimer("CHECK_ATTACK", 60000, _valakas, null);
+ startQuestTimer("SPAWN_MINION", 300000, _valakas, null);
+ break;
+ }
+ case DEAD:
+ {
+ final long remain = respawnTime - System.currentTimeMillis();
+ if (remain > 0)
+ {
+ startQuestTimer("CLEAR_STATUS", remain, null, null);
+ }
+ else
+ {
+ setStatus(ALIVE);
+ _valakas = (L2GrandBossInstance) addSpawn(VALAKAS, REST_ROOM, false, 0);
+ addBoss(_valakas);
+ }
+ break;
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+ {
+ switch (event)
+ {
+ case "enter":
+ {
+ String htmltext = null;
+ if (getStatus() == DEAD)
+ {
+ htmltext = "heart_of_volcano002.htm";
+ }
+ else if (getStatus() == IN_FIGHT)
+ {
+ htmltext = "heart_of_volcano003.htm";
+ }
+ else if (zone.getPlayersInside().size() >= MAX_PEOPLE)
+ {
+ htmltext = "heart_of_volcano004.htm";
+ }
+ else
+ {
+ if (player.isInParty())
+ {
+ final L2Party party = player.getParty();
+ final boolean isInCC = party.isInCommandChannel();
+ final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
+ final List<L2PcInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
+
+ if (isPartyLeader)
+ {
+ if (members.size() > (MAX_PEOPLE - zone.getPlayersInside().size()))
+ {
+ htmltext = "heart_of_volcano004.htm";
+ }
+ else
+ {
+ for (L2PcInstance member : members)
+ {
+ if (member.isInsideRadius(npc, 1000, true, false))
+ {
+ member.teleToLocation(ENTRANCE);
+ }
+ }
+ if (getStatus() != WAITING)
+ {
+ setStatus(WAITING);
+ startQuestTimer("SPAWN_VALAKAS", Config.VALAKAS_WAIT_TIME * 60000, null, null);
+ }
+ }
+ }
+ else
+ {
+ if (getStatus() != WAITING)
+ {
+ setStatus(WAITING);
+ startQuestTimer("SPAWN_VALAKAS", Config.VALAKAS_WAIT_TIME * 60000, null, null);
+ }
+ player.teleToLocation(ENTRANCE);
+ }
+ }
+ else
+ {
+ if (getStatus() != WAITING)
+ {
+ setStatus(WAITING);
+ startQuestTimer("SPAWN_VALAKAS", Config.VALAKAS_WAIT_TIME * 60000, null, null);
+ }
+ player.teleToLocation(ENTRANCE);
+ }
+ }
+ return htmltext;
+ }
+ case "teleportOut":
+ {
+ final Location loc = new Location(OUT_LOC.getX() + getRandom(500), OUT_LOC.getY() + getRandom(500), OUT_LOC.getZ());
+ player.teleToLocation(loc);
+ }
+ case "SPAWN_VALAKAS":
+ {
+ _valakas.teleToLocation(VALAKAS_SPAWN);
+ setStatus(IN_FIGHT);
+ _lastAttack = System.currentTimeMillis();
+ zone.broadcastPacket(new PlaySound("BS03_A"));
+ startQuestTimer("CAMERA_1", 23, _valakas, null);
+ break;
+ }
+ case "CAMERA_1":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1800, 180, -1, 1500, 15000, 10000, 0, 0, 1, 0, 0));
+ startQuestTimer("CAMERA_2", 1500, npc, null);
+ break;
+ }
+ case "CAMERA_2":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1300, 180, -5, 3000, 15000, 10000, 0, -5, 1, 0, 0));
+ startQuestTimer("CAMERA_3", 3300, npc, null);
+ break;
+ }
+ case "CAMERA_3":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 500, 180, -8, 600, 15000, 10000, 0, 60, 1, 0, 0));
+ startQuestTimer("CAMERA_4", 2900, npc, null);
+ break;
+ }
+ case "CAMERA_4":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 800, 180, -8, 2700, 15000, 10000, 0, 30, 1, 0, 0));
+ startQuestTimer("CAMERA_5", 2700, npc, null);
+ break;
+ }
+ case "CAMERA_5":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 200, 250, 70, 0, 15000, 10000, 30, 80, 1, 0, 0));
+ startQuestTimer("CAMERA_6", 1, npc, null);
+ break;
+ }
+ case "CAMERA_6":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1100, 250, 70, 2500, 15000, 10000, 30, 80, 1, 0, 0));
+ startQuestTimer("CAMERA_7", 3200, npc, null);
+ break;
+ }
+ case "CAMERA_7":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 700, 150, 30, 0, 15000, 10000, -10, 60, 1, 0, 0));
+ startQuestTimer("CAMERA_8", 1400, npc, null);
+ break;
+ }
+ case "CAMERA_8":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1200, 150, 20, 2900, 15000, 10000, -10, 30, 1, 0, 0));
+ startQuestTimer("CAMERA_9", 6700, npc, null);
+ break;
+ }
+ case "CAMERA_9":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 750, 170, -10, 3400, 15000, 4000, 10, -15, 1, 0, 0));
+ startQuestTimer("START_MOVE", 5700, npc, null);
+ break;
+ }
+ case "CAMERA_10":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1100, 210, -5, 3000, 15000, 10000, -13, 0, 1, 1, 0));
+ startQuestTimer("CAMERA_11", 3500, npc, null);
+ }
+ case "CAMERA_11":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1300, 200, -8, 3000, 15000, 10000, 0, 15, 1, 1, 0));
+ startQuestTimer("CAMERA_12", 4500, npc, null);
+ }
+ case "CAMERA_12":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1000, 190, 0, 500, 15000, 10000, 0, 10, 1, 1, 0));
+ startQuestTimer("CAMERA_13", 500, npc, null);
+ }
+ case "CAMERA_13":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1700, 120, 0, 2500, 15000, 10000, 12, 40, 1, 1, 0));
+ startQuestTimer("CAMERA_14", 4600, npc, null);
+ }
+ case "CAMERA_14":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1700, 20, 0, 700, 15000, 10000, 10, 10, 1, 1, 0));
+ startQuestTimer("CAMERA_15", 750, npc, null);
+ }
+ case "CAMERA_15":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1700, 10, 0, 1000, 15000, 10000, 20, 70, 1, 1, 0));
+ startQuestTimer("CAMERA_16", 2500, npc, null);
+ }
+ case "CAMERA_16":
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 1700, 10, 0, 300, 15000, 250, 20, -20, 1, 1, 0));
+ }
+ case "START_MOVE":
+ {
+ npc.doCast(VALAKAS_REGEN1.getSkill());
+ startQuestTimer("CHECK_ATTACK", 60000, npc, null);
+ startQuestTimer("SPAWN_MINION", 60000, npc, null);
+ for (L2PcInstance players : npc.getKnownList().getKnownPlayersInRadius(4000))
+ {
+ if (players.isHero())
+ {
+ zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_YOU_CANNOT_HOPE_TO_DEFEAT_ME_WITH_YOUR_MEAGER_STRENGTH, 2, 4000, players.getName()));
+ break;
+ }
+ }
+ break;
+ }
+ case "SET_REGEN":
+ {
+ if (npc.getCurrentHp() < (npc.getMaxHp() * 0.2))
+ {
+ npc.doCast(VALAKAS_REGEN5.getSkill());
+ }
+ else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.4))
+ {
+ npc.doCast(VALAKAS_REGEN4.getSkill());
+ }
+ else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.6))
+ {
+ npc.doCast(VALAKAS_REGEN3.getSkill());
+ }
+ else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.8))
+ {
+ npc.doCast(VALAKAS_REGEN2.getSkill());
+ }
+ else
+ {
+ npc.doCast(VALAKAS_REGEN1.getSkill());
+ }
+ startQuestTimer("SET_REGEN", 60000, npc, null);
+ break;
+ }
+ case "CHECK_ATTACK":
+ {
+ if ((npc != null) && ((_lastAttack + 900000) < System.currentTimeMillis()))
+ {
+ setStatus(ALIVE);
+ for (L2Character charInside : zone.getCharactersInside())
+ {
+ if (charInside != null)
+ {
+ if (charInside.isNpc())
+ {
+ if (charInside.getId() == VALAKAS)
+ {
+ charInside.teleToLocation(REST_ROOM);
+ }
+ else
+ {
+ charInside.deleteMe();
+ }
+ }
+ else if (charInside.isPlayer())
+ {
+ final Location loc = new Location(OUT_LOC.getX() + getRandom(500), OUT_LOC.getY() + getRandom(500), OUT_LOC.getZ());
+ charInside.teleToLocation(loc);
+ }
+ }
+ }
+ }
+ else
+ {
+ startQuestTimer("CHECK_ATTACK", 60000, _valakas, null);
+ }
+ break;
+ }
+ case "SPAWN_MINION":
+ {
+ final L2Attackable mob = (L2Attackable) npc;
+ if (mob.getAggroList().size() >= 5)
+ {
+ // TODO: mob.getAggroList().sort(Comparator.comparingInt(AgroInfo::getHate))
+ }
+ startQuestTimer("SPAWN_MINION", 60000, npc, null);
+ break;
+ }
+ case "CLEAR_STATUS":
+ {
+ _valakas = (L2GrandBossInstance) addSpawn(VALAKAS, REST_ROOM, false, 0);
+ addBoss(_valakas);
+ setStatus(ALIVE);
+ break;
+ }
+ case "CLEAR_ZONE":
+ {
+ for (L2Character charInside : zone.getCharactersInside())
+ {
+ if (charInside != null)
+ {
+ if (charInside.isNpc())
+ {
+ charInside.deleteMe();
+ }
+ else if (charInside.isPlayer())
+ {
+ final Location loc = new Location(OUT_LOC.getX() + getRandom(500), OUT_LOC.getY() + getRandom(500), OUT_LOC.getZ());
+ charInside.teleToLocation(loc);
+ }
+ }
+ }
+ break;
+ }
+ case "SKIP_WAITING":
+ {
+ if (getStatus() == WAITING)
+ {
+ cancelQuestTimer("SPAWN_VALAKAS", null, null);
+ notifyEvent("SPAWN_VALAKAS", null, null);
+ player.sendMessage(getClass().getSimpleName() + ": Skipping waiting time ...");
+ }
+ else
+ {
+ player.sendMessage(getClass().getSimpleName() + ": You cant skip waiting time right now!");
+ }
+ break;
+ }
+ case "RESPAWN_VALAKAS":
+ {
+ if (getStatus() == DEAD)
+ {
+ setRespawn(0);
+ cancelQuestTimer("CLEAR_STATUS", null, null);
+ notifyEvent("CLEAR_STATUS", null, null);
+ player.sendMessage(getClass().getSimpleName() + ": Valakas has been respawned.");
+ }
+ else
+ {
+ player.sendMessage(getClass().getSimpleName() + ": You cant respawn valakas while valakas is alive!");
+ }
+ break;
+ }
+ case "ABORT_FIGHT":
+ {
+ if (getStatus() == IN_FIGHT)
+ {
+ setStatus(ALIVE);
+ cancelQuestTimer("CHECK_ATTACK", _valakas, null);
+ cancelQuestTimer("SPAWN_MINION", _valakas, null);
+ for (L2Character charInside : zone.getCharactersInside())
+ {
+ if (charInside != null)
+ {
+ if (charInside.isNpc())
+ {
+ if (charInside.getId() == VALAKAS)
+ {
+ charInside.teleToLocation(REST_ROOM);
+ }
+ else
+ {
+ charInside.deleteMe();
+ }
+ }
+ else if (charInside.isPlayer() && !charInside.isGM())
+ {
+ final Location loc = new Location(OUT_LOC.getX() + getRandom(500), OUT_LOC.getY() + getRandom(500), OUT_LOC.getZ());
+ charInside.teleToLocation(loc);
+ }
+ }
+ }
+ player.sendMessage(getClass().getSimpleName() + ": Fight has been aborted!");
+ }
+ else
+ {
+ player.sendMessage(getClass().getSimpleName() + ": You cant abort fight right now!");
+ }
+ break;
+ }
+ default:
+ {
+ _log.info("Vyhledávaný event: \"" + event + "\" nebyl nalezen!");
+ }
+ }
+ return super.onAdvEvent(event, npc, player);
+ }
+
+ @Override
+ public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
+ {
+ return super.onAttack(npc, attacker, damage, isSummon);
+ }
+
+ @Override
+ public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
+ {
+ if (zone.isCharacterInZone(killer))
+ {
+ zone.broadcastPacket(new SpecialCamera(npc, 2000, 130, -1, 0, 15000, 10000, 0, 0, 1, 1, 0));
+ zone.broadcastPacket(new PlaySound("B03_D"));
+ startQuestTimer("CAMERA_10", 500, npc, null);
+ long respawnTime = (Config.VALAKAS_SPAWN_INTERVAL + getRandom(-Config.VALAKAS_SPAWN_RANDOM, Config.VALAKAS_SPAWN_RANDOM)) * 3600000;
+ setRespawn(respawnTime);
+ for (Location loc : CUBE_LOC)
+ {
+ addSpawn(CUBE, loc, false, 900000);
+ }
+ startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
+ cancelQuestTimer("SET_REGEN", npc, null);
+ cancelQuestTimer("CHECK_ATTACK", npc, null);
+ cancelQuestTimer("SPAWN_MINION", npc, null);
+ startQuestTimer("CLEAR_ZONE", 900000, null, null);
+ setStatus(DEAD);
+ }
+ return super.onKill(npc, killer, isSummon);
+ }
+
+ @Override
+ public String onSpawn(L2Npc npc)
+ {
+ cancelQuestTimer("SET_REGEN", npc, null);
+ startQuestTimer("SET_REGEN", 60000, npc, null);
+ ((L2Attackable) npc).setOnKillDelay(0);
+ return super.onSpawn(npc);
+ }
+
+ @Override
+ public String onSpellFinished(L2Npc npc, L2PcInstance player, Skill skill)
+ {
+ return super.onSpellFinished(npc, player, skill);
+ }
+
+ private int getStatus()
+ {
+ return GrandBossManager.getInstance().getBossStatus(VALAKAS);
+ }
+
+ private void addBoss(L2GrandBossInstance grandboss)
+ {
+ GrandBossManager.getInstance().addBoss(grandboss);
+ }
+
+ private void setStatus(int status)
+ {
+ GrandBossManager.getInstance().setBossStatus(VALAKAS, status);
+ }
+
+ private void setRespawn(long respawnTime)
+ {
+ GrandBossManager.getInstance().getStatsSet(VALAKAS).set("respawn_time", (System.currentTimeMillis() + respawnTime));
+ }
+
+ public static void main(String[] args)
+ {
+ new Valakas();
+ }
+}
\ No newline at end of file
Index: dist/game/data/scripts/ai/individual/Valakas.java
===================================================================
--- dist/game/data/scripts/ai/individual/Valakas.java (revision 10248)
+++ dist/game/data/scripts/ai/individual/Valakas.java (working copy)
@@ -1,571 +0,0 @@
-/*
- * Copyright (C) 2004-2014 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;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import ai.npc.AbstractNpcAI;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.GeoData;
-import com.l2jserver.gameserver.ai.CtrlIntention;
-import com.l2jserver.gameserver.datatables.SkillData;
-import com.l2jserver.gameserver.enums.MountType;
-import com.l2jserver.gameserver.instancemanager.GrandBossManager;
-import com.l2jserver.gameserver.model.Location;
-import com.l2jserver.gameserver.model.StatsSet;
-import com.l2jserver.gameserver.model.actor.L2Character;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.L2Playable;
-import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.holders.SkillHolder;
-import com.l2jserver.gameserver.model.skills.BuffInfo;
-import com.l2jserver.gameserver.model.skills.Skill;
-import com.l2jserver.gameserver.model.zone.type.L2BossZone;
-import com.l2jserver.gameserver.network.serverpackets.PlaySound;
-import com.l2jserver.gameserver.network.serverpackets.SocialAction;
-import com.l2jserver.gameserver.network.serverpackets.SpecialCamera;
-import com.l2jserver.gameserver.util.Util;
-
-/**
- * Valakas' AI.
- * @author Tryskell
- */
-public final class Valakas extends AbstractNpcAI
-{
- // NPC
- private static final int VALAKAS = 29028;
- // Skills
- private static final SkillHolder VALAKAS_LAVA_SKIN = new SkillHolder(4680, 1);
- private static final int VALAKAS_REGENERATION = 4691;
-
- private static final SkillHolder[] VALAKAS_REGULAR_SKILLS =
- {
- new SkillHolder(4681, 1), // Valakas Trample
- new SkillHolder(4682, 1), // Valakas Trample
- new SkillHolder(4683, 1), // Valakas Dragon Breath
- new SkillHolder(4689, 1), // Valakas Fear TODO: has two levels only level one is used.
- };
-
- private static final SkillHolder[] VALAKAS_LOWHP_SKILLS =
- {
- new SkillHolder(4681, 1), // Valakas Trample
- new SkillHolder(4682, 1), // Valakas Trample
- new SkillHolder(4683, 1), // Valakas Dragon Breath
- new SkillHolder(4689, 1), // Valakas Fear TODO: has two levels only level one is used.
- new SkillHolder(4690, 1), // Valakas Meteor Storm
- };
-
- private static final SkillHolder[] VALAKAS_AOE_SKILLS =
- {
- new SkillHolder(4683, 1), // Valakas Dragon Breath
- new SkillHolder(4684, 1), // Valakas Dragon Breath
- new SkillHolder(4685, 1), // Valakas Tail Stomp
- new SkillHolder(4686, 1), // Valakas Tail Stomp
- new SkillHolder(4688, 1), // Valakas Stun
- new SkillHolder(4689, 1), // Valakas Fear TODO: has two levels only level one is used.
- new SkillHolder(4690, 1), // Valakas Meteor Storm
- };
-
- // Locations
- private static final Location TELEPORT_CUBE_LOCATIONS[] =
- {
- new Location(214880, -116144, -1644),
- new Location(213696, -116592, -1644),
- new Location(212112, -116688, -1644),
- new Location(211184, -115472, -1664),
- new Location(210336, -114592, -1644),
- new Location(211360, -113904, -1644),
- new Location(213152, -112352, -1644),
- new Location(214032, -113232, -1644),
- new Location(214752, -114592, -1644),
- new Location(209824, -115568, -1421),
- new Location(210528, -112192, -1403),
- new Location(213120, -111136, -1408),
- new Location(215184, -111504, -1392),
- new Location(215456, -117328, -1392),
- new Location(213200, -118160, -1424)
- };
- private static final Location ATTACKER_REMOVE = new Location(150037, -57255, -2976);
- private static final Location VALAKAS_LAIR = new Location(212852, -114842, -1632);
- private static final Location VALAKAS_REGENERATION_LOC = new Location(-105200, -253104, -15264);
- // Valakas status.
- private static final byte DORMANT = 0; // Valakas is spawned and no one has entered yet. Entry is unlocked.
- private static final byte WAITING = 1; // Valakas is spawned and someone has entered, triggering a 30 minute window for additional people to enter. Entry is unlocked.
- private static final byte FIGHTING = 2; // Valakas is engaged in battle, annihilating his foes. Entry is locked.
- private static final byte DEAD = 3; // Valakas has been killed. Entry is locked.
- // Misc
- private long _timeTracker = 0; // Time tracker for last attack on Valakas.
- private L2Playable _actualVictim; // Actual target of Valakas.
- private static L2BossZone ZONE;
-
- private Valakas()
- {
- super(Valakas.class.getSimpleName(), "ai/individual");
- registerMobs(VALAKAS);
-
- ZONE = GrandBossManager.getInstance().getZone(212852, -114842, -1632);
- final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
- final int status = GrandBossManager.getInstance().getBossStatus(VALAKAS);
-
- if (status == DEAD)
- {
- // load the unlock date and time for valakas from DB
- long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
- if (temp > 0)
- {
- // The time has not yet expired. Mark Valakas as currently locked (dead).
- startQuestTimer("valakas_unlock", temp, null, null);
- }
- else
- {
- // The time has expired while the server was offline. Spawn valakas in his cave as DORMANT.
- final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 0, false, 0);
- GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
- GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
-
- valakas.setIsInvul(true);
- valakas.setRunning();
-
- valakas.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- }
- }
- else
- {
- final int loc_x = info.getInt("loc_x");
- final int loc_y = info.getInt("loc_y");
- final int loc_z = info.getInt("loc_z");
- final int heading = info.getInt("heading");
- final int hp = info.getInt("currentHP");
- final int mp = info.getInt("currentMP");
-
- final L2Npc valakas = addSpawn(VALAKAS, loc_x, loc_y, loc_z, heading, false, 0);
- GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
-
- valakas.setCurrentHpMp(hp, mp);
- valakas.setRunning();
-
- // Start timers.
- if (status == FIGHTING)
- {
- // stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
-
- startQuestTimer("regen_task", 60000, valakas, null, true);
- startQuestTimer("skill_task", 2000, valakas, null, true);
- }
- else
- {
- valakas.setIsInvul(true);
- valakas.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
-
- // Start timer to lock entry after 30 minutes
- if (status == WAITING)
- {
- startQuestTimer("beginning", (Config.VALAKAS_WAIT_TIME * 60000), valakas, null);
- }
- }
- }
- }
-
- @Override
- public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- {
- if (npc != null)
- {
- if (event.equalsIgnoreCase("beginning"))
- {
- // Stores current time
- _timeTracker = System.currentTimeMillis();
-
- // Teleport Valakas to his lair.
- npc.teleToLocation(VALAKAS_LAIR);
-
- // Sound + socialAction.
- for (L2PcInstance plyr : ZONE.getPlayersInside())
- {
- plyr.sendPacket(new PlaySound(1, "B03_A", 0, 0, 0, 0, 0));
- plyr.sendPacket(new SocialAction(npc.getObjectId(), 3));
- }
-
- // Launch the cinematic, and tasks (regen + skill).
- startQuestTimer("spawn_1", 1700, npc, null); // 1700
- startQuestTimer("spawn_2", 3200, npc, null); // 1500
- startQuestTimer("spawn_3", 6500, npc, null); // 3300
- startQuestTimer("spawn_4", 9400, npc, null); // 2900
- startQuestTimer("spawn_5", 12100, npc, null); // 2700
- startQuestTimer("spawn_6", 12430, npc, null); // 330
- startQuestTimer("spawn_7", 15430, npc, null); // 3000
- startQuestTimer("spawn_8", 16830, npc, null); // 1400
- startQuestTimer("spawn_9", 23530, npc, null); // 6700 - end of cinematic
- startQuestTimer("spawn_10", 26000, npc, null); // 2500 - AI + unlock
- }
- // Regeneration && inactivity task
- else if (event.equalsIgnoreCase("regen_task"))
- {
- // Inactivity task - 15min
- if (GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING)
- {
- if ((_timeTracker + 900000) < System.currentTimeMillis())
- {
- npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- npc.teleToLocation(VALAKAS_REGENERATION_LOC);
-
- GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
- npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
-
- // Drop all players from the zone.
- ZONE.oustAllPlayers();
-
- // Cancel skill_task and regen_task.
- cancelQuestTimer("regen_task", npc, null);
- cancelQuestTimer("skill_task", npc, null);
- return null;
- }
- }
-
- // Verify if "Valakas Regeneration" skill is active.
- final BuffInfo info = npc.getEffectList().getBuffInfoBySkillId(VALAKAS_REGENERATION);
- final int lvl = info != null ? info.getSkill().getLevel() : 0;
-
- // Current HPs are inferior to 25% ; apply lvl 4 of regen skill.
- if ((npc.getCurrentHp() < (npc.getMaxHp() / 4)) && (lvl != 4))
- {
- npc.setTarget(npc);
- npc.doCast(SkillData.getInstance().getSkill(VALAKAS_REGENERATION, 4));
- }
- // Current HPs are inferior to 50% ; apply lvl 3 of regen skill.
- else if ((npc.getCurrentHp() < ((npc.getMaxHp() * 2) / 4.0)) && (lvl != 3))
- {
- npc.setTarget(npc);
- npc.doCast(SkillData.getInstance().getSkill(VALAKAS_REGENERATION, 3));
- }
- // Current HPs are inferior to 75% ; apply lvl 2 of regen skill.
- else if ((npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0)) && (lvl != 2))
- {
- npc.setTarget(npc);
- npc.doCast(SkillData.getInstance().getSkill(VALAKAS_REGENERATION, 2));
- }
- // Apply lvl 1.
- else if (lvl != 1)
- {
- npc.setTarget(npc);
- npc.doCast(SkillData.getInstance().getSkill(VALAKAS_REGENERATION, 1));
- }
- }
- // Spawn cinematic, regen_task and choose of skill.
- else if (event.equalsIgnoreCase("spawn_1"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1800, 180, -1, 1500, 15000, 10000, 0, 0, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_2"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1300, 180, -5, 3000, 15000, 10000, 0, -5, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_3"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 500, 180, -8, 600, 15000, 10000, 0, 60, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_4"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 800, 180, -8, 2700, 15000, 10000, 0, 30, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_5"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 200, 250, 70, 0, 15000, 10000, 30, 80, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_6"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1100, 250, 70, 2500, 15000, 10000, 30, 80, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_7"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 700, 150, 30, 0, 15000, 10000, -10, 60, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_8"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1200, 150, 20, 2900, 15000, 10000, -10, 30, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_9"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 750, 170, -10, 3400, 15000, 4000, 10, -15, 1, 0, 0));
- }
- else if (event.equalsIgnoreCase("spawn_10"))
- {
- GrandBossManager.getInstance().setBossStatus(VALAKAS, FIGHTING);
- npc.setIsInvul(false);
-
- startQuestTimer("regen_task", 60000, npc, null, true);
- startQuestTimer("skill_task", 2000, npc, null, true);
- }
- // Death cinematic, spawn of Teleport Cubes.
- else if (event.equalsIgnoreCase("die_1"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 2000, 130, -1, 0, 15000, 10000, 0, 0, 1, 1, 0));
- }
- else if (event.equalsIgnoreCase("die_2"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1100, 210, -5, 3000, 15000, 10000, -13, 0, 1, 1, 0));
- }
- else if (event.equalsIgnoreCase("die_3"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1300, 200, -8, 3000, 15000, 10000, 0, 15, 1, 1, 0));
- }
- else if (event.equalsIgnoreCase("die_4"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1000, 190, 0, 500, 15000, 10000, 0, 10, 1, 1, 0));
- }
- else if (event.equalsIgnoreCase("die_5"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1700, 120, 0, 2500, 15000, 10000, 12, 40, 1, 1, 0));
- }
- else if (event.equalsIgnoreCase("die_6"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1700, 20, 0, 700, 15000, 10000, 10, 10, 1, 1, 0));
- }
- else if (event.equalsIgnoreCase("die_7"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1700, 10, 0, 1000, 15000, 10000, 20, 70, 1, 1, 0));
- }
- else if (event.equalsIgnoreCase("die_8"))
- {
- ZONE.broadcastPacket(new SpecialCamera(npc, 1700, 10, 0, 300, 15000, 250, 20, -20, 1, 1, 0));
-
- for (Location loc : TELEPORT_CUBE_LOCATIONS)
- {
- addSpawn(31759, loc, false, 900000);
- }
-
- startQuestTimer("remove_players", 900000, null, null);
- }
- else if (event.equalsIgnoreCase("skill_task"))
- {
- callSkillAI(npc);
- }
- }
- else
- {
- if (event.equalsIgnoreCase("valakas_unlock"))
- {
- final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0);
- GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
- GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
- }
- else if (event.equalsIgnoreCase("remove_players"))
- {
- ZONE.oustAllPlayers();
- }
- }
- return super.onAdvEvent(event, npc, player);
- }
-
- @Override
- public String onSpawn(L2Npc npc)
- {
- npc.disableCoreAI(true);
- return super.onSpawn(npc);
- }
-
- @Override
- public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
- {
- if (!ZONE.isInsideZone(attacker))
- {
- attacker.doDie(attacker);
- return null;
- }
-
- if (npc.isInvul())
- {
- return null;
- }
-
- if (GrandBossManager.getInstance().getBossStatus(VALAKAS) != FIGHTING)
- {
- attacker.teleToLocation(ATTACKER_REMOVE);
- return null;
- }
-
- // Debuff strider-mounted players.
- if (attacker.getMountType() == MountType.STRIDER)
- {
- final Skill skill = SkillData.getInstance().getSkill(4258, 1);
- if (!attacker.isAffectedBySkill(4258))
- {
- npc.setTarget(attacker);
- npc.doCast(skill);
- }
- }
- _timeTracker = System.currentTimeMillis();
-
- return super.onAttack(npc, attacker, damage, isSummon);
- }
-
- @Override
- public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
- {
- // Cancel skill_task and regen_task.
- cancelQuestTimer("regen_task", npc, null);
- cancelQuestTimer("skill_task", npc, null);
-
- // Launch death animation.
- ZONE.broadcastPacket(new PlaySound(1, "B03_D", 0, 0, 0, 0, 0));
- ZONE.broadcastPacket(new SpecialCamera(npc, 1200, 20, -10, 0, 10000, 13000, 0, 0, 0, 0, 0));
-
- startQuestTimer("die_1", 300, npc, null); // 300
- startQuestTimer("die_2", 600, npc, null); // 300
- startQuestTimer("die_3", 3800, npc, null); // 3200
- startQuestTimer("die_4", 8200, npc, null); // 4400
- startQuestTimer("die_5", 8700, npc, null); // 500
- startQuestTimer("die_6", 13300, npc, null); // 4600
- startQuestTimer("die_7", 14000, npc, null); // 700
- startQuestTimer("die_8", 16500, npc, null); // 2500
-
- GrandBossManager.getInstance().setBossStatus(VALAKAS, DEAD);
- // Calculate Min and Max respawn times randomly.
- long respawnTime = Config.VALAKAS_SPAWN_INTERVAL + getRandom(-Config.VALAKAS_SPAWN_RANDOM, Config.VALAKAS_SPAWN_RANDOM);
- respawnTime *= 3600000;
-
- startQuestTimer("valakas_unlock", respawnTime, null, null);
- // also save the respawn time so that the info is maintained past reboots
- StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
- info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
- GrandBossManager.getInstance().setStatsSet(VALAKAS, info);
-
- return super.onKill(npc, killer, isSummon);
- }
-
- @Override
- public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon)
- {
- return null;
- }
-
- private void callSkillAI(L2Npc npc)
- {
- if (npc.isInvul() || npc.isCastingNow())
- {
- return;
- }
-
- // Pickup a target if no or dead victim. 10% luck he decides to reconsiders his target.
- if ((_actualVictim == null) || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || (getRandom(10) == 0))
- {
- _actualVictim = getRandomTarget(npc);
- }
-
- // If result is still null, Valakas will roam. Don't go deeper in skill AI.
- if (_actualVictim == null)
- {
- if (getRandom(10) == 0)
- {
- int x = npc.getX();
- int y = npc.getY();
- int z = npc.getZ();
-
- int posX = x + getRandom(-1400, 1400);
- int posY = y + getRandom(-1400, 1400);
-
- if (GeoData.getInstance().canMove(x, y, z, posX, posY, z, npc.getInstanceId()))
- {
- npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, z, 0));
- }
- }
- return;
- }
-
- final Skill skill = getRandomSkill(npc).getSkill();
-
- // Cast the skill or follow the target.
- if (Util.checkIfInRange((skill.getCastRange() < 600) ? 600 : skill.getCastRange(), npc, _actualVictim, true))
- {
- npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- npc.setIsCastingNow(true);
- npc.setTarget(_actualVictim);
- npc.doCast(skill);
- }
- else
- {
- npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, _actualVictim, null);
- npc.setIsCastingNow(false);
- }
- }
-
- /**
- * Pick a random skill.<br>
- * Valakas will mostly use utility skills. If Valakas feels surrounded, he will use AoE skills.<br>
- * Lower than 50% HPs, he will begin to use Meteor skill.
- * @param npc valakas
- * @return a skill holder
- */
- private SkillHolder getRandomSkill(L2Npc npc)
- {
- final int hpRatio = (int) ((npc.getCurrentHp() / npc.getMaxHp()) * 100);
-
- // Valakas Lava Skin has priority.
- if ((hpRatio < 75) && (getRandom(150) == 0) && !npc.isAffectedBySkill(VALAKAS_LAVA_SKIN.getSkillId()))
- {
- return VALAKAS_LAVA_SKIN;
- }
-
- // Valakas will use mass spells if he feels surrounded.
- if (Util.getPlayersCountInRadius(1200, npc, false, false) >= 20)
- {
- return VALAKAS_AOE_SKILLS[getRandom(VALAKAS_AOE_SKILLS.length)];
- }
-
- if (hpRatio > 50)
- {
- return VALAKAS_REGULAR_SKILLS[getRandom(VALAKAS_REGULAR_SKILLS.length)];
- }
-
- return VALAKAS_LOWHP_SKILLS[getRandom(VALAKAS_LOWHP_SKILLS.length)];
- }
-
- /**
- * Pickup a random L2Playable from the zone, deads targets aren't included.
- * @param npc
- * @return a random L2Playable.
- */
- private L2Playable getRandomTarget(L2Npc npc)
- {
- List<L2Playable> result = new ArrayList<>();
-
- for (L2Character obj : npc.getKnownList().getKnownCharacters())
- {
- if ((obj == null) || obj.isPet())
- {
- continue;
- }
- else if (!obj.isDead() && obj.isPlayable())
- {
- result.add((L2Playable) obj);
- }
- }
-
- return (result.isEmpty()) ? null : result.get(getRandom(result.size()));
- }
-
- public static void main(String[] args)
- {
- new Valakas();
- }
-}
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Klein/31540-03.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540-03.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540-03.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+Until now, less than 50 people have attempted the Hall of Flames. Are you sure you want to enter it?<br>
+<a action="bypass -h npc_%objectId%_Quest Klein teleportInside">Enter</a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-05.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-05.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-05.htm (working copy)
@@ -1,4 +0,0 @@
-<html><body>Watcher of Valakas Klein:<br>
-So far, over 200 people have entered the Hall of Flames. Do you wish to enter?<br>
-<a action="bypass -h Quest GrandBossTeleporters 31540">Enter</A>
-</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-02.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-02.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-02.htm (working copy)
@@ -1,3 +0,0 @@
-<html><body>[Whispering]<br>
-<font color="LEVEL">The nest is full, you must wait.</font>
-</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-03.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-03.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31540-03.htm (working copy)
@@ -1,4 +0,0 @@
-<html><body>Watcher of Valakas Klein:<br>
-So far, between 100 and 150 people have entered the Hall of Flames. Do you wish to enter?<br>
-<a action="bypass -h Quest GrandBossTeleporters 31540">Enter</A>
-</body></html>
\ No newline at end of file
Index: dist/game/data/html/doormen/31686.htm
===================================================================
--- dist/game/data/html/doormen/31686.htm (revision 0)
+++ dist/game/data/html/doormen/31686.htm (working copy)
@@ -0,0 +1,6 @@
+<html><body>Gatekeeper of the Fire Dragon:<br>
+Congratulations on making it this far! I'm sorry, but this door can only be opened by the gatekeeper of the fire dragon on the other side of the crossroads you just passed. The door I control is behind him.<br>
+If you made it this far, you should be alright. Remember, if you have a companion, you can open both doors simultaneously.<br>
+<a action="bypass -h npc_%objectId%_open_doors 1, 24210006">"Please open the door."</a><br>
+<a action="bypass -h talk_select">Quest </a>
+</body></html>
\ No newline at end of file
Index: dist/game/data/zones/no_restart.xml
===================================================================
--- dist/game/data/zones/no_restart.xml (revision 10248)
+++ dist/game/data/zones/no_restart.xml (working copy)
@@ -132,7 +132,7 @@
<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 -->
+ <zone name="balakas_no_restart" id="70052" type="NoRestartZone" shape="NPoly" minZ="-2572" maxZ="5428"> <!-- 26_14 -->
<stat name="restartTime" val="1800" />
<node X="196866" Y="-130845" />
<node X="229289" Y="-130860" />
Index: dist/game/data/scripts/ai/npc/Klein/Klein.java
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/Klein.java (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/Klein.java (working copy)
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2004-2014 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.npc.Klein;
+
+import ai.npc.AbstractNpcAI;
+
+import com.l2jserver.gameserver.model.Location;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.variables.NpcVariables;
+
+/**
+ * Klein AI.
+ * @author St3eT
+ */
+public final class Klein extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KLEIN = 31540;
+ // Items
+ private static final int STONE = 7267; // Vacualite Floating Stone
+ // Locations
+ private static final Location TELE_LOC = new Location(183829, -115406, -3326);
+
+ private Klein()
+ {
+ super(Klein.class.getSimpleName(), "ai/npc/Teleports");
+ addStartNpc(KLEIN);
+ addFirstTalkId(KLEIN);
+ addTalkId(KLEIN);
+ addSpawnId(KLEIN);
+ }
+
+ @Override
+ public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+ {
+ final NpcVariables vars = npc.getVariables();
+ String htmltext = null;
+ switch (event)
+ {
+ case "31540-01.htm":
+ case "31540-02.htm":
+ {
+ htmltext = event;
+ }
+ case "2002":
+ {
+ if ((System.currentTimeMillis() - npc.getVariables().getInt("i_ai4")) > 3600)
+ {
+ vars.set("i_ai3", vars.getInt("i_ai2", 0));
+ vars.set("i_ai2", vars.getInt("i_ai1", 0));
+ vars.set("i_ai1", vars.getInt("i_ai0", 0));
+ vars.set("i_ai0", 0);
+ vars.set("i_ai4", System.currentTimeMillis());
+ }
+ break;
+ }
+ case "enter":
+ {
+ final int i0 = vars.getInt("i_ai3", 0) + vars.getInt("i_ai2", 0) + vars.getInt("i_ai1", 0) + vars.getInt("i_ai0", 0);
+ if (i0 < 50)
+ {
+ htmltext = "31540-03.htm";
+ }
+ else if (i0 < 100)
+ {
+ htmltext = "31540-04.htm";
+ }
+ else if (i0 < 150)
+ {
+ htmltext = "31540-05.htm";
+ }
+ else if (i0 < 200)
+ {
+ htmltext = "31540-06.htm";
+ }
+ else
+ {
+ htmltext = "31540-07.htm";
+ }
+ break;
+ }
+ case "teleportInside":
+ {
+ if (hasQuestItems(player, STONE))
+ {
+ takeItems(player, STONE, 1);
+ vars.set("i_ai0", vars.getInt("i_ai0", 0) + 1);
+ player.teleToLocation(TELE_LOC);
+ }
+ else
+ {
+ htmltext = "31540-08.htm";
+ }
+ break;
+ }
+ }
+ return htmltext;
+ }
+
+ @Override
+ public String onSpawn(L2Npc npc)
+ {
+ npc.getVariables().set("i_ai4", System.currentTimeMillis());
+ startQuestTimer("2002", 10000, npc, null, true);
+ return super.onSpawn(npc);
+ }
+
+ public static void main(String[] args)
+ {
+ new Klein();
+ }
+}
Index: dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-01.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-01.htm (revision 10248)
+++ dist/game/data/scripts/ai/npc/Teleports/GrandBossTeleporters/31385-01.htm (working copy)
@@ -1,3 +0,0 @@
-<html><body>[Whispering]<br>
-<font color="LEVEL">You can't confront Valakas yet. Away with you!</font>
-</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/handlers/admincommandhandlers/AdminGrandBoss.java
===================================================================
--- dist/game/data/scripts/handlers/admincommandhandlers/AdminGrandBoss.java (revision 10248)
+++ dist/game/data/scripts/handlers/admincommandhandlers/AdminGrandBoss.java (working copy)
@@ -24,6 +24,7 @@
import ai.individual.Antharas.Antharas;
import ai.individual.Baium.Baium;
+import ai.individual.Valakas.Valakas;
import com.l2jserver.gameserver.cache.HtmCache;
import com.l2jserver.gameserver.handler.IAdminCommandHandler;
@@ -44,6 +45,7 @@
private static final int ANTHARAS = 29068; // Antharas
private static final int ANTHARAS_ZONE = 70050; // Antharas Nest
private static final int VALAKAS = 29028; // Valakas
+ private static final int VALAKAS_ZONE = 70052;
private static final int BAIUM = 29020; // Baium
private static final int BAIUM_ZONE = 70051; // Baium Nest
private static final int QUEENANT = 29001; // Queen Ant
@@ -88,15 +90,23 @@
{
final int grandBossId = Integer.parseInt(st.nextToken());
- if (grandBossId == ANTHARAS)
+ switch (grandBossId)
{
- antharasAi().notifyEvent("SKIP_WAITING", null, activeChar);
- manageHtml(activeChar, grandBossId);
+ case ANTHARAS:
+ {
+ antharasAi().notifyEvent("SKIP_WAITING", null, activeChar);
+ manageHtml(activeChar, grandBossId);
+ }
+ case VALAKAS:
+ {
+ valakasAi().notifyEvent("SKIP_WAITING", null, activeChar);
+ manageHtml(activeChar, grandBossId);
+ }
+ default:
+ {
+ activeChar.sendMessage("Wrong ID!");
+ }
}
- else
- {
- activeChar.sendMessage("Wrong ID!");
- }
}
else
{
@@ -118,6 +128,11 @@
manageHtml(activeChar, grandBossId);
break;
}
+ case VALAKAS:
+ {
+ valakasAi().notifyEvent("RESPAWN_VALAKAS", null, activeChar);
+ manageHtml(activeChar, grandBossId);
+ }
case BAIUM:
{
baiumAi().notifyEvent("RESPAWN_BAIUM", null, activeChar);
@@ -180,6 +195,11 @@
manageHtml(activeChar, grandBossId);
break;
}
+ case VALAKAS:
+ {
+ antharasAi().notifyEvent("ABORT_FIGHT", null, activeChar);
+ manageHtml(activeChar, grandBossId);
+ }
case BAIUM:
{
baiumAi().notifyEvent("ABORT_FIGHT", null, activeChar);
@@ -223,6 +243,7 @@
}
case VALAKAS:
{
+ bossZone = ZoneManager.getInstance().getZoneById(VALAKAS_ZONE, L2NoRestartZone.class);
htmlPatch = "data/html/admin/grandboss_valakas.htm";
break;
}
@@ -322,6 +343,11 @@
return QuestManager.getInstance().getQuest(Antharas.class.getSimpleName());
}
+ private Quest valakasAi()
+ {
+ return QuestManager.getInstance().getQuest(Valakas.class.getSimpleName());
+ }
+
private Quest baiumAi()
{
return QuestManager.getInstance().getQuest(Baium.class.getSimpleName());
Index: dist/game/data/scripts/ai/npc/Klein/31540.htm
===================================================================
--- dist/game/data/scripts/ai/npc/Klein/31540.htm (revision 0)
+++ dist/game/data/scripts/ai/npc/Klein/31540.htm (working copy)
@@ -0,0 +1,7 @@
+<html><body>Watcher of Valakas Klein:<br>
+Why are you here? Are you by any chance looking for the Hall of Flames behind me?<br>
+<a action="bypass -h npc_%objectId%_Quest Klein 31540-01.htm">"Tell me more about the Hall of Flames."</a><br>
+<a action="bypass -h npc_%objectId%_Quest Klein 31540-02.htm"> "Tell me about the Amulet of Blessing and Amulet of Rescue."</a><br>
+<a action="bypass -h npc_%objectId%_Quest Klein enter">"I want to enter the Hall of Flames."</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment