Browse Source

BETA: Final Emperial Tomb (Instanced Frintezza) by Gigiikun

Rumen Nikiforov 13 years ago
parent
commit
3ef098e97d

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/html/default/32011.htm

@@ -1,7 +1,7 @@
 <html><body>
 I feel an invisible barrier... Some sort of Magic Force Field has been put in place...<br>
 ...? The guide of the Imperial mausoleum seems to have something to say.<br><br>
-<a action="bypass -h npc_%objectId%_Quest Frintezza">Enter the Magic Force Field</a><br>
+<a action="bypass -h npc_%objectId%_Quest FinalEmperialTomb">Enter the Magic Force Field</a><br>
 <a action="bypass -h npc_%objectId%_Chat 1">Listen to Imperial Tomb Guide</a><br>
 <a action="bypass -h npc_%objectId%_Quest">Quest</a>
 </body></html>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/html/teleporter/29061.htm

@@ -1,5 +1,5 @@
 <html>
 <body>Teleportation Cubic:<br>
-<a action="bypass -h npc_%objectId%_Quest Frintezza">Exit the Last Imperial Tomb</a><br>
+<a action="bypass -h npc_%objectId%_Quest FinalEmperialTomb">Exit the Last Imperial Tomb</a><br>
 </body>
 </html>

+ 31 - 0
L2J_DataPack_BETA/dist/game/data/instances/FinalEmperialTomb.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<instance name="Final Emperial Tomb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="instance.xsd">
+	<activityTime val="120" />
+	<allowSummon val="false" />
+	<emptyDestroyTime val="1800" />
+	<spawnPoint spawnX="181381" spawnY="-80883" spawnZ="-2730" />
+	<doorlist>
+		<door doorId="17130045" />
+		<door doorId="17130051" />
+		<door doorId="17130046" />
+		<door doorId="17130043" />
+		<door doorId="17130042" />
+		<door doorId="17130052" />
+		<door doorId="17130053" />
+		<door doorId="17130054" />
+		<door doorId="17130055" />
+		<door doorId="17130056" />
+		<door doorId="17130057" />
+		<door doorId="17130058" />
+		<door doorId="17130061" />
+		<door doorId="17130062" />
+		<door doorId="17130063" />
+		<door doorId="17130064" />
+		<door doorId="17130065" />
+		<door doorId="17130066" />
+		<door doorId="17130067" />
+		<door doorId="17130068" />
+		<door doorId="17130069" />
+		<door doorId="17130070" />
+	</doorlist>
+</instance>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts.cfg

@@ -64,7 +64,6 @@ ai/individual/SinWardens.java
 ai/individual/Typhoon.java
 ai/individual/Valakas.java
 ai/individual/Zaken.java
-ai/individual/Frintezza.java
 
 # Transformations
 
@@ -229,6 +228,7 @@ instances/RankuFloor/RankuFloor.java
 instances/SeedOfInfinity/HallOfSuffering.java
 instances/SeedOfDestruction/Stage1.java
 instances/NornilsGarden/NornilsGarden.java
+instances/FinalEmperialTomb/FinalEmperialTomb.java
 
 # Hellbound Section
 hellbound/Engine.java

+ 0 - 1513
L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/Frintezza.java

