From e4e773f6668e8c4a88beec85ba0589aff84a49b6 Mon Sep 17 00:00:00 2001
From: Zoey76 <zoey_76@msn.com>
Date: Sat, 31 May 2014 23:49:21 +0000
Subject: [PATCH] BETA: Pailaka - Devil's Legacy (129) update. 	* Retail like
 and separated quest from instance to match other similar scripts.

Patch by: St3eT
Reviewed by: Aikimaniac, Zoey76
---
 .../data/instances/PailakaDevilsLegacy.xml    |   5 +-
 L2J_DataPack_BETA/dist/game/data/scripts.cfg  |   2 +-
 .../Pailaka/PailakaDevilsLegacy.java          | 624 ------------------
 .../Pailaka/PailakaSongOfIceAndFire.java      |   9 +-
 .../PailakaDevilsLegacy/32498-01.htm          |   3 +
 .../PailakaDevilsLegacy/32498-02.htm          |   3 +
 .../PailakaDevilsLegacy.java                  | 335 ++++++++++
 .../129_PailakaDevilsLegacy/32498-08.htm      |   6 -
 .../129_PailakaDevilsLegacy/32498-09.htm      |   5 -
 .../32498-01.htm                              |   8 +-
 .../32498-02.htm                              |   8 +-
 .../32498-03.htm                              |   8 +-
 .../32498-04.htm                              |   8 +-
 .../32498-05.htm                              |   3 +-
 .../32498-06.htm                              |   8 +-
 .../32498-07.htm                              |   6 +-
 .../Q00129_PailakaDevilsLegacy/32498-08.htm   |   4 +
 .../Q00129_PailakaDevilsLegacy/32498-09.htm   |   3 +
 .../32498-10.htm                              |   6 +-
 .../32498-11.htm                              |   6 +-
 .../32498-12.htm                              |   6 +-
 .../32498.htm                                 |   6 +-
 .../32501-01.htm                              |   8 +-
 .../32501-02.htm                              |   8 +-
 .../32501-03.htm                              |   8 +-
 .../32501-04.htm                              |   6 +-
 .../32501.htm                                 |   6 +-
 .../32508-00.htm                              |   6 +-
 .../32508-01.htm                              |   6 +-
 .../32508-02.htm                              |   6 +-
 .../32508-03.htm                              |   6 +-
 .../32508-04.htm                              |   6 +-
 .../32508-05.htm                              |   6 +-
 .../32508-06.htm                              |   6 +-
 .../32508-07.htm                              |   6 +-
 .../32508.htm                                 |   6 +-
 .../32511-01.htm                              |   6 +-
 .../32511-02.htm                              |   6 +-
 .../32511-03.htm                              |   6 +-
 .../32511.htm                                 |   6 +-
 .../Q00129_PailakaDevilsLegacy.java           | 317 +++++++++
 .../scripts/quests/QuestMasterHandler.java    |   2 +
 .../dist/sql/game/updates/20140531update.sql  |   1 +
 43 files changed, 743 insertions(+), 763 deletions(-)
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaDevilsLegacy.java
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/32498-01.htm
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/32498-02.htm
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/PailakaDevilsLegacy.java
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-08.htm
 delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-09.htm
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-01.htm (61%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-02.htm (76%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-03.htm (76%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-04.htm (83%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-05.htm (82%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-06.htm (68%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-07.htm (62%)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-08.htm
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-09.htm
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-10.htm (70%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-11.htm (74%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498-12.htm (71%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32498.htm (82%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32501-01.htm (65%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32501-02.htm (67%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32501-03.htm (77%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32501-04.htm (85%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32501.htm (75%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508-00.htm (75%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508-01.htm (75%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508-02.htm (74%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508-03.htm (83%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508-04.htm (58%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508-05.htm (84%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508-06.htm (69%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508-07.htm (80%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32508.htm (86%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32511-01.htm (86%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32511-02.htm (63%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32511-03.htm (56%)
 rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{129_PailakaDevilsLegacy => Q00129_PailakaDevilsLegacy}/32511.htm (87%)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/Q00129_PailakaDevilsLegacy.java
 create mode 100644 L2J_DataPack_BETA/dist/sql/game/updates/20140531update.sql

diff --git a/L2J_DataPack_BETA/dist/game/data/instances/PailakaDevilsLegacy.xml b/L2J_DataPack_BETA/dist/game/data/instances/PailakaDevilsLegacy.xml
index 90284472a6..b181896faa 100644
--- a/L2J_DataPack_BETA/dist/game/data/instances/PailakaDevilsLegacy.xml
+++ b/L2J_DataPack_BETA/dist/game/data/instances/PailakaDevilsLegacy.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <instance name="Pailaka (Devil's Isle)" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
-	<activityTime val="60" />
+	<activityTime val="90" />
 	<allowSummon val="false" />
-	<emptyDestroyTime val="3000" />
+	<emptyDestroyTime val="900" />
 	<spawnPoint spawnX="85039" spawnY="147543" spawnZ="-3400" />
 	<doorlist>
 		<door doorId="22110100" />
@@ -50,7 +50,6 @@
 			<spawn npcId="32495" x="82096" y="-215088" z="-3728" heading="0" respawn="0" onKillDelay="100" />
 			<spawn npcId="32495" x="80272" y="-213776" z="-3344" heading="0" respawn="0" onKillDelay="100" />
 			<spawn npcId="32495" x="80164" y="-214350" z="-3592" heading="0" respawn="0" onKillDelay="100" />
-			<spawn npcId="32495" x="80164" y="-214350" z="-3592" heading="0" respawn="0" onKillDelay="100" />
 			<spawn npcId="32495" x="83408" y="-213344" z="-3344" heading="0" respawn="0" onKillDelay="100" />
 			<spawn npcId="32495" x="76960" y="-213456" z="-3712" heading="0" respawn="0" onKillDelay="100" />
 			<spawn npcId="32495" x="85952" y="-220466" z="-3728" heading="0" respawn="0" onKillDelay="100" />
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg
index c09d89ff0a..555a29d258 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg
+++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg
@@ -199,7 +199,7 @@ instances/Kamaloka/Kamaloka.java
 instances/MithrilMine/MithrilMine.java
 instances/MonasteryOfSilence1/MonasteryOfSilence1.java
 instances/NornilsGarden/NornilsGarden.java
-instances/Pailaka/PailakaDevilsLegacy.java
+instances/PailakaDevilsLegacy/PailakaDevilsLegacy.java
 instances/Pailaka/PailakaSongOfIceAndFire.java
 instances/SanctumOftheLordsOfDawn/SanctumOftheLordsOfDawn.java
 instances/SecretArea/SecretArea.java
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaDevilsLegacy.java b/L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaDevilsLegacy.java
deleted file mode 100644
index b28409523f..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaDevilsLegacy.java
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J DataPack
- * 
- * This file is part of L2J DataPack.
- * 
- * L2J DataPack is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J DataPack is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package instances.Pailaka;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.l2jserver.gameserver.ThreadPoolManager;
-import com.l2jserver.gameserver.ai.CtrlIntention;
-import com.l2jserver.gameserver.datatables.SkillData;
-import com.l2jserver.gameserver.enums.QuestSound;
-import com.l2jserver.gameserver.instancemanager.InstanceManager;
-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.L2Playable;
-import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.entity.Instance;
-import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
-import com.l2jserver.gameserver.model.quest.Quest;
-import com.l2jserver.gameserver.model.quest.QuestState;
-import com.l2jserver.gameserver.model.quest.State;
-import com.l2jserver.gameserver.model.skills.Skill;
-import com.l2jserver.gameserver.model.zone.L2ZoneType;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
-
-/**
- * Pailaka (Devil's Isle) instance zone.
- */
-public final class PailakaDevilsLegacy extends Quest
-{
-	private static final int MIN_LEVEL = 61;
-	private static final int MAX_LEVEL = 67;
-	private static final int EXIT_TIME = 5;
-	private static final int INSTANCE_ID = 44;
-	protected static final int[] TELEPORT =
-	{
-		76428,
-		-219038,
-		-3752
-	};
-	private static final int ZONE = 20109;
-	
-	private static final int SURVIVOR = 32498;
-	private static final int SUPPORTER = 32501;
-	private static final int ADVENTURER1 = 32508;
-	private static final int ADVENTURER2 = 32511;
-	
-	private static final int KAMS = 18629;
-	private static final int HIKORO = 18630;
-	private static final int ALKASO = 18631;
-	private static final int GERBERA = 18632;
-	private static final int LEMATAN = 18633;
-	private static final int FOLLOWERS = 18634;
-	private static final int TREASURE_BOX = 32495;
-	private static final int POWDER_KEG = 18622;
-	private static final int[] MONSTERS =
-	{
-		KAMS,
-		HIKORO,
-		ALKASO,
-		GERBERA,
-		LEMATAN,
-		FOLLOWERS,
-		TREASURE_BOX,
-		POWDER_KEG,
-		18623,
-		18624,
-		18625,
-		18626,
-		18627
-	};
-	
-	private static final int SWORD = 13042;
-	private static final int ENH_SWORD1 = 13043;
-	private static final int ENH_SWORD2 = 13044;
-	private static final int SCROLL_1 = 13046;
-	private static final int SCROLL_2 = 13047;
-	private static final int HEALING_POTION = 13033;
-	private static final int ANTIDOTE_POTION = 13048;
-	private static final int DIVINE_POTION = 13049;
-	private static final int DEFENCE_POTION = 13059;
-	private static final int PAILAKA_KEY = 13150;
-	
-	private static boolean _isTeleportScheduled = false;
-	private static boolean _isOnShip = false;
-	private static L2Npc _lematanNpc = null;
-	private List<L2Npc> _followerslist;
-	
-	private static final int[] ITEMS =
-	{
-		SWORD,
-		ENH_SWORD1,
-		ENH_SWORD2,
-		SCROLL_1,
-		SCROLL_2,
-		HEALING_POTION,
-		ANTIDOTE_POTION,
-		DIVINE_POTION,
-		DEFENCE_POTION,
-		PAILAKA_KEY
-	};
-	
-	// @formatter:off
-	private static final int[][] DROPLIST =
-	{
-		// must be sorted by npcId !
-		// npcId, itemId, chance, max
-		{ TREASURE_BOX, HEALING_POTION, 20 },
-		{ TREASURE_BOX, DIVINE_POTION, 40 },
-		{ TREASURE_BOX, DEFENCE_POTION, 60 },
-		{ TREASURE_BOX, PAILAKA_KEY, 80 },
-		{ TREASURE_BOX, ANTIDOTE_POTION, 100 }
-	};
-	
-	private static final int[][] HP_HERBS_DROPLIST = 
-	{
-		// itemId, count, chance
-		{ 8602, 1, 10 },
-		{ 8601, 1, 40 },
-		{ 8600, 1, 70 }
-	};
-	
-	private static final int[][] MP_HERBS_DROPLIST =
-	{
-		// itemId, count, chance
-		{ 8605, 1, 10 },
-		{ 8604, 1, 40 },
-		{ 8603, 1, 70 }
-	};
-	
-	private static final int[] REWARDS =
-	{
-		13295,
-		13129
-	};
-	
-	private static final int[][] FOLLOWERS_SPAWNS =
-	{
-		{ 85067, -208943, -3336, 20106, 60 },
-		{ 84904, -208944, -3336, 10904, 60 },
-		{ 85062, -208538, -3336, 44884, 60 },
-		{ 84897, -208542, -3336, 52973, 60 },
-		{ 84808, -208633, -3339, 65039, 60 },
-		{ 84808, -208856, -3339,     0, 60 },
-		{ 85144, -208855, -3341, 33380, 60 },
-		{ 85139, -208630, -3339, 31777, 60 }
-	};
-	// @formatter:on
-	
-	private static Skill boom_skill = SkillData.getInstance().getSkill(5714, 1);
-	private static Skill energy_skill = SkillData.getInstance().getSkill(5712, 1);
-	
-	private PailakaDevilsLegacy()
-	{
-		// TODO change the script to use the actual class name
-		super(129, "129_PailakaDevilsLegacy", "Pailaka - Devil's Legacy");
-		addStartNpc(SURVIVOR);
-		addFirstTalkId(SURVIVOR, SUPPORTER, ADVENTURER1, ADVENTURER2);
-		addTalkId(SURVIVOR, SUPPORTER, ADVENTURER1, ADVENTURER2);
-		addAttackId(TREASURE_BOX, POWDER_KEG, LEMATAN);
-		addKillId(MONSTERS);
-		addEnterZoneId(ZONE);
-		addSpawnId(FOLLOWERS);
-		registerQuestItems(ITEMS);
-	}
-	
-	private void attackPlayer(L2Attackable npc, L2Playable attacker)
-	{
-		npc.setIsRunning(true);
-		npc.addDamageHate(attacker, 0, 999);
-		npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
-	}
-	
-	private static final void dropHerb(L2Npc mob, L2PcInstance player, int[][] drop)
-	{
-		final int chance = getRandom(100);
-		for (int[] element : drop)
-		{
-			if (chance < element[2])
-			{
-				mob.dropItem(player, element[0], element[1]);
-				return;
-			}
-		}
-	}
-	
-	private static final void dropItem(L2Npc mob, L2PcInstance player)
-	{
-		final int npcId = mob.getId();
-		final int chance = getRandom(100);
-		for (int[] drop : DROPLIST)
-		{
-			if (npcId == drop[0])
-			{
-				if (chance < drop[2])
-				{
-					mob.dropItem(player, drop[1], getRandom(1, 6));
-					return;
-				}
-			}
-			if (npcId < drop[0])
-			{
-				return; // not found
-			}
-		}
-	}
-	
-	protected static final void teleportPlayer(L2PcInstance player, int[] coords, int instanceId)
-	{
-		player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
-		player.setInstanceId(instanceId);
-		player.teleToLocation(coords[0], coords[1], coords[2], true);
-	}
-	
-	private final synchronized void enterInstance(L2PcInstance player)
-	{
-		// check for existing instances for this player
-		InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
-		if (world != null)
-		{
-			if (world.getTemplateId() != INSTANCE_ID)
-			{
-				player.sendPacket(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER);
-				return;
-			}
-			Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
-			if (inst != null)
-			{
-				teleportPlayer(player, TELEPORT, world.getInstanceId());
-			}
-			return;
-		}
-		// New instance
-		final int instanceId = InstanceManager.getInstance().createDynamicInstance("PailakaDevilsLegacy.xml");
-		world = new InstanceWorld();
-		world.setInstanceId(instanceId);
-		world.setTemplateId(INSTANCE_ID);
-		InstanceManager.getInstance().addWorld(world);
-		
-		world.addAllowed(player.getObjectId());
-		teleportPlayer(player, TELEPORT, instanceId);
-		
-		_lematanNpc = addSpawn(LEMATAN, 88108, -209252, -3744, 64255, false, 0, false, instanceId);
-		
-	}
-	
-	@Override
-	public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
-	{
-		// Must be here, because of player == null
-		if ((npc.getId() == FOLLOWERS) && event.equals("follower_cast"))
-		{
-			if (!npc.isCastingNow() && !npc.isDead() && !_lematanNpc.isDead())
-			{
-				npc.setTarget(_lematanNpc);
-				npc.doCast(energy_skill);
-			}
-			startQuestTimer("follower_cast", 2000 + getRandom(100, 1000), npc, null);
-			return null;
-		}
-		else if ((npc.getId() == POWDER_KEG) && event.equalsIgnoreCase("keg_trigger"))
-		{
-			onAttack(npc, player, 600, false);
-		}
-		
-		final QuestState st = player.getQuestState(getName());
-		if (st == null)
-		{
-			return getNoQuestMsg(player);
-		}
-		
-		if (event.equalsIgnoreCase("enter"))
-		{
-			enterInstance(player);
-			if (st.isCond(1))
-			{
-				st.setCond(2, true);
-				return "32498-07.htm";
-			}
-			return "32498-09.htm";
-		}
-		else if (event.equalsIgnoreCase("32498-05.htm"))
-		{
-			if (st.isCond(0))
-			{
-				st.startQuest();
-			}
-		}
-		else if (event.equalsIgnoreCase("32501-03.htm"))
-		{
-			if (st.isCond(2))
-			{
-				giveItems(player, SWORD, 1);
-				st.setCond(3, true);
-			}
-		}
-		else if (event.equalsIgnoreCase("lematan_teleport"))
-		{
-			if ((npc.getId() == LEMATAN) && !npc.isMovementDisabled() && !_isOnShip)
-			{
-				// Reduce Hate
-				((L2Attackable) npc).reduceHate(player, 9999);
-				((L2Attackable) npc).abortAttack();
-				((L2Attackable) npc).abortCast();
-				// Broadcast Escape
-				npc.broadcastPacket(new MagicSkillUse(npc, 2100, 1, 1000, 0));
-				// Schedule telport - when Lematan Finish casting
-				startQuestTimer("lematan_finish_teleport", 1500, npc, player);
-			}
-			else
-			{
-				_isTeleportScheduled = false;
-			}
-			return null;
-		}
-		else if ((npc.getId() == LEMATAN) && event.equalsIgnoreCase("lematan_finish_teleport") && !_isOnShip)
-		{
-			// Teleport Lematan
-			npc.teleToLocation(84973, -208721, -3340);
-			// Set onShip
-			_isOnShip = true;
-			// Set Spawn loc to ship. If he loose aggro he should stay on board ;)
-			npc.getSpawn().setX(84973);
-			npc.getSpawn().setY(-208721);
-			npc.getSpawn().setZ(-3340);
-			// To be sure, reduce again
-			((L2Attackable) npc).reduceHate(player, 9999);
-			// Spawn followers
-			_followerslist = new ArrayList<>();
-			for (int[] SPAWN : FOLLOWERS_SPAWNS)
-			{
-				L2Npc follower = addSpawn(FOLLOWERS, SPAWN[0], SPAWN[1], SPAWN[2], SPAWN[3], false, 0, true, player.getInstanceId());
-				if (follower != null)
-				{
-					_followerslist.add(follower);
-				}
-			}
-			return null;
-		}
-		return event;
-	}
-	
-	@Override
-	public final String onFirstTalk(L2Npc npc, L2PcInstance player)
-	{
-		final QuestState st = player.getQuestState(getName());
-		if ((npc.getId() != ADVENTURER2) || (st == null) || !st.isCompleted())
-		{
-			return npc.getId() + ".htm";
-		}
-		return "32511-03.htm";
-	}
-	
-	@Override
-	public final String onTalk(L2Npc npc, L2PcInstance player)
-	{
-		final QuestState st = player.getQuestState(getName());
-		if (st == null)
-		{
-			return getNoQuestMsg(player);
-		}
-		
-		switch (npc.getId())
-		{
-			case SURVIVOR:
-				switch (st.getState())
-				{
-					case State.CREATED:
-						if (player.getLevel() < MIN_LEVEL)
-						{
-							return "32498-11.htm";
-						}
-						if (player.getLevel() > MAX_LEVEL)
-						{
-							return "32498-12.htm";
-						}
-						return "32498-01.htm";
-					case State.STARTED:
-						if (st.getCond() > 1)
-						{
-							return "32498-08.htm";
-						}
-						return "32498-06.htm";
-					case State.COMPLETED:
-						return "32498-10.htm";
-					default:
-						return "32498-01.htm";
-				}
-			case SUPPORTER:
-				if (st.getCond() > 2)
-				{
-					return "32501-04.htm";
-				}
-				return "32501-01.htm";
-			case ADVENTURER1:
-				if (!player.hasSummon())
-				{
-					if (hasQuestItems(player, SWORD))
-					{
-						if (hasQuestItems(player, SCROLL_1))
-						{
-							takeItems(player, SWORD, -1);
-							takeItems(player, SCROLL_1, -1);
-							giveItems(player, ENH_SWORD1, 1);
-							return "32508-03.htm";
-						}
-						return "32508-02.htm";
-					}
-					
-					if (hasQuestItems(player, ENH_SWORD1))
-					{
-						if (hasQuestItems(player, SCROLL_2))
-						{
-							takeItems(player, ENH_SWORD1, -1);
-							takeItems(player, SCROLL_2, -1);
-							giveItems(player, ENH_SWORD2, 1);
-							return "32508-05.htm";
-						}
-						return "32508-04.htm";
-					}
-					
-					if (hasQuestItems(player, ENH_SWORD2))
-					{
-						return "32508-06.htm";
-					}
-					return "32508-00.htm";
-				}
-				return "32508-07.htm";
-			case ADVENTURER2:
-				if (!player.hasSummon())
-				{
-					st.exitQuest(false, true);
-					
-					Instance inst = InstanceManager.getInstance().getInstance(npc.getInstanceId());
-					inst.setDuration(EXIT_TIME * 60000);
-					inst.setEmptyDestroyTime(0);
-					
-					if (inst.containsPlayer(player.getObjectId()))
-					{
-						player.setVitalityPoints(20000, true);
-						addExpAndSp(player, 10800000, 950000);
-						for (int id : REWARDS)
-						{
-							giveItems(player, id, 1);
-						}
-					}
-					return "32511-01.htm";
-				}
-				return "32511-02.htm";
-		}
-		return getNoQuestMsg(player);
-	}
-	
-	@Override
-	public final String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
-	{
-		if ((npc.getId() == POWDER_KEG) && !npc.isDead())
-		{
-			npc.doCast(boom_skill);
-			
-			if (npc.getKnownList() != null)
-			{
-				for (L2Character target : npc.getKnownList().getKnownCharactersInRadius(900))
-				{
-					target.reduceCurrentHp(500 + getRandom(0, 200), npc, boom_skill);
-					
-					if (target instanceof L2MonsterInstance)
-					{
-						if (target.getId() == POWDER_KEG)
-						{
-							startQuestTimer("keg_trigger", 500, (L2Npc) target, attacker);
-						}
-						else
-						{
-							if (isSummon)
-							{
-								attackPlayer((L2Attackable) npc, attacker.getSummon());
-							}
-							else
-							{
-								attackPlayer((L2Attackable) npc, attacker);
-							}
-						}
-					}
-				}
-			}
-			if (!npc.isDead())
-			{
-				npc.doDie(attacker);
-			}
-		}
-		else if ((npc.getId() == LEMATAN) && (npc.getCurrentHp() < (npc.getMaxHp() / 2)) && !_isTeleportScheduled)
-		{
-			startQuestTimer("lematan_teleport", 1000, npc, attacker);
-		}
-		else if (npc.getId() == TREASURE_BOX)
-		{
-			dropItem(npc, attacker);
-			npc.doDie(attacker);
-		}
-		
-		return super.onAttack(npc, attacker, damage, isSummon);
-	}
-	
-	@Override
-	public final String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
-	{
-		final QuestState st = player.getQuestState(getName());
-		if ((st != null) && st.isStarted())
-		{
-			switch (npc.getId())
-			{
-				case KAMS:
-					if (hasQuestItems(player, SWORD))
-					{
-						giveItems(player, SCROLL_1, 1);
-						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
-					}
-					break;
-				case ALKASO:
-					if (hasQuestItems(player, ENH_SWORD1))
-					{
-						giveItems(player, SCROLL_2, 1);
-						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
-					}
-					break;
-				case LEMATAN:
-					if (_followerslist != null)
-					{
-						for (L2Npc _follower : _followerslist)
-						{
-							_follower.deleteMe();
-						}
-						_followerslist.clear();
-					}
-					st.setCond(4, true);
-					addSpawn(ADVENTURER2, 84983, -208736, -3336, 49915, false, 0, false, npc.getInstanceId());
-					break;
-				case POWDER_KEG:
-				case TREASURE_BOX:
-				case FOLLOWERS:
-					// do nothing
-					break;
-				default:
-					// hardcoded herb drops
-					dropHerb(npc, player, HP_HERBS_DROPLIST);
-					dropHerb(npc, player, MP_HERBS_DROPLIST);
-					break;
-			}
-		}
-		return super.onKill(npc, player, isSummon);
-	}
-	
-	@Override
-	public final String onSpawn(L2Npc npc)
-	{
-		startQuestTimer("follower_cast", 1000 + getRandom(100, 1000), npc, null);
-		npc.disableCoreAI(true);
-		return null;
-	}
-	
-	@Override
-	public String onEnterZone(L2Character character, L2ZoneType zone)
-	{
-		if ((character instanceof L2PcInstance) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
-		{
-			InstanceWorld world = InstanceManager.getInstance().getWorld(character.getInstanceId());
-			if ((world != null) && (world.getTemplateId() == INSTANCE_ID))
-			{
-				ThreadPoolManager.getInstance().scheduleGeneral(new Teleport(character, world.getInstanceId()), 1000);
-			}
-		}
-		return super.onEnterZone(character, zone);
-	}
-	
-	static final class Teleport implements Runnable
-	{
-		private final L2Character _char;
-		private final int _instanceId;
-		
-		public Teleport(L2Character c, int id)
-		{
-			_char = c;
-			_instanceId = id;
-		}
-		
-		@Override
-		public void run()
-		{
-			try
-			{
-				teleportPlayer((L2PcInstance) _char, TELEPORT, _instanceId);
-			}
-			catch (Exception e)
-			{
-				e.printStackTrace();
-			}
-		}
-	}
-	
-	public static void main(String[] args)
-	{
-		new PailakaDevilsLegacy();
-	}
-}
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaSongOfIceAndFire.java b/L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaSongOfIceAndFire.java
index 003d9c88e7..0f53d9ea44 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaSongOfIceAndFire.java
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/instances/Pailaka/PailakaSongOfIceAndFire.java
@@ -26,6 +26,7 @@ import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Instance;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
 import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
 import com.l2jserver.gameserver.model.quest.Quest;
 import com.l2jserver.gameserver.model.quest.QuestState;
@@ -188,9 +189,12 @@ public final class PailakaSongOfIceAndFire extends Quest
 	{
 		13294,
 		13293,
-		13129
+		736
 	};
 	
+	// Skills
+	private static SkillHolder VITALITY_REPLENISHING = new SkillHolder(5774, 1);
+	
 	private PailakaSongOfIceAndFire()
 	{
 		// TODO change the script to use the actual class name
@@ -336,7 +340,8 @@ public final class PailakaSongOfIceAndFire extends Quest
 				
 				if (inst.containsPlayer(player.getObjectId()))
 				{
-					player.setVitalityPoints(20000, true);
+					npc.setTarget(player);
+					npc.doCast(VITALITY_REPLENISHING.getSkill());
 					addExpAndSp(player, 810000, 50000);
 					for (int id : REWARDS)
 					{
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/32498-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/32498-01.htm
new file mode 100644
index 0000000000..9d38b7be17
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/32498-01.htm
@@ -0,0 +1,3 @@
+<html><body>Devil's Isle Survivor:<br>
+Keep your eyes open for someone who can help you there. Good luck -- we're all counting on you!<br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/32498-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/32498-02.htm
new file mode 100644
index 0000000000..2028691bc5
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/32498-02.htm
@@ -0,0 +1,3 @@
+<html><body>Devil's Isle Survivor:<br>
+Remember what needs to be done!<br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/PailakaDevilsLegacy.java b/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/PailakaDevilsLegacy.java
new file mode 100644
index 0000000000..aac8aa0c7f
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/instances/PailakaDevilsLegacy/PailakaDevilsLegacy.java
@@ -0,0 +1,335 @@
+/*
+ * Copyright (C) 2004-2014 L2J DataPack
+ * 
+ * This file is part of L2J DataPack.
+ * 
+ * L2J DataPack is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * L2J DataPack is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package instances.PailakaDevilsLegacy;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import quests.Q00129_PailakaDevilsLegacy.Q00129_PailakaDevilsLegacy;
+import ai.npc.AbstractNpcAI;
+
+import com.l2jserver.gameserver.ai.CtrlIntention;
+import com.l2jserver.gameserver.instancemanager.InstanceManager;
+import com.l2jserver.gameserver.model.Location;
+import com.l2jserver.gameserver.model.actor.L2Attackable;
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
+import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
+import com.l2jserver.gameserver.model.quest.QuestState;
+import com.l2jserver.gameserver.model.zone.L2ZoneType;
+import com.l2jserver.gameserver.network.SystemMessageId;
+
+/**
+ * Pailaka Devil's Legacy Instance zone.
+ * @author St3eT
+ */
+public final class PailakaDevilsLegacy extends AbstractNpcAI
+{
+	protected class DIWorld extends InstanceWorld
+	{
+		L2Attackable _lematanNpc = null;
+		List<L2Attackable> _followerslist = new CopyOnWriteArrayList<>();
+	}
+	
+	// NPCs
+	private static final int LEMATAN = 18633; // Lematan
+	private static final int SURVIVOR = 32498; // Devil's Isle Survivor
+	private static final int FOLLOWERS = 18634; // Lematan's Follower
+	private static final int POWDER_KEG = 18622; // Powder Keg
+	private static final int TREASURE_BOX = 32495; // Treasure Chest
+	private static final int ADVENTURER2 = 32511; // Dwarf Adventurer
+	// Items
+	private static final int ANTIDOTE_POTION = 13048; // Pailaka Antidote
+	private static final int DIVINE_POTION = 13049; // Divine Soul
+	private static final int PAILAKA_KEY = 13150; // Pailaka All-Purpose Key
+	private static final int SHIELD = 13032; // Pailaka Instant Shield
+	private static final int DEFENCE_POTION = 13059; // Long-Range Defense Increasing Potion
+	private static final int HEALING_POTION = 13033; // Quick Healing Potion
+	// Skills
+	private static final SkillHolder ENERGY = new SkillHolder(5712, 1); // Energy Ditch
+	private static final SkillHolder BOOM = new SkillHolder(5714, 1); // Boom Up
+	private static final SkillHolder AV_TELEPORT = new SkillHolder(4671, 1); // AV - Teleport
+	// Locations
+	private static final Location TELEPORT = new Location(76427, -219045, -3780);
+	private static final Location LEMATAN_SPAWN = new Location(88108, -209252, -3744, 6425);
+	private static final Location LEMATAN_PORT_POINT = new Location(86116, -209117, -3774);
+	private static final Location LEMATAN_PORT = new Location(85000, -208699, -3336);
+	private static final Location ADVENTURER_LOC = new Location(84983, -208736, -3336, 49915);
+	private static final Location[] FOLLOWERS_LOC =
+	{
+		new Location(85067, -208943, -3336, 20106),
+		new Location(84904, -208944, -3336, 10904),
+		new Location(85062, -208538, -3336, 44884),
+		new Location(84897, -208542, -3336, 52973),
+		new Location(84808, -208633, -3339, 65039),
+		new Location(84808, -208856, -3339, 0),
+		new Location(85144, -208855, -3341, 33380),
+		new Location(85139, -208630, -3339, 31777),
+	};
+	// Misc
+	private static final int INSTANCE_ID = 44;
+	private static final int ZONE = 20109;
+	
+	private PailakaDevilsLegacy()
+	{
+		super(PailakaDevilsLegacy.class.getSimpleName(), "instances");
+		addTalkId(SURVIVOR);
+		addAttackId(POWDER_KEG, TREASURE_BOX, LEMATAN);
+		addKillId(LEMATAN);
+		addSpawnId(FOLLOWERS);
+		addEnterZoneId(ZONE);
+		addMoveFinishedId(LEMATAN);
+	}
+	
+	@Override
+	public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
+		String htmltext = null;
+		
+		if (event.equals("enter"))
+		{
+			final QuestState qs = player.getQuestState(Q00129_PailakaDevilsLegacy.class.getSimpleName());
+			enterInstance(player, "PailakaDevilsLegacy.xml");
+			if (qs.isCond(1))
+			{
+				qs.setCond(2, true);
+				htmltext = "32498-01.htm";
+			}
+			else
+			{
+				htmltext = "32498-02.htm";
+			}
+		}
+		else if ((tmpworld != null) && (tmpworld instanceof DIWorld))
+		{
+			final DIWorld world = (DIWorld) tmpworld;
+			
+			switch (event)
+			{
+				case "FOLLOWER_CAST":
+				{
+					if ((world._lematanNpc != null) && !world._lematanNpc.isDead())
+					{
+						for (L2Attackable follower : world._followerslist)
+						{
+							follower.setTarget(world._lematanNpc);
+							follower.doCast(ENERGY.getSkill());
+						}
+						startQuestTimer("FOLLOWER_CAST", 15000, world._lematanNpc, null);
+					}
+					break;
+				}
+				case "LEMATAN_TELEPORT":
+				{
+					((L2Attackable) npc).clearAggroList();
+					npc.disableCoreAI(false);
+					npc.teleToLocation(LEMATAN_PORT);
+					npc.getVariables().set("ON_SHIP", 1);
+					npc.getSpawn().setLocation(LEMATAN_PORT);
+					for (Location loc : FOLLOWERS_LOC)
+					{
+						final L2Attackable follower = (L2Attackable) addSpawn(FOLLOWERS, loc, false, 0, false, world.getInstanceId());
+						follower.disableCoreAI(true);
+						follower.setIsImmobilized(true);
+						world._followerslist.add(follower);
+					}
+					startQuestTimer("FOLLOWER_CAST", 4000, world._lematanNpc, null);
+					break;
+				}
+				case "TELEPORT":
+				{
+					player.teleToLocation(TELEPORT);
+					break;
+				}
+				case "DELETE":
+				{
+					npc.deleteMe();
+					break;
+				}
+			}
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public final String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
+	{
+		final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
+		
+		if ((tmpworld != null) && (tmpworld instanceof DIWorld))
+		{
+			switch (npc.getId())
+			{
+				case POWDER_KEG:
+				{
+					if ((damage > 0) && npc.isScriptValue(0))
+					{
+						for (L2Character characters : npc.getKnownList().getKnownCharactersInRadius(600))
+						{
+							if ((characters != null) && characters.isMonster())
+							{
+								final L2Attackable monster = (L2Attackable) characters;
+								monster.addDamageHate(npc, 0, 999);
+								monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
+								monster.reduceCurrentHp(500 + getRandom(0, 200), npc, BOOM.getSkill());
+							}
+						}
+						npc.doCast(BOOM.getSkill());
+						npc.setScriptValue(1);
+						startQuestTimer("DELETE", 2000, npc, null);
+					}
+					break;
+				}
+				case LEMATAN:
+				{
+					if (npc.isScriptValue(0) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.5)))
+					{
+						npc.disableCoreAI(true);
+						npc.setScriptValue(1);
+						npc.setIsRunning(true);
+						npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, LEMATAN_PORT_POINT);
+					}
+					break;
+				}
+				case TREASURE_BOX:
+				{
+					if (npc.isScriptValue(0))
+					{
+						switch (getRandom(7))
+						{
+							case 0:
+							case 1:
+							{
+								npc.dropItem(attacker, ANTIDOTE_POTION, getRandom(1, 10));
+								break;
+							}
+							case 2:
+							{
+								npc.dropItem(attacker, DIVINE_POTION, getRandom(1, 5));
+								break;
+							}
+							case 3:
+							{
+								npc.dropItem(attacker, PAILAKA_KEY, getRandom(1, 2));
+								break;
+							}
+							case 4:
+							{
+								npc.dropItem(attacker, DEFENCE_POTION, getRandom(1, 7));
+								break;
+							}
+							case 5:
+							{
+								npc.dropItem(attacker, SHIELD, getRandom(1, 10));
+								break;
+							}
+							case 6:
+							{
+								npc.dropItem(attacker, HEALING_POTION, getRandom(1, 10));
+								break;
+							}
+						}
+						npc.setScriptValue(1);
+						startQuestTimer("DELETE", 3000, npc, attacker);
+					}
+					break;
+				}
+			}
+		}
+		return super.onAttack(npc, attacker, damage, isSummon);
+	}
+	
+	@Override
+	public final String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
+	{
+		final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
+		
+		if ((tmpworld != null) && (tmpworld instanceof DIWorld))
+		{
+			final DIWorld world = (DIWorld) tmpworld;
+			
+			if (world._followerslist != null)
+			{
+				for (L2Npc _follower : world._followerslist)
+				{
+					_follower.deleteMe();
+				}
+				world._followerslist.clear();
+			}
+			addSpawn(ADVENTURER2, ADVENTURER_LOC, false, 0, false, npc.getInstanceId());
+		}
+		return super.onKill(npc, player, isSummon);
+	}
+	
+	@Override
+	public String onEnterZone(L2Character character, L2ZoneType zone)
+	{
+		if ((character.isPlayer()) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
+		{
+			final InstanceWorld world = InstanceManager.getInstance().getWorld(character.getInstanceId());
+			if ((world != null) && (world.getTemplateId() == INSTANCE_ID))
+			{
+				startQuestTimer("TELEPORT", 1000, ((DIWorld) world)._lematanNpc, (L2PcInstance) character);
+			}
+		}
+		return super.onEnterZone(character, zone);
+	}
+	
+	@Override
+	public void onMoveFinished(L2Npc npc)
+	{
+		if (npc.getLocation() == LEMATAN_PORT_POINT)
+		{
+			npc.doCast(AV_TELEPORT.getSkill());
+			startQuestTimer("LEMATAN_TELEPORT", 2000, npc, null);
+		}
+	}
+	
+	private void enterInstance(L2PcInstance player, String template)
+	{
+		InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
+		
+		if (world != null)
+		{
+			if (world instanceof DIWorld)
+			{
+				teleportPlayer(player, TELEPORT, world.getInstanceId());
+				return;
+			}
+			player.sendPacket(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER);
+			return;
+		}
+		world = new DIWorld();
+		world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
+		world.setTemplateId(INSTANCE_ID);
+		InstanceManager.getInstance().addWorld(world);
+		world.addAllowed(player.getObjectId());
+		teleportPlayer(player, TELEPORT, world.getInstanceId());
+		((DIWorld) world)._lematanNpc = (L2Attackable) addSpawn(LEMATAN, LEMATAN_SPAWN, false, 0, false, world.getInstanceId());
+		_log.info("Pailaka Devils Legacy" + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
+	}
+	
+	public static void main(String[] args)
+	{
+		new PailakaDevilsLegacy();
+	}
+}
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-08.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-08.htm
deleted file mode 100644
index b388fdf877..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-08.htm
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<body>Devil's Isle Survivor:<br>
-Do you want to enter Pailaka again? Don't forget what I told you before!<br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy Enter">Enter Pailaka.</a><br>
-</body>
-</html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-09.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-09.htm
deleted file mode 100644
index c86aba226a..0000000000
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-09.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>Devil's Isle Survivor:<br>
-Remember what needs to be done!<br>
-</body>
-</html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-01.htm
similarity index 61%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-01.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-01.htm
index 1940f52996..3b43765536 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-01.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-01.htm
@@ -1,7 +1,5 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 Devil's Isle... Oh, I am the sole survivor from that awful place... I don't want to mislead you -- many adventurers still go to Devil's Isle and return.<br>
 But I am the only one to return from the worst spot on that accursed island: Lematan's Fleet.<br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy 32498-02.htm">Ask about Lematan's Fleet.</a><br>
-</body>
-</html>
\ No newline at end of file
+<a action="bypass -h Quest Q00129_PailakaDevilsLegacy 32498-02.htm">Ask about Lematan's Fleet.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-02.htm
similarity index 76%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-02.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-02.htm
index 26da39d78c..61defe87c1 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-02.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-02.htm
@@ -1,9 +1,7 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 Uh... I suppose I can talk about Lematan's Fleet with someone of your skill and experience...<br>
 Lematan was a pirate who lusted after Zaken's treasure... But instead of making him rich, it brought him only evil.<br>
 As soon as he touched the treasure, a powerful curse was cast about Lematan. He and his men were transformed into something...indescribable.<br>
 And that wasn't the end of it. An unnatural darkness, blacker than black, suddenly arose and swallowed them all. It was like looking into the pit of chaos itself...<br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy 32498-03.htm">Ask him to tell you more.</a><br>
-</body>
-</html>
\ No newline at end of file
+<a action="bypass -h Quest Q00129_PailakaDevilsLegacy 32498-03.htm">Ask him to tell you more.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-03.htm
similarity index 76%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-03.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-03.htm
index f8c9487389..e57eebb106 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-03.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-03.htm
@@ -1,9 +1,7 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 Chaos... That's right. That's the best word I can use to describe it...<br>
 It was like something ripped a hole in reality itself. Both captain and crew were sucked in...<br>
 I later heard that that power is called Kamaloka or Pailaka or somesuch. They say that it will engulf the entire world.<br>
 That's when my nightmares came... Soon after closing my eyes, I dream of strange and horrible monsters who torture me until I wake again. Ah, but the real problem was something else... Do you know what it is?<br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy 32498-04.htm">Ask him to tell you.</a><br>
-</body>
-</html>
\ No newline at end of file
+<a action="bypass -h Quest Q00129_PailakaDevilsLegacy 32498-04.htm">Ask him to tell you.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-04.htm
similarity index 83%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-04.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-04.htm
index 660c29e6e2..5c2023b479 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-04.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-04.htm
@@ -1,10 +1,8 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 I'm not the only one who has these nightmares! And all of us are both emotionally -- and, strangely enough, even physically -- drained upon waking.<br>
 I thought it was this Kamaloka I've heard about, but they say it's something else. It couldn't be entered in the same way as Kamaloka.<br>
 The mages say it's called Pailaka.<br>
 Whatever its name, someone must penetrate it and defeat this coming darkness... I believe you have the ability to set things right. What do you say? Will you do it?<br>
 <font color="LEVEL">(You will be rewarded for your efforts. Vitality points will be granted to you immediately upon completing the quest. If you already have maximum Vitality, you will not gain any additional Vitality.)</font><br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy 32498-05.htm">Say yes.</a><br>
-</body>
-</html>
\ No newline at end of file
+<a action="bypass -h Quest Q00129_PailakaDevilsLegacy 32498-05.htm">Say yes.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-05.htm
similarity index 82%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-05.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-05.htm
index 3dad048b35..2a2ac61e0c 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-05.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-05.htm
@@ -1,4 +1,3 @@
 <html><body>Devil's Isle Survivor:<br>
 Thank you! When you're ready, come find me.<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-06.htm
similarity index 68%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-06.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-06.htm
index 40356f7843..3bf98ab1c4 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-06.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-06.htm
@@ -1,9 +1,7 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 I looked into it while you were gone -- even the scholars can't agree about the nature of Pailaka...<br>
 But most think, as I do, that you should find an ally once you cross over.<br>
 We just don't know the specifics! Stay alert and you'll do fine.<br>
 Now then, we've talked long enough! Ready to go?<br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy Enter">Enter Pailaka.</a><br>
-</body>
-</html>
\ No newline at end of file
+<a action="bypass -h Quest Q00129_PailakaDevilsLegacy enter">Enter Pailaka.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-07.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-07.htm
similarity index 62%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-07.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-07.htm
index bcba7f5db1..9d38b7be17 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-07.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-07.htm
@@ -1,5 +1,3 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 Keep your eyes open for someone who can help you there. Good luck -- we're all counting on you!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-08.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-08.htm
new file mode 100644
index 0000000000..fd679dc427
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-08.htm
@@ -0,0 +1,4 @@
+<html><body>Devil's Isle Survivor:<br>
+Do you want to enter Pailaka again? Don't forget what I told you before!<br>
+<a action="bypass -h Quest PailakaDevilsLegacy enter">Enter Pailaka.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-09.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-09.htm
new file mode 100644
index 0000000000..2028691bc5
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-09.htm
@@ -0,0 +1,3 @@
+<html><body>Devil's Isle Survivor:<br>
+Remember what needs to be done!<br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-10.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-10.htm
similarity index 70%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-10.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-10.htm
index 40a1ac0a4c..f1c19680b8 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-10.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-10.htm
@@ -1,7 +1,5 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 Uh... it was very difficult...<br>
 But thanks to you, I think my nightmares may finally stop... <br>
 (This quest has already been completed)<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-11.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-11.htm
similarity index 74%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-11.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-11.htm
index 8e25cb1ccd..69f3716c73 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-11.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-11.htm
@@ -1,6 +1,4 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 What's the use of knowing more? If you try your luck there now, there'll just be one more corpse: yours!<br>
 (Only characters level 61 and higher may undertake this quest)<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-12.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-12.htm
similarity index 71%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-12.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-12.htm
index f9b8a151cb..8e920609bc 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498-12.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498-12.htm
@@ -1,6 +1,4 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 Why do you want to know? There are better ways to spend your time, believe me!<br>
 (Only characters level 67 and lower may undertake this quest)<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498.htm
similarity index 82%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498.htm
index df3c444f73..4368c3037f 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32498.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32498.htm
@@ -1,8 +1,6 @@
-<html>
-<body>Devil's Isle Survivor:<br>
+<html><body>Devil's Isle Survivor:<br>
 You know about Devil's Isle?<br>
 I guess if you're from around here you must have heard about it... It was the hideout of that legendary pirate king, Zaken -- only the bravest of the brave dare to venture there now.<br>
 But be warned...<br>
 <a action="bypass -h npc_%objectId%_Quest">Quest</a><br>
-</body>
-</html>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-01.htm
similarity index 65%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-01.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-01.htm
index 61abfd3ecf..e4797272af 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-01.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-01.htm
@@ -1,7 +1,5 @@
-<html>
-<body>Devil's Isle Supporter:<br>
+<html><body>Devil's Isle Supporter:<br>
 Some time ago, powerful pirates came from the other side of the sky and occupied Devil's Isle.<br>
 I believe they are the ones who touched Zaken's relic. I don't know what they've done, but since then the monsters have become especially violent -- now nobody can even set foot on the island!<br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy 32501-02.htm">Listen to his story.</a><br>
-</body>
-</html>
\ No newline at end of file
+<a action="bypass -h Quest Q00129_PailakaDevilsLegacy 32501-02.htm">Listen to his story.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-02.htm
similarity index 67%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-02.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-02.htm
index 0f50f2f7e7..f90a987d66 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-02.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-02.htm
@@ -1,7 +1,5 @@
-<html>
-<body>Devil's Isle Supporter:<br>
+<html><body>Devil's Isle Supporter:<br>
 I don't know where they came from. But they occupied Devil's Isle and kicked out all the Humans and Dwarves. We can't just do nothing...<br>
 We must fight them! Here, take this sword. It can summon the <font color="LEVEL">Tigress</font>, our fleet's guardian spirit. She will certainly be able to help you!<br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy 32501-03.htm">Take the sword.</a><br>
-</body>
-</html>
\ No newline at end of file
+<a action="bypass -h Quest Q00129_PailakaDevilsLegacy 32501-03.htm">Take the sword.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-03.htm
similarity index 77%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-03.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-03.htm
index 40b763a0a9..a76e72e85f 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-03.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-03.htm
@@ -1,9 +1,7 @@
-<html>
-<body>Devil's Isle Supporter:<br>
+<html><body>Devil's Isle Supporter:<br>
 This sword is an ancient relic of Devil's Isle. It was used to destroy those who fell under the curse.<br>
 Fearing its power, they were finally able to weaken it by sealing away a few of its powers in a number of scrolls.<br>
 As you use it to defeat our enemies, though, you'll acquire the ability to enhance the weapon to its former strength.<br>
 You should know that there are several Dwarven adventurers also trapped on the island. Take the sword and a Scroll of Enchant Weapon to one of them and they'll make your weapon even more powerful!<br>
-<a action="bypass -h Quest 129_PailakaDevilsLegacy 32501-04.htm">Ask about the enemy.</a><br>
-</body>
-</html>
\ No newline at end of file
+<a action="bypass -h Quest Q00129_PailakaDevilsLegacy 32501-04.htm">Ask about the enemy.</a><br>
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-04.htm
similarity index 85%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-04.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-04.htm
index cdd805fb95..45747e598f 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501-04.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501-04.htm
@@ -1,6 +1,4 @@
-<html>
-<body>Devil's Isle Supporter:<br>
+<html><body>Devil's Isle Supporter:<br>
 The enemies who invaded Devil's Isle are <font color="LEVEL">Lematan's Followers</font>. Four of them are especially dangerous: <font color="LEVEL">Kams, Hikoro, Alkaso and Gerbera</font>. Some of them will have Scrolls of Enchant Weapon.<br>
 Defeat them and you can enhance your sword and Tigress...and eventually become powerful enough to destroy Lematan himself!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501.htm
similarity index 75%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501.htm
index 21b5e214d0..8cc505747e 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32501.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32501.htm
@@ -1,6 +1,4 @@
-<html>
-<body>Devil's Isle Supporter:<br>
+<html><body>Devil's Isle Supporter:<br>
 There's something strange happening on Devil's Isle! Monstrous pirates suddenly appeared and are wreaking havoc everywhere!<br>
 <a action="bypass -h npc_%objectId%_Quest">Quest</a><br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-00.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-00.htm
similarity index 75%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-00.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-00.htm
index 1a2df836ac..a3dc95abfb 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-00.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-00.htm
@@ -1,5 +1,3 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 You will need a special weapon to solve the problems facing us... The <font color="LEVEL">Devil's Isle Supporter</font> is somewhere around here -- go find him!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-01.htm
similarity index 75%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-01.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-01.htm
index 1a2df836ac..a3dc95abfb 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-01.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-01.htm
@@ -1,5 +1,3 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 You will need a special weapon to solve the problems facing us... The <font color="LEVEL">Devil's Isle Supporter</font> is somewhere around here -- go find him!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-02.htm
similarity index 74%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-02.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-02.htm
index 1f4add47f0..87be5488a4 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-02.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-02.htm
@@ -1,5 +1,3 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 Unless you have a Scroll of Enchant Weapon, I can't enchant either your weapon or your pet. Defeat the pirates and bring back the Scroll of Enchant Weapon!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-03.htm
similarity index 83%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-03.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-03.htm
index 036df42c60..1132a5b087 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-03.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-03.htm
@@ -1,6 +1,4 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 Your weapon has been enhanced! In addition to allowing you to summon Tigress, it now also possesses a powerful long-range water attack called <font color="LEVEL">Ice Ball</font>.<br>
 If you wish to enhance the sword a final time, find the last remaining Scroll of Enchant Weapon!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-04.htm
similarity index 58%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-04.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-04.htm
index eae2c39755..b6b1c34ae9 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-04.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-04.htm
@@ -1,5 +1,3 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 Bring back the second Enchant Scroll. I'm sure some pirate thug has it!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-05.htm
similarity index 84%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-05.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-05.htm
index 8017314ac0..f9f65ed412 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-05.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-05.htm
@@ -1,6 +1,4 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 Your weapon has been enhanced! In addition to <font color="LEVEL">Ice Ball</font>, your Complete Ancient Legacy Sword now possesses <font color="LEVEL">Chill Strike</font>, which inflicts a powerful short-range water attack.<br>
 Your Tigress has also been enhanced! She now possesses more power than ever!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-06.htm
similarity index 69%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-06.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-06.htm
index 5532e441eb..7dcf9b1248 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-06.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-06.htm
@@ -1,5 +1,3 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 Your weapon has been enhanced! With this strengthened Ancient Legacy Sword, you're more than a match for any pirate!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-07.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-07.htm
similarity index 80%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-07.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-07.htm
index 198a47ecfd..74cfe293fa 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508-07.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508-07.htm
@@ -1,6 +1,4 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 In order to enhance the sword, Tigress must first be returned to it. Any other summoned pets or servitors will also disrupt the process. Until they have been dismissed, we cannot begin.<br>
 Let me know when you are ready.<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508.htm
similarity index 86%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508.htm
index a52162ca81..0145b82518 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32508.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32508.htm
@@ -1,7 +1,5 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 Ah, an adventurer who wields the Ancient Legacy Sword has finally come! Since you have made it this far, I will place my trust in you as well!<br>
 If you have the <font color="LEVEL">Pailaka Scroll of Enchant Weapon</font>, I will enhance both your Ancient Legacy Sword and your Tigress!<br>
 <a action="bypass -h npc_%objectId%_Quest">Enhance your weapon.</a>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-01.htm
similarity index 86%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-01.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-01.htm
index 9c49932474..8ec5bfb791 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-01.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-01.htm
@@ -1,8 +1,6 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 Thanks! Is it my imagination, or did your body just become a bit blurry?<br>
 You don't look like you're from around here... Am I right? You appeared just as suddenly as those pirates!<br>
 Anyway, thank you. Please take these gifts.<br>
 Among them is a magic item capable of returning you to your world. Use the Scroll of Escape to leave Pailaka and return to where you belong!<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-02.htm
similarity index 63%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-02.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-02.htm
index 81847c565d..d1f662afbe 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-02.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-02.htm
@@ -1,5 +1,3 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 After dismissing Tigress, please do the same with any other summoned pets or servitors.<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-03.htm
similarity index 56%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-03.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-03.htm
index 948986ebe0..b3294e70fb 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511-03.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511-03.htm
@@ -1,5 +1,3 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 Use the Scroll of Escape that I gave you to return to your world.<br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511.htm
similarity index 87%
rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511.htm
index 9b5250b9f7..a48bc52c29 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/129_PailakaDevilsLegacy/32511.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/32511.htm
@@ -1,7 +1,5 @@
-<html>
-<body>Dwarf Adventurer:<br>
+<html><body>Dwarf Adventurer:<br>
 That cursed pirate has finally fallen! Now I must ask you to return the sword. It is also a legacy of this place, so if you take it away -- even by mistake -- you will incur the curse of Devil's Isle.<br>
 <font color="LEVEL">If your Tigress is beside you, return her to the sword before giving it to me.</font><br>
 <a action="bypass -h npc_%objectId%_Quest">Return the sword.</a><br>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/Q00129_PailakaDevilsLegacy.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/Q00129_PailakaDevilsLegacy.java
new file mode 100644
index 0000000000..9dd2cbfdf9
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00129_PailakaDevilsLegacy/Q00129_PailakaDevilsLegacy.java
@@ -0,0 +1,317 @@
+/*
+ * Copyright (C) 2004-2014 L2J DataPack
+ * 
+ * This file is part of L2J DataPack.
+ * 
+ * L2J DataPack is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * L2J DataPack is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package quests.Q00129_PailakaDevilsLegacy;
+
+import com.l2jserver.gameserver.enums.QuestSound;
+import com.l2jserver.gameserver.instancemanager.InstanceManager;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.Instance;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
+import com.l2jserver.gameserver.model.quest.Quest;
+import com.l2jserver.gameserver.model.quest.QuestState;
+import com.l2jserver.gameserver.model.quest.State;
+
+/**
+ * Pailaka - Devil's Legacy (129)
+ * @author Gnacik, St3eT
+ */
+public final class Q00129_PailakaDevilsLegacy extends Quest
+{
+	// NPCs
+	private static final int KAMS = 18629; // Kams (Panuka)
+	private static final int ALKASO = 18631; // Alkaso (Panuka)
+	private static final int LEMATAN = 18633; // Lematan
+	private static final int SURVIVOR = 32498; // Devil's Isle Survivor
+	private static final int SUPPORTER = 32501; // Devil's Isle Supporter
+	private static final int ADVENTURER1 = 32508; // Dwarf Adventurer
+	private static final int ADVENTURER2 = 32511; // Dwarf Adventurer
+	// Items
+	private static final int SWORD = 13042; // Ancient Legacy Sword
+	private static final int ENH_SWORD1 = 13043; // Enhanced Ancient Legacy Sword
+	private static final int ENH_SWORD2 = 13044; // Complete Ancient Legacy Sword
+	private static final int SCROLL_1 = 13046; // Pailaka Weapon Upgrade Stage 1
+	private static final int SCROLL_2 = 13047; // Pailaka Weapon Upgrade Stage 2
+	private static final int SHIELD = 13032; // Pailaka Instant Shield
+	private static final int HEALING_POTION = 13033; // Quick Healing Potion
+	private static final int ANTIDOTE_POTION = 13048; // Pailaka Antidote
+	private static final int DIVINE_POTION = 13049; // Divine Soul
+	private static final int DEFENCE_POTION = 13059; // Long-Range Defense Increasing Potion
+	private static final int PAILAKA_KEY = 13150; // Pailaka All-Purpose Key
+	private static final int BRACELET = 13295; // Pailaka Bracelet
+	private static final int ESCAPE = 736; // Scroll of Escape
+	// Skills
+	private static final SkillHolder VITALITY_REPLENISHING = new SkillHolder(5774, 2); // Pailaka Reward Vitality Replenishing
+	// Misc
+	private static final int MIN_LEVEL = 61;
+	private static final int MAX_LEVEL = 67;
+	private static final int EXIT_TIME = 5;
+	
+	public Q00129_PailakaDevilsLegacy()
+	{
+		super(129, Q00129_PailakaDevilsLegacy.class.getSimpleName(), "Pailaka - Devil's Legacy");
+		addStartNpc(SURVIVOR);
+		addFirstTalkId(SURVIVOR, SUPPORTER, ADVENTURER1, ADVENTURER2);
+		addTalkId(SURVIVOR, SUPPORTER, ADVENTURER1, ADVENTURER2);
+		addKillId(KAMS, ALKASO, LEMATAN);
+		registerQuestItems(SWORD, ENH_SWORD1, ENH_SWORD2, SCROLL_1, SCROLL_2, SHIELD, HEALING_POTION, ANTIDOTE_POTION, DIVINE_POTION, DEFENCE_POTION, PAILAKA_KEY);
+	}
+	
+	@Override
+	public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		final QuestState qs = getQuestState(player, false);
+		String htmltext = null;
+		
+		if (qs == null)
+		{
+			return getNoQuestMsg(player);
+		}
+		
+		switch (event)
+		{
+			case "32498-02.htm":
+			case "32498-03.htm":
+			case "32498-04.htm":
+			{
+				htmltext = event;
+				break;
+			}
+			case "32498-05.htm":
+			{
+				if (qs.isCond(0))
+				{
+					htmltext = event;
+					qs.startQuest();
+				}
+				break;
+			}
+			case "32501-02.htm":
+			case "32501-04.htm":
+			{
+				htmltext = event;
+				break;
+			}
+			case "32501-03.htm":
+			{
+				if (qs.isCond(2))
+				{
+					giveItems(player, SWORD, 1);
+					qs.setCond(3, true);
+					htmltext = event;
+				}
+				break;
+			}
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public final String onFirstTalk(L2Npc npc, L2PcInstance player)
+	{
+		final QuestState qs = getQuestState(player, false);
+		if ((npc.getId() != ADVENTURER2) || (qs == null) || !qs.isCompleted())
+		{
+			return npc.getId() + ".htm";
+		}
+		return "32511-03.htm";
+	}
+	
+	@Override
+	public final String onTalk(L2Npc npc, L2PcInstance player)
+	{
+		String htmltext = getNoQuestMsg(player);
+		final QuestState qs = getQuestState(player, true);
+		if (qs == null)
+		{
+			return getNoQuestMsg(player);
+		}
+		
+		switch (npc.getId())
+		{
+			case SURVIVOR:
+			{
+				switch (qs.getState())
+				{
+					case State.CREATED:
+					{
+						if (player.getLevel() < MIN_LEVEL)
+						{
+							htmltext = "32498-11.htm";
+						}
+						else if (player.getLevel() > MAX_LEVEL)
+						{
+							htmltext = "32498-12.htm";
+						}
+						else
+						{
+							htmltext = "32498-01.htm";
+						}
+						break;
+					}
+					case State.STARTED:
+					{
+						if (qs.getCond() > 1)
+						{
+							htmltext = "32498-08.htm";
+						}
+						else
+						{
+							htmltext = "32498-06.htm";
+						}
+						break;
+					}
+					case State.COMPLETED:
+					{
+						htmltext = "32498-10.htm";
+						break;
+					}
+					default:
+					{
+						htmltext = "32498-01.htm";
+						break;
+					}
+				}
+				break;
+			}
+			case SUPPORTER:
+			{
+				if (qs.getCond() > 2)
+				{
+					htmltext = "32501-04.htm";
+				}
+				else
+				{
+					htmltext = "32501-01.htm";
+				}
+				break;
+			}
+			case ADVENTURER1:
+			{
+				if (player.hasSummon())
+				{
+					htmltext = "32508-07.htm";
+				}
+				else if (hasQuestItems(player, SWORD))
+				{
+					if (hasQuestItems(player, SCROLL_1))
+					{
+						takeItems(player, SWORD, -1);
+						takeItems(player, SCROLL_1, -1);
+						giveItems(player, ENH_SWORD1, 1);
+						htmltext = "32508-03.htm";
+					}
+					else
+					{
+						htmltext = "32508-02.htm";
+					}
+				}
+				else if (hasQuestItems(player, ENH_SWORD1))
+				{
+					if (hasQuestItems(player, SCROLL_2))
+					{
+						takeItems(player, ENH_SWORD1, -1);
+						takeItems(player, SCROLL_2, -1);
+						giveItems(player, ENH_SWORD2, 1);
+						htmltext = "32508-05.htm";
+					}
+					htmltext = "32508-04.htm";
+				}
+				else if (hasQuestItems(player, ENH_SWORD2))
+				{
+					htmltext = "32508-06.htm";
+				}
+				else
+				{
+					htmltext = "32508-00.htm";
+				}
+				
+				break;
+			}
+			case ADVENTURER2:
+			{
+				if (player.hasSummon())
+				{
+					htmltext = "32511-02.htm";
+				}
+				else
+				{
+					final Instance inst = InstanceManager.getInstance().getInstance(npc.getInstanceId());
+					qs.exitQuest(false, true);
+					inst.setDuration(EXIT_TIME * 60000);
+					inst.setEmptyDestroyTime(0);
+					if (inst.containsPlayer(player.getObjectId()))
+					{
+						npc.setTarget(player);
+						npc.doCast(VITALITY_REPLENISHING.getSkill());
+						addExpAndSp(player, 10800000, 950000);
+						rewardItems(player, BRACELET, 1);
+						rewardItems(player, ESCAPE, 1);
+					}
+					else
+					{
+						htmltext = "32511-01.htm";
+					}
+				}
+				break;
+			}
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public final String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
+	{
+		final QuestState qs = getQuestState(player, false);
+		
+		if ((qs != null) && qs.isStarted())
+		{
+			switch (npc.getId())
+			{
+				case KAMS:
+				{
+					if (hasQuestItems(player, SWORD))
+					{
+						giveItems(player, SCROLL_1, 1);
+						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
+					}
+					break;
+				}
+				case ALKASO:
+				{
+					if (hasQuestItems(player, ENH_SWORD1))
+					{
+						giveItems(player, SCROLL_2, 1);
+						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
+					}
+					break;
+				}
+				case LEMATAN:
+				{
+					if (qs.isCond(3))
+					{
+						qs.setCond(4, true);
+					}
+					break;
+				}
+			}
+		}
+		return super.onKill(npc, player, isSummon);
+	}
+}
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java
index 8f5de97297..601d4f00ea 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java
@@ -92,6 +92,7 @@ import quests.Q00122_OminousNews.Q00122_OminousNews;
 import quests.Q00124_MeetingTheElroki.Q00124_MeetingTheElroki;
 import quests.Q00125_TheNameOfEvil1.Q00125_TheNameOfEvil1;
 import quests.Q00126_TheNameOfEvil2.Q00126_TheNameOfEvil2;
+import quests.Q00129_PailakaDevilsLegacy.Q00129_PailakaDevilsLegacy;
 import quests.Q00131_BirdInACage.Q00131_BirdInACage;
 import quests.Q00132_MatrasCuriosity.Q00132_MatrasCuriosity;
 import quests.Q00134_TempleMissionary.Q00134_TempleMissionary;
@@ -451,6 +452,7 @@ public class QuestMasterHandler
 		Q00124_MeetingTheElroki.class,
 		Q00125_TheNameOfEvil1.class,
 		Q00126_TheNameOfEvil2.class,
+		Q00129_PailakaDevilsLegacy.class,
 		Q00131_BirdInACage.class,
 		Q00132_MatrasCuriosity.class,
 		Q00134_TempleMissionary.class,
diff --git a/L2J_DataPack_BETA/dist/sql/game/updates/20140531update.sql b/L2J_DataPack_BETA/dist/sql/game/updates/20140531update.sql
new file mode 100644
index 0000000000..89d0205f30
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/sql/game/updates/20140531update.sql
@@ -0,0 +1 @@
+UPDATE character_quests SET name='Q00129_PailakaDevilsLegacy' WHERE name='129_PailakaDevilsLegacy';
\ No newline at end of file
-- 
GitLab