From 17b287427defdbc7f2b6e008aa8d400ace43a4db Mon Sep 17 00:00:00 2001
From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Thu, 24 Feb 2022 11:21:59 +0000
Subject: [PATCH] Addition of Dwelling Of Spirits instance. Contributed by
Serenitty.
---
.../dist/game/data/DailyMission.xml | 32 +-
.../game/data/instances/DwellingOfSpirits.xml | 125 ++
.../data/instances/ResidenceOfKingIgnis.xml | 38 -
.../data/instances/ResidenceOfKingPetram.xml | 36 -
.../instances/ResidenceOfKingProcella.xml | 31 -
.../data/instances/ResidenceOfQueenNebula.xml | 36 -
.../admincommandhandlers/AdminPledge.java | 21 +
.../instances/DwellingOfSpirits/34176.htm | 4 +
.../DwellingOfSpirits/DwellingOfSpirits.java | 1058 +++++++++++++++++
.../instances/MonsterArena/30202-01.htm | 10 +-
.../instances/MonsterArena/30202-02.htm | 24 +-
.../instances/MonsterArena/30202-03.htm | 17 +-
.../instances/MonsterArena/34169-01.htm | 44 +
.../instances/MonsterArena/34169-02.htm | 13 +
.../instances/MonsterArena/34169-03.htm | 16 +
.../instances/MonsterArena/34169-04.htm | 48 +
.../instances/MonsterArena/MonsterArena.java | 106 +-
.../ResidenceOfKingIgnis.java | 248 ----
.../ResidenceOfKingPetram.java | 229 ----
.../ResidenceOfKingProcella.java | 182 ---
.../ResidenceOfQueenNebula.java | 231 ----
.../dist/game/data/stats/npcs/29100-29199.xml | 8 +-
.../game/data/stats/skills/50000-50099.xml | 2 +-
.../dist/game/data/zones/teleportzones.xml | 79 ++
.../instancemanager/DailyTaskManager.java | 9 +
.../GlobalVariablesManager.java | 1 +
.../dist/game/data/DailyMission.xml | 32 +-
.../game/data/instances/DwellingOfSpirits.xml | 125 ++
.../data/instances/ResidenceOfKingIgnis.xml | 38 -
.../data/instances/ResidenceOfKingPetram.xml | 36 -
.../instances/ResidenceOfKingProcella.xml | 31 -
.../data/instances/ResidenceOfQueenNebula.xml | 36 -
.../instances/DwellingOfSpirits/34176.htm | 4 +
.../DwellingOfSpirits/DwellingOfSpirits.java | 1058 +++++++++++++++++
.../instances/MonsterArena/34169-02.htm | 2 +-
.../ResidenceOfKingIgnis.java | 248 ----
.../ResidenceOfKingPetram.java | 229 ----
.../ResidenceOfKingProcella.java | 182 ---
.../ResidenceOfQueenNebula.java | 231 ----
.../dist/game/data/stats/npcs/29100-29199.xml | 8 +-
.../game/data/stats/skills/50000-50099.xml | 2 +-
.../dist/game/data/zones/teleportzones.xml | 76 ++
.../dist/game/data/DailyMission.xml | 32 +-
.../game/data/instances/DwellingOfSpirits.xml | 125 ++
.../data/instances/ResidenceOfKingIgnis.xml | 38 -
.../data/instances/ResidenceOfKingPetram.xml | 36 -
.../instances/ResidenceOfKingProcella.xml | 31 -
.../data/instances/ResidenceOfQueenNebula.xml | 36 -
.../instances/DwellingOfSpirits/34176.htm | 4 +
.../DwellingOfSpirits/DwellingOfSpirits.java | 1058 +++++++++++++++++
.../instances/MonsterArena/34169-02.htm | 2 +-
.../ResidenceOfKingIgnis.java | 248 ----
.../ResidenceOfKingPetram.java | 229 ----
.../ResidenceOfKingProcella.java | 182 ---
.../ResidenceOfQueenNebula.java | 231 ----
.../dist/game/data/stats/npcs/29100-29199.xml | 8 +-
.../game/data/stats/skills/50000-50099.xml | 2 +-
.../dist/game/data/zones/teleportzones.xml | 76 ++
58 files changed, 4129 insertions(+), 3195 deletions(-)
create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/DwellingOfSpirits.xml
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingIgnis.xml
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingPetram.xml
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingProcella.xml
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfQueenNebula.xml
create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-01.htm
create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-03.htm
create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-04.htm
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/zones/teleportzones.xml
create mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/DwellingOfSpirits.xml
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingIgnis.xml
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingPetram.xml
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingProcella.xml
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfQueenNebula.xml
create mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
create mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
create mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/DwellingOfSpirits.xml
delete mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingIgnis.xml
delete mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingPetram.xml
delete mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingProcella.xml
delete mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfQueenNebula.xml
create mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
create mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
delete mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
delete mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
delete mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
delete mode 100644 L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/DailyMission.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/DailyMission.xml
index 5d9074b2e6..aea835b083 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/DailyMission.xml
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/DailyMission.xml
@@ -992,43 +992,43 @@
Victory Pack
+ -->
- Weekly mission. A reward is given for defeating 1 enemy together with your clan members in the Clan Arena.
+
40
99
- Spirit Ore
- Clan XP
- Scroll: Boost Attack
+
+
+
- Weekly mission. A reward is given for defeating monsters during a clan raid to the Dwelling of Spirits.
+
76
99
- Improved Water Attack Potion
- Improved Wind Attack Potion
- Improved Earth Attack Potion
- Improved Fire Attack Potion
+
+
+
+
- Weekly mission. A reward is given for defeating Ignis, Nebula, Procella or Petram during a clan raid to the Dwelling of Spirits.
+
76
99
- Improved Water Attack Potion
- Improved Wind Attack Potion
- Improved Earth Attack Potion
- Improved Fire Attack Potion
+
+
+
+
- -->
-
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/DwellingOfSpirits.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/DwellingOfSpirits.xml
new file mode 100644
index 0000000000..0a8bc01b34
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/DwellingOfSpirits.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingIgnis.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingIgnis.xml
deleted file mode 100644
index 042e27144a..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingIgnis.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingPetram.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingPetram.xml
deleted file mode 100644
index b0c695af74..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingPetram.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingProcella.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingProcella.xml
deleted file mode 100644
index 3466755d90..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfKingProcella.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfQueenNebula.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfQueenNebula.xml
deleted file mode 100644
index ff4e4911b7..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/instances/ResidenceOfQueenNebula.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminPledge.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminPledge.java
index cdd4d1e894..3f1eb85a98 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminPledge.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminPledge.java
@@ -21,6 +21,7 @@ import java.util.StringTokenizer;
import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.enums.UserInfoType;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.clan.Clan;
@@ -196,6 +197,26 @@ public class AdminPledge implements IAdminCommandHandler
}
break;
}
+ case "arena":
+ {
+ if (clan == null)
+ {
+ BuilderUtil.sendSysMessage(activeChar, "Target player has no clan!");
+ break;
+ }
+
+ try
+ {
+ final int stage = Integer.parseInt(param);
+ GlobalVariablesManager.getInstance().set(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + clan.getId(), stage);
+ BuilderUtil.sendSysMessage(activeChar, "You set " + stage + " Monster Arena stage for clan " + clan.getName() + "");
+ }
+ catch (Exception e)
+ {
+ BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge arena ");
+ }
+ break;
+ }
}
break;
}
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
new file mode 100644
index 0000000000..1ab7154aa4
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
@@ -0,0 +1,4 @@
+Animael:
+All done here?
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
new file mode 100644
index 0000000000..c2f13dc68c
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
@@ -0,0 +1,1058 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package instances.DwellingOfSpirits;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.l2jmobius.gameserver.data.xml.SkillData;
+import org.l2jmobius.gameserver.enums.ChatType;
+import org.l2jmobius.gameserver.enums.SkillFinishType;
+import org.l2jmobius.gameserver.enums.TeleportWhereType;
+import org.l2jmobius.gameserver.instancemanager.ZoneManager;
+import org.l2jmobius.gameserver.model.Party;
+import org.l2jmobius.gameserver.model.actor.Creature;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.holders.SkillHolder;
+import org.l2jmobius.gameserver.model.instancezone.Instance;
+import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
+import org.l2jmobius.gameserver.model.skill.Skill;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
+import org.l2jmobius.gameserver.model.zone.ZoneType;
+import org.l2jmobius.gameserver.network.NpcStringId;
+import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent;
+import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
+import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
+
+import instances.AbstractInstance;
+
+/**
+ * @author Serenitty
+ */
+public class DwellingOfSpirits extends AbstractInstance
+{
+ // CRITICAL NPCs
+ private static final int RUIP = 22273;
+ private static final int SEALSTONE = 34178;
+ private static final int ANIMAEL = 34176;
+ private static final int PORTAL_EVENT_FIRE = 15969;
+ private static final int PORTAL_EVENT_WATER = 15970;
+ private static final int PORTAL_EVENT_EARTH = 15972;
+ private static final int PORTAL_EVENT_WIND = 15971;
+
+ // PROCELLA BOSS WIND
+ private static final int KING_PROCELLA = 29107;
+ private static final int PROCELLA_GUARDIAN_1 = 29112;
+ private static final int PROCELLA_STORM = 29115;
+
+ private static final SkillHolder HURRICANE_SUMMON = new SkillHolder(50042, 1);
+ private static final int HURRICANE_BOLT = 50043;
+ private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1);
+ private static final int STORM_MAX_COUNT = 20; //
+
+ // PETRAM BOSS EARTH
+ private static final int KING_PETRAM = 29108;
+ private static final int PETRAM_PIECE = 29116;
+ private static final int PETRAM_FRAGMENT = 29117;
+ // Skills
+ private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1);
+ private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1);
+ private static final SkillHolder TEST = new SkillHolder(5712, 1);
+
+ // IGNIS BOSS FIRE
+ // NPCs
+ private static final int KING_IGNIS = 29105;
+ // Skills
+ private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
+ private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
+ private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
+ private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
+
+ // NEBULA BOSS WATER
+ // NPCs
+ private static final int KING_NEBULA = 29106;
+ private static final int WATER_SLIME = 29111;
+ // Skills
+ private static final int AQUA_RAGE = 50036;
+ private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
+ private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
+ private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
+ private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
+ private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
+ private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
+
+ // Entrace Portal Triggers
+ private static final int WIND_FIRST_TRIGGER_1 = 16158880;
+ private static final int WIND_FIRST_TRIGGER_2 = 16158882;
+ private static final int EARTH_FIRST_TRIGGER_1 = 16156660;
+ private static final int EARTH_FIRST_TRIGGER_2 = 16156662;
+ private static final int FIRE_FIRST_TRIGGER_1 = 16155550;
+ private static final int FIRE_FIRST_TRIGGER_2 = 16155552;
+ private static final int WATER_FIRST_TRIGGER_1 = 16157770;
+ private static final int WATER_FIRST_TRIGGER_2 = 16157772;
+
+ // Statue Kill Indicator Triggers
+ private static final int KILL_INDICATOR_TRIGGER_1 = 16159990;
+ private static final int KILL_INDICATOR_TRIGGER_2 = 16159994;
+ private static final int KILL_INDICATOR_TRIGGER_3 = 16159996;
+ private static final int KILL_INDICATOR_TRIGGER_4 = 16159998;
+ private static final int KILL_INDICATOR_TRIGGER_5 = 16159992;
+
+ private static final int TEMPLATE_ID = 214;
+
+ private static final Map PORTAL_MSG = new HashMap<>();
+ static
+ {
+ PORTAL_MSG.put(1, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_EARTH_IS_OPEN);
+ PORTAL_MSG.put(2, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_WATER_IS_OPEN);
+ PORTAL_MSG.put(3, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_WIND_IS_OPEN);
+ PORTAL_MSG.put(4, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_FIRE_IS_OPEN);
+ PORTAL_MSG.put(5, NpcStringId.SEAL_STONE_DISAPPEARS_AFTER_RESONATING_WITH_THE_STATUE);
+ }
+
+ public DwellingOfSpirits()
+ {
+ super(TEMPLATE_ID);
+ addKillId(KING_PETRAM, KING_NEBULA, KING_PROCELLA, KING_IGNIS);
+ addKillId(PROCELLA_GUARDIAN_1);
+ addKillId(PETRAM_PIECE, PETRAM_FRAGMENT);
+ addKillId(WATER_SLIME);
+ addAttackId(KING_PETRAM, KING_NEBULA, KING_PROCELLA, KING_IGNIS);
+ addSpawnId(KING_NEBULA);
+ addFirstTalkId(ANIMAEL, SEALSTONE);
+ addTalkId(ANIMAEL);
+ addStartNpc(SEALSTONE);
+ addCreatureSeeId(RUIP, ANIMAEL);
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, Player player)
+ {
+ switch (event)
+ {
+ case "ENTER":
+ {
+ if (player.isInParty())
+ {
+ final Party party = player.getParty();
+ final boolean isInCC = party.isInCommandChannel();
+ final List members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
+ for (Player member : members)
+ {
+ if (!member.isInsideRadius3D(npc, 1000))
+ {
+ player.sendMessage("Player " + member.getName() + " must go closer to Jay.");
+ }
+ enterInstance(member, npc, TEMPLATE_ID);
+ }
+ }
+ else if (player.isGM())
+ {
+ enterInstance(player, npc, TEMPLATE_ID);
+ player.sendMessage("SYS: You have entered as GM/Admin to Dwelling.");
+ }
+ else
+ {
+ if (!player.isInsideRadius3D(npc, 1000))
+ {
+ player.sendMessage("You must go closer to Jay.");
+ }
+ enterInstance(player, npc, TEMPLATE_ID);
+ }
+ break;
+ }
+
+ case "TELEPORT":
+ {
+ player.teleToLocation(TeleportWhereType.TOWN, null);
+ return null;
+ }
+ //////////////// BOSS PROCELLA WIND ACTION /////////////
+ case "SPAWN_MINION_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if ((world != null) && (npc.getId() == KING_PROCELLA))
+ {
+ world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
+ world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_1, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
+ world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_1, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
+ startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(KING_PROCELLA), player);
+ }
+ break;
+ }
+ case "SPAWN_STORM_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
+ {
+ world.getNpc(KING_PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
+ final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(KING_PROCELLA).getX() + getRandom(-500, 500), world.getNpc(KING_PROCELLA).getY() + getRandom(-500, 500), world.getNpc(KING_PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
+ procellaStorm.setRandomWalking(true);
+ world.getParameters().increaseInt("stormCount", 1);
+ startQuestTimer("SPAWN_STORM_PROCELLA", 30000, world.getNpc(KING_PROCELLA), player);
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, procellaStorm, player);
+ }
+ break;
+ }
+ case "HIDE_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PROCELLA_GUARDIAN_1) >= 1)
+ {
+ world.getNpc(KING_PROCELLA).setInvisible(true);
+ }
+ else if (world.getAliveNpcCount(PROCELLA_GUARDIAN_1) == 0)
+ {
+ world.getNpc(KING_PROCELLA).setInvisible(false);
+ startQuestTimer("SPAWN_MINION_PROCELLA", 90000 + getRandom(-15000, 11000), world.getNpc(KING_PROCELLA), player);
+ }
+ break;
+ }
+ case "CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Player plr = world.getPlayers().stream().findAny().orElse(null);
+ if ((plr != null) && (plr.isInsideRadius3D(npc, 200)))
+ {
+ npc.abortAttack();
+ npc.abortCast();
+ npc.setTarget(plr);
+ if (plr.getAffectedSkillLevel(HURRICANE_BOLT) == 1)
+ {
+ npc.abortCast();
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ else
+ {
+ if (SkillCaster.checkUseConditions(npc, HURRICANE_BOLT_LV_1.getSkill()))
+ {
+ npc.doCast(HURRICANE_BOLT_LV_1.getSkill());
+ }
+ }
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ else
+ {
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ }
+ break;
+ }
+ //////////////// BOSS PETRAM EARTH ACTION /////////////
+ case "SPAWN_MINION":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PETRAM_FRAGMENT) == 0)
+ {
+ npc.doCast(EARTH_ENERGY.getSkill());
+
+ if (!world.getParameters().getBoolean("spawnedMinions", false))
+ {
+ world.getParameters().set("spawnedMinions", true);
+
+ final int stage = world.getParameters().getInt("stage", 0);
+ world.getParameters().set("stage", stage + 1);
+
+ world.setParameter("minionpetram1", addSpawn(npc, PETRAM_FRAGMENT, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram3", addSpawn(npc, PETRAM_FRAGMENT, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
+
+ npc.setInvul(true);
+ npc.broadcastSay(ChatType.NPC_SHOUT, "HaHahaha, fighters lets kill them. Now Im invul!!!");
+ }
+
+ startQuestTimer("SUPPORT_PETRAM", 3000, npc, player);
+ }
+ break;
+ }
+ case "UNSPAWN_MINION":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PETRAM_FRAGMENT) == 0)
+ {
+ world.getParameters().set("spawnedMinions", false);
+
+ npc.setInvul(false);
+ npc.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
+ }
+ break;
+ }
+ case "SUPPORT_PETRAM":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Npc m1 = world.getParameters().getObject("minionpetram1", Npc.class);
+ final Npc m2 = world.getParameters().getObject("minionpetram2", Npc.class);
+ final Npc m3 = world.getParameters().getObject("minionpetram3", Npc.class);
+ final Npc m4 = world.getParameters().getObject("minionpetram4", Npc.class);
+ if (!m1.isDead())
+ {
+ m1.setTarget(world.getNpc(KING_PETRAM));
+ m1.doCast(TEST.getSkill());
+ }
+ if (!m2.isDead())
+ {
+ m2.setTarget(world.getNpc(KING_PETRAM));
+ m2.doCast(TEST.getSkill());
+ }
+ if (!m3.isDead())
+ {
+ m3.setTarget(world.getNpc(KING_PETRAM));
+ m3.doCast(TEST.getSkill());
+ }
+ if (!m4.isDead())
+ {
+ m4.setTarget(world.getNpc(KING_PETRAM));
+ m4.doCast(TEST.getSkill());
+ }
+
+ startQuestTimer("SUPPORT_PETRAM", 10100, npc, player);
+ }
+ break;
+ }
+ case "EARTH_FURY":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ npc.doCast(EARTH_FURY.getSkill());
+ }
+ break;
+ }
+ //////////////// BOSS IGNIS ACTION /////////////
+ case "CAST_FIRE_RAGE_1":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_2.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_2.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_2":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_4.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_4.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_3":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_6.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_6.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_4":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_8.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_8.getSkill());
+ }
+ break;
+ }
+ //////////////// BOSS NEBULA ACTION /////////////
+ case "SPAWN_WATER_SLIME":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Player plr = world.getPlayers().stream().findAny().get();
+ startQuestTimer("CAST_AQUA_RAGE", 30000 + getRandom(-15000, 15000), npc, plr);
+ if (npc.getId() == KING_NEBULA)
+ {
+ npc.doCast(AQUA_SUMMON.getSkill());
+ for (int i = 0; i < getRandom(4, 6); i++)
+ {
+ addSpawn(npc, WATER_SLIME, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, -1, true, npc.getInstanceId());
+ startQuestTimer("SPAWN_WATER_SLIME", 80000, npc, null);
+ }
+ }
+ }
+ break;
+ }
+ case "PLAYER_PARA":
+ {
+ if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
+ {
+ player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
+ player.setImmobilized(true);
+ startQuestTimer("PLAYER_UNPARA", 5000, npc, player);
+ }
+ break;
+ }
+ case "PLAYER_UNPARA":
+ {
+ player.getEffectList().stopSkillEffects(SkillFinishType.REMOVED, AQUA_RAGE_5.getSkill());
+ player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
+ player.setImmobilized(false);
+ break;
+ }
+ case "CAST_AQUA_RAGE":
+ {
+ startQuestTimer("CAST_AQUA_RAGE", 5000, npc, player);
+ if ((player.isInsideRadius3D(npc, 1000)))
+ {
+ if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_2.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_2.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_3.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_3.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_4.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_4.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_5.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_5.getSkill());
+ startQuestTimer("PLAYER_PARA", 100, npc, player);
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
+ {
+ npc.abortCast();
+ }
+ else
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_1.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_1.getSkill());
+ }
+ }
+ }
+ break;
+ }
+ case "check_status":
+ {
+ final Instance world = player.getInstanceWorld();
+ if (!isInInstance(world))
+ {
+ return null;
+ }
+
+ switch (world.getStatus())
+ {
+ case 0:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(1);
+ world.despawnGroup("sealstone");
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 1:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(2);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 2:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(3);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 3:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(4);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 4:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(5);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(3), null));
+ addSpawn(KING_PROCELLA, 212862, 179828, -15489, 48103, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 5: // Dummy stage pause, u need defeat boss to continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 6:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(7);
+ world.spawnGroup("ruipwave_1");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 7:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(8);
+ world.spawnGroup("NormalMobs");
+ world.spawnGroup("ruipwave_1");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 8:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(9);
+ world.spawnGroup("NormalMobs");
+ world.spawnGroup("ruipwave_2");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 9:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(10);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(1), null));
+ addSpawn(KING_PETRAM, 222063, 191514, -15486, 50142, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 10: // Dummy stage pause, u need defeat boss to continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 11:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(12);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 12:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(13);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 13:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(14);
+ world.spawnGroup("ruipwave_2");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 14:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(15);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(4), null));
+ addSpawn(KING_IGNIS, 202350, 169121, -15484, 48103, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 15: // Dummy stage pause, u need defeat boss for continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 16:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(17);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 17:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(18);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 18:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(19);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 19: // need defeat boss for finish.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+
+ {
+ world.setStatus(20);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(2), null));
+ addSpawn(KING_NEBULA, 222127, 169057, -15486, 48730, false, 0, false, world.getId());
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 20:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.getParameters().set("DwellingOfSpiritsFinished", true);
+ world.setStatus(21);
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ }
+
+ return null;
+ }
+ }
+
+ return super.onAdvEvent(event, npc, player);
+
+ }
+
+ @Override
+ public String onSpawn(Npc npc)
+ {
+ startQuestTimer("SPAWN_WATER_SLIME", 40000, npc, null);
+ return super.onSpawn(npc);
+ }
+
+ @Override
+ public String onAttack(Npc npc, Player player, int damage, boolean isSummon, Skill skill)
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world == null)
+ {
+ return null;
+ }
+
+ switch (npc.getId())
+ {
+ case KING_PROCELLA:
+ {
+ if (npc.getCurrentHp() < (npc.getMaxHp() * 0.90))
+ {
+ startQuestTimer("SPAWN_MINION_PROCELLA", 80000 + getRandom(-15000, 15000), npc, player);
+ startQuestTimer("SPAWN_STORM_PROCELLA", 4000, npc, player);
+ world.setParameter("stormCount", 0);
+ }
+ break;
+ }
+ case KING_PETRAM:
+ {
+ if (npc.getCurrentHp() < (npc.getMaxHp() * 0.80))
+ {
+ startQuestTimer("EARTH_FURY", 1000, npc, player);
+ if ((world.getParameters().getInt("stage", 0) == 0) || (npc.getCurrentHp() < (npc.getMaxHp() * 0.50)))
+ {
+ startQuestTimer("SPAWN_MINION", 1000, npc, player);
+ }
+ }
+ break;
+ }
+ case KING_IGNIS:
+ {
+ if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.90)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.70)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_1", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.50)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_2", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.50)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.40)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_3", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.25)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_4", 1000, npc, null);
+ }
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String onCreatureSee(Npc npc, Creature creature)
+ {
+ if (creature.isPlayer())
+ {
+ final Instance world = creature.getInstanceWorld();
+ if (world.getStatus() >= 5)
+ {
+ enableZoneWind();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WIND_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WIND_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 10)
+ {
+ enableZoneEarth();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(EARTH_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(EARTH_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 15)
+ {
+ enableZoneFire();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(FIRE_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(FIRE_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 20)
+ {
+ enableZoneWater();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WATER_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WATER_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 21)
+ {
+ world.despawnGroup("ruipwave_1");
+ world.despawnGroup("ruipwave_2");
+ world.despawnGroup("NormalMobs");
+ world.finishInstance();
+ }
+ }
+
+ return super.onCreatureSee(npc, creature);
+ }
+
+ @Override
+ public String onKill(Npc npc, Player player, boolean isSummon)
+ {
+ final Instance instance = npc.getInstanceWorld();
+
+ switch (npc.getId())
+ {
+ case KING_PETRAM:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_EARTH, 222065, 192767, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1); // set the portal visible
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneEarthExit();
+ cancelQuestTimer("SPAWN_MINION", npc, player);
+ instance.setStatus(12);
+ final Instance world = npc.getInstanceWorld();
+ for (Npc spawn : world.getNpcs(PETRAM_FRAGMENT))
+ {
+ spawn.deleteMe();
+ }
+ break;
+ }
+ case KING_NEBULA:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_WATER, 222127, 170488, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ player.sendPacket(new ExSendUIEvent(player, false, false, 0, 0, NpcStringId.TIME_LEFT));
+ setActive(true);
+ enableZoneWindExit();
+ instance.setStatus(21);
+ instance.spawnGroup("animael");
+ break;
+ }
+ case KING_IGNIS:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_FIRE, 202349, 170533, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneFireExit();
+ instance.setStatus(17);
+ break;
+ }
+ case KING_PROCELLA:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_WIND, 212863, 181090, -15487, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneWaterExit();
+ instance.setStatus(7);
+ final Instance world = npc.getInstanceWorld();
+ for (Npc spawn : world.getNpcs(PROCELLA_GUARDIAN_1))
+ {
+ spawn.deleteMe();
+ }
+ break;
+ }
+ case PETRAM_FRAGMENT:
+ {
+ startQuestTimer("UNSPAWN_MINION", 1000, instance.getNpc(KING_PETRAM), player);
+ break;
+ }
+ case PROCELLA_GUARDIAN_1:
+ {
+
+ startQuestTimer("HIDE_PROCELLA", 1000, instance.getNpc(KING_PROCELLA), player);
+ break;
+ }
+ case WATER_SLIME:
+ {
+ if (getRandomBoolean())
+ {
+ switch (player.getAffectedSkillLevel(AQUA_RAGE))
+ {
+ case 1:
+ {
+ player.stopSkillEffects(AQUA_RAGE_1.getSkill());
+ break;
+ }
+ case 2:
+ {
+ player.stopSkillEffects(AQUA_RAGE_2.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 1);
+ skill.applyEffects(player, player);
+ break;
+ }
+ case 3:
+ {
+ player.stopSkillEffects(AQUA_RAGE_3.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 2);
+ skill.applyEffects(player, player);
+ break;
+ }
+ case 4:
+ {
+ player.stopSkillEffects(AQUA_RAGE_4.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 3);
+ skill.applyEffects(player, player);
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ return super.onKill(npc, player, isSummon);
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, Player player)
+ {
+ if (npc.getId() == ANIMAEL)
+ {
+ return "34176.htm";
+ }
+
+ if (!player.getInstanceWorld().getParameters().getBoolean("PlayerEnter", false))
+ {
+ player.getInstanceWorld().setParameter("PlayerEnter", true);
+ player.getInstanceWorld().setDuration(30);
+ startEvent(npc, player);
+ }
+
+ return super.onFirstTalk(npc, player);
+ }
+
+ // PORTALS
+ private void enableZoneWind()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_wind");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneEarth()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_earth");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneFire()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_fire");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWater()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_water");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWindExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_procella");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneEarthExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_petram");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneFireExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_ignis");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWaterExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_nebula");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void startEvent(Npc npc, Player player)
+ {
+ if (!player.getInstanceWorld().getParameters().getBoolean("DwellingOfSpiritsFinished", false))
+ {
+ player.sendPacket(new ExSendUIEvent(player, false, false, 1800, 2, NpcStringId.TIME_LEFT));
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(5), null));
+ startQuestTimer("check_status", 1000, null, player);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ new DwellingOfSpirits();
+ }
+}
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-01.htm b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-01.htm
index 01db57722f..0ee7867bcb 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-01.htm
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-01.htm
@@ -10,30 +10,30 @@
-
Expand the influence of your clan!
+
In order to give every clan a chance to test their might a special venue was created. It s called the Clan arena.
-
Create alliance and challenge the enemies!
+
Gather a command channel and go to the Clan Arena
-
-
+
-
+
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-02.htm b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-02.htm
index 05fcbe0215..d01c4aefea 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-02.htm
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-02.htm
@@ -1,8 +1,18 @@
-Leo:
-Hello! We created special area in the Monster Arena for hard fights between characters in alliances. So go into battle for glory and power!
-To enter the Arena, members of one clan must form an alliance, and clan leader must confirm leader's rights.
-Remember that you can go to Arena only for 20 minutes! Of course, you can extend residence time. Well spend this fee for various research than help us to improve Arena.
-Arena battles are held once a week, the count is reset every Wednesday at 6:30 a.m. Battle begins with Raid 20 Lv. Level of available Raids grows gradually. Thanks to the progress' statistics higher level Raid will be available each week.
-The best thing is to have in alliance as many characters as possible.
-Home
+
+
+
+
+
+
+
+
+
+
+While at the Clan Arena a command channel created members of the same clan
+can respond to a challenge. You can stay inside for 3 minutes.,
+you can, however, extend you stay. Battles take place once a week,
+the counteris reset every Wednesday. the raid consist of 25 consecutive stages.
+Your progress is saved so you can start at the stage where you left off the week before.
+The stages will get significantly harder after you cleared the first 20..
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-03.htm b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-03.htm
index 15d0baae65..e62f34beeb 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-03.htm
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/30202-03.htm
@@ -1,5 +1,14 @@
-Leo:
-To enter the Arena, members of one clan must form an alliance, and clan leader must make an entrance request.
-Alliance can not enter the Arena without an entrance request from it's leader.
-Home
+
+
+
+
+
+
+
+
+
+
+The battle won't be easy, so there are certain conditions for participation.
+You can join battle only as a member of a party-command channel.
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-01.htm b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-01.htm
new file mode 100644
index 0000000000..36049a3ede
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-01.htm
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Nothing is impossible for a clan of friends!
+
+
+
+
+
+
Create a command channel and go for it!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-02.htm b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
new file mode 100644
index 0000000000..95ab5de5eb
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-03.htm b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-03.htm
new file mode 100644
index 0000000000..58df31c4a1
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-03.htm
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+Punitive expedition againt Frintezza is available for
+command channels with 10-40 warriors, all of whom have reached Lv 76.,
+After the start of the expedition you will have60 minutesto finish it.
+Every Wednesday and Saturday
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-04.htm b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-04.htm
new file mode 100644
index 0000000000..c7d2f59f6c
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/34169-04.htm
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Join the punitive expedition against Frintezza,
+
+
+
+
+
+
the last prince of Elmoreden,
+
+
+
+
+
+
who chose to accept the power
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/MonsterArena.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/MonsterArena.java
index 0af78ec5ea..f41a42a653 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/MonsterArena.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/MonsterArena/MonsterArena.java
@@ -20,11 +20,21 @@ import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
+import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.clan.Clan;
+import org.l2jmobius.gameserver.model.clan.ClanMember;
+import org.l2jmobius.gameserver.model.events.EventType;
+import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
+import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
+import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanLeft;
+import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.instancezone.Instance;
+import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent;
@@ -32,12 +42,12 @@ import instances.AbstractInstance;
/**
* @author Mobius
- * @URL https://l2wiki.com/classic/Clan_-_Clan_Arena
+ * @URL https://www.l2central.info/essence/articles/793.html?lang=en
*/
public class MonsterArena extends AbstractInstance
{
// NPCs
- private static final int LEO = 30202;
+ private static final int KOLDRUT_JAY = 34169;
private static final int MACHINE = 30203;
private static final int SUPPLIES = 30204;
private static final int[] BOSSES =
@@ -62,26 +72,33 @@ public class MonsterArena extends AbstractInstance
25811, // Satur
25812, // Kosnak
25813, // Garaki
+ // TODO: 21-25 bosses
+ // 25834, // Shadai
+ // 25835, // Tyrobait
+ // 25836, // Tier
+ // 25837, // Cherkia
+ // 25838, // Spicula
};
// Rewards
- private static final int BATTLE_BOX_1 = 70917;
- private static final int BATTLE_BOX_2 = 70918;
- private static final int BATTLE_BOX_3 = 70919;
- private static final int BATTLE_BOX_4 = 70920;
- private static final int TICKET_L = 90945;
+ private static final int BATTLE_BOX_1 = 90913;
+ private static final int BATTLE_BOX_2 = 90913;
+ private static final int BATTLE_BOX_3 = 90914;
+ private static final int BATTLE_BOX_4 = 90914;
+ private static final int VALOR_BOX = 90915;
private static final int TICKET_M = 90946;
private static final int TICKET_H = 90947;
+ // Skill
+ private static final int CLAN_EXUBERANCE = 1867;
// Misc
private static final Collection REWARDED_PLAYERS = ConcurrentHashMap.newKeySet();
- private static final String MONSTER_ARENA_VARIABLE = "MA_C";
private static final int TEMPLATE_ID = 192;
public MonsterArena()
{
super(TEMPLATE_ID);
- addStartNpc(LEO, MACHINE, SUPPLIES);
- addFirstTalkId(LEO, MACHINE, SUPPLIES);
- addTalkId(LEO, MACHINE, SUPPLIES);
+ addStartNpc(KOLDRUT_JAY, MACHINE, SUPPLIES);
+ addFirstTalkId(KOLDRUT_JAY, MACHINE, SUPPLIES);
+ addTalkId(KOLDRUT_JAY, MACHINE, SUPPLIES);
addKillId(BOSSES);
addInstanceLeaveId(TEMPLATE_ID);
}
@@ -91,6 +108,11 @@ public class MonsterArena extends AbstractInstance
{
switch (event)
{
+ case "34169.htm":
+ case "34169-01.htm":
+ case "34169-02.htm":
+ case "34169-03.htm":
+ case "34169-04.htm":
case "30202-01.htm":
case "30202-02.htm":
case "30202-03.htm":
@@ -146,16 +168,16 @@ public class MonsterArena extends AbstractInstance
machine.setScriptValue(player.getClanId());
// Initialize progress if it does not exist.
- if (GlobalVariablesManager.getInstance().getInt(MONSTER_ARENA_VARIABLE + machine.getScriptValue(), -1) == -1)
+ if (GlobalVariablesManager.getInstance().getInt(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + machine.getScriptValue(), -1) == -1)
{
- GlobalVariablesManager.getInstance().set(MONSTER_ARENA_VARIABLE + machine.getScriptValue(), 1);
+ GlobalVariablesManager.getInstance().set(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + machine.getScriptValue(), 1);
}
// On max progress, set last four bosses.
- final int progress = GlobalVariablesManager.getInstance().getInt(MONSTER_ARENA_VARIABLE + machine.getScriptValue());
- if (progress > 17)
+ final int progress = GlobalVariablesManager.getInstance().getInt(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + machine.getScriptValue());
+ if (progress > 17) // TODO: 22 for 25 total bosses.
{
- GlobalVariablesManager.getInstance().set(MONSTER_ARENA_VARIABLE + machine.getScriptValue(), 17);
+ GlobalVariablesManager.getInstance().set(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + machine.getScriptValue(), 17); // TODO: 22 for 25 total bosses.
}
startQuestTimer("machine_talk", 10000, machine, null);
@@ -181,7 +203,7 @@ public class MonsterArena extends AbstractInstance
world.setStatus(1);
for (Player plr : world.getPlayers())
{
- plr.sendPacket(new ExSendUIEvent(plr, false, false, 1200, 0, NpcStringId.TIME_LEFT));
+ plr.sendPacket(new ExSendUIEvent(plr, false, false, 1800, 0, NpcStringId.TIME_LEFT));
}
}
break;
@@ -191,7 +213,7 @@ public class MonsterArena extends AbstractInstance
final Instance world = npc.getInstanceWorld();
if (world != null)
{
- world.spawnGroup("boss_" + GlobalVariablesManager.getInstance().getInt(MONSTER_ARENA_VARIABLE + npc.getScriptValue()));
+ world.spawnGroup("boss_" + GlobalVariablesManager.getInstance().getInt(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + npc.getScriptValue()));
}
break;
}
@@ -210,7 +232,7 @@ public class MonsterArena extends AbstractInstance
// Mandatory reward.
final Npc machine = world.getNpc(MACHINE);
- final int progress = GlobalVariablesManager.getInstance().getInt(MONSTER_ARENA_VARIABLE + machine.getScriptValue());
+ final int progress = GlobalVariablesManager.getInstance().getInt(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + machine.getScriptValue());
if (progress > 16)
{
giveItems(player, BATTLE_BOX_4, 1);
@@ -231,7 +253,7 @@ public class MonsterArena extends AbstractInstance
// Rare reward.
if (getRandom(100) < 1) // 1% chance.
{
- giveItems(player, TICKET_L, 1);
+ giveItems(player, VALOR_BOX, 1);
}
else if (getRandom(100) < 1) // 1% chance.
{
@@ -283,7 +305,7 @@ public class MonsterArena extends AbstractInstance
machine.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HA_NOT_BAD);
// Save progress to global variables.
- GlobalVariablesManager.getInstance().increaseInt(MONSTER_ARENA_VARIABLE + machine.getScriptValue(), 1);
+ GlobalVariablesManager.getInstance().increaseInt(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + machine.getScriptValue(), 1);
// Spawn reward chests.
world.spawnGroup("supplies");
@@ -312,6 +334,48 @@ public class MonsterArena extends AbstractInstance
return npc.getId() + "-01.htm";
}
+ @RegisterEvent(EventType.ON_PLAYER_LOGIN)
+ @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
+ public void onPlayerLogin(OnPlayerLogin event)
+ {
+ final Player player = event.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ final Clan clan = player.getClan();
+ if (clan == null)
+ {
+ // Should never happen.
+ final Skill knownSkill = player.getKnownSkill(CLAN_EXUBERANCE);
+ if (knownSkill != null)
+ {
+ player.removeSkill(knownSkill, true);
+ }
+ return;
+ }
+
+ final int stage = GlobalVariablesManager.getInstance().getInt(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + clan.getId(), 0);
+ if (stage > 4)
+ {
+ player.addSkill(SkillData.getInstance().getSkill(CLAN_EXUBERANCE, stage / 5), false);
+ }
+ }
+
+ @RegisterEvent(EventType.ON_PLAYER_CLAN_LEFT)
+ @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
+ public void onPlayerClanLeft(OnPlayerClanLeft event)
+ {
+ final ClanMember member = event.getClanMember();
+ if ((member == null) || !member.isOnline())
+ {
+ return;
+ }
+
+ member.getPlayer().removeSkill(CLAN_EXUBERANCE, true);
+ }
+
public static void main(String[] args)
{
new MonsterArena();
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
deleted file mode 100644
index e751cffbb9..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingIgnis;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.l2jmobius.gameserver.enums.ChatType;
-import org.l2jmobius.gameserver.enums.SkillFinishType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.Skill;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik
- * @NOTE: Retail like working - I get informations from wiki and youtube video.
- * @TODO: Maybe rewrite code to modern style.
- * @TODO: Check skill 50050 - working, but I dont know if is correct.
- * @TODO: Ignis other skills - skills are implemented, but I dont know if is correct.
- */
-public class ResidenceOfKingIgnis extends AbstractInstance
-{
- // NPCs
- private static final int TARA = 34047;
- private static final int FREYA = 29109;
- private static final int IGNIS = 29105;
- // Skills
- private static final SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
- private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
- private static final SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
- private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
- private static final SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
- private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
- private static final SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
- private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
- private static final SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
- private static final SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
- private static final SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
- // Misc
- private static final int TEMPLATE_ID = 195;
- private static final Map _playerFireRage = new ConcurrentHashMap<>();
-
- public ResidenceOfKingIgnis()
- {
- super(TEMPLATE_ID);
- addStartNpc(TARA);
- addTalkId(FREYA);
- addKillId(IGNIS);
- addAttackId(IGNIS);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- _playerFireRage.put(player, 0);
- break;
- }
- case "REMOVE_FIRE_RAGE":
- {
- if (player.isAffectedBySkill(FIRE_RAG_1))
- {
- final int playerFireRage = _playerFireRage.getOrDefault(player, 0);
- if (playerFireRage < 5)
- {
- _playerFireRage.put(player, playerFireRage + 1);
- player.stopSkillEffects(SkillFinishType.REMOVED, FIRE_RAG_1.getSkillId());
- player.doCast(FREYA_SAFETY_ZONE.getSkill());
- npc.broadcastSay(ChatType.NPC_SHOUT, "Bless with you. Lets finish fight!");
- break;
- }
- npc.broadcastSay(ChatType.NPC_SHOUT, "You cannot use my power again.");
- player.sendMessage("Freya: You cannot use my power again.");
- break;
- }
- npc.broadcastSay(ChatType.NPC_SHOUT, "I help you only when you affected by Fire Rage skill.");
- break;
- }
- case "CAST_FIRE_RAGE_1":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_1.getSkill()))
- {
- npc.doCast(FIRE_RAG_1.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_2":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_2.getSkill()))
- {
- npc.doCast(FIRE_RAG_2.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_3":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_3.getSkill()))
- {
- npc.doCast(FIRE_RAG_3.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_4":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_4.getSkill()))
- {
- npc.doCast(FIRE_RAG_4.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_5":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_5.getSkill()))
- {
- npc.doCast(FIRE_RAG_5.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_6":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_6.getSkill()))
- {
- npc.doCast(FIRE_RAG_6.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_7":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_7.getSkill()))
- {
- npc.doCast(FIRE_RAG_7.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_8":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_8.getSkill()))
- {
- npc.doCast(FIRE_RAG_8.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_9":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_9.getSkill()))
- {
- npc.doCast(FIRE_RAG_9.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_10":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_10.getSkill()))
- {
- npc.doCast(FIRE_RAG_10.getSkill());
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
- {
- if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.99)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.70)))
- {
- startQuestTimer("CAST_FIRE_RAGE_1", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.50)))
- {
- startQuestTimer("CAST_FIRE_RAGE_2", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.50)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.40)))
- {
- startQuestTimer("CAST_FIRE_RAGE_3", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.25)))
- {
- startQuestTimer("CAST_FIRE_RAGE_4", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.25)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.15)))
- {
- startQuestTimer("CAST_FIRE_RAGE_5", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.15)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.10)))
- {
- startQuestTimer("CAST_FIRE_RAGE_6", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.10)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.7)))
- {
- startQuestTimer("CAST_FIRE_RAGE_7", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.7)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.5)))
- {
- startQuestTimer("CAST_FIRE_RAGE_8", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.5)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.3)))
- {
- startQuestTimer("CAST_FIRE_RAGE_9", 1000, npc, null);
- }
- else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.3))
- {
- startQuestTimer("CAST_FIRE_RAGE_10", 1000, npc, null);
- }
- return super.onAttack(npc, attacker, damage, isSummon, skill);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.finishInstance();
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingIgnis();
- }
-}
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
deleted file mode 100644
index df955bf126..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingPetram;
-
-import org.l2jmobius.gameserver.enums.ChatType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.Skill;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik, Mobius
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- * @TODO: Petram Skills and minion skills
- */
-public class ResidenceOfKingPetram extends AbstractInstance
-{
- // NPCs
- private static final int TRITAN = 34049;
- private static final int PETRAM = 29108;
- private static final int PETRAM_PIECE = 29116;
- private static final int PETRAM_FRAGMENT = 29117;
- // Skills
- private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
- private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1); // When change invul state.
- private static final SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
- // Misc
- private static final int TEMPLATE_ID = 198;
-
- public ResidenceOfKingPetram()
- {
- super(TEMPLATE_ID);
- addStartNpc(TRITAN);
- addKillId(PETRAM, PETRAM_PIECE, PETRAM_FRAGMENT);
- addAttackId(PETRAM);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- break;
- }
- case "SPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- npc.doCast(EARTH_ENERGY.getSkill());
-
- // Prevent to double or higher spawn when HP is between 68-70% + etc...
- if (!world.getParameters().getBoolean("spawnedMinions", false))
- {
- world.getParameters().set("spawnedMinions", true);
-
- final int stage = world.getParameters().getInt("stage", 0);
- world.getParameters().set("stage", stage + 1);
-
- world.setParameter("minion1", addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion3", addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
-
- npc.setInvul(true);
- npc.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
- }
-
- startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
- }
- break;
- }
- case "UNSPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.getParameters().set("spawnedMinions", false);
-
- npc.setInvul(false);
- npc.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
- }
- break;
- }
- case "SUPPORT_PETRAM":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Npc m1 = world.getParameters().getObject("minion1", Npc.class);
- final Npc m2 = world.getParameters().getObject("minion2", Npc.class);
- final Npc m3 = world.getParameters().getObject("minion3", Npc.class);
- final Npc m4 = world.getParameters().getObject("minion4", Npc.class);
- if (!m1.isDead())
- {
- m1.setTarget(world.getNpc(PETRAM));
- m1.doCast(TEST.getSkill());
- }
- if (!m2.isDead())
- {
- m2.setTarget(world.getNpc(PETRAM));
- m2.doCast(TEST.getSkill());
- }
- if (!m3.isDead())
- {
- m3.setTarget(world.getNpc(PETRAM));
- m3.doCast(TEST.getSkill());
- }
- if (!m4.isDead())
- {
- m4.setTarget(world.getNpc(PETRAM));
- m4.doCast(TEST.getSkill());
- }
-
- startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
- }
- break;
- }
- case "EARTH_FURY":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- npc.doCast(EARTH_FURY.getSkill());
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PETRAM)
- {
- if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.68)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 0)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.38)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 1)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.20)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.18)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 2)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.10)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.08)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 3)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- }
- return super.onAttack(npc, attacker, damage, isSummon, skill);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PETRAM)
- {
- world.finishInstance();
- }
- else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()) && (world.getParameters().getObject("minion4", Npc.class).isDead()))
- {
- startQuestTimer("UNSPAWN_MINION", 3000, world.getNpc(PETRAM), null);
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingPetram();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
deleted file mode 100644
index 43a715ab2e..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingProcella;
-
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik, Mobius
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- */
-public class ResidenceOfKingProcella extends AbstractInstance
-{
- // NPCs
- private static final int WIRI = 34048;
- private static final int PROCELLA = 29107;
- private static final int PROCELLA_GUARDIAN_1 = 29112;
- private static final int PROCELLA_GUARDIAN_2 = 29113;
- private static final int PROCELLA_GUARDIAN_3 = 29114;
- private static final int PROCELLA_STORM = 29115;
- // Skills
- private static final SkillHolder HURRICANE_SUMMON = new SkillHolder(50042, 1); // When spawn Minion
- private static final int HURRICANE_BOLT = 50043;
- private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1); // When player in Radius + para
- // Misc
- private static final int TEMPLATE_ID = 197;
- private static final int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
-
- public ResidenceOfKingProcella()
- {
- super(TEMPLATE_ID);
- addStartNpc(WIRI);
- addKillId(PROCELLA, PROCELLA_GUARDIAN_1, PROCELLA_GUARDIAN_2, PROCELLA_GUARDIAN_3);
- addInstanceEnterId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- final Instance world = player.getInstanceWorld();
- if (world != null)
- {
- final Npc procella = addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
- startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), procella, player);
- startQuestTimer("SPAWN_STORM", 5000, procella, player);
- world.setParameter("stormCount", 0);
- }
- break;
- }
- case "SPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if ((world != null) && (npc.getId() == PROCELLA))
- {
- world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
- world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
- world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
- startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
- }
- break;
- }
- case "SPAWN_STORM":
- {
- final Instance world = npc.getInstanceWorld();
- if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
- {
- world.getNpc(PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
- final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(PROCELLA).getX() + getRandom(-500, 500), world.getNpc(PROCELLA).getY() + getRandom(-500, 500), world.getNpc(PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
- procellaStorm.setRandomWalking(true);
- world.getParameters().increaseInt("stormCount", 1);
- startQuestTimer("SPAWN_STORM", 60000, world.getNpc(PROCELLA), null);
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, procellaStorm, player); // All time checking
- }
- break;
- }
- case "HIDE_PROCELLA":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- if (world.getNpc(PROCELLA).isInvisible())
- {
- world.getNpc(PROCELLA).setInvisible(false);
- }
- else
- {
- world.getNpc(PROCELLA).setInvisible(true);
- startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), world.getNpc(PROCELLA), player);
- }
- }
- break;
- }
- case "CHECK_CHAR_INSIDE_RADIUS_NPC":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Player plr = world.getPlayers().stream().findAny().orElse(null);
- if ((plr != null) && (plr.isInsideRadius3D(npc, 100)))
- {
- npc.abortAttack();
- npc.abortCast();
- npc.setTarget(plr);
- if (plr.getAffectedSkillLevel(HURRICANE_BOLT) == 1)
- {
- npc.abortCast();
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- else
- {
- if (SkillCaster.checkUseConditions(npc, HURRICANE_BOLT_LV_1.getSkill()))
- {
- npc.doCast(HURRICANE_BOLT_LV_1.getSkill());
- }
- }
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- else
- {
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PROCELLA)
- {
- cancelQuestTimer("SPAWN_MINION", npc, player);
- cancelQuestTimer("SPAWN_STORM", npc, player);
- cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
- world.finishInstance();
- }
- else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()))
- {
- startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
- }
-
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingProcella();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
deleted file mode 100644
index eb97a38b6c..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfQueenNebula;
-
-import org.l2jmobius.gameserver.data.xml.SkillData;
-import org.l2jmobius.gameserver.enums.SkillFinishType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
-import org.l2jmobius.gameserver.model.skill.Skill;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- * @TODO: The less Nebula's HP, the more damage she deals.
- */
-public class ResidenceOfQueenNebula extends AbstractInstance
-{
- // NPCs
- private static final int IRIS = 34046;
- private static final int NEBULA = 29106;
- private static final int WATER_SLIME = 29111;
- // Skills
- private static final int AQUA_RAGE = 50036;
- private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
- private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
- private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
- private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
- private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
- private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
- // Misc
- private static final int TEMPLATE_ID = 196;
-
- public ResidenceOfQueenNebula()
- {
- super(TEMPLATE_ID);
- addStartNpc(IRIS);
- addKillId(NEBULA, WATER_SLIME);
- addAttackId(NEBULA);
- addSpawnId(NEBULA);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- break;
- }
- case "SPAWN_WATER_SLIME":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Player plr = world.getPlayers().stream().findAny().get();
- startQuestTimer("CAST_AQUA_RAGE", 60000 + getRandom(-15000, 15000), npc, plr);
- if (npc.getId() == NEBULA)
- {
- npc.doCast(AQUA_SUMMON.getSkill());
- for (int i = 0; i < getRandom(4, 6); i++)
- {
- addSpawn(npc, WATER_SLIME, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, -1, true, npc.getInstanceId());
- startQuestTimer("SPAWN_WATER_SLIME", 300000, npc, null);
- }
- }
- }
- break;
- }
- case "PLAYER_PARA":
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
- {
- player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
- player.setImmobilized(true);
- startQuestTimer("PLAYER_UNPARA", 5000, npc, player);
- }
- break;
- }
- case "PLAYER_UNPARA":
- {
- player.getEffectList().stopSkillEffects(SkillFinishType.REMOVED, AQUA_RAGE_5.getSkill());
- player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
- player.setImmobilized(false);
- break;
- }
- case "CAST_AQUA_RAGE":
- {
- startQuestTimer("CAST_AQUA_RAGE", 5000, npc, player);
- if ((player.isInsideRadius3D(npc, 1000)))
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_2.getSkill()))
- {
- npc.doCast(AQUA_RAGE_2.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_3.getSkill()))
- {
- npc.doCast(AQUA_RAGE_3.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_4.getSkill()))
- {
- npc.doCast(AQUA_RAGE_4.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_5.getSkill()))
- {
- npc.doCast(AQUA_RAGE_5.getSkill());
- startQuestTimer("PLAYER_PARA", 100, npc, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
- {
- npc.abortCast();
- }
- else
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_1.getSkill()))
- {
- npc.doCast(AQUA_RAGE_1.getSkill());
- }
- }
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onSpawn(Npc npc)
- {
- startQuestTimer("SPAWN_WATER_SLIME", 300000, npc, null);
- return super.onSpawn(npc);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- switch (npc.getId())
- {
- case NEBULA:
- {
- cancelQuestTimer("CAST_AQUA_RAGE", npc, player);
- cancelQuestTimer("SPAWN_WATER_SLIME", npc, player);
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.finishInstance();
- }
- break;
- }
- case WATER_SLIME:
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_1.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_2.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 1);
- skill.applyEffects(player, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_3.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 2);
- skill.applyEffects(player, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_4.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 3);
- skill.applyEffects(player, player);
- }
- }
- break;
- }
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfQueenNebula();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/npcs/29100-29199.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/npcs/29100-29199.xml
index f7b0eb1c68..96d23bf020 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/npcs/29100-29199.xml
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/npcs/29100-29199.xml
@@ -111,7 +111,7 @@
MALE
-
+
@@ -198,7 +198,7 @@
MALE
-
+
@@ -283,7 +283,7 @@
MALE
-
+
@@ -368,7 +368,7 @@
MALE
-
+
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/50000-50099.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/50000-50099.xml
index 486806094e..239c64ddd6 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/50000-50099.xml
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/50000-50099.xml
@@ -332,7 +332,7 @@
45
- -1
+ 30100FREEZINGtrue
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/zones/teleportzones.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/zones/teleportzones.xml
new file mode 100644
index 0000000000..78520a6878
--- /dev/null
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/zones/teleportzones.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java
index aca8c05819..d747a07888 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java
@@ -104,6 +104,7 @@ public class DailyTaskManager
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY)
{
clanLeaderApply();
+ resetMonsterArenaWeekly();
resetTimedHuntingZonesWeekly();
resetVitalityWeekly();
}
@@ -233,6 +234,14 @@ public class DailyTaskManager
LOGGER.info("Vitality resetted");
}
+ private void resetMonsterArenaWeekly()
+ {
+ for (Clan clan : ClanTable.getInstance().getClans())
+ {
+ GlobalVariablesManager.getInstance().remove(GlobalVariablesManager.MONSTER_ARENA_VARIABLE + clan.getId());
+ }
+ }
+
private void resetClanBonus()
{
ClanTable.getInstance().getClans().forEach(Clan::resetClanBonus);
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/GlobalVariablesManager.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/GlobalVariablesManager.java
index f32205e734..5b69f1db60 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/GlobalVariablesManager.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/instancemanager/GlobalVariablesManager.java
@@ -43,6 +43,7 @@ public class GlobalVariablesManager extends AbstractVariables
// Public variable names
public static final String DAILY_TASK_RESET = "DAILY_TASK_RESET";
+ public static final String MONSTER_ARENA_VARIABLE = "MA_C";
protected GlobalVariablesManager()
{
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/DailyMission.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/DailyMission.xml
index e5aa5144a1..dd75a47ae0 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/DailyMission.xml
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/DailyMission.xml
@@ -963,43 +963,43 @@
Victory Pack
+ -->
- Weekly mission. A reward is given for defeating 1 enemy together with your clan members in the Clan Arena.
+
40
99
- Spirit Ore
- Clan XP
- Scroll: Boost Attack
+
+
+
- Weekly mission. A reward is given for defeating monsters during a clan raid to the Dwelling of Spirits.
+
76
99
- Improved Water Attack Potion
- Improved Wind Attack Potion
- Improved Earth Attack Potion
- Improved Fire Attack Potion
+
+
+
+
- Weekly mission. A reward is given for defeating Ignis, Nebula, Procella or Petram during a clan raid to the Dwelling of Spirits.
+
76
99
- Improved Water Attack Potion
- Improved Wind Attack Potion
- Improved Earth Attack Potion
- Improved Fire Attack Potion
+
+
+
+
- -->
-
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/DwellingOfSpirits.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/DwellingOfSpirits.xml
new file mode 100644
index 0000000000..0a8bc01b34
--- /dev/null
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/DwellingOfSpirits.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingIgnis.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingIgnis.xml
deleted file mode 100644
index 042e27144a..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingIgnis.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingPetram.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingPetram.xml
deleted file mode 100644
index b0c695af74..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingPetram.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingProcella.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingProcella.xml
deleted file mode 100644
index 3466755d90..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfKingProcella.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfQueenNebula.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfQueenNebula.xml
deleted file mode 100644
index ff4e4911b7..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/instances/ResidenceOfQueenNebula.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
new file mode 100644
index 0000000000..1ab7154aa4
--- /dev/null
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
@@ -0,0 +1,4 @@
+Animael:
+All done here?
+ByeByeBye
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
new file mode 100644
index 0000000000..c2f13dc68c
--- /dev/null
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
@@ -0,0 +1,1058 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package instances.DwellingOfSpirits;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.l2jmobius.gameserver.data.xml.SkillData;
+import org.l2jmobius.gameserver.enums.ChatType;
+import org.l2jmobius.gameserver.enums.SkillFinishType;
+import org.l2jmobius.gameserver.enums.TeleportWhereType;
+import org.l2jmobius.gameserver.instancemanager.ZoneManager;
+import org.l2jmobius.gameserver.model.Party;
+import org.l2jmobius.gameserver.model.actor.Creature;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.holders.SkillHolder;
+import org.l2jmobius.gameserver.model.instancezone.Instance;
+import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
+import org.l2jmobius.gameserver.model.skill.Skill;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
+import org.l2jmobius.gameserver.model.zone.ZoneType;
+import org.l2jmobius.gameserver.network.NpcStringId;
+import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent;
+import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
+import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
+
+import instances.AbstractInstance;
+
+/**
+ * @author Serenitty
+ */
+public class DwellingOfSpirits extends AbstractInstance
+{
+ // CRITICAL NPCs
+ private static final int RUIP = 22273;
+ private static final int SEALSTONE = 34178;
+ private static final int ANIMAEL = 34176;
+ private static final int PORTAL_EVENT_FIRE = 15969;
+ private static final int PORTAL_EVENT_WATER = 15970;
+ private static final int PORTAL_EVENT_EARTH = 15972;
+ private static final int PORTAL_EVENT_WIND = 15971;
+
+ // PROCELLA BOSS WIND
+ private static final int KING_PROCELLA = 29107;
+ private static final int PROCELLA_GUARDIAN_1 = 29112;
+ private static final int PROCELLA_STORM = 29115;
+
+ private static final SkillHolder HURRICANE_SUMMON = new SkillHolder(50042, 1);
+ private static final int HURRICANE_BOLT = 50043;
+ private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1);
+ private static final int STORM_MAX_COUNT = 20; //
+
+ // PETRAM BOSS EARTH
+ private static final int KING_PETRAM = 29108;
+ private static final int PETRAM_PIECE = 29116;
+ private static final int PETRAM_FRAGMENT = 29117;
+ // Skills
+ private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1);
+ private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1);
+ private static final SkillHolder TEST = new SkillHolder(5712, 1);
+
+ // IGNIS BOSS FIRE
+ // NPCs
+ private static final int KING_IGNIS = 29105;
+ // Skills
+ private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
+ private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
+ private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
+ private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
+
+ // NEBULA BOSS WATER
+ // NPCs
+ private static final int KING_NEBULA = 29106;
+ private static final int WATER_SLIME = 29111;
+ // Skills
+ private static final int AQUA_RAGE = 50036;
+ private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
+ private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
+ private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
+ private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
+ private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
+ private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
+
+ // Entrace Portal Triggers
+ private static final int WIND_FIRST_TRIGGER_1 = 16158880;
+ private static final int WIND_FIRST_TRIGGER_2 = 16158882;
+ private static final int EARTH_FIRST_TRIGGER_1 = 16156660;
+ private static final int EARTH_FIRST_TRIGGER_2 = 16156662;
+ private static final int FIRE_FIRST_TRIGGER_1 = 16155550;
+ private static final int FIRE_FIRST_TRIGGER_2 = 16155552;
+ private static final int WATER_FIRST_TRIGGER_1 = 16157770;
+ private static final int WATER_FIRST_TRIGGER_2 = 16157772;
+
+ // Statue Kill Indicator Triggers
+ private static final int KILL_INDICATOR_TRIGGER_1 = 16159990;
+ private static final int KILL_INDICATOR_TRIGGER_2 = 16159994;
+ private static final int KILL_INDICATOR_TRIGGER_3 = 16159996;
+ private static final int KILL_INDICATOR_TRIGGER_4 = 16159998;
+ private static final int KILL_INDICATOR_TRIGGER_5 = 16159992;
+
+ private static final int TEMPLATE_ID = 214;
+
+ private static final Map PORTAL_MSG = new HashMap<>();
+ static
+ {
+ PORTAL_MSG.put(1, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_EARTH_IS_OPEN);
+ PORTAL_MSG.put(2, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_WATER_IS_OPEN);
+ PORTAL_MSG.put(3, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_WIND_IS_OPEN);
+ PORTAL_MSG.put(4, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_FIRE_IS_OPEN);
+ PORTAL_MSG.put(5, NpcStringId.SEAL_STONE_DISAPPEARS_AFTER_RESONATING_WITH_THE_STATUE);
+ }
+
+ public DwellingOfSpirits()
+ {
+ super(TEMPLATE_ID);
+ addKillId(KING_PETRAM, KING_NEBULA, KING_PROCELLA, KING_IGNIS);
+ addKillId(PROCELLA_GUARDIAN_1);
+ addKillId(PETRAM_PIECE, PETRAM_FRAGMENT);
+ addKillId(WATER_SLIME);
+ addAttackId(KING_PETRAM, KING_NEBULA, KING_PROCELLA, KING_IGNIS);
+ addSpawnId(KING_NEBULA);
+ addFirstTalkId(ANIMAEL, SEALSTONE);
+ addTalkId(ANIMAEL);
+ addStartNpc(SEALSTONE);
+ addCreatureSeeId(RUIP, ANIMAEL);
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, Player player)
+ {
+ switch (event)
+ {
+ case "ENTER":
+ {
+ if (player.isInParty())
+ {
+ final Party party = player.getParty();
+ final boolean isInCC = party.isInCommandChannel();
+ final List members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
+ for (Player member : members)
+ {
+ if (!member.isInsideRadius3D(npc, 1000))
+ {
+ player.sendMessage("Player " + member.getName() + " must go closer to Jay.");
+ }
+ enterInstance(member, npc, TEMPLATE_ID);
+ }
+ }
+ else if (player.isGM())
+ {
+ enterInstance(player, npc, TEMPLATE_ID);
+ player.sendMessage("SYS: You have entered as GM/Admin to Dwelling.");
+ }
+ else
+ {
+ if (!player.isInsideRadius3D(npc, 1000))
+ {
+ player.sendMessage("You must go closer to Jay.");
+ }
+ enterInstance(player, npc, TEMPLATE_ID);
+ }
+ break;
+ }
+
+ case "TELEPORT":
+ {
+ player.teleToLocation(TeleportWhereType.TOWN, null);
+ return null;
+ }
+ //////////////// BOSS PROCELLA WIND ACTION /////////////
+ case "SPAWN_MINION_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if ((world != null) && (npc.getId() == KING_PROCELLA))
+ {
+ world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
+ world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_1, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
+ world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_1, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
+ startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(KING_PROCELLA), player);
+ }
+ break;
+ }
+ case "SPAWN_STORM_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
+ {
+ world.getNpc(KING_PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
+ final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(KING_PROCELLA).getX() + getRandom(-500, 500), world.getNpc(KING_PROCELLA).getY() + getRandom(-500, 500), world.getNpc(KING_PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
+ procellaStorm.setRandomWalking(true);
+ world.getParameters().increaseInt("stormCount", 1);
+ startQuestTimer("SPAWN_STORM_PROCELLA", 30000, world.getNpc(KING_PROCELLA), player);
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, procellaStorm, player);
+ }
+ break;
+ }
+ case "HIDE_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PROCELLA_GUARDIAN_1) >= 1)
+ {
+ world.getNpc(KING_PROCELLA).setInvisible(true);
+ }
+ else if (world.getAliveNpcCount(PROCELLA_GUARDIAN_1) == 0)
+ {
+ world.getNpc(KING_PROCELLA).setInvisible(false);
+ startQuestTimer("SPAWN_MINION_PROCELLA", 90000 + getRandom(-15000, 11000), world.getNpc(KING_PROCELLA), player);
+ }
+ break;
+ }
+ case "CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Player plr = world.getPlayers().stream().findAny().orElse(null);
+ if ((plr != null) && (plr.isInsideRadius3D(npc, 200)))
+ {
+ npc.abortAttack();
+ npc.abortCast();
+ npc.setTarget(plr);
+ if (plr.getAffectedSkillLevel(HURRICANE_BOLT) == 1)
+ {
+ npc.abortCast();
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ else
+ {
+ if (SkillCaster.checkUseConditions(npc, HURRICANE_BOLT_LV_1.getSkill()))
+ {
+ npc.doCast(HURRICANE_BOLT_LV_1.getSkill());
+ }
+ }
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ else
+ {
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ }
+ break;
+ }
+ //////////////// BOSS PETRAM EARTH ACTION /////////////
+ case "SPAWN_MINION":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PETRAM_FRAGMENT) == 0)
+ {
+ npc.doCast(EARTH_ENERGY.getSkill());
+
+ if (!world.getParameters().getBoolean("spawnedMinions", false))
+ {
+ world.getParameters().set("spawnedMinions", true);
+
+ final int stage = world.getParameters().getInt("stage", 0);
+ world.getParameters().set("stage", stage + 1);
+
+ world.setParameter("minionpetram1", addSpawn(npc, PETRAM_FRAGMENT, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram3", addSpawn(npc, PETRAM_FRAGMENT, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
+
+ npc.setInvul(true);
+ npc.broadcastSay(ChatType.NPC_SHOUT, "HaHahaha, fighters lets kill them. Now Im invul!!!");
+ }
+
+ startQuestTimer("SUPPORT_PETRAM", 3000, npc, player);
+ }
+ break;
+ }
+ case "UNSPAWN_MINION":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PETRAM_FRAGMENT) == 0)
+ {
+ world.getParameters().set("spawnedMinions", false);
+
+ npc.setInvul(false);
+ npc.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
+ }
+ break;
+ }
+ case "SUPPORT_PETRAM":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Npc m1 = world.getParameters().getObject("minionpetram1", Npc.class);
+ final Npc m2 = world.getParameters().getObject("minionpetram2", Npc.class);
+ final Npc m3 = world.getParameters().getObject("minionpetram3", Npc.class);
+ final Npc m4 = world.getParameters().getObject("minionpetram4", Npc.class);
+ if (!m1.isDead())
+ {
+ m1.setTarget(world.getNpc(KING_PETRAM));
+ m1.doCast(TEST.getSkill());
+ }
+ if (!m2.isDead())
+ {
+ m2.setTarget(world.getNpc(KING_PETRAM));
+ m2.doCast(TEST.getSkill());
+ }
+ if (!m3.isDead())
+ {
+ m3.setTarget(world.getNpc(KING_PETRAM));
+ m3.doCast(TEST.getSkill());
+ }
+ if (!m4.isDead())
+ {
+ m4.setTarget(world.getNpc(KING_PETRAM));
+ m4.doCast(TEST.getSkill());
+ }
+
+ startQuestTimer("SUPPORT_PETRAM", 10100, npc, player);
+ }
+ break;
+ }
+ case "EARTH_FURY":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ npc.doCast(EARTH_FURY.getSkill());
+ }
+ break;
+ }
+ //////////////// BOSS IGNIS ACTION /////////////
+ case "CAST_FIRE_RAGE_1":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_2.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_2.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_2":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_4.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_4.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_3":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_6.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_6.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_4":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_8.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_8.getSkill());
+ }
+ break;
+ }
+ //////////////// BOSS NEBULA ACTION /////////////
+ case "SPAWN_WATER_SLIME":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Player plr = world.getPlayers().stream().findAny().get();
+ startQuestTimer("CAST_AQUA_RAGE", 30000 + getRandom(-15000, 15000), npc, plr);
+ if (npc.getId() == KING_NEBULA)
+ {
+ npc.doCast(AQUA_SUMMON.getSkill());
+ for (int i = 0; i < getRandom(4, 6); i++)
+ {
+ addSpawn(npc, WATER_SLIME, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, -1, true, npc.getInstanceId());
+ startQuestTimer("SPAWN_WATER_SLIME", 80000, npc, null);
+ }
+ }
+ }
+ break;
+ }
+ case "PLAYER_PARA":
+ {
+ if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
+ {
+ player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
+ player.setImmobilized(true);
+ startQuestTimer("PLAYER_UNPARA", 5000, npc, player);
+ }
+ break;
+ }
+ case "PLAYER_UNPARA":
+ {
+ player.getEffectList().stopSkillEffects(SkillFinishType.REMOVED, AQUA_RAGE_5.getSkill());
+ player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
+ player.setImmobilized(false);
+ break;
+ }
+ case "CAST_AQUA_RAGE":
+ {
+ startQuestTimer("CAST_AQUA_RAGE", 5000, npc, player);
+ if ((player.isInsideRadius3D(npc, 1000)))
+ {
+ if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_2.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_2.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_3.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_3.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_4.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_4.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_5.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_5.getSkill());
+ startQuestTimer("PLAYER_PARA", 100, npc, player);
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
+ {
+ npc.abortCast();
+ }
+ else
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_1.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_1.getSkill());
+ }
+ }
+ }
+ break;
+ }
+ case "check_status":
+ {
+ final Instance world = player.getInstanceWorld();
+ if (!isInInstance(world))
+ {
+ return null;
+ }
+
+ switch (world.getStatus())
+ {
+ case 0:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(1);
+ world.despawnGroup("sealstone");
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 1:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(2);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 2:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(3);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 3:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(4);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 4:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(5);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(3), null));
+ addSpawn(KING_PROCELLA, 212862, 179828, -15489, 48103, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 5: // Dummy stage pause, u need defeat boss to continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 6:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(7);
+ world.spawnGroup("ruipwave_1");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 7:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(8);
+ world.spawnGroup("NormalMobs");
+ world.spawnGroup("ruipwave_1");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 8:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(9);
+ world.spawnGroup("NormalMobs");
+ world.spawnGroup("ruipwave_2");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 9:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(10);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(1), null));
+ addSpawn(KING_PETRAM, 222063, 191514, -15486, 50142, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 10: // Dummy stage pause, u need defeat boss to continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 11:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(12);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 12:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(13);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 13:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(14);
+ world.spawnGroup("ruipwave_2");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 14:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(15);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(4), null));
+ addSpawn(KING_IGNIS, 202350, 169121, -15484, 48103, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 15: // Dummy stage pause, u need defeat boss for continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 16:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(17);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 17:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(18);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 18:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(19);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 19: // need defeat boss for finish.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+
+ {
+ world.setStatus(20);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(2), null));
+ addSpawn(KING_NEBULA, 222127, 169057, -15486, 48730, false, 0, false, world.getId());
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 20:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.getParameters().set("DwellingOfSpiritsFinished", true);
+ world.setStatus(21);
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ }
+
+ return null;
+ }
+ }
+
+ return super.onAdvEvent(event, npc, player);
+
+ }
+
+ @Override
+ public String onSpawn(Npc npc)
+ {
+ startQuestTimer("SPAWN_WATER_SLIME", 40000, npc, null);
+ return super.onSpawn(npc);
+ }
+
+ @Override
+ public String onAttack(Npc npc, Player player, int damage, boolean isSummon, Skill skill)
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world == null)
+ {
+ return null;
+ }
+
+ switch (npc.getId())
+ {
+ case KING_PROCELLA:
+ {
+ if (npc.getCurrentHp() < (npc.getMaxHp() * 0.90))
+ {
+ startQuestTimer("SPAWN_MINION_PROCELLA", 80000 + getRandom(-15000, 15000), npc, player);
+ startQuestTimer("SPAWN_STORM_PROCELLA", 4000, npc, player);
+ world.setParameter("stormCount", 0);
+ }
+ break;
+ }
+ case KING_PETRAM:
+ {
+ if (npc.getCurrentHp() < (npc.getMaxHp() * 0.80))
+ {
+ startQuestTimer("EARTH_FURY", 1000, npc, player);
+ if ((world.getParameters().getInt("stage", 0) == 0) || (npc.getCurrentHp() < (npc.getMaxHp() * 0.50)))
+ {
+ startQuestTimer("SPAWN_MINION", 1000, npc, player);
+ }
+ }
+ break;
+ }
+ case KING_IGNIS:
+ {
+ if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.90)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.70)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_1", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.50)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_2", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.50)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.40)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_3", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.25)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_4", 1000, npc, null);
+ }
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String onCreatureSee(Npc npc, Creature creature)
+ {
+ if (creature.isPlayer())
+ {
+ final Instance world = creature.getInstanceWorld();
+ if (world.getStatus() >= 5)
+ {
+ enableZoneWind();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WIND_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WIND_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 10)
+ {
+ enableZoneEarth();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(EARTH_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(EARTH_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 15)
+ {
+ enableZoneFire();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(FIRE_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(FIRE_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 20)
+ {
+ enableZoneWater();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WATER_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WATER_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 21)
+ {
+ world.despawnGroup("ruipwave_1");
+ world.despawnGroup("ruipwave_2");
+ world.despawnGroup("NormalMobs");
+ world.finishInstance();
+ }
+ }
+
+ return super.onCreatureSee(npc, creature);
+ }
+
+ @Override
+ public String onKill(Npc npc, Player player, boolean isSummon)
+ {
+ final Instance instance = npc.getInstanceWorld();
+
+ switch (npc.getId())
+ {
+ case KING_PETRAM:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_EARTH, 222065, 192767, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1); // set the portal visible
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneEarthExit();
+ cancelQuestTimer("SPAWN_MINION", npc, player);
+ instance.setStatus(12);
+ final Instance world = npc.getInstanceWorld();
+ for (Npc spawn : world.getNpcs(PETRAM_FRAGMENT))
+ {
+ spawn.deleteMe();
+ }
+ break;
+ }
+ case KING_NEBULA:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_WATER, 222127, 170488, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ player.sendPacket(new ExSendUIEvent(player, false, false, 0, 0, NpcStringId.TIME_LEFT));
+ setActive(true);
+ enableZoneWindExit();
+ instance.setStatus(21);
+ instance.spawnGroup("animael");
+ break;
+ }
+ case KING_IGNIS:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_FIRE, 202349, 170533, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneFireExit();
+ instance.setStatus(17);
+ break;
+ }
+ case KING_PROCELLA:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_WIND, 212863, 181090, -15487, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneWaterExit();
+ instance.setStatus(7);
+ final Instance world = npc.getInstanceWorld();
+ for (Npc spawn : world.getNpcs(PROCELLA_GUARDIAN_1))
+ {
+ spawn.deleteMe();
+ }
+ break;
+ }
+ case PETRAM_FRAGMENT:
+ {
+ startQuestTimer("UNSPAWN_MINION", 1000, instance.getNpc(KING_PETRAM), player);
+ break;
+ }
+ case PROCELLA_GUARDIAN_1:
+ {
+
+ startQuestTimer("HIDE_PROCELLA", 1000, instance.getNpc(KING_PROCELLA), player);
+ break;
+ }
+ case WATER_SLIME:
+ {
+ if (getRandomBoolean())
+ {
+ switch (player.getAffectedSkillLevel(AQUA_RAGE))
+ {
+ case 1:
+ {
+ player.stopSkillEffects(AQUA_RAGE_1.getSkill());
+ break;
+ }
+ case 2:
+ {
+ player.stopSkillEffects(AQUA_RAGE_2.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 1);
+ skill.applyEffects(player, player);
+ break;
+ }
+ case 3:
+ {
+ player.stopSkillEffects(AQUA_RAGE_3.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 2);
+ skill.applyEffects(player, player);
+ break;
+ }
+ case 4:
+ {
+ player.stopSkillEffects(AQUA_RAGE_4.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 3);
+ skill.applyEffects(player, player);
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ return super.onKill(npc, player, isSummon);
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, Player player)
+ {
+ if (npc.getId() == ANIMAEL)
+ {
+ return "34176.htm";
+ }
+
+ if (!player.getInstanceWorld().getParameters().getBoolean("PlayerEnter", false))
+ {
+ player.getInstanceWorld().setParameter("PlayerEnter", true);
+ player.getInstanceWorld().setDuration(30);
+ startEvent(npc, player);
+ }
+
+ return super.onFirstTalk(npc, player);
+ }
+
+ // PORTALS
+ private void enableZoneWind()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_wind");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneEarth()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_earth");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneFire()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_fire");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWater()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_water");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWindExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_procella");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneEarthExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_petram");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneFireExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_ignis");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWaterExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_nebula");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void startEvent(Npc npc, Player player)
+ {
+ if (!player.getInstanceWorld().getParameters().getBoolean("DwellingOfSpiritsFinished", false))
+ {
+ player.sendPacket(new ExSendUIEvent(player, false, false, 1800, 2, NpcStringId.TIME_LEFT));
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(5), null));
+ startQuestTimer("check_status", 1000, null, player);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ new DwellingOfSpirits();
+ }
+}
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/MonsterArena/34169-02.htm b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
index 0982f30720..95ab5de5eb 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
@@ -8,6 +8,6 @@
--.- NO AVAILABLE -.-
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
deleted file mode 100644
index e751cffbb9..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingIgnis;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.l2jmobius.gameserver.enums.ChatType;
-import org.l2jmobius.gameserver.enums.SkillFinishType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.Skill;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik
- * @NOTE: Retail like working - I get informations from wiki and youtube video.
- * @TODO: Maybe rewrite code to modern style.
- * @TODO: Check skill 50050 - working, but I dont know if is correct.
- * @TODO: Ignis other skills - skills are implemented, but I dont know if is correct.
- */
-public class ResidenceOfKingIgnis extends AbstractInstance
-{
- // NPCs
- private static final int TARA = 34047;
- private static final int FREYA = 29109;
- private static final int IGNIS = 29105;
- // Skills
- private static final SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
- private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
- private static final SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
- private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
- private static final SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
- private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
- private static final SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
- private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
- private static final SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
- private static final SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
- private static final SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
- // Misc
- private static final int TEMPLATE_ID = 195;
- private static final Map _playerFireRage = new ConcurrentHashMap<>();
-
- public ResidenceOfKingIgnis()
- {
- super(TEMPLATE_ID);
- addStartNpc(TARA);
- addTalkId(FREYA);
- addKillId(IGNIS);
- addAttackId(IGNIS);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- _playerFireRage.put(player, 0);
- break;
- }
- case "REMOVE_FIRE_RAGE":
- {
- if (player.isAffectedBySkill(FIRE_RAG_1))
- {
- final int playerFireRage = _playerFireRage.getOrDefault(player, 0);
- if (playerFireRage < 5)
- {
- _playerFireRage.put(player, playerFireRage + 1);
- player.stopSkillEffects(SkillFinishType.REMOVED, FIRE_RAG_1.getSkillId());
- player.doCast(FREYA_SAFETY_ZONE.getSkill());
- npc.broadcastSay(ChatType.NPC_SHOUT, "Bless with you. Lets finish fight!");
- break;
- }
- npc.broadcastSay(ChatType.NPC_SHOUT, "You cannot use my power again.");
- player.sendMessage("Freya: You cannot use my power again.");
- break;
- }
- npc.broadcastSay(ChatType.NPC_SHOUT, "I help you only when you affected by Fire Rage skill.");
- break;
- }
- case "CAST_FIRE_RAGE_1":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_1.getSkill()))
- {
- npc.doCast(FIRE_RAG_1.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_2":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_2.getSkill()))
- {
- npc.doCast(FIRE_RAG_2.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_3":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_3.getSkill()))
- {
- npc.doCast(FIRE_RAG_3.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_4":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_4.getSkill()))
- {
- npc.doCast(FIRE_RAG_4.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_5":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_5.getSkill()))
- {
- npc.doCast(FIRE_RAG_5.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_6":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_6.getSkill()))
- {
- npc.doCast(FIRE_RAG_6.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_7":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_7.getSkill()))
- {
- npc.doCast(FIRE_RAG_7.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_8":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_8.getSkill()))
- {
- npc.doCast(FIRE_RAG_8.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_9":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_9.getSkill()))
- {
- npc.doCast(FIRE_RAG_9.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_10":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_10.getSkill()))
- {
- npc.doCast(FIRE_RAG_10.getSkill());
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
- {
- if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.99)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.70)))
- {
- startQuestTimer("CAST_FIRE_RAGE_1", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.50)))
- {
- startQuestTimer("CAST_FIRE_RAGE_2", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.50)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.40)))
- {
- startQuestTimer("CAST_FIRE_RAGE_3", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.25)))
- {
- startQuestTimer("CAST_FIRE_RAGE_4", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.25)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.15)))
- {
- startQuestTimer("CAST_FIRE_RAGE_5", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.15)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.10)))
- {
- startQuestTimer("CAST_FIRE_RAGE_6", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.10)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.7)))
- {
- startQuestTimer("CAST_FIRE_RAGE_7", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.7)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.5)))
- {
- startQuestTimer("CAST_FIRE_RAGE_8", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.5)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.3)))
- {
- startQuestTimer("CAST_FIRE_RAGE_9", 1000, npc, null);
- }
- else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.3))
- {
- startQuestTimer("CAST_FIRE_RAGE_10", 1000, npc, null);
- }
- return super.onAttack(npc, attacker, damage, isSummon, skill);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.finishInstance();
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingIgnis();
- }
-}
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
deleted file mode 100644
index df955bf126..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingPetram;
-
-import org.l2jmobius.gameserver.enums.ChatType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.Skill;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik, Mobius
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- * @TODO: Petram Skills and minion skills
- */
-public class ResidenceOfKingPetram extends AbstractInstance
-{
- // NPCs
- private static final int TRITAN = 34049;
- private static final int PETRAM = 29108;
- private static final int PETRAM_PIECE = 29116;
- private static final int PETRAM_FRAGMENT = 29117;
- // Skills
- private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
- private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1); // When change invul state.
- private static final SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
- // Misc
- private static final int TEMPLATE_ID = 198;
-
- public ResidenceOfKingPetram()
- {
- super(TEMPLATE_ID);
- addStartNpc(TRITAN);
- addKillId(PETRAM, PETRAM_PIECE, PETRAM_FRAGMENT);
- addAttackId(PETRAM);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- break;
- }
- case "SPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- npc.doCast(EARTH_ENERGY.getSkill());
-
- // Prevent to double or higher spawn when HP is between 68-70% + etc...
- if (!world.getParameters().getBoolean("spawnedMinions", false))
- {
- world.getParameters().set("spawnedMinions", true);
-
- final int stage = world.getParameters().getInt("stage", 0);
- world.getParameters().set("stage", stage + 1);
-
- world.setParameter("minion1", addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion3", addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
-
- npc.setInvul(true);
- npc.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
- }
-
- startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
- }
- break;
- }
- case "UNSPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.getParameters().set("spawnedMinions", false);
-
- npc.setInvul(false);
- npc.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
- }
- break;
- }
- case "SUPPORT_PETRAM":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Npc m1 = world.getParameters().getObject("minion1", Npc.class);
- final Npc m2 = world.getParameters().getObject("minion2", Npc.class);
- final Npc m3 = world.getParameters().getObject("minion3", Npc.class);
- final Npc m4 = world.getParameters().getObject("minion4", Npc.class);
- if (!m1.isDead())
- {
- m1.setTarget(world.getNpc(PETRAM));
- m1.doCast(TEST.getSkill());
- }
- if (!m2.isDead())
- {
- m2.setTarget(world.getNpc(PETRAM));
- m2.doCast(TEST.getSkill());
- }
- if (!m3.isDead())
- {
- m3.setTarget(world.getNpc(PETRAM));
- m3.doCast(TEST.getSkill());
- }
- if (!m4.isDead())
- {
- m4.setTarget(world.getNpc(PETRAM));
- m4.doCast(TEST.getSkill());
- }
-
- startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
- }
- break;
- }
- case "EARTH_FURY":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- npc.doCast(EARTH_FURY.getSkill());
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PETRAM)
- {
- if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.68)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 0)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.38)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 1)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.20)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.18)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 2)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.10)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.08)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 3)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- }
- return super.onAttack(npc, attacker, damage, isSummon, skill);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PETRAM)
- {
- world.finishInstance();
- }
- else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()) && (world.getParameters().getObject("minion4", Npc.class).isDead()))
- {
- startQuestTimer("UNSPAWN_MINION", 3000, world.getNpc(PETRAM), null);
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingPetram();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
deleted file mode 100644
index 43a715ab2e..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingProcella;
-
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik, Mobius
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- */
-public class ResidenceOfKingProcella extends AbstractInstance
-{
- // NPCs
- private static final int WIRI = 34048;
- private static final int PROCELLA = 29107;
- private static final int PROCELLA_GUARDIAN_1 = 29112;
- private static final int PROCELLA_GUARDIAN_2 = 29113;
- private static final int PROCELLA_GUARDIAN_3 = 29114;
- private static final int PROCELLA_STORM = 29115;
- // Skills
- private static final SkillHolder HURRICANE_SUMMON = new SkillHolder(50042, 1); // When spawn Minion
- private static final int HURRICANE_BOLT = 50043;
- private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1); // When player in Radius + para
- // Misc
- private static final int TEMPLATE_ID = 197;
- private static final int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
-
- public ResidenceOfKingProcella()
- {
- super(TEMPLATE_ID);
- addStartNpc(WIRI);
- addKillId(PROCELLA, PROCELLA_GUARDIAN_1, PROCELLA_GUARDIAN_2, PROCELLA_GUARDIAN_3);
- addInstanceEnterId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- final Instance world = player.getInstanceWorld();
- if (world != null)
- {
- final Npc procella = addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
- startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), procella, player);
- startQuestTimer("SPAWN_STORM", 5000, procella, player);
- world.setParameter("stormCount", 0);
- }
- break;
- }
- case "SPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if ((world != null) && (npc.getId() == PROCELLA))
- {
- world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
- world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
- world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
- startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
- }
- break;
- }
- case "SPAWN_STORM":
- {
- final Instance world = npc.getInstanceWorld();
- if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
- {
- world.getNpc(PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
- final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(PROCELLA).getX() + getRandom(-500, 500), world.getNpc(PROCELLA).getY() + getRandom(-500, 500), world.getNpc(PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
- procellaStorm.setRandomWalking(true);
- world.getParameters().increaseInt("stormCount", 1);
- startQuestTimer("SPAWN_STORM", 60000, world.getNpc(PROCELLA), null);
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, procellaStorm, player); // All time checking
- }
- break;
- }
- case "HIDE_PROCELLA":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- if (world.getNpc(PROCELLA).isInvisible())
- {
- world.getNpc(PROCELLA).setInvisible(false);
- }
- else
- {
- world.getNpc(PROCELLA).setInvisible(true);
- startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), world.getNpc(PROCELLA), player);
- }
- }
- break;
- }
- case "CHECK_CHAR_INSIDE_RADIUS_NPC":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Player plr = world.getPlayers().stream().findAny().orElse(null);
- if ((plr != null) && (plr.isInsideRadius3D(npc, 100)))
- {
- npc.abortAttack();
- npc.abortCast();
- npc.setTarget(plr);
- if (plr.getAffectedSkillLevel(HURRICANE_BOLT) == 1)
- {
- npc.abortCast();
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- else
- {
- if (SkillCaster.checkUseConditions(npc, HURRICANE_BOLT_LV_1.getSkill()))
- {
- npc.doCast(HURRICANE_BOLT_LV_1.getSkill());
- }
- }
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- else
- {
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PROCELLA)
- {
- cancelQuestTimer("SPAWN_MINION", npc, player);
- cancelQuestTimer("SPAWN_STORM", npc, player);
- cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
- world.finishInstance();
- }
- else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()))
- {
- startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
- }
-
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingProcella();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
deleted file mode 100644
index eb97a38b6c..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfQueenNebula;
-
-import org.l2jmobius.gameserver.data.xml.SkillData;
-import org.l2jmobius.gameserver.enums.SkillFinishType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
-import org.l2jmobius.gameserver.model.skill.Skill;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- * @TODO: The less Nebula's HP, the more damage she deals.
- */
-public class ResidenceOfQueenNebula extends AbstractInstance
-{
- // NPCs
- private static final int IRIS = 34046;
- private static final int NEBULA = 29106;
- private static final int WATER_SLIME = 29111;
- // Skills
- private static final int AQUA_RAGE = 50036;
- private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
- private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
- private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
- private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
- private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
- private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
- // Misc
- private static final int TEMPLATE_ID = 196;
-
- public ResidenceOfQueenNebula()
- {
- super(TEMPLATE_ID);
- addStartNpc(IRIS);
- addKillId(NEBULA, WATER_SLIME);
- addAttackId(NEBULA);
- addSpawnId(NEBULA);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- break;
- }
- case "SPAWN_WATER_SLIME":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Player plr = world.getPlayers().stream().findAny().get();
- startQuestTimer("CAST_AQUA_RAGE", 60000 + getRandom(-15000, 15000), npc, plr);
- if (npc.getId() == NEBULA)
- {
- npc.doCast(AQUA_SUMMON.getSkill());
- for (int i = 0; i < getRandom(4, 6); i++)
- {
- addSpawn(npc, WATER_SLIME, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, -1, true, npc.getInstanceId());
- startQuestTimer("SPAWN_WATER_SLIME", 300000, npc, null);
- }
- }
- }
- break;
- }
- case "PLAYER_PARA":
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
- {
- player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
- player.setImmobilized(true);
- startQuestTimer("PLAYER_UNPARA", 5000, npc, player);
- }
- break;
- }
- case "PLAYER_UNPARA":
- {
- player.getEffectList().stopSkillEffects(SkillFinishType.REMOVED, AQUA_RAGE_5.getSkill());
- player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
- player.setImmobilized(false);
- break;
- }
- case "CAST_AQUA_RAGE":
- {
- startQuestTimer("CAST_AQUA_RAGE", 5000, npc, player);
- if ((player.isInsideRadius3D(npc, 1000)))
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_2.getSkill()))
- {
- npc.doCast(AQUA_RAGE_2.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_3.getSkill()))
- {
- npc.doCast(AQUA_RAGE_3.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_4.getSkill()))
- {
- npc.doCast(AQUA_RAGE_4.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_5.getSkill()))
- {
- npc.doCast(AQUA_RAGE_5.getSkill());
- startQuestTimer("PLAYER_PARA", 100, npc, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
- {
- npc.abortCast();
- }
- else
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_1.getSkill()))
- {
- npc.doCast(AQUA_RAGE_1.getSkill());
- }
- }
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onSpawn(Npc npc)
- {
- startQuestTimer("SPAWN_WATER_SLIME", 300000, npc, null);
- return super.onSpawn(npc);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- switch (npc.getId())
- {
- case NEBULA:
- {
- cancelQuestTimer("CAST_AQUA_RAGE", npc, player);
- cancelQuestTimer("SPAWN_WATER_SLIME", npc, player);
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.finishInstance();
- }
- break;
- }
- case WATER_SLIME:
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_1.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_2.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 1);
- skill.applyEffects(player, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_3.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 2);
- skill.applyEffects(player, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_4.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 3);
- skill.applyEffects(player, player);
- }
- }
- break;
- }
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfQueenNebula();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/npcs/29100-29199.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/npcs/29100-29199.xml
index cebd2150c9..d9fc952c73 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/npcs/29100-29199.xml
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/npcs/29100-29199.xml
@@ -111,7 +111,7 @@
MALE
-
+
@@ -198,7 +198,7 @@
MALE
-
+
@@ -283,7 +283,7 @@
MALE
-
+
@@ -368,7 +368,7 @@
MALE
-
+
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/50000-50099.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/50000-50099.xml
index 9b72c28e20..22c9071df8 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/50000-50099.xml
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/50000-50099.xml
@@ -332,7 +332,7 @@
45
- -1
+ 30100FREEZINGtrue
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/zones/teleportzones.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/zones/teleportzones.xml
index d0510c8833..afb1bb78a4 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/zones/teleportzones.xml
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/zones/teleportzones.xml
@@ -1,5 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/DailyMission.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/DailyMission.xml
index e5aa5144a1..dd75a47ae0 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/DailyMission.xml
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/DailyMission.xml
@@ -963,43 +963,43 @@
Victory Pack
+ -->
- Weekly mission. A reward is given for defeating 1 enemy together with your clan members in the Clan Arena.
+
40
99
- Spirit Ore
- Clan XP
- Scroll: Boost Attack
+
+
+
- Weekly mission. A reward is given for defeating monsters during a clan raid to the Dwelling of Spirits.
+
76
99
- Improved Water Attack Potion
- Improved Wind Attack Potion
- Improved Earth Attack Potion
- Improved Fire Attack Potion
+
+
+
+
- Weekly mission. A reward is given for defeating Ignis, Nebula, Procella or Petram during a clan raid to the Dwelling of Spirits.
+
76
99
- Improved Water Attack Potion
- Improved Wind Attack Potion
- Improved Earth Attack Potion
- Improved Fire Attack Potion
+
+
+
+
- -->
-
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/DwellingOfSpirits.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/DwellingOfSpirits.xml
new file mode 100644
index 0000000000..0a8bc01b34
--- /dev/null
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/DwellingOfSpirits.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingIgnis.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingIgnis.xml
deleted file mode 100644
index 042e27144a..0000000000
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingIgnis.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingPetram.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingPetram.xml
deleted file mode 100644
index b0c695af74..0000000000
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingPetram.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingProcella.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingProcella.xml
deleted file mode 100644
index 3466755d90..0000000000
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfKingProcella.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfQueenNebula.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfQueenNebula.xml
deleted file mode 100644
index ff4e4911b7..0000000000
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/instances/ResidenceOfQueenNebula.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
new file mode 100644
index 0000000000..1ab7154aa4
--- /dev/null
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/DwellingOfSpirits/34176.htm
@@ -0,0 +1,4 @@
+Animael:
+All done here?
+ByeByeBye
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
new file mode 100644
index 0000000000..c2f13dc68c
--- /dev/null
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/DwellingOfSpirits/DwellingOfSpirits.java
@@ -0,0 +1,1058 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package instances.DwellingOfSpirits;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.l2jmobius.gameserver.data.xml.SkillData;
+import org.l2jmobius.gameserver.enums.ChatType;
+import org.l2jmobius.gameserver.enums.SkillFinishType;
+import org.l2jmobius.gameserver.enums.TeleportWhereType;
+import org.l2jmobius.gameserver.instancemanager.ZoneManager;
+import org.l2jmobius.gameserver.model.Party;
+import org.l2jmobius.gameserver.model.actor.Creature;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.holders.SkillHolder;
+import org.l2jmobius.gameserver.model.instancezone.Instance;
+import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
+import org.l2jmobius.gameserver.model.skill.Skill;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
+import org.l2jmobius.gameserver.model.zone.ZoneType;
+import org.l2jmobius.gameserver.network.NpcStringId;
+import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent;
+import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
+import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
+
+import instances.AbstractInstance;
+
+/**
+ * @author Serenitty
+ */
+public class DwellingOfSpirits extends AbstractInstance
+{
+ // CRITICAL NPCs
+ private static final int RUIP = 22273;
+ private static final int SEALSTONE = 34178;
+ private static final int ANIMAEL = 34176;
+ private static final int PORTAL_EVENT_FIRE = 15969;
+ private static final int PORTAL_EVENT_WATER = 15970;
+ private static final int PORTAL_EVENT_EARTH = 15972;
+ private static final int PORTAL_EVENT_WIND = 15971;
+
+ // PROCELLA BOSS WIND
+ private static final int KING_PROCELLA = 29107;
+ private static final int PROCELLA_GUARDIAN_1 = 29112;
+ private static final int PROCELLA_STORM = 29115;
+
+ private static final SkillHolder HURRICANE_SUMMON = new SkillHolder(50042, 1);
+ private static final int HURRICANE_BOLT = 50043;
+ private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1);
+ private static final int STORM_MAX_COUNT = 20; //
+
+ // PETRAM BOSS EARTH
+ private static final int KING_PETRAM = 29108;
+ private static final int PETRAM_PIECE = 29116;
+ private static final int PETRAM_FRAGMENT = 29117;
+ // Skills
+ private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1);
+ private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1);
+ private static final SkillHolder TEST = new SkillHolder(5712, 1);
+
+ // IGNIS BOSS FIRE
+ // NPCs
+ private static final int KING_IGNIS = 29105;
+ // Skills
+ private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
+ private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
+ private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
+ private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
+
+ // NEBULA BOSS WATER
+ // NPCs
+ private static final int KING_NEBULA = 29106;
+ private static final int WATER_SLIME = 29111;
+ // Skills
+ private static final int AQUA_RAGE = 50036;
+ private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
+ private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
+ private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
+ private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
+ private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
+ private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
+
+ // Entrace Portal Triggers
+ private static final int WIND_FIRST_TRIGGER_1 = 16158880;
+ private static final int WIND_FIRST_TRIGGER_2 = 16158882;
+ private static final int EARTH_FIRST_TRIGGER_1 = 16156660;
+ private static final int EARTH_FIRST_TRIGGER_2 = 16156662;
+ private static final int FIRE_FIRST_TRIGGER_1 = 16155550;
+ private static final int FIRE_FIRST_TRIGGER_2 = 16155552;
+ private static final int WATER_FIRST_TRIGGER_1 = 16157770;
+ private static final int WATER_FIRST_TRIGGER_2 = 16157772;
+
+ // Statue Kill Indicator Triggers
+ private static final int KILL_INDICATOR_TRIGGER_1 = 16159990;
+ private static final int KILL_INDICATOR_TRIGGER_2 = 16159994;
+ private static final int KILL_INDICATOR_TRIGGER_3 = 16159996;
+ private static final int KILL_INDICATOR_TRIGGER_4 = 16159998;
+ private static final int KILL_INDICATOR_TRIGGER_5 = 16159992;
+
+ private static final int TEMPLATE_ID = 214;
+
+ private static final Map PORTAL_MSG = new HashMap<>();
+ static
+ {
+ PORTAL_MSG.put(1, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_EARTH_IS_OPEN);
+ PORTAL_MSG.put(2, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_WATER_IS_OPEN);
+ PORTAL_MSG.put(3, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_WIND_IS_OPEN);
+ PORTAL_MSG.put(4, NpcStringId.DIMENSIONAL_DOOR_TO_THE_SPIRIT_OF_FIRE_IS_OPEN);
+ PORTAL_MSG.put(5, NpcStringId.SEAL_STONE_DISAPPEARS_AFTER_RESONATING_WITH_THE_STATUE);
+ }
+
+ public DwellingOfSpirits()
+ {
+ super(TEMPLATE_ID);
+ addKillId(KING_PETRAM, KING_NEBULA, KING_PROCELLA, KING_IGNIS);
+ addKillId(PROCELLA_GUARDIAN_1);
+ addKillId(PETRAM_PIECE, PETRAM_FRAGMENT);
+ addKillId(WATER_SLIME);
+ addAttackId(KING_PETRAM, KING_NEBULA, KING_PROCELLA, KING_IGNIS);
+ addSpawnId(KING_NEBULA);
+ addFirstTalkId(ANIMAEL, SEALSTONE);
+ addTalkId(ANIMAEL);
+ addStartNpc(SEALSTONE);
+ addCreatureSeeId(RUIP, ANIMAEL);
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, Player player)
+ {
+ switch (event)
+ {
+ case "ENTER":
+ {
+ if (player.isInParty())
+ {
+ final Party party = player.getParty();
+ final boolean isInCC = party.isInCommandChannel();
+ final List members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
+ for (Player member : members)
+ {
+ if (!member.isInsideRadius3D(npc, 1000))
+ {
+ player.sendMessage("Player " + member.getName() + " must go closer to Jay.");
+ }
+ enterInstance(member, npc, TEMPLATE_ID);
+ }
+ }
+ else if (player.isGM())
+ {
+ enterInstance(player, npc, TEMPLATE_ID);
+ player.sendMessage("SYS: You have entered as GM/Admin to Dwelling.");
+ }
+ else
+ {
+ if (!player.isInsideRadius3D(npc, 1000))
+ {
+ player.sendMessage("You must go closer to Jay.");
+ }
+ enterInstance(player, npc, TEMPLATE_ID);
+ }
+ break;
+ }
+
+ case "TELEPORT":
+ {
+ player.teleToLocation(TeleportWhereType.TOWN, null);
+ return null;
+ }
+ //////////////// BOSS PROCELLA WIND ACTION /////////////
+ case "SPAWN_MINION_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if ((world != null) && (npc.getId() == KING_PROCELLA))
+ {
+ world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
+ world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_1, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
+ world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_1, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
+ startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(KING_PROCELLA), player);
+ }
+ break;
+ }
+ case "SPAWN_STORM_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
+ {
+ world.getNpc(KING_PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
+ final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(KING_PROCELLA).getX() + getRandom(-500, 500), world.getNpc(KING_PROCELLA).getY() + getRandom(-500, 500), world.getNpc(KING_PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
+ procellaStorm.setRandomWalking(true);
+ world.getParameters().increaseInt("stormCount", 1);
+ startQuestTimer("SPAWN_STORM_PROCELLA", 30000, world.getNpc(KING_PROCELLA), player);
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, procellaStorm, player);
+ }
+ break;
+ }
+ case "HIDE_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PROCELLA_GUARDIAN_1) >= 1)
+ {
+ world.getNpc(KING_PROCELLA).setInvisible(true);
+ }
+ else if (world.getAliveNpcCount(PROCELLA_GUARDIAN_1) == 0)
+ {
+ world.getNpc(KING_PROCELLA).setInvisible(false);
+ startQuestTimer("SPAWN_MINION_PROCELLA", 90000 + getRandom(-15000, 11000), world.getNpc(KING_PROCELLA), player);
+ }
+ break;
+ }
+ case "CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Player plr = world.getPlayers().stream().findAny().orElse(null);
+ if ((plr != null) && (plr.isInsideRadius3D(npc, 200)))
+ {
+ npc.abortAttack();
+ npc.abortCast();
+ npc.setTarget(plr);
+ if (plr.getAffectedSkillLevel(HURRICANE_BOLT) == 1)
+ {
+ npc.abortCast();
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ else
+ {
+ if (SkillCaster.checkUseConditions(npc, HURRICANE_BOLT_LV_1.getSkill()))
+ {
+ npc.doCast(HURRICANE_BOLT_LV_1.getSkill());
+ }
+ }
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ else
+ {
+ startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC_PROCELLA", 100, npc, player);
+ }
+ }
+ break;
+ }
+ //////////////// BOSS PETRAM EARTH ACTION /////////////
+ case "SPAWN_MINION":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PETRAM_FRAGMENT) == 0)
+ {
+ npc.doCast(EARTH_ENERGY.getSkill());
+
+ if (!world.getParameters().getBoolean("spawnedMinions", false))
+ {
+ world.getParameters().set("spawnedMinions", true);
+
+ final int stage = world.getParameters().getInt("stage", 0);
+ world.getParameters().set("stage", stage + 1);
+
+ world.setParameter("minionpetram1", addSpawn(npc, PETRAM_FRAGMENT, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram3", addSpawn(npc, PETRAM_FRAGMENT, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
+ world.setParameter("minionpetram4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
+
+ npc.setInvul(true);
+ npc.broadcastSay(ChatType.NPC_SHOUT, "HaHahaha, fighters lets kill them. Now Im invul!!!");
+ }
+
+ startQuestTimer("SUPPORT_PETRAM", 3000, npc, player);
+ }
+ break;
+ }
+ case "UNSPAWN_MINION":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world.getAliveNpcCount(PETRAM_FRAGMENT) == 0)
+ {
+ world.getParameters().set("spawnedMinions", false);
+
+ npc.setInvul(false);
+ npc.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
+ }
+ break;
+ }
+ case "SUPPORT_PETRAM":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Npc m1 = world.getParameters().getObject("minionpetram1", Npc.class);
+ final Npc m2 = world.getParameters().getObject("minionpetram2", Npc.class);
+ final Npc m3 = world.getParameters().getObject("minionpetram3", Npc.class);
+ final Npc m4 = world.getParameters().getObject("minionpetram4", Npc.class);
+ if (!m1.isDead())
+ {
+ m1.setTarget(world.getNpc(KING_PETRAM));
+ m1.doCast(TEST.getSkill());
+ }
+ if (!m2.isDead())
+ {
+ m2.setTarget(world.getNpc(KING_PETRAM));
+ m2.doCast(TEST.getSkill());
+ }
+ if (!m3.isDead())
+ {
+ m3.setTarget(world.getNpc(KING_PETRAM));
+ m3.doCast(TEST.getSkill());
+ }
+ if (!m4.isDead())
+ {
+ m4.setTarget(world.getNpc(KING_PETRAM));
+ m4.doCast(TEST.getSkill());
+ }
+
+ startQuestTimer("SUPPORT_PETRAM", 10100, npc, player);
+ }
+ break;
+ }
+ case "EARTH_FURY":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ npc.doCast(EARTH_FURY.getSkill());
+ }
+ break;
+ }
+ //////////////// BOSS IGNIS ACTION /////////////
+ case "CAST_FIRE_RAGE_1":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_2.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_2.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_2":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_4.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_4.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_3":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_6.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_6.getSkill());
+ }
+ break;
+ }
+ case "CAST_FIRE_RAGE_4":
+ {
+ if (SkillCaster.checkUseConditions(npc, FIRE_RAG_8.getSkill()))
+ {
+ npc.doCast(FIRE_RAG_8.getSkill());
+ }
+ break;
+ }
+ //////////////// BOSS NEBULA ACTION /////////////
+ case "SPAWN_WATER_SLIME":
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world != null)
+ {
+ final Player plr = world.getPlayers().stream().findAny().get();
+ startQuestTimer("CAST_AQUA_RAGE", 30000 + getRandom(-15000, 15000), npc, plr);
+ if (npc.getId() == KING_NEBULA)
+ {
+ npc.doCast(AQUA_SUMMON.getSkill());
+ for (int i = 0; i < getRandom(4, 6); i++)
+ {
+ addSpawn(npc, WATER_SLIME, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, -1, true, npc.getInstanceId());
+ startQuestTimer("SPAWN_WATER_SLIME", 80000, npc, null);
+ }
+ }
+ }
+ break;
+ }
+ case "PLAYER_PARA":
+ {
+ if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
+ {
+ player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
+ player.setImmobilized(true);
+ startQuestTimer("PLAYER_UNPARA", 5000, npc, player);
+ }
+ break;
+ }
+ case "PLAYER_UNPARA":
+ {
+ player.getEffectList().stopSkillEffects(SkillFinishType.REMOVED, AQUA_RAGE_5.getSkill());
+ player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
+ player.setImmobilized(false);
+ break;
+ }
+ case "CAST_AQUA_RAGE":
+ {
+ startQuestTimer("CAST_AQUA_RAGE", 5000, npc, player);
+ if ((player.isInsideRadius3D(npc, 1000)))
+ {
+ if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_2.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_2.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_3.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_3.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_4.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_4.getSkill());
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_5.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_5.getSkill());
+ startQuestTimer("PLAYER_PARA", 100, npc, player);
+ }
+ }
+ else if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
+ {
+ npc.abortCast();
+ }
+ else
+ {
+ if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_1.getSkill()))
+ {
+ npc.doCast(AQUA_RAGE_1.getSkill());
+ }
+ }
+ }
+ break;
+ }
+ case "check_status":
+ {
+ final Instance world = player.getInstanceWorld();
+ if (!isInInstance(world))
+ {
+ return null;
+ }
+
+ switch (world.getStatus())
+ {
+ case 0:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(1);
+ world.despawnGroup("sealstone");
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 1:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(2);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 2:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(3);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 3:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(4);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 4:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(5);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(3), null));
+ addSpawn(KING_PROCELLA, 212862, 179828, -15489, 48103, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 5: // Dummy stage pause, u need defeat boss to continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 6:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(7);
+ world.spawnGroup("ruipwave_1");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 7:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(8);
+ world.spawnGroup("NormalMobs");
+ world.spawnGroup("ruipwave_1");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 8:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(9);
+ world.spawnGroup("NormalMobs");
+ world.spawnGroup("ruipwave_2");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 9:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(10);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(1), null));
+ addSpawn(KING_PETRAM, 222063, 191514, -15486, 50142, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 10: // Dummy stage pause, u need defeat boss to continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 11:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(12);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 12:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(13);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 13:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(14);
+ world.spawnGroup("ruipwave_2");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 14:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 1)
+ {
+ world.setStatus(15);
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(4), null));
+ addSpawn(KING_IGNIS, 202350, 169121, -15484, 48103, false, 0, false, world.getId());
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 15: // Dummy stage pause, u need defeat boss for continue.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 16:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(17);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_1, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 17:
+ {
+ if (world.getAliveNpcCount(RUIP) <= 3)
+ {
+ world.setStatus(18);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_2, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_3, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 18:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.setStatus(19);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_4, true));
+ player.broadcastPacket(new OnEventTrigger(KILL_INDICATOR_TRIGGER_5, true));
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 19: // need defeat boss for finish.
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+
+ {
+ world.setStatus(20);
+ world.spawnGroup("ruipwave_1");
+ world.spawnGroup("NormalMobs");
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(2), null));
+ addSpawn(KING_NEBULA, 222127, 169057, -15486, 48730, false, 0, false, world.getId());
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ case 20:
+ {
+ if (world.getAliveNpcCount(RUIP) == 0)
+ {
+ world.getParameters().set("DwellingOfSpiritsFinished", true);
+ world.setStatus(21);
+ }
+ startQuestTimer("check_status", 1000, null, player);
+ break;
+ }
+ }
+
+ return null;
+ }
+ }
+
+ return super.onAdvEvent(event, npc, player);
+
+ }
+
+ @Override
+ public String onSpawn(Npc npc)
+ {
+ startQuestTimer("SPAWN_WATER_SLIME", 40000, npc, null);
+ return super.onSpawn(npc);
+ }
+
+ @Override
+ public String onAttack(Npc npc, Player player, int damage, boolean isSummon, Skill skill)
+ {
+ final Instance world = npc.getInstanceWorld();
+ if (world == null)
+ {
+ return null;
+ }
+
+ switch (npc.getId())
+ {
+ case KING_PROCELLA:
+ {
+ if (npc.getCurrentHp() < (npc.getMaxHp() * 0.90))
+ {
+ startQuestTimer("SPAWN_MINION_PROCELLA", 80000 + getRandom(-15000, 15000), npc, player);
+ startQuestTimer("SPAWN_STORM_PROCELLA", 4000, npc, player);
+ world.setParameter("stormCount", 0);
+ }
+ break;
+ }
+ case KING_PETRAM:
+ {
+ if (npc.getCurrentHp() < (npc.getMaxHp() * 0.80))
+ {
+ startQuestTimer("EARTH_FURY", 1000, npc, player);
+ if ((world.getParameters().getInt("stage", 0) == 0) || (npc.getCurrentHp() < (npc.getMaxHp() * 0.50)))
+ {
+ startQuestTimer("SPAWN_MINION", 1000, npc, player);
+ }
+ }
+ break;
+ }
+ case KING_IGNIS:
+ {
+ if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.90)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.70)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_1", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.50)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_2", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.50)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.40)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_3", 1000, npc, null);
+ }
+ else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.25)))
+ {
+ startQuestTimer("CAST_FIRE_RAGE_4", 1000, npc, null);
+ }
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String onCreatureSee(Npc npc, Creature creature)
+ {
+ if (creature.isPlayer())
+ {
+ final Instance world = creature.getInstanceWorld();
+ if (world.getStatus() >= 5)
+ {
+ enableZoneWind();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WIND_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WIND_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 10)
+ {
+ enableZoneEarth();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(EARTH_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(EARTH_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 15)
+ {
+ enableZoneFire();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(FIRE_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(FIRE_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 20)
+ {
+ enableZoneWater();
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WATER_FIRST_TRIGGER_1, true));
+ creature.getActingPlayer().sendPacket(new OnEventTrigger(WATER_FIRST_TRIGGER_2, true));
+ }
+ else if (world.getStatus() >= 21)
+ {
+ world.despawnGroup("ruipwave_1");
+ world.despawnGroup("ruipwave_2");
+ world.despawnGroup("NormalMobs");
+ world.finishInstance();
+ }
+ }
+
+ return super.onCreatureSee(npc, creature);
+ }
+
+ @Override
+ public String onKill(Npc npc, Player player, boolean isSummon)
+ {
+ final Instance instance = npc.getInstanceWorld();
+
+ switch (npc.getId())
+ {
+ case KING_PETRAM:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_EARTH, 222065, 192767, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1); // set the portal visible
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneEarthExit();
+ cancelQuestTimer("SPAWN_MINION", npc, player);
+ instance.setStatus(12);
+ final Instance world = npc.getInstanceWorld();
+ for (Npc spawn : world.getNpcs(PETRAM_FRAGMENT))
+ {
+ spawn.deleteMe();
+ }
+ break;
+ }
+ case KING_NEBULA:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_WATER, 222127, 170488, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ player.sendPacket(new ExSendUIEvent(player, false, false, 0, 0, NpcStringId.TIME_LEFT));
+ setActive(true);
+ enableZoneWindExit();
+ instance.setStatus(21);
+ instance.spawnGroup("animael");
+ break;
+ }
+ case KING_IGNIS:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_FIRE, 202349, 170533, -15488, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneFireExit();
+ instance.setStatus(17);
+ break;
+ }
+ case KING_PROCELLA:
+ {
+ final Npc portal = addSpawn(PORTAL_EVENT_WIND, 212863, 181090, -15487, 16384, false, 0, false, instance.getId());
+ portal.setDisplayEffect(1);
+ player.getVariables().set("DSIGNIS", 1);
+ setActive(true);
+ enableZoneWaterExit();
+ instance.setStatus(7);
+ final Instance world = npc.getInstanceWorld();
+ for (Npc spawn : world.getNpcs(PROCELLA_GUARDIAN_1))
+ {
+ spawn.deleteMe();
+ }
+ break;
+ }
+ case PETRAM_FRAGMENT:
+ {
+ startQuestTimer("UNSPAWN_MINION", 1000, instance.getNpc(KING_PETRAM), player);
+ break;
+ }
+ case PROCELLA_GUARDIAN_1:
+ {
+
+ startQuestTimer("HIDE_PROCELLA", 1000, instance.getNpc(KING_PROCELLA), player);
+ break;
+ }
+ case WATER_SLIME:
+ {
+ if (getRandomBoolean())
+ {
+ switch (player.getAffectedSkillLevel(AQUA_RAGE))
+ {
+ case 1:
+ {
+ player.stopSkillEffects(AQUA_RAGE_1.getSkill());
+ break;
+ }
+ case 2:
+ {
+ player.stopSkillEffects(AQUA_RAGE_2.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 1);
+ skill.applyEffects(player, player);
+ break;
+ }
+ case 3:
+ {
+ player.stopSkillEffects(AQUA_RAGE_3.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 2);
+ skill.applyEffects(player, player);
+ break;
+ }
+ case 4:
+ {
+ player.stopSkillEffects(AQUA_RAGE_4.getSkill());
+ final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 3);
+ skill.applyEffects(player, player);
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ return super.onKill(npc, player, isSummon);
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, Player player)
+ {
+ if (npc.getId() == ANIMAEL)
+ {
+ return "34176.htm";
+ }
+
+ if (!player.getInstanceWorld().getParameters().getBoolean("PlayerEnter", false))
+ {
+ player.getInstanceWorld().setParameter("PlayerEnter", true);
+ player.getInstanceWorld().setDuration(30);
+ startEvent(npc, player);
+ }
+
+ return super.onFirstTalk(npc, player);
+ }
+
+ // PORTALS
+ private void enableZoneWind()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_wind");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneEarth()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_earth");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneFire()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_fire");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWater()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("dwelling_portal_water");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWindExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_procella");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneEarthExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_petram");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneFireExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_ignis");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void enableZoneWaterExit()
+ {
+ final ZoneType zone = ZoneManager.getInstance().getZoneByName("return_portal_nebula");
+ if (zone != null)
+ {
+ zone.setEnabled(true);
+ }
+ }
+
+ private void startEvent(Npc npc, Player player)
+ {
+ if (!player.getInstanceWorld().getParameters().getBoolean("DwellingOfSpiritsFinished", false))
+ {
+ player.sendPacket(new ExSendUIEvent(player, false, false, 1800, 2, NpcStringId.TIME_LEFT));
+ player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 8000, false, null, PORTAL_MSG.get(5), null));
+ startQuestTimer("check_status", 1000, null, player);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ new DwellingOfSpirits();
+ }
+}
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/MonsterArena/34169-02.htm b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
index 0982f30720..95ab5de5eb 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/MonsterArena/34169-02.htm
@@ -8,6 +8,6 @@
--.- NO AVAILABLE -.-
+
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
deleted file mode 100644
index e751cffbb9..0000000000
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingIgnis/ResidenceOfKingIgnis.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingIgnis;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.l2jmobius.gameserver.enums.ChatType;
-import org.l2jmobius.gameserver.enums.SkillFinishType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.Skill;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik
- * @NOTE: Retail like working - I get informations from wiki and youtube video.
- * @TODO: Maybe rewrite code to modern style.
- * @TODO: Check skill 50050 - working, but I dont know if is correct.
- * @TODO: Ignis other skills - skills are implemented, but I dont know if is correct.
- */
-public class ResidenceOfKingIgnis extends AbstractInstance
-{
- // NPCs
- private static final int TARA = 34047;
- private static final int FREYA = 29109;
- private static final int IGNIS = 29105;
- // Skills
- private static final SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
- private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
- private static final SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
- private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
- private static final SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
- private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
- private static final SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
- private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
- private static final SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
- private static final SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
- private static final SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
- // Misc
- private static final int TEMPLATE_ID = 195;
- private static final Map _playerFireRage = new ConcurrentHashMap<>();
-
- public ResidenceOfKingIgnis()
- {
- super(TEMPLATE_ID);
- addStartNpc(TARA);
- addTalkId(FREYA);
- addKillId(IGNIS);
- addAttackId(IGNIS);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- _playerFireRage.put(player, 0);
- break;
- }
- case "REMOVE_FIRE_RAGE":
- {
- if (player.isAffectedBySkill(FIRE_RAG_1))
- {
- final int playerFireRage = _playerFireRage.getOrDefault(player, 0);
- if (playerFireRage < 5)
- {
- _playerFireRage.put(player, playerFireRage + 1);
- player.stopSkillEffects(SkillFinishType.REMOVED, FIRE_RAG_1.getSkillId());
- player.doCast(FREYA_SAFETY_ZONE.getSkill());
- npc.broadcastSay(ChatType.NPC_SHOUT, "Bless with you. Lets finish fight!");
- break;
- }
- npc.broadcastSay(ChatType.NPC_SHOUT, "You cannot use my power again.");
- player.sendMessage("Freya: You cannot use my power again.");
- break;
- }
- npc.broadcastSay(ChatType.NPC_SHOUT, "I help you only when you affected by Fire Rage skill.");
- break;
- }
- case "CAST_FIRE_RAGE_1":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_1.getSkill()))
- {
- npc.doCast(FIRE_RAG_1.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_2":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_2.getSkill()))
- {
- npc.doCast(FIRE_RAG_2.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_3":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_3.getSkill()))
- {
- npc.doCast(FIRE_RAG_3.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_4":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_4.getSkill()))
- {
- npc.doCast(FIRE_RAG_4.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_5":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_5.getSkill()))
- {
- npc.doCast(FIRE_RAG_5.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_6":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_6.getSkill()))
- {
- npc.doCast(FIRE_RAG_6.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_7":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_7.getSkill()))
- {
- npc.doCast(FIRE_RAG_7.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_8":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_8.getSkill()))
- {
- npc.doCast(FIRE_RAG_8.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_9":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_9.getSkill()))
- {
- npc.doCast(FIRE_RAG_9.getSkill());
- }
- break;
- }
- case "CAST_FIRE_RAGE_10":
- {
- if (SkillCaster.checkUseConditions(npc, FIRE_RAG_10.getSkill()))
- {
- npc.doCast(FIRE_RAG_10.getSkill());
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
- {
- if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.99)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.70)))
- {
- startQuestTimer("CAST_FIRE_RAGE_1", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.50)))
- {
- startQuestTimer("CAST_FIRE_RAGE_2", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.50)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.40)))
- {
- startQuestTimer("CAST_FIRE_RAGE_3", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.25)))
- {
- startQuestTimer("CAST_FIRE_RAGE_4", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.25)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.15)))
- {
- startQuestTimer("CAST_FIRE_RAGE_5", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.15)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.10)))
- {
- startQuestTimer("CAST_FIRE_RAGE_6", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.10)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.7)))
- {
- startQuestTimer("CAST_FIRE_RAGE_7", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.7)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.5)))
- {
- startQuestTimer("CAST_FIRE_RAGE_8", 1000, npc, null);
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.5)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.3)))
- {
- startQuestTimer("CAST_FIRE_RAGE_9", 1000, npc, null);
- }
- else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.3))
- {
- startQuestTimer("CAST_FIRE_RAGE_10", 1000, npc, null);
- }
- return super.onAttack(npc, attacker, damage, isSummon, skill);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.finishInstance();
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingIgnis();
- }
-}
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
deleted file mode 100644
index df955bf126..0000000000
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingPetram/ResidenceOfKingPetram.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingPetram;
-
-import org.l2jmobius.gameserver.enums.ChatType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.Skill;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik, Mobius
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- * @TODO: Petram Skills and minion skills
- */
-public class ResidenceOfKingPetram extends AbstractInstance
-{
- // NPCs
- private static final int TRITAN = 34049;
- private static final int PETRAM = 29108;
- private static final int PETRAM_PIECE = 29116;
- private static final int PETRAM_FRAGMENT = 29117;
- // Skills
- private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
- private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1); // When change invul state.
- private static final SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
- // Misc
- private static final int TEMPLATE_ID = 198;
-
- public ResidenceOfKingPetram()
- {
- super(TEMPLATE_ID);
- addStartNpc(TRITAN);
- addKillId(PETRAM, PETRAM_PIECE, PETRAM_FRAGMENT);
- addAttackId(PETRAM);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- break;
- }
- case "SPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- npc.doCast(EARTH_ENERGY.getSkill());
-
- // Prevent to double or higher spawn when HP is between 68-70% + etc...
- if (!world.getParameters().getBoolean("spawnedMinions", false))
- {
- world.getParameters().set("spawnedMinions", true);
-
- final int stage = world.getParameters().getInt("stage", 0);
- world.getParameters().set("stage", stage + 1);
-
- world.setParameter("minion1", addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion3", addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
- world.setParameter("minion4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
-
- npc.setInvul(true);
- npc.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
- }
-
- startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
- }
- break;
- }
- case "UNSPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.getParameters().set("spawnedMinions", false);
-
- npc.setInvul(false);
- npc.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
- }
- break;
- }
- case "SUPPORT_PETRAM":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Npc m1 = world.getParameters().getObject("minion1", Npc.class);
- final Npc m2 = world.getParameters().getObject("minion2", Npc.class);
- final Npc m3 = world.getParameters().getObject("minion3", Npc.class);
- final Npc m4 = world.getParameters().getObject("minion4", Npc.class);
- if (!m1.isDead())
- {
- m1.setTarget(world.getNpc(PETRAM));
- m1.doCast(TEST.getSkill());
- }
- if (!m2.isDead())
- {
- m2.setTarget(world.getNpc(PETRAM));
- m2.doCast(TEST.getSkill());
- }
- if (!m3.isDead())
- {
- m3.setTarget(world.getNpc(PETRAM));
- m3.doCast(TEST.getSkill());
- }
- if (!m4.isDead())
- {
- m4.setTarget(world.getNpc(PETRAM));
- m4.doCast(TEST.getSkill());
- }
-
- startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
- }
- break;
- }
- case "EARTH_FURY":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- npc.doCast(EARTH_FURY.getSkill());
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PETRAM)
- {
- if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.70)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.68)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 0)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.40)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.38)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 1)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.20)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.18)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 2)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.10)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.08)))
- {
- startQuestTimer("EARTH_FURY", 1000, npc, null);
-
- if (world.getParameters().getInt("stage", 0) == 3)
- {
- startQuestTimer("SPAWN_MINION", 1000, npc, null);
- }
- }
- }
- return super.onAttack(npc, attacker, damage, isSummon, skill);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PETRAM)
- {
- world.finishInstance();
- }
- else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()) && (world.getParameters().getObject("minion4", Npc.class).isDead()))
- {
- startQuestTimer("UNSPAWN_MINION", 3000, world.getNpc(PETRAM), null);
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingPetram();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
deleted file mode 100644
index 43a715ab2e..0000000000
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfKingProcella/ResidenceOfKingProcella.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfKingProcella;
-
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik, Mobius
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- */
-public class ResidenceOfKingProcella extends AbstractInstance
-{
- // NPCs
- private static final int WIRI = 34048;
- private static final int PROCELLA = 29107;
- private static final int PROCELLA_GUARDIAN_1 = 29112;
- private static final int PROCELLA_GUARDIAN_2 = 29113;
- private static final int PROCELLA_GUARDIAN_3 = 29114;
- private static final int PROCELLA_STORM = 29115;
- // Skills
- private static final SkillHolder HURRICANE_SUMMON = new SkillHolder(50042, 1); // When spawn Minion
- private static final int HURRICANE_BOLT = 50043;
- private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1); // When player in Radius + para
- // Misc
- private static final int TEMPLATE_ID = 197;
- private static final int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
-
- public ResidenceOfKingProcella()
- {
- super(TEMPLATE_ID);
- addStartNpc(WIRI);
- addKillId(PROCELLA, PROCELLA_GUARDIAN_1, PROCELLA_GUARDIAN_2, PROCELLA_GUARDIAN_3);
- addInstanceEnterId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- final Instance world = player.getInstanceWorld();
- if (world != null)
- {
- final Npc procella = addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
- startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), procella, player);
- startQuestTimer("SPAWN_STORM", 5000, procella, player);
- world.setParameter("stormCount", 0);
- }
- break;
- }
- case "SPAWN_MINION":
- {
- final Instance world = npc.getInstanceWorld();
- if ((world != null) && (npc.getId() == PROCELLA))
- {
- world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
- world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
- world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
- startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
- }
- break;
- }
- case "SPAWN_STORM":
- {
- final Instance world = npc.getInstanceWorld();
- if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
- {
- world.getNpc(PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
- final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(PROCELLA).getX() + getRandom(-500, 500), world.getNpc(PROCELLA).getY() + getRandom(-500, 500), world.getNpc(PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
- procellaStorm.setRandomWalking(true);
- world.getParameters().increaseInt("stormCount", 1);
- startQuestTimer("SPAWN_STORM", 60000, world.getNpc(PROCELLA), null);
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, procellaStorm, player); // All time checking
- }
- break;
- }
- case "HIDE_PROCELLA":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- if (world.getNpc(PROCELLA).isInvisible())
- {
- world.getNpc(PROCELLA).setInvisible(false);
- }
- else
- {
- world.getNpc(PROCELLA).setInvisible(true);
- startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), world.getNpc(PROCELLA), player);
- }
- }
- break;
- }
- case "CHECK_CHAR_INSIDE_RADIUS_NPC":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Player plr = world.getPlayers().stream().findAny().orElse(null);
- if ((plr != null) && (plr.isInsideRadius3D(npc, 100)))
- {
- npc.abortAttack();
- npc.abortCast();
- npc.setTarget(plr);
- if (plr.getAffectedSkillLevel(HURRICANE_BOLT) == 1)
- {
- npc.abortCast();
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- else
- {
- if (SkillCaster.checkUseConditions(npc, HURRICANE_BOLT_LV_1.getSkill()))
- {
- npc.doCast(HURRICANE_BOLT_LV_1.getSkill());
- }
- }
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- else
- {
- startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, npc, player); // All time checking
- }
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- final Instance world = npc.getInstanceWorld();
- if (world == null)
- {
- return null;
- }
-
- if (npc.getId() == PROCELLA)
- {
- cancelQuestTimer("SPAWN_MINION", npc, player);
- cancelQuestTimer("SPAWN_STORM", npc, player);
- cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
- world.finishInstance();
- }
- else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()))
- {
- startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
- }
-
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfKingProcella();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
deleted file mode 100644
index eb97a38b6c..0000000000
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/instances/ResidenceOfQueenNebula/ResidenceOfQueenNebula.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package instances.ResidenceOfQueenNebula;
-
-import org.l2jmobius.gameserver.data.xml.SkillData;
-import org.l2jmobius.gameserver.enums.SkillFinishType;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.Player;
-import org.l2jmobius.gameserver.model.holders.SkillHolder;
-import org.l2jmobius.gameserver.model.instancezone.Instance;
-import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
-import org.l2jmobius.gameserver.model.skill.Skill;
-import org.l2jmobius.gameserver.model.skill.SkillCaster;
-
-import instances.AbstractInstance;
-
-/**
- * @author RobikBobik
- * @NOTE: Retail like working
- * @TODO: Rewrite code to modern style.
- * @TODO: The less Nebula's HP, the more damage she deals.
- */
-public class ResidenceOfQueenNebula extends AbstractInstance
-{
- // NPCs
- private static final int IRIS = 34046;
- private static final int NEBULA = 29106;
- private static final int WATER_SLIME = 29111;
- // Skills
- private static final int AQUA_RAGE = 50036;
- private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
- private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
- private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
- private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
- private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
- private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
- // Misc
- private static final int TEMPLATE_ID = 196;
-
- public ResidenceOfQueenNebula()
- {
- super(TEMPLATE_ID);
- addStartNpc(IRIS);
- addKillId(NEBULA, WATER_SLIME);
- addAttackId(NEBULA);
- addSpawnId(NEBULA);
- addInstanceLeaveId(TEMPLATE_ID);
- }
-
- @Override
- public String onAdvEvent(String event, Npc npc, Player player)
- {
- switch (event)
- {
- case "ENTER":
- {
- enterInstance(player, npc, TEMPLATE_ID);
- break;
- }
- case "SPAWN_WATER_SLIME":
- {
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- final Player plr = world.getPlayers().stream().findAny().get();
- startQuestTimer("CAST_AQUA_RAGE", 60000 + getRandom(-15000, 15000), npc, plr);
- if (npc.getId() == NEBULA)
- {
- npc.doCast(AQUA_SUMMON.getSkill());
- for (int i = 0; i < getRandom(4, 6); i++)
- {
- addSpawn(npc, WATER_SLIME, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, -1, true, npc.getInstanceId());
- startQuestTimer("SPAWN_WATER_SLIME", 300000, npc, null);
- }
- }
- }
- break;
- }
- case "PLAYER_PARA":
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
- {
- player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
- player.setImmobilized(true);
- startQuestTimer("PLAYER_UNPARA", 5000, npc, player);
- }
- break;
- }
- case "PLAYER_UNPARA":
- {
- player.getEffectList().stopSkillEffects(SkillFinishType.REMOVED, AQUA_RAGE_5.getSkill());
- player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.FROZEN_PILLAR);
- player.setImmobilized(false);
- break;
- }
- case "CAST_AQUA_RAGE":
- {
- startQuestTimer("CAST_AQUA_RAGE", 5000, npc, player);
- if ((player.isInsideRadius3D(npc, 1000)))
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_2.getSkill()))
- {
- npc.doCast(AQUA_RAGE_2.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_3.getSkill()))
- {
- npc.doCast(AQUA_RAGE_3.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_4.getSkill()))
- {
- npc.doCast(AQUA_RAGE_4.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_5.getSkill()))
- {
- npc.doCast(AQUA_RAGE_5.getSkill());
- startQuestTimer("PLAYER_PARA", 100, npc, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 5)
- {
- npc.abortCast();
- }
- else
- {
- if (SkillCaster.checkUseConditions(npc, AQUA_RAGE_1.getSkill()))
- {
- npc.doCast(AQUA_RAGE_1.getSkill());
- }
- }
- }
- break;
- }
- }
- return null;
- }
-
- @Override
- public String onSpawn(Npc npc)
- {
- startQuestTimer("SPAWN_WATER_SLIME", 300000, npc, null);
- return super.onSpawn(npc);
- }
-
- @Override
- public String onKill(Npc npc, Player player, boolean isSummon)
- {
- switch (npc.getId())
- {
- case NEBULA:
- {
- cancelQuestTimer("CAST_AQUA_RAGE", npc, player);
- cancelQuestTimer("SPAWN_WATER_SLIME", npc, player);
- final Instance world = npc.getInstanceWorld();
- if (world != null)
- {
- world.finishInstance();
- }
- break;
- }
- case WATER_SLIME:
- {
- if (player.getAffectedSkillLevel(AQUA_RAGE) == 1)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_1.getSkill());
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 2)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_2.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 1);
- skill.applyEffects(player, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 3)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_3.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 2);
- skill.applyEffects(player, player);
- }
- }
- else if (player.getAffectedSkillLevel(AQUA_RAGE) == 4)
- {
- if (getRandom(100) < 50)
- {
- player.stopSkillEffects(AQUA_RAGE_4.getSkill());
- final Skill skill = SkillData.getInstance().getSkill(AQUA_RAGE, 3);
- skill.applyEffects(player, player);
- }
- }
- break;
- }
- }
- return super.onKill(npc, player, isSummon);
- }
-
- public static void main(String[] args)
- {
- new ResidenceOfQueenNebula();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/stats/npcs/29100-29199.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/stats/npcs/29100-29199.xml
index 0b49a8f404..0694231d57 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/stats/npcs/29100-29199.xml
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/stats/npcs/29100-29199.xml
@@ -111,7 +111,7 @@
MALE
-
+
@@ -198,7 +198,7 @@
MALE
-
+
@@ -283,7 +283,7 @@
MALE
-
+
@@ -368,7 +368,7 @@
MALE
-
+
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/stats/skills/50000-50099.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/stats/skills/50000-50099.xml
index 480708d8ac..32b3a221b1 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/stats/skills/50000-50099.xml
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/stats/skills/50000-50099.xml
@@ -332,7 +332,7 @@
45
- -1
+ 30100FREEZINGtrue
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/zones/teleportzones.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/zones/teleportzones.xml
index d0510c8833..afb1bb78a4 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/zones/teleportzones.xml
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/zones/teleportzones.xml
@@ -1,5 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+