@@ -1,1513 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-package ai.individual;
-
-import java.util.List;
-
-import javolution.util.FastList;
-import ai.group_template.L2AttackableAIScript;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.ai.CtrlIntention;
-import com.l2jserver.gameserver.datatables.DoorTable;
-import com.l2jserver.gameserver.datatables.SkillTable;
-import com.l2jserver.gameserver.instancemanager.GrandBossManager;
-import com.l2jserver.gameserver.model.L2CommandChannel;
-import com.l2jserver.gameserver.model.L2Party;
-import com.l2jserver.gameserver.model.L2Skill;
-import com.l2jserver.gameserver.model.actor.L2Attackable;
-import com.l2jserver.gameserver.model.actor.L2Character;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.zone.type.L2BossZone;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.serverpackets.AbstractNpcInfo.NpcInfo;
-import com.l2jserver.gameserver.network.serverpackets.Earthquake;
-import com.l2jserver.gameserver.network.serverpackets.MagicSkillCanceld;
-import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
-import com.l2jserver.gameserver.network.serverpackets.NpcSay;
-import com.l2jserver.gameserver.network.serverpackets.PlaySound;
-import com.l2jserver.gameserver.network.serverpackets.SocialAction;
-import com.l2jserver.gameserver.network.serverpackets.SpecialCamera;
-import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
-import com.l2jserver.gameserver.skills.AbnormalEffect;
-import com.l2jserver.gameserver.templates.StatsSet;
-import com.l2jserver.util.Rnd;
-
-/**
- * Frintezza AI
- * 
- * @author Darki699
- * @author SANDMAN L2J_JP(modified)
- * @author JOJO
- * 
- * Update by rocknow
- * Updated by L2jOff team
- *
- * <BR>
- * Warn: be careful with adding new spawns {@link #getXFix(int)}
- * 
- */
-public class Frintezza extends L2AttackableAIScript
-{
-	private static final int[][] _invadeLoc =
-	{
-		{ 174102, -76039, -5105 },
-		{ 173235, -76884, -5105 },
-		{ 175003, -76933, -5105 },
-		{ 174196, -76190, -5105 },
-		{ 174013, -76120, -5105 },
-		{ 173263, -75161, -5105 }
-	};
-	
-	private static final int[][] _skill =
-	{
-		{ 5015, 1, 5000 },
-		{ 5015, 4, 5000 },
-		{ 5015, 2, 5000 },
-		{ 5015, 5, 5000 },
-		{ 5018, 1, 10000 },
-		{ 5016, 1, 5000 },
-		{ 5015, 3, 5000 },
-		{ 5015, 6, 5000 },
-		{ 5018, 2, 10000 },
-		{ 5019, 1, 10000 },
-		{ 5016, 1, 5000 }
-	};
-	
-	private static final int[][] _mobLoc =
-	{
-		{ 18328,172894,-76019,-5107,243 },
-		{ 18328,174095,-77279,-5107,16216 },
-		{ 18328,174111,-74833,-5107,49043 },
-		{ 18328,175344,-76042,-5107,32847 },
-		{ 18330,173489,-76227,-5134,63565 },
-		{ 18330,173498,-75724,-5107,58498 },
-		{ 18330,174365,-76745,-5107,22424 },
-		{ 18330,174570,-75584,-5107,31968 },
-		{ 18330,174613,-76179,-5107,31471 },
-		{ 18332,173620,-75981,-5107,4588 },
-		{ 18332,173630,-76340,-5107,62454 },
-		{ 18332,173755,-75613,-5107,57892 },
-		{ 18332,173823,-76688,-5107,2411 },
-		{ 18332,174000,-75411,-5107,54718 },
-		{ 18332,174487,-75555,-5107,33861 },
-		{ 18332,174517,-76471,-5107,21893 },
-		{ 18332,174576,-76122,-5107,31176 },
-		{ 18332,174600,-75841,-5134,35927 },
-		{ 18329,173481,-76043,-5107,61312 },
-		{ 18329,173539,-75678,-5107,59524 },
-		{ 18329,173584,-76386,-5107,3041 },
-		{ 18329,173773,-75420,-5107,51115 },
-		{ 18329,173777,-76650,-5107,12588 },
-		{ 18329,174585,-76510,-5107,21704 },
-		{ 18329,174623,-75571,-5107,40141 },
-		{ 18329,174744,-76240,-5107,29202 },
-		{ 18329,174769,-75895,-5107,29572 },
-		{ 18333,173861,-76011,-5107,383 },
-		{ 18333,173872,-76461,-5107,8041 },
-		{ 18333,173898,-75668,-5107,51856 },
-		{ 18333,174422,-75689,-5107,42878 },
-		{ 18333,174460,-76355,-5107,27311 },
-		{ 18333,174483,-76041,-5107,30947 },
-		{ 18331,173515,-76184,-5107,6971 },
-		{ 18331,173516,-75790,-5134,3142 },
-		{ 18331,173696,-76675,-5107,6757 },
-		{ 18331,173766,-75502,-5134,60827 },
-		{ 18331,174473,-75321,-5107,37147 },
-		{ 18331,174493,-76505,-5107,34503 },
-		{ 18331,174568,-75654,-5134,41661 },
-		{ 18331,174584,-76263,-5107,31729 },
-		{ 18339,173892,-81592,-5123,50849 },
-		{ 18339,173958,-81820,-5123,7459 },
-		{ 18339,174128,-81805,-5150,21495 },
-		{ 18339,174245,-81566,-5123,41760 },
-		{ 18334,173264,-81529,-5072,1646 },
-		{ 18334,173265,-81656,-5072,441 },
-		{ 18334,173267,-81889,-5072,0 },
-		{ 18334,173271,-82015,-5072,65382 },
-		{ 18334,174867,-81655,-5073,32537 },
-		{ 18334,174868,-81890,-5073,32768 },
-		{ 18334,174869,-81485,-5073,32315 },
-		{ 18334,174871,-82017,-5073,33007 },
-		{ 18335,173074,-80817,-5107,8353 },
-		{ 18335,173128,-82702,-5107,5345 },
-		{ 18335,173181,-82544,-5107,65135 },
-		{ 18335,173191,-80981,-5107,6947 },
-		{ 18335,174859,-80889,-5134,24103 },
-		{ 18335,174924,-82666,-5107,38710 },
-		{ 18335,174947,-80733,-5107,22449 },
-		{ 18335,175096,-82724,-5107,42205 },
-		{ 18336,173435,-80512,-5107,65215 },
-		{ 18336,173440,-82948,-5107,417 },
-		{ 18336,173443,-83120,-5107,1094 },
-		{ 18336,173463,-83064,-5107,286 },
-		{ 18336,173465,-80453,-5107,174 },
-		{ 18336,173465,-83006,-5107,2604 },
-		{ 18336,173468,-82889,-5107,316 },
-		{ 18336,173469,-80570,-5107,65353 },
-		{ 18336,173469,-80628,-5107,166 },
-		{ 18336,173492,-83121,-5107,394 },
-		{ 18336,173493,-80683,-5107,0 },
-		{ 18336,173497,-80510,-5134,417 },
-		{ 18336,173499,-82947,-5107,0 },
-		{ 18336,173521,-83063,-5107,316 },
-		{ 18336,173523,-82889,-5107,128 },
-		{ 18336,173524,-80627,-5134,65027 },
-		{ 18336,173524,-83007,-5107,0 },
-		{ 18336,173526,-80452,-5107,64735 },
-		{ 18336,173527,-80569,-5134,65062 },
-		{ 18336,174602,-83122,-5107,33104 },
-		{ 18336,174604,-82949,-5107,33184 },
-		{ 18336,174609,-80514,-5107,33234 },
-		{ 18336,174609,-80684,-5107,32851 },
-		{ 18336,174629,-80627,-5107,33346 },
-		{ 18336,174632,-80570,-5107,32896 },
-		{ 18336,174632,-83066,-5107,32768 },
-		{ 18336,174635,-82893,-5107,33594 },
-		{ 18336,174636,-80456,-5107,32065 },
-		{ 18336,174639,-83008,-5107,33057 },
-		{ 18336,174660,-80512,-5107,33057 },
-		{ 18336,174661,-83121,-5107,32768 },
-		{ 18336,174663,-82948,-5107,32768 },
-		{ 18336,174664,-80685,-5107,32676 },
-		{ 18336,174687,-83008,-5107,32520 },
-		{ 18336,174691,-83066,-5107,32961 },
-		{ 18336,174692,-80455,-5107,33202 },
-		{ 18336,174692,-80571,-5107,32768 },
-		{ 18336,174693,-80630,-5107,32994 },
-		{ 18336,174693,-82889,-5107,32622 },
-		{ 18337,172837,-82382,-5107,58363 },
-		{ 18337,172867,-81123,-5107,64055 },
-		{ 18337,172883,-82495,-5107,64764 },
-		{ 18337,172916,-81033,-5107,7099 },
-		{ 18337,172940,-82325,-5107,58998 },
-		{ 18337,172946,-82435,-5107,58038 },
-		{ 18337,172971,-81198,-5107,14768 },
-		{ 18337,172992,-81091,-5107,9438 },
-		{ 18337,173032,-82365,-5107,59041 },
-		{ 18337,173064,-81125,-5107,5827 },
-		{ 18337,175014,-81173,-5107,26398 },
-		{ 18337,175061,-82374,-5107,43290 },
-		{ 18337,175096,-81080,-5107,24719 },
-		{ 18337,175169,-82453,-5107,37672 },
-		{ 18337,175172,-80972,-5107,32315 },
-		{ 18337,175174,-82328,-5107,41760 },
-		{ 18337,175197,-81157,-5107,27617 },
-		{ 18337,175245,-82547,-5107,40275 },
-		{ 18337,175249,-81075,-5107,28435 },
-		{ 18337,175292,-82432,-5107,42225 },
-		{ 18338,173014,-82628,-5107,11874 },
-		{ 18338,173033,-80920,-5107,10425 },
-		{ 18338,173095,-82520,-5107,49152 },
-		{ 18338,173115,-80986,-5107,9611 },
-		{ 18338,173144,-80894,-5107,5345 },
-		{ 18338,173147,-82602,-5107,51316 },
-		{ 18338,174912,-80825,-5107,24270 },
-		{ 18338,174935,-80899,-5107,18061 },
-		{ 18338,175016,-82697,-5107,39533 },
-		{ 18338,175041,-80834,-5107,25420 },
-		{ 18338,175071,-82549,-5107,39163 },
-		{ 18338,175154,-82619,-5107,36345 }
-	};
-	
-	private static final int SCARLET1 = 29046;
-	private static final int SCARLET2 = 29047;
-	private static final int FRINTEZZA = 29045;
-	private static final int GUIDE = 32011;
-	private static final int CUBE = 29061;
-	
-	//Frintezza Status Tracking :
-	private static final byte DORMANT = 0;		//Frintezza is spawned and no one has entered yet. Entry is unlocked
-	private static final byte WAITING = 1;		//Frintezza is spawend and someone has entered, triggering a 30 minute window for additional people to enter
-	//before he unleashes his attack. Entry is unlocked
-	private static final byte FIGHTING = 2; 	//Frintezza is engaged in battle, annihilating his foes. Entry is locked
-	private static final byte DEAD = 3;			//Frintezza has been killed. Entry is locked
-	
-	private static long _LastAction = 0;
-	private static int _Angle = 0;
-	private static int _Heading = 0;
-	private static int _LocCycle = 0;
-	private static int _Bomber = 0;
-	private static int _CheckDie = 0;
-	private static int _OnCheck = 0;
-	private static int _OnSong = 0;
-	private static int _Abnormal = 0;
-	private static int _OnMorph = 0;
-	private static int _Scarlet_x = 0;
-	private static int _Scarlet_y = 0;
-	private static int _Scarlet_z = 0;
-	private static int _Scarlet_h = 0;
-	private static int _SecondMorph = 0;
-	private static int _ThirdMorph = 0;
-	private static int _KillHallAlarmDevice = 0;
-	private static int _KillDarkChoirPlayer = 0;
-	private static int _KillDarkChoirCaptain = 0;
-	
-	private static L2BossZone _Zone;
-	private L2GrandBossInstance frintezza, weakScarlet, strongScarlet, activeScarlet;
-	private L2MonsterInstance demon1, demon2, demon3, demon4, portrait1, portrait2, portrait3, portrait4;
-	private L2Npc _frintezzaDummy, _overheadDummy, _portraitDummy1, _portraitDummy3, _scarletDummy;
-	private static List<L2PcInstance> _PlayersInside = new FastList<L2PcInstance>();
-	private static List<L2Npc> _Room1Mobs = new FastList<L2Npc>();
-	private static List<L2Npc> _Room2Mobs = new FastList<L2Npc>();
-	private static List<L2Attackable> Minions = new FastList<L2Attackable>();
-	
-	// Boss: Frintezza
-	public Frintezza(int id, String name, String descr)
-	{
-		super(id,name,descr);
-		int[] mob = {SCARLET1, SCARLET2, FRINTEZZA, 18328, 18329, 18330, 18331, 18332, 18333, 18334, 18335, 18336, 18337, 18338, 18339, 29048, 29049, 29050, 29051};
-		_Zone = GrandBossManager.getInstance().getZone(getXFix(174232), getYFix(-88020), getZFix(-5116));
-		registerMobs(mob);
-		addStartNpc(GUIDE, CUBE);
-		addTalkId(GUIDE, CUBE);
-		
-		StatsSet info = GrandBossManager.getInstance().getStatsSet(FRINTEZZA);
-		int status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA);
-		if (status == DEAD)
-		{
-			long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
-			if (temp > 0)
-				startQuestTimer("frintezza_unlock", temp, null, null);
-			else
-				GrandBossManager.getInstance().setBossStatus(FRINTEZZA,DORMANT);
-		}
-		else if (status != DORMANT)
-			GrandBossManager.getInstance().setBossStatus(FRINTEZZA,DORMANT);
-		
-		//tempfix for messed door cords
-		for (int i = 0; i < 8; i++)
-			DoorTable.getInstance().getDoor(17130051+i).setRange(0, 0, 0, 0, 0, 0);
-	}
-	
-	@Override
-	public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)
-	{
-		long temp = 0;
-		if (event.equalsIgnoreCase("waiting"))
-		{
-			startQuestTimer("close", 27000, npc, null);
-			startQuestTimer("camera_1", 30000, npc, null);
-			_Zone.broadcastPacket(new Earthquake(getXFix(174232), getYFix(-88020), getZFix(-5116), 45, 27));
-		}
-		else if (event.equalsIgnoreCase("room1_spawn"))
-		{
-			for (int i = 0; i <= 17; i++)
-			{
-				L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4],false,0);
-				_Room1Mobs.add(mob);
-			}
-		}
-		else if (event.equalsIgnoreCase("room1_spawn2"))
-		{
-			for (int i = 18; i <= 26; i++)
-			{
-				L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4],false,0);
-				_Room1Mobs.add(mob);
-			}
-		}
-		else if (event.equalsIgnoreCase("room1_spawn3"))
-		{
-			for (int i = 27; i <= 32; i++)
-			{
-				L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4],false,0);
-				_Room1Mobs.add(mob);
-			}
-		}
-		else if (event.equalsIgnoreCase("room1_spawn4"))
-		{
-			for (int i = 33; i <= 40; i++)
-			{
-				L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4],false,0);
-				_Room1Mobs.add(mob);
-			}
-		}
-		else if (event.equalsIgnoreCase("room2_spawn"))
-		{
-			for (int i = 41; i <= 44; i++)
-			{
-				L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4],false,0);
-				_Room2Mobs.add(mob);
-			}
-		}
-		else if (event.equalsIgnoreCase("room2_spawn2"))
-		{
-			for (int i = 45; i <= 131; i++)
-			{
-				L2Npc mob = addSpawn(_mobLoc[i][0],_mobLoc[i][1],_mobLoc[i][2],_mobLoc[i][3],_mobLoc[i][4],false,0);
-				_Room2Mobs.add(mob);
-			}
-		}
-		else if (event.equalsIgnoreCase("room1_del"))
-		{
-			for (L2Npc mob : _Room1Mobs)
-			{
-				if (mob != null)
-					mob.deleteMe();
-			}
-			_Room1Mobs.clear();
-		}
-		else if (event.equalsIgnoreCase("room2_del"))
-		{
-			for (L2Npc mob : _Room2Mobs)
-			{
-				if (mob != null)
-					mob.deleteMe();
-			}
-			_Room2Mobs.clear();
-		}
-		else if (event.equalsIgnoreCase("room3_del"))
-		{
-			if (demon1 != null)
-				demon1.deleteMe();
-			if (demon2 != null)
-				demon2.deleteMe();
-			if (demon3 != null)
-				demon3.deleteMe();
-			if (demon4 != null)
-				demon4.deleteMe();
-			if (portrait1 != null)
-				portrait1.deleteMe();
-			if (portrait2 != null)
-				portrait2.deleteMe();
-			if (portrait3 != null)
-				portrait3.deleteMe();
-			if (portrait4 != null)
-				portrait4.deleteMe();
-			if (frintezza != null)
-				frintezza.deleteMe();
-			if (weakScarlet != null)
-				weakScarlet.deleteMe();
-			if (strongScarlet != null)
-				strongScarlet.deleteMe();
-			
-			demon1 = null;
-			demon2 = null;
-			demon3 = null;
-			demon4 = null;
-			portrait1 = null;
-			portrait2 = null;
-			portrait3 = null;
-			portrait4 = null;
-			frintezza = null;
-			weakScarlet = null;
-			strongScarlet = null;
-			activeScarlet = null;
-		}
-		else if (event.equalsIgnoreCase("clean"))
-		{
-			_LastAction = 0;
-			_LocCycle = 0;
-			_CheckDie = 0;
-			_OnCheck = 0;
-			_Abnormal = 0;
-			_OnMorph = 0;
-			_SecondMorph = 0;
-			_ThirdMorph = 0;
-			_KillHallAlarmDevice = 0;
-			_KillDarkChoirPlayer = 0;
-			_KillDarkChoirCaptain = 0;
-			_PlayersInside.clear();
-		}
-		else if (event.equalsIgnoreCase("close"))
-		{
-			for (int i = 17130051; i <= 17130058; i++)
-				DoorTable.getInstance().getDoor(i).closeMe();
-			for (int i = 17130061; i <= 17130070; i++)
-				DoorTable.getInstance().getDoor(i).closeMe();
-			
-			DoorTable.getInstance().getDoor(17130042).closeMe();
-			DoorTable.getInstance().getDoor(17130043).closeMe();
-			DoorTable.getInstance().getDoor(17130045).closeMe();
-			DoorTable.getInstance().getDoor(17130046).closeMe();
-		}
-		else if (event.equalsIgnoreCase("loc_check"))
-		{
-			if (GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
-			{
-				if (!_Zone.isInsideZone(npc))
-					npc.teleToLocation(getXFix(174232),getYFix(-88020),getZFix(-5116));
-				if (npc.getX() < getXFix(171932) || npc.getX() > getXFix(176532) || npc.getY() < getYFix(-90320) || npc.getY() > getYFix(-85720) || npc.getZ() < getZFix(-5130))
-					npc.teleToLocation(getXFix(174232),getYFix(-88020),getZFix(-5116));
-			}
-		}
-		else if (event.equalsIgnoreCase("camera_1"))
-		{
-			GrandBossManager.getInstance().setBossStatus(FRINTEZZA,FIGHTING);
-			
-			_frintezzaDummy = addSpawn(29052,174240,-89805,-5022,16048,false,0);
-			_frintezzaDummy.setIsInvul(true);
-			_frintezzaDummy.setIsImmobilized(true);
-			
-			_overheadDummy = addSpawn(29052,174232,-88020,-5110,16384,false,0);
-			_overheadDummy.setIsInvul(true);
-			_overheadDummy.setIsImmobilized(true);
-			_overheadDummy.setCollisionHeight(600);
-			_Zone.broadcastPacket(new NpcInfo(_overheadDummy, null));
-			
-			_portraitDummy1 = addSpawn(29052, 172450, -87890, -5100, 16048,false,0);
-			_portraitDummy1.setIsImmobilized(true);
-			_portraitDummy1.setIsInvul(true);
-			
-			_portraitDummy3 = addSpawn(29052, 176012, -87890, -5100, 16048,false,0);
-			_portraitDummy3.setIsImmobilized(true);
-			_portraitDummy3.setIsInvul(true);
-			
-			_scarletDummy = addSpawn(29053,174232,-88020,-5110,16384,false,0);
-			_scarletDummy.setIsInvul(true);
-			_scarletDummy.setIsImmobilized(true);
-			
-			startQuestTimer("stop_pc", 0, npc, null);
-			startQuestTimer("camera_2", 1000, _overheadDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_2"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(),0, 75, -89, 0, 100,0,0,1,0));
-			startQuestTimer("camera_2b", 0, _overheadDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_2b"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(),0, 75, -89, 0, 100,0,0,1,0));
-			startQuestTimer("camera_3", 0, _overheadDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_3"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(),300, 90, -10, 6500, 7000,0,0,1,0));
-			
-			frintezza = (L2GrandBossInstance) addSpawn(FRINTEZZA,174240,-89805,-5022,16048,false,0);
-			GrandBossManager.getInstance().addBoss(frintezza);
-			frintezza.setIsImmobilized(true);
-			frintezza.setIsInvul(true);
-			frintezza.disableAllSkills();
-			_Zone.updateKnownList(frintezza);
-			
-			demon2 = (L2MonsterInstance) addSpawn(29051, 175876, -88713, -5100, 28205,false,0);
-			demon2.setIsImmobilized(true);
-			demon2.disableAllSkills();
-			_Zone.updateKnownList(demon2);
-			
-			demon3 = (L2MonsterInstance) addSpawn(29051, 172608, -88702, -5100, 64817,false,0);
-			demon3.setIsImmobilized(true);
-			demon3.disableAllSkills();
-			_Zone.updateKnownList(demon3);
-			
-			demon1 = (L2MonsterInstance) addSpawn(29050, 175833, -87165, -5100, 35048,false,0);
-			demon1.setIsImmobilized(true);
-			demon1.disableAllSkills();
-			_Zone.updateKnownList(demon1);
-			
-			demon4 = (L2MonsterInstance) addSpawn(29050, 172634, -87165, -5100, 57730,false,0);
-			demon4.setIsImmobilized(true);
-			demon4.disableAllSkills();
-			_Zone.updateKnownList(demon4);
-			
-			startQuestTimer("camera_4", 6500, _overheadDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_4"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(),1800, 90, 8, 6500, 7000,0,0,1,0));
-			startQuestTimer("camera_5", 900, _frintezzaDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_5"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(),140, 90, 10, 2500, 4500,0,0,1,0));
-			startQuestTimer("camera_5b", 4000, _frintezzaDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_5b"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),40, 75, -10, 0, 1000,0,0,1,0));
-			startQuestTimer("camera_6", 0, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_6"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),40, 75, -10, 0, 12000,0,0,1,0));
-			startQuestTimer("camera_7", 1350, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_7"))
-		{
-			_Zone.broadcastPacket(new SocialAction(frintezza,2));
-			startQuestTimer("camera_8", 7000, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_8"))
-		{
-			startQuestTimer("camera_9", 1000, frintezza, null);
-			_frintezzaDummy.deleteMe();
-			_frintezzaDummy = null;
-		}
-		else if (event.equalsIgnoreCase("camera_9"))
-		{
-			_Zone.broadcastPacket(new SocialAction(demon2,1));
-			_Zone.broadcastPacket(new SocialAction(demon3,1));
-			startQuestTimer("camera_9b", 400, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_9b"))
-		{
-			_Zone.broadcastPacket(new SocialAction(demon1,1));
-			_Zone.broadcastPacket(new SocialAction(demon4,1));
-			
-			for (L2Character pc : _Zone.getCharactersInsideArray())
-			{
-				if (pc instanceof L2PcInstance)
-				{
-					if (pc.getX() < getXFix(174232))
-						pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(),1000, 118, 0, 0, 1000,0,0,1,0));
-					else
-						pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(),1000, 62, 0, 0, 1000,0,0,1,0));
-				}
-			}
-			startQuestTimer("camera_9c", 0, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_9c"))
-		{
-			for (L2Character pc : _Zone.getCharactersInsideArray())
-			{
-				if (pc instanceof L2PcInstance)
-				{
-					if (pc.getX() < getXFix(174232))
-						pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(),1000, 118, 0, 0, 10000,0,0,1,0));
-					else
-						pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(),1000, 62, 0, 0, 10000,0,0,1,0));
-				}
-			}
-			startQuestTimer("camera_10", 2000, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_10"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),240, 90, 0, 0, 1000,0,0,1,0));
-			startQuestTimer("camera_11", 0, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_11"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),240, 90, 25, 5500, 10000,0,0,1,0));
-			_Zone.broadcastPacket(new SocialAction(frintezza,3));
-			_portraitDummy1.deleteMe();
-			_portraitDummy3.deleteMe();
-			_portraitDummy1 = null;
-			_portraitDummy3 = null;
-			
-			startQuestTimer("camera_12", 4500, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_12"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),100, 195, 35, 0, 10000,0,0,1,0));
-			startQuestTimer("camera_13", 700, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_13"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),100, 195, 35, 0, 10000,0,0,1,0));
-			startQuestTimer("camera_14", 1300, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_14"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),120, 180, 45, 1500, 10000,0,0,1,0));
-			_Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5006, 1, 34000, 0));
-			startQuestTimer("camera_16", 1500, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_16"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),520, 135, 45, 8000, 10000,0,0,1,0));
-			startQuestTimer("camera_17", 7500, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_17"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),1500, 110, 25, 10000, 13000,0,0,1,0));
-			startQuestTimer("camera_18", 9500, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("camera_18"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(),930, 160, -20, 0, 1000,0,0,1,0));
-			startQuestTimer("camera_18b", 0, _overheadDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_18b"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 600, 180, -25, 0, 10000,0,0,1,0));
-			_Zone.broadcastPacket(new MagicSkillUse(_scarletDummy,_overheadDummy, 5004, 1, 5800, 0));
-			
-			weakScarlet = (L2GrandBossInstance) addSpawn(29046, 174232, -88020, -5110, 16384, false, 0, true);
-			weakScarlet.setIsInvul(true);
-			weakScarlet.setIsImmobilized(true);
-			weakScarlet.disableAllSkills();
-			_Zone.updateKnownList(weakScarlet);
-			activeScarlet = weakScarlet;
-			
-			startQuestTimer("camera_19",  2400, _scarletDummy, null);
-			startQuestTimer("camera_19b", 5000, _scarletDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_19"))
-		{
-			weakScarlet.teleToLocation(getXFix(174232), getYFix(-88020), getZFix(-5110));
-		}
-		else if (event.equalsIgnoreCase("camera_19b"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(_scarletDummy.getObjectId(), 800, 180, 10, 1000, 10000,0,0,1,0));
-			startQuestTimer("camera_20", 2100, _scarletDummy, null);
-		}
-		else if (event.equalsIgnoreCase("camera_20"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),300, 60, 8, 0, 10000,0,0,1,0));
-			startQuestTimer("camera_21", 2000, weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("camera_21"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),500, 90, 10, 3000, 5000,0,0,1,0));
-			startQuestTimer("camera_22", 3000, weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("camera_22"))
-		{
-			portrait2 = (L2MonsterInstance) addSpawn(29049, 175876, -88713, -5000, 28205,false,0);
-			portrait2.setIsImmobilized(true);
-			portrait2.disableAllSkills();
-			_Zone.updateKnownList(portrait2);
-			
-			portrait3 = (L2MonsterInstance) addSpawn(29049, 172608, -88702, -5000, 64817,false,0);
-			portrait3.setIsImmobilized(true);
-			portrait3.disableAllSkills();
-			_Zone.updateKnownList(portrait3);
-			
-			portrait1 = (L2MonsterInstance) addSpawn(29048, 175833, -87165, -5000, 35048,false,0);
-			portrait1.setIsImmobilized(true);
-			portrait1.disableAllSkills();
-			_Zone.updateKnownList(portrait1);
-			
-			portrait4 = (L2MonsterInstance) addSpawn(29048, 172634, -87165, -5000, 57730,false,0);
-			portrait4.setIsImmobilized(true);
-			portrait4.disableAllSkills();
-			_Zone.updateKnownList(portrait4);
-			
-			_overheadDummy.deleteMe();
-			_scarletDummy.deleteMe();
-			_overheadDummy = null;
-			_scarletDummy = null;
-			
-			startQuestTimer("camera_23", 2000, weakScarlet, null);
-			startQuestTimer("start_pc", 2000, weakScarlet, null);
-			startQuestTimer("loc_check", 60000, weakScarlet, null, true);
-			startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null);
-			startQuestTimer("skill01", 10000 + Rnd.get(10000), weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("camera_23"))
-		{
-			demon1.setIsImmobilized(false);
-			demon2.setIsImmobilized(false);
-			demon3.setIsImmobilized(false);
-			demon4.setIsImmobilized(false);
-			demon1.enableAllSkills();
-			demon2.enableAllSkills();
-			demon3.enableAllSkills();
-			demon4.enableAllSkills();
-			portrait1.setIsImmobilized(false);
-			portrait2.setIsImmobilized(false);
-			portrait3.setIsImmobilized(false);
-			portrait4.setIsImmobilized(false);
-			portrait1.enableAllSkills();
-			portrait2.enableAllSkills();
-			portrait3.enableAllSkills();
-			portrait4.enableAllSkills();
-			weakScarlet.setIsInvul(false);
-			weakScarlet.setIsImmobilized(false);
-			weakScarlet.enableAllSkills();
-			weakScarlet.setRunning();
-			
-			startQuestTimer("spawn_minion", 20000, portrait1, null);
-			startQuestTimer("spawn_minion", 20000, portrait2, null);
-			startQuestTimer("spawn_minion", 20000, portrait3, null);
-			startQuestTimer("spawn_minion", 20000, portrait4, null);
-		}
-		else if (event.equalsIgnoreCase("stop_pc"))
-		{
-			for (L2Character cha : _Zone.getCharactersInsideArray())
-			{
-				cha.abortAttack();
-				cha.abortCast();
-				cha.disableAllSkills();
-				cha.setTarget(null);
-				cha.stopMove(null);
-				cha.setIsImmobilized(true);
-				cha.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
-			}
-		}
-		else if (event.equalsIgnoreCase("stop_npc"))
-		{
-			_Heading = npc.getHeading();
-			if (_Heading < 32768)
-				_Angle = Math.abs(180 - (int)(_Heading / 182.044444444));
-			else
-				_Angle = Math.abs(540 - (int)(_Heading / 182.044444444));
-		}
-		else if (event.equalsIgnoreCase("start_pc"))
-		{
-			for (L2Character cha : _Zone.getCharactersInsideArray())
-			{
-				if (cha != frintezza)
-				{
-					cha.enableAllSkills();
-					cha.setIsImmobilized(false);
-				}
-			}
-		}
-		else if (event.equalsIgnoreCase("start_npc"))
-		{
-			npc.setRunning();
-			npc.setIsInvul(false);
-		}
-		else if (event.equalsIgnoreCase("morph_end"))
-		{
-			_OnMorph = 0;
-		}
-		else if (event.equalsIgnoreCase("morph_01"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),250, _Angle, 12, 2000, 15000,0,0,1,0));
-			startQuestTimer("morph_02", 3000, weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_02"))
-		{
-			_Zone.broadcastPacket(new SocialAction(weakScarlet,1));
-			weakScarlet.setRHandId(7903);
-			startQuestTimer("morph_03", 4000, weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_03"))
-		{
-			startQuestTimer("morph_04", 1500, weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_04"))
-		{
-			_Zone.broadcastPacket(new SocialAction(weakScarlet,4));
-			L2Skill skill = SkillTable.getInstance().getInfo(5017, 1);
-			if (skill != null)
-				skill.getEffects(weakScarlet, weakScarlet);
-			
-			startQuestTimer("morph_end", 6000, weakScarlet, null);
-			startQuestTimer("start_pc", 3000, weakScarlet, null);
-			startQuestTimer("start_npc", 3000, weakScarlet, null);
-			startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null);
-			startQuestTimer("skill02", 10000 + Rnd.get(10000), weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_05a"))
-		{
-			_Zone.broadcastPacket(new SocialAction(frintezza,4));
-		}
-		else if (event.equalsIgnoreCase("morph_05"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),250, 120, 15, 0, 1000,0,0,1,0));
-			startQuestTimer("morph_06", 0, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("morph_06"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),250, 120, 15, 0, 10000,0,0,1,0));
-			
-			cancelQuestTimers("loc_check");
-			
-			_Scarlet_x = weakScarlet.getX();
-			_Scarlet_y = weakScarlet.getY();
-			_Scarlet_z = weakScarlet.getZ();
-			_Scarlet_h = weakScarlet.getHeading();
-			weakScarlet.deleteMe();
-			weakScarlet = null;
-			activeScarlet = null;
-			weakScarlet = (L2GrandBossInstance) addSpawn(29046, _Scarlet_x, _Scarlet_y, _Scarlet_z, _Scarlet_h, false,0);
-			weakScarlet.setIsInvul(true);
-			weakScarlet.setIsImmobilized(true);
-			weakScarlet.disableAllSkills();
-			weakScarlet.setRHandId(7903);
-			_Zone.updateKnownList(weakScarlet);
-			
-			startQuestTimer("morph_07", 7000, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("morph_07"))
-		{
-			_Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5006, 1, 34000, 0));
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),500, 70, 15, 3000, 10000,0,0,1,0));
-			startQuestTimer("morph_08", 3000, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("morph_08"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),2500, 90, 12, 6000, 10000,0,0,1,0));
-			startQuestTimer("morph_09", 3000, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("morph_09"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),250, _Angle, 12, 0, 1000,0,0,1,0));
-			startQuestTimer("morph_10", 0, weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_10"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),250, _Angle, 12, 0, 10000,0,0,1,0));
-			startQuestTimer("morph_11", 500, weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_11"))
-		{
-			weakScarlet.doDie(weakScarlet);
-			_Zone.broadcastPacket(new SpecialCamera(weakScarlet.getObjectId(),450, _Angle, 14, 8000, 8000,0,0,1,0));
-			
-			startQuestTimer("morph_12", 6250, weakScarlet, null);
-			startQuestTimer("morph_13", 7200, weakScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_12"))
-		{
-			weakScarlet.deleteMe();
-			weakScarlet = null;
-		}
-		else if (event.equalsIgnoreCase("morph_13"))
-		{
-			strongScarlet = (L2GrandBossInstance) addSpawn(SCARLET2, reverseXFix(_Scarlet_x), reverseYFix(_Scarlet_y), reverseZFix(_Scarlet_z), _Scarlet_h, false,0);
-			strongScarlet.setIsInvul(true);
-			strongScarlet.setIsImmobilized(true);
-			strongScarlet.disableAllSkills();
-			_Zone.updateKnownList(strongScarlet);
-			activeScarlet = strongScarlet;
-			
-			_Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(),450, _Angle, 12, 500, 14000,0,0,1,0));
-			
-			startQuestTimer("morph_14", 3000, strongScarlet, null);
-			startQuestTimer("loc_check", 60000, strongScarlet, null, true);
-		}
-		else if (event.equalsIgnoreCase("morph_14"))
-		{
-			startQuestTimer("morph_15", 5100, strongScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_15"))
-		{
-			_Zone.broadcastPacket(new SocialAction(strongScarlet,2));
-			L2Skill skill = SkillTable.getInstance().getInfo(5017, 1);
-			if (skill != null)
-				skill.getEffects(strongScarlet, strongScarlet);
-			
-			startQuestTimer("morph_end", 9000, strongScarlet, null);
-			startQuestTimer("start_pc", 6000, strongScarlet, null);
-			startQuestTimer("start_npc", 6000, strongScarlet, null);
-			startQuestTimer("songs_play", 10000 + Rnd.get(10000), frintezza, null);
-			startQuestTimer("skill03", 10000 + Rnd.get(10000), strongScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_16"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(),300, _Angle - 180 , 5, 0, 7000,0,0,1,0));
-			startQuestTimer("morph_17", 0, strongScarlet, null);
-		}
-		else if (event.equalsIgnoreCase("morph_17"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(strongScarlet.getObjectId(),200, _Angle, 85, 4000, 10000,0,0,1,0));
-			startQuestTimer("morph_17b", 7400, frintezza, null);
-			startQuestTimer("morph_18", 7500, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("morph_17b"))
-		{
-			frintezza.doDie(frintezza);
-		}
-		else if (event.equalsIgnoreCase("morph_18"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),100, 120, 5, 0, 7000,0,0,1,0));
-			startQuestTimer("morph_19", 0, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("morph_19"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),100, 90, 5, 5000, 15000,0,0,1,0));
-			startQuestTimer("morph_20", 7000, frintezza, null);
-			startQuestTimer("spawn_cubes", 7000, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("morph_20"))
-		{
-			_Zone.broadcastPacket(new SpecialCamera(frintezza.getObjectId(),900, 90, 25, 7000, 10000,0,0,1,0));
-			startQuestTimer("start_pc", 7000, frintezza, null);
-		}
-		else if (event.equalsIgnoreCase("songs_play"))
-		{
-			if (frintezza != null && !frintezza.isDead() && _OnMorph == 0)
-			{
-				_OnSong = Rnd.get(1, 5);
-				if (_OnSong == 1 && _ThirdMorph == 1 && strongScarlet.getCurrentHp() < strongScarlet.getMaxHp() * 0.6 && Rnd.get(100) < 80)
-				{
-					_Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 1, 32000, 0));
-					startQuestTimer("songs_effect", 5000, frintezza, null);
-					startQuestTimer("songs_play", 32000 + Rnd.get(10000), frintezza, null);
-				}
-				else if (_OnSong == 2 || _OnSong == 3)
-				{
-					_Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, _OnSong, 32000, 0));
-					startQuestTimer("songs_effect", 5000, frintezza, null);
-					startQuestTimer("songs_play", 32000 + Rnd.get(10000), frintezza, null);
-				}
-				else if (_OnSong == 4 && _SecondMorph == 1)
-				{
-					_Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 4, 31000, 0));
-					startQuestTimer("songs_effect", 5000, frintezza, null);
-					startQuestTimer("songs_play", 31000 + Rnd.get(10000), frintezza, null);
-				}
-				else if (_OnSong == 5 && _ThirdMorph == 1 && _Abnormal == 0)
-				{
-					_Abnormal = 1;
-					_Zone.broadcastPacket(new MagicSkillUse(frintezza, frintezza, 5007, 5, 35000, 0));
-					startQuestTimer("songs_effect", 5000, frintezza, null);
-					startQuestTimer("songs_play", 35000 + Rnd.get(10000), frintezza, null);
-				}
-				else
-					startQuestTimer("songs_play", 5000 + Rnd.get(5000), frintezza, null);
-			}
-		}
-		else if (event.equalsIgnoreCase("songs_effect"))
-		{
-			L2Skill skill = SkillTable.getInstance().getInfo(5008, _OnSong);
-			if (skill == null)
-				return null;
-			
-			if (_OnSong == 1 || _OnSong == 2 || _OnSong == 3)
-			{
-				if (frintezza != null && !frintezza.isDead() && activeScarlet != null && !activeScarlet.isDead())
-					skill.getEffects(frintezza, activeScarlet);
-			}
-			else if (_OnSong == 4)
-			{
-				for (L2Character cha : _Zone.getCharactersInsideArray())
-				{
-					if (cha instanceof L2PcInstance && Rnd.get(100) < 80)
-					{
-						skill.getEffects(frintezza, cha);
-						cha.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5008, 4));
-					}
-				}
-			}
-			else if (_OnSong == 5)
-			{
-				for (L2Character cha : _Zone.getCharactersInsideArray())
-				{
-					if (cha instanceof L2PcInstance && Rnd.get(100) < 70)
-					{
-						cha.abortAttack();
-						cha.abortCast();
-						cha.disableAllSkills();
-						cha.stopMove(null);
-						cha.setIsParalyzed(true);
-						cha.setIsImmobilized(true);
-						cha.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
-						skill.getEffects(frintezza, cha);
-						cha.startAbnormalEffect(AbnormalEffect.DANCE_STUNNED);
-						cha.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(5008, 5));
-					}
-				}
-				startQuestTimer("stop_effect", 25000, frintezza, null);
-			}
-		}
-		else if (event.equalsIgnoreCase("stop_effect"))
-		{
-			for (L2Character cha : _Zone.getCharactersInsideArray())
-			{
-				if (cha instanceof L2PcInstance)
-				{
-					cha.stopAbnormalEffect(AbnormalEffect.DANCE_STUNNED);
-					cha.stopAbnormalEffect(AbnormalEffect.FLOATING_ROOT);
-					cha.enableAllSkills();
-					cha.setIsImmobilized(false);
-					cha.setIsParalyzed(false);
-				}
-			}
-			_Abnormal = 0;
-		}
-		else if (event.equalsIgnoreCase("attack_stop"))
-		{
-			cancelQuestTimers("skill01");
-			cancelQuestTimers("skill02");
-			cancelQuestTimers("skill03");
-			cancelQuestTimers("songs_play");
-			cancelQuestTimers("songs_effect");
-			
-			if (frintezza != null)
-				_Zone.broadcastPacket(new MagicSkillCanceld(frintezza.getObjectId()));
-		}
-		else if (event.equalsIgnoreCase("check_hp"))
-		{
-			if (npc.isDead())
-			{
-				_OnMorph = 1;
-				_Zone.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
-				
-				startQuestTimer("attack_stop", 0, frintezza, null);
-				startQuestTimer("stop_pc", 0, npc, null);
-				startQuestTimer("stop_npc", 0, npc, null);
-				startQuestTimer("morph_16", 0, npc, null);
-			}
-			else
-			{
-				_CheckDie = _CheckDie + 10;
-				if (_CheckDie < 3000)
-					startQuestTimer("check_hp", 10, npc, null);
-				else
-				{
-					_OnCheck = 0;
-					_CheckDie = 0;
-				}
-			}
-		}
-		else if (event.equalsIgnoreCase("skill01"))
-		{
-			if (weakScarlet != null && !weakScarlet.isDead() && _SecondMorph == 0 && _ThirdMorph == 0 && _OnMorph == 0)
-			{
-				int i = Rnd.get(0,1);
-				L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0],_skill[i][1]);
-				if (skill != null)
-				{
-					weakScarlet.stopMove(null);
-					weakScarlet.setIsCastingNow(true);
-					weakScarlet.doCast(skill);
-				}
-				startQuestTimer("skill01", _skill[i][2] + 5000 + Rnd.get(10000), npc, null);
-			}
-		}
-		else if (event.equalsIgnoreCase("skill02"))
-		{
-			if (weakScarlet != null && !weakScarlet.isDead() && _SecondMorph == 1 && _ThirdMorph == 0 && _OnMorph == 0)
-			{
-				int i = 0;
-				if (_Abnormal == 0)
-					i = Rnd.get(2,5);
-				else
-					i = Rnd.get(2,4);
-				
-				L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0],_skill[i][1]);
-				if (skill != null)
-				{
-					weakScarlet.stopMove(null);
-					weakScarlet.setIsCastingNow(true);
-					weakScarlet.doCast(skill);
-				}
-				startQuestTimer("skill02", _skill[i][2] + 5000 + Rnd.get(10000), npc, null);
-				
-				if (i == 5)
-				{
-					_Abnormal = 1;
-					startQuestTimer("float_effect", 4000, weakScarlet, null);
-				}
-			}
-		}
-		else if (event.equalsIgnoreCase("skill03"))
-		{
-			if (strongScarlet != null && !strongScarlet.isDead() && _SecondMorph == 1 && _ThirdMorph == 1 && _OnMorph == 0)
-			{
-				int i = 0;
-				if (_Abnormal == 0)
-					i = Rnd.get(6,10);
-				else
-					i = Rnd.get(6,9);
-				
-				L2Skill skill = SkillTable.getInstance().getInfo(_skill[i][0],_skill[i][1]);
-				if (skill != null)
-				{
-					strongScarlet.stopMove(null);
-					strongScarlet.setIsCastingNow(true);
-					strongScarlet.doCast(skill);
-				}
-				startQuestTimer("skill03", _skill[i][2] + 5000 + Rnd.get(10000), npc, null);
-				
-				if (i == 10)
-				{
-					_Abnormal = 1;
-					startQuestTimer("float_effect", 3000, npc, null);
-				}
-			}
-		}
-		else if (event.equalsIgnoreCase("float_effect"))
-		{
-			if (npc.isCastingNow())
-			{
-				startQuestTimer("float_effect", 500, npc, null);
-			}
-			else
-			{
-				for (L2Character cha : _Zone.getCharactersInsideArray())
-				{
-					if (cha instanceof L2PcInstance)
-					{
-						if (cha.getFirstEffect(5016) != null)
-						{
-							cha.abortAttack();
-							cha.abortCast();
-							cha.disableAllSkills();
-							cha.stopMove(null);
-							cha.setIsParalyzed(true);
-							cha.setIsImmobilized(true);
-							cha.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
-							cha.startAbnormalEffect(AbnormalEffect.FLOATING_ROOT);
-						}
-					}
-				}
-				startQuestTimer("stop_effect", 25000, npc, null);
-			}
-		}
-		else if (event.equalsIgnoreCase("action"))
-		{
-			_Zone.broadcastPacket(new SocialAction(npc,1));
-		}
-		else if (event.equalsIgnoreCase("bomber"))
-		{
-			_Bomber = 0;
-		}
-		else if (event.equalsIgnoreCase("room_final"))
-		{
-			_Zone.broadcastPacket(new NpcSay(npc.getObjectId(),1,npc.getNpcId(),"Exceeded his time limit, challenge failed!"));
-			_Zone.oustAllPlayers();
-			
-			cancelQuestTimers("waiting");
-			cancelQuestTimers("frintezza_despawn");
-			startQuestTimer("clean", 1000, npc, null);
-			startQuestTimer("close", 1000, npc, null);
-			startQuestTimer("room1_del", 1000, npc, null);
-			startQuestTimer("room2_del", 1000, npc, null);
-			
-			GrandBossManager.getInstance().setBossStatus(FRINTEZZA,DORMANT);
-		}
-		else if (event.equalsIgnoreCase("frintezza_despawn"))
-		{
-			temp = (System.currentTimeMillis() - _LastAction);
-			if (temp > 900000)
-			{
-				_Zone.oustAllPlayers();
-				
-				cancelQuestTimers("waiting");
-				cancelQuestTimers("loc_check");
-				cancelQuestTimers("room_final");
-				cancelQuestTimers("spawn_minion");
-				startQuestTimer("clean", 1000, npc, null);
-				startQuestTimer("close", 1000, npc, null);
-				startQuestTimer("attack_stop", 1000, npc, null);
-				startQuestTimer("room1_del", 1000, npc, null);
-				startQuestTimer("room2_del", 1000, npc, null);
-				startQuestTimer("room3_del", 1000, npc, null);
-				startQuestTimer("minions_despawn", 1000, npc, null);
-				
-				GrandBossManager.getInstance().setBossStatus(FRINTEZZA,DORMANT);
-				
-				cancelQuestTimers("frintezza_despawn");
-			}
-		}
-		else if (event.equalsIgnoreCase("minions_despawn"))
-		{
-			for (int i = 0; i < Minions.size(); i++)
-			{
-				L2Attackable mob = Minions.get(i);
-				if (mob != null)
-					mob.decayMe();
-			}
-			Minions.clear();
-		}
-		else if (event.equalsIgnoreCase("spawn_minion"))
-		{
-			if (npc != null && !npc.isDead() && frintezza != null && !frintezza.isDead())
-			{
-				L2Attackable mob = (L2Attackable)addSpawn(npc.getNpcId()+2,npc.getX(),npc.getY(),npc.getZ(),npc.getHeading(),false,0);
-				mob.setIsRaidMinion(true);
-				Minions.add(mob);
-				
-				startQuestTimer("action", 200, mob, null);
-				startQuestTimer("spawn_minion", 18000, npc, null);
-			}
-		}
-		else if (event.equalsIgnoreCase("spawn_cubes"))
-		{
-			addSpawn(CUBE,174232,-88020,-5114,16384,false,900000);
-		}
-		else if (event.equalsIgnoreCase("frintezza_unlock"))
-		{
-			GrandBossManager.getInstance().setBossStatus(FRINTEZZA,DORMANT);
-		}
-		else if (event.equalsIgnoreCase("remove_players"))
-		{
-			_Zone.oustAllPlayers();
-		}
-		
-		return super.onAdvEvent(event, npc, player);
-	}
-	
-	@Override
-	public String onTalk (L2Npc npc, L2PcInstance player)
-	{
-		if (npc.getNpcId() == CUBE)
-		{
-			int x = 150037 + Rnd.get(500);
-			int y = -57720 + Rnd.get(500);
-			player.teleToLocation(x, y, -2976);
-			return null;
-		}
-		
-		String htmltext = "";
-		synchronized(this) //Synch to prevent 2 command channels entering at once
-		{
-			if (GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == DEAD)
-			{
-				htmltext = "<html><body>There is nothing beyond the Magic Force Field. Come back later.<br>(You may not enter because Frintezza is not inside the Imperial Tomb.)</body></html>";
-			}
-			else if (GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == DORMANT)
-			{
-				if ((!player.isInParty() || !player.getParty().isLeader(player))
-						|| (player.getParty().getCommandChannel() == null)
-						|| (player.getParty().getCommandChannel().getChannelLeader() != player))
-				{
-					htmltext = "<html><body>No reaction. Contact must be initiated by the Command Channel Leader.</body></html>";
-				}
-				else if (player.getParty().getCommandChannel().getPartys().size() < 4 || player.getParty().getCommandChannel().getPartys().size() > 5)
-				{
-					htmltext = "<html><body>Your command channel needs to have at least 4 parties and a maximum of 5.</body></html>";
-				}
-				else if (player.getInventory().getItemByItemId(8073) == null)
-				{
-					htmltext = "<html><body>You dont have required item.</body></html>";
-				}
-				else
-				{
-					player.destroyItemByItemId("Quest", 8073, 1, player, true);
-					L2CommandChannel CC = player.getParty().getCommandChannel();
-					GrandBossManager.getInstance().setBossStatus(FRINTEZZA, WAITING);
-					
-					startQuestTimer("close", 0, npc, null);
-					startQuestTimer("room1_spawn", 5000, npc, null);
-					startQuestTimer("room_final", 2100000, npc, null);
-					startQuestTimer("frintezza_despawn", 60000, npc, null, true);
-					
-					_LastAction = System.currentTimeMillis();
-					for (L2Party party : CC.getPartys())
-					{
-						if (party == null)
-							continue;
-						for (L2PcInstance member : party.getPartyMembers())
-						{
-							if (member == null || member.getLevel() < 74)
-								continue;
-							if (!member.isInsideRadius(npc, 700, false, false))
-								continue;
-							if (_PlayersInside.size() > 45)
-							{
-								member.sendMessage("The number of challenges have been full, so can not enter.");
-								break;
-							}
-							_PlayersInside.add(member);
-							_Zone.allowPlayerEntry(member, 300);
-							member.teleToLocation(getXFix(_invadeLoc[_LocCycle][0]) + Rnd.get(50), getYFix(_invadeLoc[_LocCycle][1]) + Rnd.get(50), getZFix(_invadeLoc[_LocCycle][2]));
-						}
-						if (_PlayersInside.size() > 45)
-							break;
-						
-						_LocCycle++;
-						if (_LocCycle >= 6)
-							_LocCycle = 1;
-					}
-				}
-			}
-			else
-				htmltext = "<html><body>Someone else is already inside the Magic Force Field. Try again later.</body></html>";
-		}
-		
-		return htmltext;
-	}
-	
-	@Override
-	public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
-	{
-		_LastAction = System.currentTimeMillis();
-		if (npc.getNpcId() == FRINTEZZA)
-		{
-			npc.setCurrentHpMp(npc.getMaxHp(), 0);
-			return null;
-		}
-		if (npc.getNpcId() == SCARLET1 && _SecondMorph == 0 && _ThirdMorph == 0 && _OnMorph == 0 && npc.getCurrentHp() < npc.getMaxHp() * 0.75 && GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
-		{
-			startQuestTimer("attack_stop", 0, frintezza, null);
-			
-			_SecondMorph = 1;
-			_OnMorph = 1;
-			
-			startQuestTimer("stop_pc", 1000, npc, null);
-			startQuestTimer("stop_npc", 1000, npc, null);
-			startQuestTimer("morph_01", 1100, npc, null);
-		}
-		else if (npc.getNpcId() == SCARLET1 && _SecondMorph == 1 && _ThirdMorph == 0 && _OnMorph == 0 && npc.getCurrentHp() < npc.getMaxHp() * 0.5 && GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
-		{
-			startQuestTimer("attack_stop", 0, frintezza, null);
-			
-			_ThirdMorph = 1;
-			_OnMorph = 1;
-			
-			startQuestTimer("stop_pc", 2000, npc, null);
-			startQuestTimer("stop_npc", 2000, npc, null);
-			startQuestTimer("morph_05a", 2000, npc, null);
-			startQuestTimer("morph_05", 2100, npc, null);
-		}
-		else if (npc.getNpcId() == SCARLET2 && _SecondMorph == 1 && _ThirdMorph == 1 && _OnCheck == 0 && damage >= npc.getCurrentHp() && GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
-		{
-			_OnCheck = 1;
-			startQuestTimer("check_hp", 0, npc, null);
-		}
-		else if ((npc.getNpcId() == 29050 || npc.getNpcId() == 29051) && _Bomber == 0)
-		{
-			if (npc.getCurrentHp() < npc.getMaxHp() * 0.1)
-			{
-				if (Rnd.get(100) < 30)
-				{
-					_Bomber = 1;
-					startQuestTimer("bomber", 3000, npc, null);
-					
-					L2Skill skill = SkillTable.getInstance().getInfo(5011,1);
-					if (skill != null)
-					{
-						npc.setIsCastingNow(true);
-						npc.doCast(skill);
-					}
-				}
-			}
-		}
-		
-		return super.onAttack(npc, attacker, damage, isPet);
-	}
-	
-	@Override
-	public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
-	{
-		if (npc.getNpcId() == FRINTEZZA)
-		{
-			return null;
-		}
-		else if (npc.getNpcId() == SCARLET2 && _OnCheck == 0 && GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
-		{
-			_OnCheck = 1;
-			startQuestTimer("stop_pc", 0, npc, null);
-			startQuestTimer("stop_npc", 0, npc, null);
-			startQuestTimer("morph_16", 0, npc, null);
-		}
-		else if (npc.getNpcId() == SCARLET2 && _OnCheck == 1 && GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == FIGHTING)
-		{
-			cancelQuestTimers("loc_check");
-			cancelQuestTimers("spawn_minion");
-			cancelQuestTimers("frintezza_despawn");
-			startQuestTimer("clean", 30000, npc, null);
-			startQuestTimer("close", 30000, npc, null);
-			startQuestTimer("room3_del", 60000, npc, null);
-			startQuestTimer("minions_despawn", 60000, npc, null);
-			startQuestTimer("remove_players", 900000, npc, null);
-			
-			GrandBossManager.getInstance().setBossStatus(FRINTEZZA,DEAD);
-			long respawnTime = (long)Config.Interval_Of_Frintezza_Spawn + Rnd.get(Config.Random_Of_Frintezza_Spawn);
-			startQuestTimer("frintezza_unlock", respawnTime, npc, null);
-			// also save the respawn time so that the info is maintained past reboots
-			StatsSet info = GrandBossManager.getInstance().getStatsSet(FRINTEZZA);
-			info.set("respawn_time", System.currentTimeMillis() + respawnTime);
-			GrandBossManager.getInstance().setStatsSet(FRINTEZZA,info);
-		}
-		else if (npc.getNpcId() == 18328)
-		{
-			_KillHallAlarmDevice++;
-			if (_KillHallAlarmDevice == 4)
-			{
-				startQuestTimer("room1_del", 100, npc, null);
-				startQuestTimer("room2_spawn", 100, npc, null);
-				
-				DoorTable.getInstance().getDoor(17130042).openMe();
-				DoorTable.getInstance().getDoor(17130043).openMe();
-				// DoorTable.getInstance().getDoor(17130045).openMe();
-				// DoorTable.getInstance().getDoor(17130046).openMe();
-				for (int i = 17130051; i <= 17130058; i++)
-					DoorTable.getInstance().getDoor(i).openMe();
-			}
-		}
-		else if (npc.getNpcId() == 18339)
-		{
-			_KillDarkChoirPlayer ++;
-			if (_KillDarkChoirPlayer == 2)
-			{
-				DoorTable.getInstance().getDoor(17130042).closeMe();
-				DoorTable.getInstance().getDoor(17130043).closeMe();
-				DoorTable.getInstance().getDoor(17130045).closeMe();
-				DoorTable.getInstance().getDoor(17130046).closeMe();
-				int outside = 0;
-				for (L2PcInstance room2_pc : _PlayersInside)
-				{
-					if (_Zone.isInsideZone(room2_pc) && room2_pc.getY() > getYFix(-86130))
-						outside++;
-				}
-				if (outside == 0)
-				{
-					startQuestTimer("room2_del", 100, npc, null);
-					startQuestTimer("waiting", 180000, npc, null);
-					cancelQuestTimers("room_final");
-				}
-				else
-				{
-					for (int i = 17130061; i <= 17130070; i++)
-						DoorTable.getInstance().getDoor(i).openMe();
-					
-					startQuestTimer("room2_spawn2", 1000, npc, null);
-				}
-			}
-		}
-		else if (npc.getNpcId() == 18334)
-		{
-			_KillDarkChoirCaptain ++;
-			if (_KillDarkChoirCaptain == 8)
-			{
-				startQuestTimer("room2_del", 100, npc, null);
-				
-				DoorTable.getInstance().getDoor(17130045).openMe();
-				DoorTable.getInstance().getDoor(17130046).openMe();
-				
-				startQuestTimer("waiting", 180000, npc, null);
-				cancelQuestTimers("room_final");
-			}
-		}
-		
-		return super.onKill(npc,killer,isPet);
-	}
-	
-	/**
-	 * Override spawn method to correct spawn cords after lair move<BR>
-	 * TODO: Update cords in script, im just lazy :)
-	 */
-	@Override
-	public L2Npc addSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffset, long despawnDelay, boolean isSummonSpawn, int instanceId)
-	{
-		// cords fix:
-		return super.addSpawn(npcId, getXFix(x), getYFix(y), getZFix(z), heading, randomOffset, despawnDelay, isSummonSpawn, instanceId);
-	}
-	
-	
-	public int getXFix(int x)
-	{
-		return x - 262016;
-	}
-	public int getYFix(int y)
-	{
-		return y - 65278;
-	}
-	public int getZFix(int z)
-	{
-		return z - 4065;
-	}
-	
-	public int reverseXFix(int x)
-	{
-		return x + 262016;
-	}
-	public int reverseYFix(int y)
-	{
-		return y + 65278;
-	}
-	public int reverseZFix(int z)
-	{
-		return z + 4065;
-	}
-	
-	public static void main(String[] args)
-	{
-		// now call the constructor (starts up the ai)
-		new Frintezza(-1,"Frintezza","ai");
-	}
-}

+ 1338 - 0
L2J_DataPack_BETA/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java

@@ -0,0 +1,1338 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package instances.FinalEmperialTomb;
+
+import gnu.trove.TIntObjectHashMap;
+
+import java.io.File;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.logging.Level;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.GeoData;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.ai.CtrlIntention;
+import com.l2jserver.gameserver.instancemanager.InstanceManager;
+import com.l2jserver.gameserver.instancemanager.InstanceManager.InstanceWorld;
+import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.L2CommandChannel;
+import com.l2jserver.gameserver.model.L2Object.InstanceType;
+import com.l2jserver.gameserver.model.L2Party;
+import com.l2jserver.gameserver.model.L2Skill;
+import com.l2jserver.gameserver.model.L2Territory;
+import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.actor.L2Attackable;
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.quest.Quest;
+import com.l2jserver.gameserver.model.quest.QuestState;
+import com.l2jserver.gameserver.network.NpcStringId;
+import com.l2jserver.gameserver.network.SystemMessageId;
+import com.l2jserver.gameserver.network.serverpackets.AbstractNpcInfo.NpcInfo;
+import com.l2jserver.gameserver.network.serverpackets.Earthquake;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
+import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
+import com.l2jserver.gameserver.network.serverpackets.MagicSkillCanceld;
+import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
+import com.l2jserver.gameserver.network.serverpackets.SocialAction;
+import com.l2jserver.gameserver.network.serverpackets.SpecialCamera;
+import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
+import com.l2jserver.gameserver.skills.SkillHolder;
+import com.l2jserver.gameserver.templates.skills.L2SkillType;
+import com.l2jserver.gameserver.util.Util;
+import com.l2jserver.util.Rnd;
+
+/*
+TODO:
+- test when Frintezza song use 5008 effect skill
+- maybe test more deeply halishas AI
+- use correct Song names
+- use proper zone spawn system
+Contributing authors: Gigiikun
+*/
+public class FinalEmperialTomb extends Quest
+{
+
+	private class FETWorld extends InstanceWorld
+	{
+		public         Lock                 lock                         = new ReentrantLock();
+		public         List<L2Npc>          npcList                      = new FastList<L2Npc>();
+		public         int                  darkChoirPlayerCount         = 0;
+		public         FrintezzaSong        OnSong                       = null;
+		public         ScheduledFuture<?>   songTask                     = null;
+		public         ScheduledFuture<?>   songEffectTask               = null;
+		public         boolean              isVideo                      = false;
+		public         L2Npc                frintezzaDummy               = null;
+		public         L2Npc                overheadDummy                = null;
+		public         L2Npc                portraitDummy1               = null;
+		public         L2Npc                portraitDummy3               = null;
+		public         L2Npc                scarletDummy                 = null;
+		public         L2GrandBossInstance  frintezza                    = null;
+		public         L2GrandBossInstance  activeScarlet                = null;
+		public         List<L2MonsterInstance>  demons                   = new FastList<L2MonsterInstance>();
+		public         Map<L2MonsterInstance, Integer>  portraits        = new FastMap<L2MonsterInstance, Integer>();
+		public         int                  scarlet_x                    = 0;
+		public         int                  scarlet_y                    = 0;
+		public         int                  scarlet_z                    = 0;
+		public         int                  scarlet_h                    = 0;
+		public         int                  scarlet_a                    = 0;
+
+		public FETWorld()
+		{
+		}
+	}
+	
+	private static class FETSpawn
+	{
+		public boolean isZone = false;
+		public boolean isNeededNextFlag = false;
+		public int npcId;
+		public int x = 0;
+		public int y = 0;
+		public int z = 0;
+		public int h = 0;
+		public int zone = 0;
+		public int count = 0;
+	}
+	
+	private static class FrintezzaSong
+	{
+		public SkillHolder skill;
+		public SkillHolder effectSkill;
+		public NpcStringId songName;
+		public int chance;
+		
+		public FrintezzaSong(SkillHolder sk, SkillHolder esk, NpcStringId sn, int ch)
+		{
+			skill = sk;
+			effectSkill = esk;
+			songName = sn;
+			chance = ch;
+		}
+	}
+	
+	private static final String qn = "FinalEmperialTomb";
+	private static final int INSTANCEID = 136; // this is the client number
+	private static final int MIN_PLAYERS = 36;
+	private static final int MAX_PLAYERS = 45;
+	private static final boolean debug = false;
+	
+	private final TIntObjectHashMap<L2Territory> _spawnZoneList = new TIntObjectHashMap<L2Territory>();
+	private final TIntObjectHashMap<List<FETSpawn>> _spawnList = new TIntObjectHashMap<List<FETSpawn>>();
+	private final List<Integer> _mustKillMobsId = new FastList<Integer>();
+	
+	// Teleports
+	private static final int[] ENTER_TELEPORT = {-88015,-141153,-9168};
+	
+	//NPCs
+	private static final int GUIDE = 32011;
+	private static final int CUBE = 29061;
+	
+	//mobs
+	private static final int SCARLET1 = 29046;
+	private static final int SCARLET2 = 29047;
+	private static final int FRINTEZZA = 29045;
+	private static final int[] PORTRAITS = { 29048, 29049 };
+	private static final int[] DEMONS = { 29050, 29051 };
+	private static final int HALL_ALARM = 18328;
+	private static final int DARK_CHOIR_PLAYER = 18339;
+	private static final int[] AI_DISABLED_MOBS = { 18328 };
+	
+	private static final int FIRST_SCARLET_WEAPON = 8204;
+	private static final int SECOND_SCARLET_WEAPON = 7903;
+	private static final SkillHolder INTRO_SKILL = new SkillHolder(5004,1);
+	private static final SkillHolder FIRST_MORPH_SKILL = new SkillHolder(5017,1);
+	
+	private static final FrintezzaSong[] FRINTEZZASONGLIST = 
+	{
+		new FrintezzaSong(new SkillHolder(5007,1), new SkillHolder(5008,1), NpcStringId.REQUIEM_OF_HATRED, 5),
+        new FrintezzaSong(new SkillHolder(5007,2), new SkillHolder(5008,2), NpcStringId.RONDO_OF_SOLITUDE, 50),
+        new FrintezzaSong(new SkillHolder(5007,3), new SkillHolder(5008,3), NpcStringId.FRENETIC_TOCCATA, 70),
+        new FrintezzaSong(new SkillHolder(5007,4), new SkillHolder(5008,4), NpcStringId.FUGUE_OF_JUBILATION, 90),
+        new FrintezzaSong(new SkillHolder(5007,5), new SkillHolder(5008,5), NpcStringId.HYPNOTIC_MAZURKA, 100),
+	};
+	
+	// Doors/Walls/Zones
+	private static final int[] FIRST_ROOM_DOORS = 
+	{ 
+		17130051, 17130052, 17130053, 17130054, 17130055,
+		17130056, 17130057, 17130058
+	};
+	private static final int[] SECOND_ROOM_DOORS = 
+	{
+		17130061, 17130062, 17130063, 17130064, 17130065,
+		17130066, 17130067, 17130068, 17130069, 17130070
+	};
+	private static final int[] FIRST_ROUTE_DOORS = { 17130042, 17130043 };
+	private static final int[] SECOND_ROUTE_DOORS = { 17130045, 17130046 };
+	private static final L2CharPosition MOVE_TO_CENTER = new L2CharPosition( -87904, -141296, -9168, 0 );
+
+	// spawns
+	private static final int TIME_BETWEEN_DEMON_SPAWNS = 20000;
+	private static final int MAX_DEMONS = 24;
+	private static final int[][] PORTRAIT_SPAWNS = 
+	{
+		{ 29048, -89381, -153981, -9168, 3368, -89378, -153968, -9168, 3368 },
+		{ 29048, -86234, -152467, -9168, 37656, -86261, -152492, -9168, 37656 },
+		{ 29049, -89342, -152479, -9168, -5152, -89311, -152491, -9168, -5152 },
+		{ 29049, -86189, -153968, -9168, 29456, -86217, -153956, -9168, 29456 }
+	};
+	
+	// Initialization at 6:30 am on Wednesday and Saturday
+	private static final int RESET_HOUR = 6;
+	private static final int RESET_MIN = 30;
+	private static final int RESET_DAY_1 = 4;
+	private static final int RESET_DAY_2 = 7;
+	
+	@SuppressWarnings("unused")
+	private void load()
+	{
+		
+		int spawnCount = 0;
+		try
+		{
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			factory.setValidating(false);
+			factory.setIgnoringComments(true);
+			
+			File file = new File(Config.DATAPACK_ROOT + "/data/scripts/instances/FinalEmperialTomb/data.xml");
+			if (!file.exists())
+			{
+				_log.severe("[Final Emperial Tomb] Missing data.xml. The quest wont work without it!");
+				return;
+			}
+			
+			Document doc = factory.newDocumentBuilder().parse(file);
+			Node first = doc.getFirstChild();
+			if (first != null && "list".equalsIgnoreCase(first.getNodeName()))
+			{
+				for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
+				{
+					if ("npc".equalsIgnoreCase(n.getNodeName()))
+					{
+						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
+						{
+							if ("spawn".equalsIgnoreCase(d.getNodeName()))
+							{
+								NamedNodeMap attrs = d.getAttributes();
+								Node att = attrs.getNamedItem("npcId");
+								if (att == null)
+								{
+									_log.severe("[Final Emperial Tomb] Missing npcId in npc List, skipping");
+									continue;
+								}
+								int npcId = Integer.parseInt(attrs.getNamedItem("npcId").getNodeValue());
+								
+								att = attrs.getNamedItem("flag");
+								if (att == null)
+								{
+									_log.severe("[Final Emperial Tomb] Missing flag in npc List npcId: " + npcId + ", skipping");
+									continue;
+								}
+								int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
+								if (!_spawnList.contains(flag))
+									_spawnList.put(flag, new FastList<FETSpawn>());
+								
+								for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
+								{
+									if ("loc".equalsIgnoreCase(cd.getNodeName()))
+									{
+										attrs = cd.getAttributes();
+										FETSpawn spw = new FETSpawn();
+										spw.npcId = npcId;
+										
+										att = attrs.getNamedItem("x");
+										if (att != null)
+											spw.x = Integer.parseInt(att.getNodeValue());
+										else
+											continue;
+										att = attrs.getNamedItem("y");
+										if (att != null)
+											spw.y = Integer.parseInt(att.getNodeValue());
+										else
+											continue;
+										att = attrs.getNamedItem("z");
+										if (att != null)
+											spw.z = Integer.parseInt(att.getNodeValue());
+										else
+											continue;
+										att = attrs.getNamedItem("heading");
+										if (att != null)
+											spw.h = Integer.parseInt(att.getNodeValue());
+										else
+											continue;
+										att = attrs.getNamedItem("mustKill");
+										if (att != null)
+											spw.isNeededNextFlag = Boolean.parseBoolean(att.getNodeValue());
+										if (spw.isNeededNextFlag)
+											_mustKillMobsId.add(npcId);
+										_spawnList.get(flag).add(spw);
+										spawnCount++;
+									}
+									else if ("zone".equalsIgnoreCase(cd.getNodeName()))
+									{
+										attrs = cd.getAttributes();
+										FETSpawn spw = new FETSpawn();
+										spw.npcId = npcId;
+										spw.isZone = true;
+										
+										att = attrs.getNamedItem("id");
+										if (att != null)
+											spw.zone = Integer.parseInt(att.getNodeValue());
+										else
+											continue;
+										att = attrs.getNamedItem("count");
+										if (att != null)
+											spw.count = Integer.parseInt(att.getNodeValue());
+										else
+											continue;
+										att = attrs.getNamedItem("mustKill");
+										if (att != null)
+											spw.isNeededNextFlag = Boolean.parseBoolean(att.getNodeValue());
+										if (spw.isNeededNextFlag)
+											_mustKillMobsId.add(npcId);
+										_spawnList.get(flag).add(spw);
+										spawnCount++;
+									}
+								}
+							}
+						}
+					}
+					else if ("spawnZones".equalsIgnoreCase(n.getNodeName()))
+					{
+						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
+						{
+							if ("zone".equalsIgnoreCase(d.getNodeName()))
+							{
+								NamedNodeMap attrs = d.getAttributes();
+								Node att = attrs.getNamedItem("id");
+								if (att == null)
+								{
+									_log.severe("[Final Emperial Tomb] Missing id in spawnZones List, skipping");
+									continue;
+								}
+								int id = Integer.parseInt(att.getNodeValue());
+								att = attrs.getNamedItem("minZ");
+								if (att == null)
+								{
+									_log.severe("[Final Emperial Tomb] Missing minZ in spawnZones List id: " + id + ", skipping");
+									continue;
+								}
+								int minz = Integer.parseInt(att.getNodeValue());
+								att = attrs.getNamedItem("maxZ");
+								if (att == null)
+								{
+									_log.severe("[Final Emperial Tomb] Missing maxZ in spawnZones List id: " + id + ", skipping");
+									continue;
+								}
+								int maxz = Integer.parseInt(att.getNodeValue());
+								L2Territory ter = new L2Territory(id);
+								
+								for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
+								{
+									if ("point".equalsIgnoreCase(cd.getNodeName()))
+									{
+										attrs = cd.getAttributes();
+										int x, y;
+										att = attrs.getNamedItem("x");
+										if (att != null)
+											x = Integer.parseInt(att.getNodeValue());
+										else
+											continue;
+										att = attrs.getNamedItem("y");
+										if (att != null)
+											y = Integer.parseInt(att.getNodeValue());
+										else
+											continue;
+										
+										ter.add(x, y, minz, maxz, 0);
+									}
+								}
+								
+								_spawnZoneList.put(id, ter);
+							}
+						}
+					}
+				}
+			}
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "[Final Emperial Tomb] Could not parse data.xml file: " + e.getMessage(), e);
+		}
+		if (debug)
+		{
+			_log.info("[Final Emperial Tomb] Loaded " + _spawnZoneList.size() + " spawn zones data.");
+			_log.info("[Final Emperial Tomb] Loaded " + spawnCount + " spawns data.");
+		}
+	}
+	
+	protected void openDoor(int doorId, int instanceId)
+	{
+		for (L2DoorInstance door : InstanceManager.getInstance().getInstance(instanceId).getDoors())
+			if (door.getDoorId() == doorId)
+				door.openMe();
+	}
+	
+	protected void closeDoor(int doorId, int instanceId)
+	{
+		for (L2DoorInstance door : InstanceManager.getInstance().getInstance(instanceId).getDoors())
+			if (door.getDoorId() == doorId)
+				if (door.getOpen())
+					door.closeMe();
+	}
+	
+	private boolean checkConditions(L2PcInstance player)
+	{
+		if (debug || player.isGM())
+			return true;
+		L2Party party = player.getParty();
+		if (party == null)
+		{
+			player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER));
+			return false;
+		}
+		L2CommandChannel channel = player.getParty().getCommandChannel();
+		if (channel == null)
+		{
+			player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_IN_COMMAND_CHANNEL_CANT_ENTER));
+			return false;
+		}
+		else if (channel.getChannelLeader() != player)
+		{
+			player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER));
+			return false;
+		}
+		else if (player.getInventory().getItemByItemId(8073) == null)
+		{
+			SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_ITEM_REQUIREMENT_NOT_SUFFICIENT);
+			sm.addPcName(player);
+			player.sendPacket(sm);
+			return false;
+		}
+		else if (channel.getMemberCount() < MIN_PLAYERS || channel.getMemberCount() > MAX_PLAYERS)
+		{
+			player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PARTY_EXCEEDED_THE_LIMIT_CANT_ENTER));
+			return false;
+		}
+		for (L2PcInstance channelMember : channel.getMembers())
+		{
+			if (channelMember.getLevel() < 80)
+			{
+				SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT);
+				sm.addPcName(channelMember);
+				party.broadcastToPartyMembers(sm);
+				return false;
+			}
+			if (!Util.checkIfInRange(1000, player, channelMember, true))
+			{
+				SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED);
+				sm.addPcName(channelMember);
+				party.broadcastToPartyMembers(sm);
+				return false;
+			}
+			Long reentertime = InstanceManager.getInstance().getInstanceTime(channelMember.getObjectId(), INSTANCEID);
+			if (System.currentTimeMillis() < reentertime)
+			{
+				SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_REENTER_YET);
+				sm.addPcName(channelMember);
+				party.broadcastToPartyMembers(sm);
+				return false;
+			}
+		}
+		return true;
+	}
+	
+	private void teleportPlayer(L2PcInstance player, int[] coords, int instanceId)
+	{
+		player.setInstanceId(instanceId);
+		player.teleToLocation(coords[0], coords[1], coords[2]);
+	}
+	
+	protected int enterInstance(L2PcInstance player, String template, int[] coords)
+	{
+		int instanceId = 0;
+		//check for existing instances for this player
+		InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
+		//existing instance
+		if (world != null)
+		{
+			if (!(world instanceof FETWorld))
+			{
+				player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER));
+				return 0;
+			}
+			teleportPlayer(player, coords, world.instanceId);
+			return world.instanceId;
+		}
+		//New instance
+		else
+		{
+			if (!checkConditions(player))
+				return 0;
+			if (!player.isGM() && !player.destroyItemByItemId("QUEST", 8073, 1, player, true))
+				return 0;
+			instanceId = InstanceManager.getInstance().createDynamicInstance(template);
+			//Instance ins = InstanceManager.getInstance().getInstance(instanceId);
+			//ins.setSpawnLoc(new int[]{player.getX(),player.getY(),player.getZ()});
+			world = new FETWorld();
+			world.instanceId = instanceId;
+			world.status = 0;
+			InstanceManager.getInstance().addWorld(world);
+			controlStatus((FETWorld) world);
+			_log.info("Final Emperial Tomb started " + template + " Instance: " + instanceId + " created by player: " + player.getName());
+			// teleport players
+			if (player.getParty() == null || player.getParty().getCommandChannel() == null)
+			{
+				world.allowed.add(player.getObjectId());
+				teleportPlayer(player, coords, instanceId);
+			}
+			else
+			{
+				for (L2PcInstance channelMember : player.getParty().getCommandChannel().getMembers())
+				{
+					world.allowed.add(channelMember.getObjectId());
+					teleportPlayer(channelMember, coords, instanceId);
+				}
+			}
+			return instanceId;
+		}
+	}
+	
+	protected boolean checkKillProgress(L2Npc mob, FETWorld world)
+	{
+		if (world.npcList.contains(mob))
+			world.npcList.remove(mob);
+		return world.npcList.size() == 0;
+	}
+	
+	private void spawnFlaggedNPCs(FETWorld world, int flag)
+	{
+		if (world.lock.tryLock())
+		{
+			try
+			{
+				for (FETSpawn spw : _spawnList.get(flag))
+				{
+					if (spw.isZone)
+					{
+						for (int i = 0; i < spw.count; i++)
+						{
+							if (_spawnZoneList.contains(spw.zone))
+							{
+								int[] point = _spawnZoneList.get(spw.zone).getRandomPoint();
+								spawn(world, spw.npcId, point[0], point[1], GeoData.getInstance().getSpawnHeight(point[0], point[1], point[2], point[3], null), Rnd.get(65535), spw.isNeededNextFlag);
+							}
+							else
+								_log.info("[Final Emperial Tomb] Missing zone: " + spw.zone);
+						}
+					}
+					else
+						spawn(world, spw.npcId, spw.x, spw.y, spw.z, spw.h, spw.isNeededNextFlag);
+				}
+			}
+			finally
+			{
+				world.lock.unlock();
+			}
+		}
+	}
+	
+	protected boolean controlStatus(FETWorld world)
+	{
+		if (world.lock.tryLock())
+		{
+			try
+			{
+				if (debug)
+					_log.info("[Final Emperial Tomb] Starting " + world.status + ". status.");
+				world.npcList.clear();
+				switch (world.status)
+				{
+					case 0:
+						spawnFlaggedNPCs(world, 0);
+						break;
+					case 1:
+						for (int doorId : FIRST_ROUTE_DOORS)
+							openDoor(doorId, world.instanceId);
+						spawnFlaggedNPCs(world, world.status);
+						break;
+					case 2:
+						for (int doorId : SECOND_ROUTE_DOORS)
+							openDoor(doorId, world.instanceId);
+						ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(world, 0), 600000);
+						break;
+					case 3: // first morph
+						if (world.songEffectTask != null)
+							world.songEffectTask.cancel(false);
+						world.songEffectTask = null;
+						world.activeScarlet.setIsInvul(true);
+						if (world.activeScarlet.isCastingNow())
+							world.activeScarlet.abortCast();
+						setInstanceTimeRestrictions(world);
+						world.activeScarlet.doCast(FIRST_MORPH_SKILL.getSkill());
+						ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(world, 2), 1500);
+						break;
+					case 4: // second morph
+						world.isVideo = true;
+						broadCastPacket(world, new MagicSkillCanceld(world.frintezza.getObjectId()));
+						if (world.songEffectTask != null)
+							world.songEffectTask.cancel(false);
+						world.songEffectTask = null;
+						ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(world, 23), 2000);
+						ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(world, 24), 2100);
+						break;
+					case 5: // raid success
+						world.isVideo = true;
+						broadCastPacket(world, new MagicSkillCanceld(world.frintezza.getObjectId()));
+						if (world.songTask != null)
+							world.songTask.cancel(true);
+						if (world.songEffectTask != null)
+							world.songEffectTask.cancel(false);
+						world.songTask = null;
+						world.songEffectTask = null;
+						ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(world, 33), 500);
+						break;
+					case 6: // open doors
+						InstanceManager.getInstance().getInstance(world.instanceId).setDuration(300000);
+						for (int doorId : FIRST_ROOM_DOORS)
+							openDoor(doorId, world.instanceId);
+						for (int doorId : FIRST_ROUTE_DOORS)
+							openDoor(doorId, world.instanceId);
+						for (int doorId : SECOND_ROUTE_DOORS)
+							openDoor(doorId, world.instanceId);
+						for (int doorId : SECOND_ROOM_DOORS)
+							closeDoor(doorId, world.instanceId);
+						break;
+				}
+				world.status++;
+				return true;
+			}
+			finally
+			{
+				world.lock.unlock();
+			}
+		}
+		return false;
+	}
+	
+	protected void spawn(FETWorld world, int npcId, int x, int y, int z, int h, boolean addToKillTable)
+	{
+		L2Npc npc = addSpawn(npcId, x, y, z, h, false, 0, false, world.instanceId);
+		if (addToKillTable)
+			world.npcList.add(npc);
+		npc.setIsNoRndWalk(true);
+		if (npc.isInstanceType(InstanceType.L2Attackable))
+			((L2Attackable) npc).setSeeThroughSilentMove(true);
+		if (Util.contains(AI_DISABLED_MOBS, npcId))
+			npc.disableCoreAI(true);
+		if (npcId == DARK_CHOIR_PLAYER)
+			world.darkChoirPlayerCount++;
+	}
+	
+	private class DemonSpawnTask implements Runnable
+	{
+		private final FETWorld _world;
+		
+		DemonSpawnTask(FETWorld world)
+		{
+			_world = world;
+		}
+		
+		@Override
+		public void run()
+		{
+			if (InstanceManager.getInstance().getWorld(_world.instanceId) != _world || _world.portraits.isEmpty())
+			{
+				if (debug)
+					_log.info("[Final Emperial Tomb] Instance is deleted or all Portraits is killed.");
+				return;
+			}
+			for (int i : _world.portraits.values())
+			{
+				if (_world.demons.size() > MAX_DEMONS)
+					break;
+				L2MonsterInstance demon = (L2MonsterInstance) addSpawn(PORTRAIT_SPAWNS[i][0] + 2, PORTRAIT_SPAWNS[i][5], PORTRAIT_SPAWNS[i][6], PORTRAIT_SPAWNS[i][7], PORTRAIT_SPAWNS[i][8], false, 0, false, _world.instanceId);
+				updateKnownList(_world, demon);
+				_world.demons.add(demon);
+			}
+			ThreadPoolManager.getInstance().scheduleGeneral(new DemonSpawnTask(_world), TIME_BETWEEN_DEMON_SPAWNS);
+		}
+	}
+	
+	private class SongTask implements Runnable
+	{
+		private final FETWorld _world;
+		private final int _status;
+		
+		SongTask(FETWorld world, int status)
+		{
+			_world = world;
+			_status = status;
+		}
+		
+		@Override
+		public void run()
+		{
+			if (InstanceManager.getInstance().getWorld(_world.instanceId) != _world)
+				return;
+			switch (_status)
+			{
+				case 0: // new song play
+					if (_world.isVideo)
+						_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), 1000);
+					else if (_world.frintezza != null && !_world.frintezza.isDead())
+					{
+						int rnd = Rnd.get(100);
+						for (int i = 0; i < FRINTEZZASONGLIST.length; i++)
+						{
+							if (rnd < FRINTEZZASONGLIST[i].chance)
+							{
+								_world.OnSong = FRINTEZZASONGLIST[i];
+								broadCastPacket(_world, new ExShowScreenMessage(FRINTEZZASONGLIST[i].songName, 2, 500));
+								broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, FRINTEZZASONGLIST[i].skill.getSkillId(), FRINTEZZASONGLIST[i].skill.getSkillLvl(), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime(), 0));
+								_world.songEffectTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 1), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime() - 10000);
+								_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime());
+								break;
+							}
+						}
+					}
+					break;
+				case 1: // Frintezza song effect
+					_world.songEffectTask = null;
+					L2Skill skill = _world.OnSong.effectSkill.getSkill();
+					if (skill == null)
+						return;
+					
+					if (_world.frintezza != null && !_world.frintezza.isDead() && _world.activeScarlet != null && !_world.activeScarlet.isDead())
+					{
+						List<L2Character> targetList = new FastList<L2Character>();
+						if (skill.getSkillType() == L2SkillType.STUN || skill.getSkillType() == L2SkillType.DEBUFF)
+						{
+							for (int objId : _world.allowed)
+							{
+								L2PcInstance player = L2World.getInstance().getPlayer(objId);
+								if (player != null && player.isOnline() && player.getInstanceId() == _world.instanceId)
+								{
+									if (!player.isDead())
+										targetList.add(player);
+									if (player.getPet() != null && !player.getPet().isDead())
+										targetList.add(player.getPet());
+								}
+							}
+						}
+						else
+							targetList.add(_world.activeScarlet);
+						if (targetList.size() > 0)
+							_world.frintezza.doCast(skill, targetList.get(0), targetList.toArray(new L2Character[targetList.size()]));
+					}
+					break;
+				case 2: // finish morph
+					_world.activeScarlet.setRHandId(SECOND_SCARLET_WEAPON);
+					_world.activeScarlet.setIsInvul(false);
+					break;
+			}
+		}
+	}
+	
+	private class IntroTask implements Runnable
+	{
+		private final FETWorld _world;
+		private final int _status;
+		
+		IntroTask(FETWorld world, int status)
+		{
+			_world = world;
+			_status = status;
+		}
+		
+		@Override
+		public void run()
+		{
+			switch (_status)
+			{
+				case 0:
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 1), 27000);
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 2), 30000);
+					broadCastPacket(_world, new Earthquake(-87784, -155083, -9087, 45, 27));
+					break;
+				case 1:
+					for (int doorId : FIRST_ROOM_DOORS)
+						closeDoor(doorId, _world.instanceId);
+					for (int doorId : FIRST_ROUTE_DOORS)
+						closeDoor(doorId, _world.instanceId);
+					for (int doorId : SECOND_ROOM_DOORS)
+						closeDoor(doorId, _world.instanceId);
+					for (int doorId : SECOND_ROUTE_DOORS)
+						closeDoor(doorId, _world.instanceId);
+					addSpawn(29061, -87904, -141296, -9168, 0, false, 0, false, _world.instanceId);
+					break;
+				case 2:
+					_world.frintezzaDummy = addSpawn(29052, -87784, -155083, -9087, 16048, false, 0, false, _world.instanceId);
+					_world.frintezzaDummy.setIsInvul(true);
+					_world.frintezzaDummy.setIsImmobilized(true);
+					
+					_world.overheadDummy = addSpawn(29052, -87784, -153298, -9175, 16384, false, 0, false, _world.instanceId);
+					_world.overheadDummy.setIsInvul(true);
+					_world.overheadDummy.setIsImmobilized(true);
+					_world.overheadDummy.setCollisionHeight(600);
+					broadCastPacket(_world, new NpcInfo(_world.overheadDummy, null));
+					
+					_world.portraitDummy1 = addSpawn(29052, -89566, -153168, -9165, 16048, false, 0, false, _world.instanceId);
+					_world.portraitDummy1.setIsImmobilized(true);
+					_world.portraitDummy1.setIsInvul(true);
+					
+					_world.portraitDummy3 = addSpawn(29052, -86004, -153168, -9165, 16048, false, 0, false, _world.instanceId);
+					_world.portraitDummy3.setIsImmobilized(true);
+					_world.portraitDummy3.setIsInvul(true);
+					
+					_world.scarletDummy = addSpawn(29053, -87784, -153298, -9175, 16384, false, 0, false, _world.instanceId);
+					_world.scarletDummy.setIsInvul(true);
+					_world.scarletDummy.setIsImmobilized(true);
+					
+					stopPc();
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 3), 1000);
+					break;
+				case 3:
+					broadCastPacket(_world, new SpecialCamera(_world.overheadDummy.getObjectId(), 0, 75, -89, 0, 100, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.overheadDummy.getObjectId(), 0, 75, -89, 0, 100, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.overheadDummy.getObjectId(), 300, 90, -10, 6500, 7000, 0, 0, 1, 0));
+					
+					_world.frintezza = (L2GrandBossInstance) addSpawn(FRINTEZZA, -87784, -155083, -9087, 16048, false, 0, false, _world.instanceId);
+					_world.frintezza.setIsImmobilized(true);
+					_world.frintezza.setIsInvul(true);
+					_world.frintezza.disableAllSkills();
+					updateKnownList(_world, _world.frintezza);
+					
+					for (int i = 0; i < PORTRAIT_SPAWNS.length; i++)
+					{
+						L2MonsterInstance demon = (L2MonsterInstance) addSpawn(PORTRAIT_SPAWNS[i][0] + 2, PORTRAIT_SPAWNS[i][5], PORTRAIT_SPAWNS[i][6], PORTRAIT_SPAWNS[i][7], PORTRAIT_SPAWNS[i][8], false, 0, false, _world.instanceId);
+						demon.setIsImmobilized(true);
+						demon.disableAllSkills();
+						updateKnownList(_world, demon);
+						_world.demons.add(demon);
+					}
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 4), 6500);
+					break;
+				case 4:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezzaDummy.getObjectId(), 1800, 90, 8, 6500, 7000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 5), 900);
+					break;
+				case 5:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezzaDummy.getObjectId(), 140, 90, 10, 2500, 4500, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 6), 4000);
+					break;
+				case 6:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 40, 75, -10, 0, 1000, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 40, 75, -10, 0, 12000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 7), 1350);
+					break;
+				case 7:
+					broadCastPacket(_world, new SocialAction(_world.frintezza.getObjectId(), 2));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 8), 7000);
+					break;
+				case 8:
+					_world.frintezzaDummy.deleteMe();
+					_world.frintezzaDummy = null;
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 9), 1000);
+					break;
+				case 9:
+					broadCastPacket(_world, new SocialAction(_world.demons.get(1).getObjectId(), 1));
+					broadCastPacket(_world, new SocialAction(_world.demons.get(2).getObjectId(), 1));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 10), 400);
+					break;
+				case 10:
+					broadCastPacket(_world, new SocialAction(_world.demons.get(0).getObjectId(), 1));
+					broadCastPacket(_world, new SocialAction(_world.demons.get(3).getObjectId(), 1));
+					sendPacketX(new SpecialCamera(_world.portraitDummy1.getObjectId(), 1000, 118, 0, 0, 1000, 0, 0, 1, 0), new SpecialCamera(_world.portraitDummy3.getObjectId(), 1000, 62, 0, 0, 1000, 0, 0, 1, 0), -87784);
+					sendPacketX(new SpecialCamera(_world.portraitDummy1.getObjectId(), 1000, 118, 0, 0, 10000, 0, 0, 1, 0), new SpecialCamera(_world.portraitDummy3.getObjectId(), 1000, 62, 0, 0, 10000, 0, 0, 1, 0), -87784);
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 11), 2000);
+					break;
+				case 11:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 240, 90, 0, 0, 1000, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 240, 90, 25, 5500, 10000, 0, 0, 1, 0));
+					broadCastPacket(_world, new SocialAction(_world.frintezza.getObjectId(), 3));
+					_world.portraitDummy1.deleteMe();
+					_world.portraitDummy3.deleteMe();
+					_world.portraitDummy1 = null;
+					_world.portraitDummy3 = null;
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 12), 4500);
+					break;
+				case 12:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 100, 195, 35, 0, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 13), 700);
+					break;
+				case 13:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 100, 195, 35, 0, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 14), 1300);
+					break;
+				case 14:
+					broadCastPacket(_world, new ExShowScreenMessage(NpcStringId.MOURNFUL_CHORALE_PRELUDE, 2, 5000));
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 120, 180, 45, 1500, 10000, 0, 0, 1, 0));
+					broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, 5006, 1, 34000, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 15), 1500);
+					break;
+				case 15:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 520, 135, 45, 8000, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 16), 7500);
+					break;
+				case 16:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 1500, 110, 25, 10000, 13000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 17), 9500);
+					break;
+				case 17:
+					broadCastPacket(_world, new SpecialCamera(_world.overheadDummy.getObjectId(), 930, 160, -20, 0, 1000, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.overheadDummy.getObjectId(), 600, 180, -25, 0, 10000, 0, 0, 1, 0));
+					broadCastPacket(_world, new MagicSkillUse(_world.scarletDummy, _world.overheadDummy, 5004, 1, 5800, 0));
+					
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 18), 5000);
+					break;
+				case 18:
+					_world.activeScarlet = (L2GrandBossInstance) addSpawn(29046, -87784, -153298, -9165, 16384, false, 0, false, _world.instanceId);
+					_world.activeScarlet.setRHandId(FIRST_SCARLET_WEAPON);
+					_world.activeScarlet.setIsInvul(true);
+					_world.activeScarlet.setIsImmobilized(true);
+					_world.activeScarlet.disableAllSkills();
+					updateKnownList(_world, _world.activeScarlet);
+					broadCastPacket(_world, new SocialAction(_world.activeScarlet.getObjectId(), 3));
+					broadCastPacket(_world, new SpecialCamera(_world.scarletDummy.getObjectId(), 800, 180, 10, 1000, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 19), 2100);
+					break;
+				case 19:
+					broadCastPacket(_world, new SpecialCamera(_world.activeScarlet.getObjectId(), 300, 60, 8, 0, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 20), 2000);
+					break;
+				case 20:
+					broadCastPacket(_world, new SpecialCamera(_world.activeScarlet.getObjectId(), 500, 90, 10, 3000, 5000, 0, 0, 1, 0));
+					_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), 100);
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 21), 3000);
+					break;
+				case 21:
+					for (int i = 0; i < PORTRAIT_SPAWNS.length; i++)
+					{
+						L2MonsterInstance portrait = (L2MonsterInstance) addSpawn(PORTRAIT_SPAWNS[i][0], PORTRAIT_SPAWNS[i][1], PORTRAIT_SPAWNS[i][2], PORTRAIT_SPAWNS[i][3], PORTRAIT_SPAWNS[i][4], false, 0, false, _world.instanceId);
+						updateKnownList(_world, portrait);
+						_world.portraits.put(portrait, i);
+					}
+					
+					_world.overheadDummy.deleteMe();
+					_world.scarletDummy.deleteMe();
+					_world.overheadDummy = null;
+					_world.scarletDummy = null;
+					
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 22), 2000);
+					break;
+				case 22:
+					for (L2MonsterInstance demon : _world.demons)
+					{
+						demon.setIsImmobilized(false);
+						demon.enableAllSkills();
+					}
+					_world.activeScarlet.setIsInvul(false);
+					_world.activeScarlet.setIsImmobilized(false);
+					_world.activeScarlet.enableAllSkills();
+					_world.activeScarlet.setRunning();
+					_world.activeScarlet.doCast(INTRO_SKILL.getSkill());
+					_world.frintezza.enableAllSkills();
+					_world.frintezza.disableCoreAI(true);
+					_world.frintezza.setIsMortal(false);
+					startPc();
+					
+					ThreadPoolManager.getInstance().scheduleGeneral(new DemonSpawnTask(_world), TIME_BETWEEN_DEMON_SPAWNS);
+					break;
+				case 23:
+					broadCastPacket(_world, new SocialAction(_world.frintezza.getObjectId(), 4));
+					break;
+				case 24:
+					stopPc();
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 250, 120, 15, 0, 1000, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 250, 120, 15, 0, 10000, 0, 0, 1, 0));
+					_world.activeScarlet.abortAttack();
+					_world.activeScarlet.abortCast();
+					_world.activeScarlet.setIsInvul(true);
+					_world.activeScarlet.setIsImmobilized(true);
+					_world.activeScarlet.disableAllSkills();
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 25), 7000);
+					break;
+				case 25:
+					broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, 5006, 1, 34000, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 500, 70, 15, 3000, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 26), 3000);
+					break;
+				case 26:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 2500, 90, 12, 6000, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 27), 3000);
+					break;
+				case 27:
+					_world.scarlet_x = _world.activeScarlet.getX();
+					_world.scarlet_y = _world.activeScarlet.getY();
+					_world.scarlet_z = _world.activeScarlet.getZ();
+					_world.scarlet_h = _world.activeScarlet.getHeading();
+					if (_world.scarlet_h < 32768)
+						_world.scarlet_a = Math.abs(180 - (int) (_world.scarlet_h / 182.044444444));
+					else
+						_world.scarlet_a = Math.abs(540 - (int) (_world.scarlet_h / 182.044444444));
+					broadCastPacket(_world, new SpecialCamera(_world.activeScarlet.getObjectId(), 250, _world.scarlet_a, 12, 0, 1000, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.activeScarlet.getObjectId(), 250, _world.scarlet_a, 12, 0, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 28), 500);
+					break;
+				case 28:
+					_world.activeScarlet.doDie(_world.activeScarlet);
+					broadCastPacket(_world, new SpecialCamera(_world.activeScarlet.getObjectId(), 450, _world.scarlet_a, 14, 8000, 8000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 29), 6250);
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 30), 7200);
+					break;
+				case 29:
+					_world.activeScarlet.deleteMe();
+					_world.activeScarlet = null;
+					break;
+				case 30:
+					_world.activeScarlet = (L2GrandBossInstance) addSpawn(SCARLET2, _world.scarlet_x, _world.scarlet_y, _world.scarlet_z, _world.scarlet_h, false, 0, false, _world.instanceId);
+					_world.activeScarlet.setIsInvul(true);
+					_world.activeScarlet.setIsImmobilized(true);
+					_world.activeScarlet.disableAllSkills();
+					updateKnownList(_world, _world.activeScarlet);
+					
+					broadCastPacket(_world, new SpecialCamera(_world.activeScarlet.getObjectId(), 450, _world.scarlet_a, 12, 500, 14000, 0, 0, 1, 0));
+					
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 31), 8100);
+					break;
+				case 31:
+					broadCastPacket(_world, new SocialAction(_world.activeScarlet.getObjectId(), 2));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 32), 9000);
+					break;
+				case 32:
+					startPc();
+					_world.activeScarlet.setIsInvul(false);
+					_world.activeScarlet.setIsImmobilized(false);
+					_world.activeScarlet.enableAllSkills();
+					_world.isVideo = false;
+					break;
+				case 33:
+					broadCastPacket(_world, new SpecialCamera(_world.activeScarlet.getObjectId(), 300, _world.scarlet_a - 180, 5, 0, 7000, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.activeScarlet.getObjectId(), 200, _world.scarlet_a, 85, 4000, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 34), 7400);
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 35), 7500);
+					break;
+				case 34:
+					_world.frintezza.doDie(_world.frintezza);
+					break;
+				case 35:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 100, 120, 5, 0, 7000, 0, 0, 1, 0));
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 100, 90, 5, 5000, 15000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 36), 7000);
+					break;
+				case 36:
+					broadCastPacket(_world, new SpecialCamera(_world.frintezza.getObjectId(), 900, 90, 25, 7000, 10000, 0, 0, 1, 0));
+					ThreadPoolManager.getInstance().scheduleGeneral(new IntroTask(_world, 37), 9000);
+					break;
+				case 37:
+					controlStatus(_world);
+					_world.isVideo = false;
+					startPc();
+					break;
+			}
+		}
+		
+		private void stopPc()
+		{
+			for (int objId : _world.allowed)
+			{
+				L2PcInstance player = L2World.getInstance().getPlayer(objId);
+				if (player != null && player.isOnline() && player.getInstanceId() == _world.instanceId)
+				{
+					player.abortAttack();
+					player.abortCast();
+					player.disableAllSkills();
+					player.setTarget(null);
+					player.stopMove(null);
+					player.setIsImmobilized(true);
+					player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
+				}
+			}
+		}
+		
+		private void startPc()
+		{
+			for (int objId : _world.allowed)
+			{
+				L2PcInstance player = L2World.getInstance().getPlayer(objId);
+				if (player != null && player.isOnline() && player.getInstanceId() == _world.instanceId)
+				{
+					player.enableAllSkills();
+					player.setIsImmobilized(false);
+				}
+			}
+		}
+		
+		private void sendPacketX(L2GameServerPacket packet1, L2GameServerPacket packet2, int x)
+		{
+			for (int objId : _world.allowed)
+			{
+				L2PcInstance player = L2World.getInstance().getPlayer(objId);
+				if (player != null && player.isOnline() && player.getInstanceId() == _world.instanceId)
+				{
+					if (player.getX() < x)
+						player.sendPacket(packet1);
+					else
+						player.sendPacket(packet2);
+				}
+			}
+		}
+	}
+	
+	private class StatusTask implements Runnable
+	{
+		private final FETWorld _world;
+		private final int _status;
+		
+		StatusTask(FETWorld world, int status)
+		{
+			_world = world;
+			_status = status;
+		}
+		
+		@Override
+		public void run()
+		{
+			if (InstanceManager.getInstance().getWorld(_world.instanceId) != _world)
+				return;
+			switch (_status)
+			{
+				case 0:
+					ThreadPoolManager.getInstance().scheduleGeneral(new StatusTask(_world, 1), 2000);
+					for (int doorId : FIRST_ROOM_DOORS)
+						openDoor(doorId, _world.instanceId);
+					break;
+				case 1:
+					addAggroToMobs();
+					break;
+				case 2:
+					ThreadPoolManager.getInstance().scheduleGeneral(new StatusTask(_world, 3), 100);
+					for (int doorId : SECOND_ROOM_DOORS)
+						openDoor(doorId, _world.instanceId);
+					break;
+				case 3:
+					addAggroToMobs();
+					break;
+				case 4:
+					controlStatus(_world);
+					break;
+			}
+		}
+		
+		private void addAggroToMobs()
+		{
+			L2PcInstance target = L2World.getInstance().getPlayer(_world.allowed.get(Rnd.get(_world.allowed.size())));
+			if (target == null || target.getInstanceId() != _world.instanceId || target.isDead() || target.isFakeDeath())
+				for (int objId : _world.allowed)
+				{
+					target = L2World.getInstance().getPlayer(objId);
+					if (target != null && target.getInstanceId() == _world.instanceId && !target.isDead() && !target.isFakeDeath())
+						break;
+					target = null;
+				}
+			for (L2Npc mob : _world.npcList)
+			{
+				mob.setRunning();
+				if (target != null)
+				{
+					((L2MonsterInstance) mob).addDamageHate(target, 0, 500);
+					mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
+				}
+				else
+					mob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MOVE_TO_CENTER);
+			}
+		}
+	}
+	
+	protected void setInstanceTimeRestrictions(FETWorld world)
+	{
+		Calendar reenter = Calendar.getInstance();
+		reenter.set(Calendar.MINUTE, RESET_MIN);
+		reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
+		// if time is >= RESET_HOUR - roll to the next day
+		if (reenter.getTimeInMillis() <= System.currentTimeMillis())
+			reenter.add(Calendar.DAY_OF_MONTH, 1);
+		if (reenter.get(Calendar.DAY_OF_WEEK) <= RESET_DAY_1)
+			while (reenter.get(Calendar.DAY_OF_WEEK) != RESET_DAY_1)
+				reenter.add(Calendar.DAY_OF_MONTH, 1);
+		else
+			while (reenter.get(Calendar.DAY_OF_WEEK) != RESET_DAY_2)
+				reenter.add(Calendar.DAY_OF_MONTH, 1);
+		
+		SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_RESTRICTED);
+		sm.addString(InstanceManager.getInstance().getInstanceIdName(INSTANCEID));
+		
+		// set instance reenter time for all allowed players
+		for (int objectId : world.allowed)
+		{
+			L2PcInstance player = L2World.getInstance().getPlayer(objectId);
+			InstanceManager.getInstance().setInstanceTime(objectId, INSTANCEID, reenter.getTimeInMillis());
+			if (player != null && player.isOnline())
+				player.sendPacket(sm);
+		}
+	}
+	
+	private void broadCastPacket(FETWorld world, L2GameServerPacket packet)
+	{
+		for (int objId : world.allowed)
+		{
+			L2PcInstance player = L2World.getInstance().getPlayer(objId);
+			if (player != null && player.isOnline() && player.getInstanceId() == world.instanceId)
+				player.sendPacket(packet);
+		}
+	}
+	
+	private void updateKnownList(FETWorld world, L2Npc npc)
+	{
+		Map<Integer, L2PcInstance> npcKnownPlayers = npc.getKnownList().getKnownPlayers();
+		for (int objId : world.allowed)
+		{
+			L2PcInstance player = L2World.getInstance().getPlayer(objId);
+			if (player != null && player.isOnline() && player.getInstanceId() == world.instanceId)
+				npcKnownPlayers.put(player.getObjectId(), player);
+		}
+	}
+	
+	@Override
+	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, L2Skill skill)
+	{
+		InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
+		if (tmpworld instanceof FETWorld)
+		{
+			FETWorld world = (FETWorld) tmpworld;
+			if (npc.getNpcId() == SCARLET1 && world.status == 3 && npc.getCurrentHp() < npc.getMaxHp() * 0.80)
+			{
+				controlStatus(world);
+			}
+			else if (npc.getNpcId() == SCARLET1 && world.status == 4 && npc.getCurrentHp() < npc.getMaxHp() * 0.20)
+			{
+				controlStatus(world);
+			}
+		}
+		return null;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
+	{
+		InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
+		if (tmpworld instanceof FETWorld)
+		{
+			FETWorld world = (FETWorld) tmpworld;
+			if (npc.getNpcId() == HALL_ALARM)
+			{
+				ThreadPoolManager.getInstance().scheduleGeneral(new StatusTask(world, 0), 2000);
+				if (debug)
+					_log.info("[Final Emperial Tomb] Hall alarm is disabled, doors will open!");
+			}
+			else if (npc.getNpcId() == DARK_CHOIR_PLAYER)
+			{
+				world.darkChoirPlayerCount--;
+				if (world.darkChoirPlayerCount < 1)
+				{
+					ThreadPoolManager.getInstance().scheduleGeneral(new StatusTask(world, 2), 2000);
+					if (debug)
+						_log.info("[Final Emperial Tomb] All Dark Choir Players are killed, doors will open!");
+				}
+			}
+			else if (npc.getNpcId() == SCARLET2)
+			{
+				controlStatus(world);
+			}
+			else if (world.status <= 2)
+			{
+				if (checkKillProgress(npc, world))
+					controlStatus(world);
+			}
+			else if (world.demons.contains(npc))
+			{
+				world.demons.remove(npc);
+			}
+			else if (world.portraits.containsKey(npc))
+			{
+				world.portraits.remove(npc);
+			}
+		}
+		return "";
+	}
+	
+	@Override
+	public String onTalk(L2Npc npc, L2PcInstance player)
+	{
+		int npcId = npc.getNpcId();
+		QuestState st = player.getQuestState(qn);
+		if (st == null)
+			st = newQuestState(player);
+		if (npcId == GUIDE)
+		{
+			enterInstance(player, "FinalEmperialTomb.xml", ENTER_TELEPORT);
+		}
+		else if (npc.getNpcId() == CUBE)
+		{
+			int x = -87534 + Rnd.get(500);
+			int y = -153048 + Rnd.get(500);
+			player.teleToLocation(x, y, -9165);
+			return null;
+		}
+		return "";
+	}
+	
+	public FinalEmperialTomb(int questId, String name, String descr)
+	{
+		super(questId, name, descr);
+		
+		load();
+		addStartNpc(GUIDE);
+		addTalkId(GUIDE);
+		addStartNpc(CUBE);
+		addTalkId(CUBE);
+		addKillId(HALL_ALARM);
+		addKillId(DARK_CHOIR_PLAYER);
+		addAttackId(SCARLET1);
+		addKillId(SCARLET2);
+		for (int mobId : PORTRAITS)
+			addKillId(mobId);
+		for (int mobId : DEMONS)
+			addKillId(mobId);
+		for (int mobId : _mustKillMobsId)
+			addKillId(mobId);
+	}
+	
+	public static void main(String[] args)
+	{
+		// now call the constructor (starts up the)
+		new FinalEmperialTomb(-1, qn, "instances");
+	}
+}

+ 474 - 0
L2J_DataPack_BETA/dist/game/data/scripts/instances/FinalEmperialTomb/data.xml

@@ -0,0 +1,474 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<list>
+	<spawnZones>
+		<zone id="0" minZ="-9220" maxZ="-8920">
+			<point x="-87956" y="-151907" />
+			<point x="-87590" y="-151906" />
+			<point x="-87590" y="-151419" />
+			<point x="-87955" y="-151421" />
+		</zone>
+		<zone id="1" minZ="-9239" maxZ="-8739">
+			<point x="-86067" y="-152626" />
+			<point x="-86292" y="-152322" />
+			<point x="-87125" y="-151593" />
+			<point x="-88505" y="-151586" />
+			<point x="-89313" y="-152278" />
+			<point x="-89503" y="-152648" />
+			<point x="-89500" y="-153806" />
+			<point x="-89429" y="-154257" />
+			<point x="-88538" y="-155006" />
+			<point x="-87030" y="-155003" />
+			<point x="-86063" y="-154215" />
+		</zone>
+		<zone id="2" minZ="-9239" maxZ="-8739">
+			<point x="-86067" y="-152626" />
+			<point x="-86292" y="-152322" />
+			<point x="-87125" y="-151593" />
+			<point x="-88505" y="-151586" />
+			<point x="-89313" y="-152278" />
+			<point x="-89503" y="-152648" />
+			<point x="-89500" y="-153806" />
+			<point x="-89429" y="-154257" />
+			<point x="-88538" y="-155006" />
+			<point x="-87030" y="-155003" />
+			<point x="-86063" y="-154215" />
+		</zone>
+		<zone id="3" minZ="-9239" maxZ="-8739">
+			<point x="-86067" y="-152626" />
+			<point x="-86292" y="-152322" />
+			<point x="-87125" y="-151593" />
+			<point x="-88505" y="-151586" />
+			<point x="-89313" y="-152278" />
+			<point x="-89503" y="-152648" />
+			<point x="-89500" y="-153806" />
+			<point x="-89429" y="-154257" />
+			<point x="-88538" y="-155006" />
+			<point x="-87030" y="-155003" />
+			<point x="-86063" y="-154215" />
+		</zone>
+		<zone id="4" minZ="-9211" maxZ="-9011">
+			<point x="-88018" y="-141410" />
+			<point x="-87818" y="-141410" />
+			<point x="-87818" y="-141210" />
+			<point x="-88018" y="-141210" />
+		</zone>
+		<zone id="5" minZ="-9211" maxZ="-9011">
+			<point x="-88018" y="-141410" />
+			<point x="-87818" y="-141410" />
+			<point x="-87818" y="-141210" />
+			<point x="-88018" y="-141210" />
+		</zone>
+		<zone id="6" minZ="-9211" maxZ="-9011">
+			<point x="-88018" y="-141410" />
+			<point x="-87818" y="-141410" />
+			<point x="-87818" y="-141210" />
+			<point x="-88018" y="-141210" />
+		</zone>
+		<zone id="7" minZ="-9211" maxZ="-9011">
+			<point x="-88018" y="-141410" />
+			<point x="-87818" y="-141410" />
+			<point x="-87818" y="-141210" />
+			<point x="-88018" y="-141210" />
+		</zone>
+		<zone id="8" minZ="-9184" maxZ="-8984">
+			<point x="-89294" y="-141847" />
+			<point x="-88970" y="-141605" />
+			<point x="-88968" y="-141044" />
+			<point x="-89304" y="-140802" />
+		</zone>
+		<zone id="9" minZ="-9184" maxZ="-8984">
+			<point x="-88512" y="-142679" />
+			<point x="-88417" y="-142318" />
+			<point x="-88906" y="-141825" />
+			<point x="-89271" y="-141896" />
+		</zone>
+		<zone id="10" minZ="-9184" maxZ="-8984">
+			<point x="-88455" y="-142693" />
+			<point x="-87361" y="-142677" />
+			<point x="-87645" y="-142372" />
+			<point x="-88201" y="-142374" />
+		</zone>
+		<zone id="11" minZ="-9184" maxZ="-8984">
+			<point x="-87321" y="-142651" />
+			<point x="-86557" y="-141902" />
+			<point x="-86900" y="-141818" />
+			<point x="-87412" y="-142316" />
+		</zone>
+		<zone id="12" minZ="-9184" maxZ="-8984">
+			<point x="-86857" y="-141595" />
+			<point x="-86536" y="-141863" />
+			<point x="-86540" y="-140772" />
+			<point x="-86848" y="-141016" />
+		</zone>
+		<zone id="13" minZ="-9184" maxZ="-8984">
+			<point x="-87404" y="-140315" />
+			<point x="-86911" y="-140809" />
+			<point x="-86557" y="-140709" />
+			<point x="-87326" y="-139949" />
+		</zone>
+		<zone id="14" minZ="-9184" maxZ="-8984">
+			<point x="-88197" y="-140256" />
+			<point x="-87615" y="-140252" />
+			<point x="-87364" y="-139933" />
+			<point x="-88459" y="-139926" />
+		</zone>
+		<zone id="15" minZ="-9184" maxZ="-8984">
+			<point x="-88921" y="-140820" />
+			<point x="-88399" y="-140306" />
+			<point x="-88500" y="-139940" />
+			<point x="-89255" y="-140698" />
+		</zone>
+		<zone id="16" minZ="-9228" maxZ="-9028">
+			<point x="-88059" y="-147379" />
+			<point x="-87699" y="-147371" />
+			<point x="-87707" y="-146959" />
+			<point x="-88075" y="-146975" />
+		</zone>
+		<zone id="17" minZ="-9228" maxZ="-9028">
+			<point x="-88059" y="-147379" />
+			<point x="-87699" y="-147371" />
+			<point x="-87707" y="-146959" />
+			<point x="-88075" y="-146975" />
+		</zone>
+		<zone id="18" minZ="-9243" maxZ="-9043">
+			<point x="-87305" y="-148597" />
+			<point x="-86465" y="-147777" />
+			<point x="-86461" y="-146501" />
+			<point x="-87361" y="-145537" />
+			<point x="-88685" y="-145565" />
+			<point x="-89665" y="-146413" />
+			<point x="-89609" y="-147729" />
+			<point x="-88793" y="-148637" />
+		</zone>
+		<zone id="19" minZ="-9243" maxZ="-9043">
+			<point x="-87305" y="-148597" />
+			<point x="-86465" y="-147777" />
+			<point x="-86461" y="-146501" />
+			<point x="-87361" y="-145537" />
+			<point x="-88685" y="-145565" />
+			<point x="-89665" y="-146413" />
+			<point x="-89609" y="-147729" />
+			<point x="-88793" y="-148637" />
+		</zone>
+		<zone id="20" minZ="-9252" maxZ="-9052">
+			<point x="-88963" y="-146803" />
+			<point x="-88587" y="-146095" />
+			<point x="-88595" y="-145659" />
+			<point x="-88991" y="-146071" />
+		</zone>
+		<zone id="21" minZ="-9256" maxZ="-9056">
+			<point x="-89395" y="-147615" />
+			<point x="-88971" y="-148119" />
+			<point x="-89011" y="-146091" />
+			<point x="-89399" y="-146511" />
+		</zone>
+		<zone id="22" minZ="-9252" maxZ="-9052">
+			<point x="-88963" y="-148107" />
+			<point x="-88527" y="-148471" />
+			<point x="-88527" y="-148151" />
+			<point x="-88971" y="-147299" />
+		</zone>
+		<zone id="23" minZ="-9232" maxZ="-9032">
+			<point x="-87339" y="-148071" />
+			<point x="-87371" y="-148463" />
+			<point x="-87003" y="-148127" />
+			<point x="-86991" y="-147451" />
+		</zone>
+		<zone id="24" minZ="-9240" maxZ="-9040">
+			<point x="-86975" y="-148119" />
+			<point x="-86583" y="-147711" />
+			<point x="-86543" y="-146519" />
+			<point x="-86915" y="-146055" />
+		</zone>
+		<zone id="25" minZ="-9232" maxZ="-9032">
+			<point x="-87347" y="-146047" />
+			<point x="-86971" y="-146711" />
+			<point x="-86927" y="-146063" />
+			<point x="-87335" y="-145711" />
+		</zone>
+	</spawnZones>
+	<npc>
+		<spawn npcId="18328" flag="0">
+			<loc x="-87904" y="-141296" z="-9168" heading="0" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="8" count="3"  mustKill="true" />
+		</spawn>
+		<spawn npcId="18331" flag="0">
+			<zone id="8" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18329" flag="0">
+			<zone id="8" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="8" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18333" flag="0">
+			<zone id="8" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="9" count="3" mustKill="true" />
+		</spawn>
+		<spawn npcId="18331" flag="0">
+			<zone id="9" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18329" flag="0">
+			<zone id="9" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="9" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18333" flag="0">
+			<zone id="9" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="10" count="3" mustKill="true" />
+		</spawn>
+		<spawn npcId="18331" flag="0">
+			<zone id="10" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18329" flag="0">
+			<zone id="10" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="10" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18333" flag="0">
+			<zone id="10" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="11" count="3" mustKill="true" />
+		</spawn>
+		<spawn npcId="18331" flag="0">
+			<zone id="11" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18329" flag="0">
+			<zone id="11" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="11" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18333" flag="0">
+			<zone id="11" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="12" count="3" mustKill="true" />
+		</spawn>
+		<spawn npcId="18331" flag="0">
+			<zone id="12" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18329" flag="0">
+			<zone id="12" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="12" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18333" flag="0">
+			<zone id="12" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="13" count="3" mustKill="true" />
+		</spawn>
+		<spawn npcId="18331" flag="0">
+			<zone id="13" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18329" flag="0">
+			<zone id="13" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="13" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18333" flag="0">
+			<zone id="13" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="14" count="3" mustKill="true" />
+		</spawn>
+		<spawn npcId="18331" flag="0">
+			<zone id="14" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18329" flag="0">
+			<zone id="14" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="14" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18333" flag="0">
+			<zone id="14" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="15" count="3" mustKill="true" />
+		</spawn>
+		<spawn npcId="18331" flag="0">
+			<zone id="15" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18329" flag="0">
+			<zone id="15" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18330" flag="0">
+			<zone id="15" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18333" flag="0">
+			<zone id="15" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18339" flag="1">
+			<zone id="16" count="4" />
+		</spawn>
+		<spawn npcId="18334" flag="1">
+			<loc x="-88755" y="-147395" z="-9138" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18334" flag="1">
+			<loc x="-88755" y="-147187" z="-9138" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18334" flag="1">
+			<loc x="-88755" y="-146963" z="-9138" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18334" flag="1">
+			<loc x="-88755" y="-146723" z="-9138" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18334" flag="1">
+			<loc x="-87155" y="-147411" z="-9138" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18334" flag="1">
+			<loc x="-87155" y="-147219" z="-9138" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18334" flag="1">
+			<loc x="-87155" y="-146963" z="-9138" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18334" flag="1">
+			<loc x="-87171" y="-146739" z="-9138" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88467" y="-148467" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88467" y="-148403" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88467" y="-148339" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88467" y="-148271" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88471" y="-148199" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88499" y="-148435" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88503" y="-148375" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88499" y="-148307" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88503" y="-148239" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-148191" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-148263" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-148331" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-148395" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-148467" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87395" y="-148435" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87395" y="-148371" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87395" y="-148303" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87395" y="-148227" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-145683" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-145747" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-145883" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-145819" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87427" y="-145955" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87395" y="-145715" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87395" y="-145779" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87395" y="-145859" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-87395" y="-145923" z="-9170" heading="33000" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88463" y="-145971" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88467" y="-145899" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88467" y="-145827" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88467" y="-145763" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88471" y="-145699" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88495" y="-145939" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88499" y="-145863" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88499" y="-145795" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18336" flag="1">
+			<loc x="-88499" y="-145731" z="-9170" heading="0" mustKill="true" />
+		</spawn>
+		<spawn npcId="18335" flag="1">
+			<zone id="20" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18337" flag="1">
+			<zone id="21" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18338" flag="1">
+			<zone id="21" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18335" flag="1">
+			<zone id="22" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18335" flag="1">
+			<zone id="23" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18337" flag="1">
+			<zone id="24" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18338" flag="1">
+			<zone id="24" count="10" mustKill="true" />
+		</spawn>
+		<spawn npcId="18335" flag="1">
+			<zone id="25" count="10" mustKill="true" />
+		</spawn>
+	</npc>
+</list>

+ 0 - 5
L2J_DataPack_BETA/dist/game/data/zones/custom_boss_zones.xml

@@ -83,11 +83,6 @@
 		<node X="229176" Y="-98508" />
 		<node X="196880" Y="-98498" />
 	</zone>
-	<zone name="Frintezza Boss" id="12011" type="BossZone" shape="Cuboid" minZ="-9205" maxZ="-8065"> <!-- Not Verified -->
-		<stat name="InvadeTime" val="1800000" />
-		<node X="-89840" Y="-139384" />
-		<node X="-85732" Y="-155311" />
-	</zone>
 	<zone name="Queen Ant Boss" id="12012" type="BossZone" shape="NPoly" minZ="-5947" maxZ="-5547"> <!-- Not Verified -->
 		<stat name="EnabledByDefault" val="false" />
 		<node X="-21490" Y="178613" />

+ 1 - 1
L2J_DataPack_BETA/dist/sql/game/grandboss_data.sql

@@ -22,8 +22,8 @@ INSERT IGNORE INTO `grandboss_data` VALUES
 (29066, 185708, 114298, -8221,32768, 0, 14518000, 3996000, 0), -- Antharas Weak (79)
 (29067, 185708, 114298, -8221,32768, 0, 16184000, 3996000, 0), -- Antharas Normal (79)
 (29068, 185708, 114298, -8221,32768, 0, 204677324.07859, 3996000, 0), -- Antharas Strong (85)
-(29045, 0, 0, 0, 0, 0, 1018821.42723286, 52001.06567747795, 0), -- Frintezza (85)
 (29118, 0, 0, 0, 0, 0, 4109288, 1220547, 0); -- Beleth (83)
+-- (29045, 0, 0, 0, 0, 0, 1018821.42723286, 52001.06567747795, 0), -- Frintezza (85)
 -- (29046, 0, 0, 0, 0, 0, 1824900, 23310, 0), -- Scarlet Van Halisha (85)
 -- (29047, 174238, -89792, -5002, 0, 0, 898044, 4519, 0), -- Scarlet Van Halisha (85)
 -- (29099, 0, 0, 0, 0, 0, 1703893, 111000, 0), -- Baylor (83)

+ 2 - 2
L2J_DataPack_BETA/dist/sql/game/npc.sql

@@ -5936,8 +5936,8 @@ INSERT INTO `npc` VALUES
 (29042,29042,'Inferno Golem',0,'',0,'LineageMonster2.lava_golem','22','45',84,'male','L2Monster',40,'20917.08','1657.536','34.92','3.88',40,43,30,21,20,20,0,0,'5024.6','1340.9765','3539.6658','490.626',253,4,0,333,0,0,0,13,60,1,1,0,1),
 (29043,29043,'Howling Ifrit',0,'',0,'LineageMonster2.ifrit','10','42',84,'male','L2Monster',40,'20917.08','1657.536','34.92','3.88',40,43,30,21,20,20,0,0,'5024.6','1340.9765','3539.6658','490.626',253,4,0,333,0,0,0,38,170,1,1,0,1),
 (29044,29044,'Howling Ifrit',0,'',0,'LineageMonster2.ifrit','10','42',84,'male','L2Monster',40,'20917.08','1657.536','34.92','3.88',40,43,30,21,20,20,0,0,'6682.718','1340.9765','6293.5257924','490.626',253,4,0,333,0,0,0,38,170,1,1,0,1),
-(29045,29045,'Frintezza',0,'',0,'LineageMonster3.frintessa','45','42.7',85,'male','L2GrandBoss',40,'428076.229929773','23423.9034583234','2484.3','3.15',60,57,73,76,43,80,0,0,'2641.63342970569','4218.55484265502','971.856593649426','3093.6078479881',253,4,0,333,0,0,0,30,31,1,1,0,1),
-(29046,29046,'Scarlet van Halisha',0,'',0,'LineageMonster3.follower_of_frintessa','45','90.7',85,'male','L2GrandBoss',40,'2254518.0975573','11026.9882971101','248.43','109',60,57,73,76,43,80,0,0,'3135.90530099925','1342.97453242915','1442.51644402476','2089.07149518896',253,4,0,333,8204,0,0,240,111,1,1,0,1),
+(29045,29045,'Frintezza',0,'',0,'LineageMonster3.frintessa','45','42.7',85,'male','L2GrandBoss',40,'428076.229929773','23423.9034583234','2484.3','3.15',60,57,73,76,43,80,0,0,'2641.63342970569','4218.55484265502','971.856593649426','3093.6078479881',253,4,3000,333,0,0,0,30,31,1,1,0,1),
+(29046,29046,'Scarlet van Halisha',0,'',0,'LineageMonster3.follower_of_frintessa','45','90.7',85,'male','L2GrandBoss',40,'2254518.0975573','11026.9882971101','248.43','109',60,57,73,76,43,80,0,0,'3135.90530099925','1342.97453242915','1442.51644402476','2089.07149518896',253,4,3000,333,8204,0,0,240,111,1,1,0,1),
 (29047,29047,'Scarlet van Halisha',0,'',0,'LineageMonster3.follower_of_frintessa_tran','92','112.8',85,'male','L2GrandBoss',40,'3842432.67633202','23156.6754239312','248.43','109',60,57,73,76,43,80,130849003,10028450,'8890.29152833288','1566.80362116734','8989.0725799934','2193.5250699484',253,4,0,333,8222,0,0,250,155,1,1,0,1),
 (29048,29048,'Evil Spirit',0,'',0,'LineageMonster3.Evilate','40','100',85,'female','L2Monster',40,'82844.5126642967','2177.28986625269','1.03','1.03',40,43,30,21,20,20,0,0,'1637.21079615435','1637.38608949103','1151.5428303933','1091.59072648368',253,4,0,333,0,0,0,10,1,1,1,0,1),
 (29049,29049,'Evil Spirit',0,'',0,'LineageMonster3.Evilate','40','100',85,'female','L2Monster',40,'82844.5126642967','2177.28986625269','1.03','1.03',40,43,30,21,20,20,0,0,'1637.21079615435','1637.38608949103','1151.5428303933','1091.59072648368',253,4,0,333,0,0,0,10,1,1,1,0,1),

+ 2 - 2
L2J_DataPack_BETA/dist/sql/game/npcaidata.sql

@@ -5912,8 +5912,8 @@ INSERT INTO `npcaidata` VALUES
 (29043,7,15,0,1,0,0,0,0,0,0,0,0,0,'fire_clan',300,NULL,0,0,'balanced'),
 (29044,7,15,0,1,0,0,0,0,0,0,0,0,0,'fire_clan',300,NULL,0,0,'balanced'),
 (29045,7,15,0,1,0,0,0,0,0,0,0,0,0,'frintessa_clan',0,NULL,0,0,'balanced'),
-(29046,7,15,0,1,0,0,0,0,0,0,0,0,0,'frintessa_clan',2000,NULL,0,0,'balanced'),
-(29047,7,15,0,1,0,0,0,0,0,0,0,0,0,'frintessa_clan',2000,NULL,0,0,'balanced'),
+(29046,7,15,5014,1,0,0,0,0,0,0,0,0,0,'frintessa_clan',2000,NULL,0,0,'balanced'),
+(29047,7,15,5014,1,5019,10,0,0,0,0,0,0,0,'frintessa_clan',2000,NULL,0,0,'balanced'),
 (29048,7,15,0,1,0,0,0,0,0,0,0,0,0,'frintessa_clan',1000,NULL,0,0,'corpse'),
 (29049,7,15,0,1,0,0,0,0,0,0,0,0,0,'frintessa_clan',1000,NULL,0,0,'corpse'),
 (29050,7,15,0,1,0,0,0,0,0,0,0,0,0,'frintessa_clan',2000,NULL,0,0,'balanced'),

+ 1 - 0
L2J_DataPack_BETA/dist/sql/game/updates/20101001update.sql

@@ -0,0 +1 @@
+DELETE FROM grandboss_data WHERE boss_id = 29045;