From a62e18b5dda1f1074baf523632f8fda6a1ebad97 Mon Sep 17 00:00:00 2001
From: nonom <nonom@users.noreply.github.com>
Date: Sun, 2 Sep 2012 18:33:46 +0000
Subject: [PATCH] BETA: Monastery AI rework.  * Updated Npcs and NpcStrings.  *
 Solina Monks should not attack disarmed/invisible players.  * Solina Knights
 are training now.  * Added Gumiel AI and Q00457 Lost And Found.

---
 L2J_DataPack_BETA/dist/game/data/scripts.cfg  |   1 +
 .../scripts/ai/group_template/Monastery.java  | 217 ++++++++--------
 .../quests/Q00457_LostAndFound/32759-01.htm   |   5 +
 .../quests/Q00457_LostAndFound/32759-01a.html |   3 +
 .../quests/Q00457_LostAndFound/32759-02.html  |   5 +
 .../quests/Q00457_LostAndFound/32759-03.html  |   4 +
 .../quests/Q00457_LostAndFound/32759-04.html  |   5 +
 .../quests/Q00457_LostAndFound/32759-05.html  |   5 +
 .../quests/Q00457_LostAndFound/32759-06.html  |   3 +
 .../quests/Q00457_LostAndFound/32759-07.html  |   3 +
 .../quests/Q00457_LostAndFound/32759-08.html  |   3 +
 .../quests/Q00457_LostAndFound/32759-09.html  |   3 +
 .../quests/Q00457_LostAndFound/32759.html     |   5 +
 .../Q00457_LostAndFound.java                  | 242 ++++++++++++++++++
 L2J_DataPack_BETA/dist/sql/game/npcaidata.sql |  10 +-
 L2J_DataPack_BETA/dist/sql/game/spawnlist.sql |   3 +
 16 files changed, 410 insertions(+), 107 deletions(-)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-01.htm
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-01a.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-02.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-03.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-04.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-05.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-06.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-07.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-08.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-09.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759.html
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/Q00457_LostAndFound.java

diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg
index 6729aee96f..a7eac3837c 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg
+++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg
@@ -590,6 +590,7 @@ quests/450_GraveRobberMemberRescue/__init__.py
 quests/451_LuciensAltar/__init__.py
 quests/Q00452_FindingtheLostSoldiers/Q00452_FindingtheLostSoldiers.java
 quests/Q00453_NotStrongEnoughAlone/Q00453_NotStrongEnoughAlone.java
+quests/Q00457_LostAndFound/Q00457_LostAndFound.java
 quests/Q00458_PerfectForm/Q00458_PerfectForm.java
 quests/Q00461_RumbleInTheBase/Q00461_RumbleInTheBase.java
 quests/Q00463_IMustBeaGenius/Q00463_IMustBeaGenius.java
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/Monastery.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/Monastery.java
index acb5f18316..e308af0148 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/Monastery.java
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/Monastery.java
@@ -14,21 +14,17 @@
  */
 package ai.group_template;
 
-import java.util.Collection;
-
-import javolution.util.FastList;
 import ai.npc.AbstractNpcAI;
 
 import com.l2jserver.gameserver.ai.CtrlIntention;
-import com.l2jserver.gameserver.datatables.SkillTable;
+import com.l2jserver.gameserver.datatables.SpawnTable;
 import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.L2Spawn;
 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.L2Summon;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
 import com.l2jserver.gameserver.model.skills.L2Skill;
 import com.l2jserver.gameserver.model.skills.L2SkillType;
 import com.l2jserver.gameserver.network.NpcStringId;
@@ -38,69 +34,124 @@ import com.l2jserver.gameserver.util.Util;
 
 /**
  * Monastery AI.
- * @author Kerberos
+ * @author Kerberos, nonom
  */
 public class Monastery extends AbstractNpcAI
 {
-	private static final int[] MOBS1 =
+	private static final int CAPTAIN = 18910;
+	private static final int KNIGHT = 18909;
+	private static final int SCARECROW = 18912;
+	
+	private static final int[] SOLINA_CLAN =
+	{
+		22789, // Guide Solina
+		22790, // Seeker Solina
+		22791, // Savior Solina
+		22793, // Ascetic Solina
+	};
+	
+	private static final int[] DIVINITY_CLAN =
 	{
-		22124,
-		22125,
-		22126,
-		22127,
-		22129
+		22794, // Divinity Judge
+		22795, // Divinity Manager
 	};
-	private static final int[] MOBS2 =
+
+	private static final NpcStringId[] SOLINA_KNIGHTS_MSG =
 	{
-		22134,
-		22135
+		NpcStringId.PUNISH_ALL_THOSE_WHO_TREAD_FOOTSTEPS_IN_THIS_PLACE,
+		NpcStringId.WE_ARE_THE_SWORD_OF_TRUTH_THE_SWORD_OF_SOLINA,
+		NpcStringId.WE_RAISE_OUR_BLADES_FOR_THE_GLORY_OF_SOLINA
 	};
 	
-	private static final NpcStringId[] MESSAGES =
+	private static final NpcStringId[] DIVINITY_MSG =
 	{
-		NpcStringId.YOU_CANNOT_CARRY_A_WEAPON_WITHOUT_AUTHORIZATION,
 		NpcStringId.S1_WHY_WOULD_YOU_CHOOSE_THE_PATH_OF_DARKNESS,
 		NpcStringId.S1_HOW_DARE_YOU_DEFY_THE_WILL_OF_EINHASAD
 	};
 	
+	private static final SkillHolder DECREASE_SPEED = new SkillHolder(4589, 8);
+	
 	private Monastery(String name, String descr)
 	{
 		super(name, descr);
-		registerMobs(MOBS1, QuestEventType.ON_AGGRO_RANGE_ENTER, QuestEventType.ON_SPAWN, QuestEventType.ON_SPELL_FINISHED);
-		registerMobs(MOBS2, QuestEventType.ON_SKILL_SEE);
+		addAggroRangeEnterId(SOLINA_CLAN);
+		addAggroRangeEnterId(CAPTAIN, KNIGHT);
+		addSpellFinishedId(SOLINA_CLAN);
+		addSkillSeeId(DIVINITY_CLAN);
+		addAttackId(KNIGHT, CAPTAIN);
+		addSpawnId(KNIGHT);
+		
+		for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
+		{
+			switch (spawn.getNpcid())
+			{
+				case KNIGHT:
+					startQuestTimer("training", 5000, spawn.getLastSpawn(), null, true);
+					break;
+				case SCARECROW:
+					spawn.getLastSpawn().setIsInvul(true);
+					spawn.getLastSpawn().disableCoreAI(true);
+					break;
+			}
+		}
 	}
 	
 	@Override
-	public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
 	{
-		if (Util.contains(MOBS1, npc.getNpcId()) && !npc.isInCombat() && (npc.getTarget() == null))
+		switch (event)
 		{
-			if (player.getActiveWeaponInstance() != null)
-			{
-				npc.setTarget(player);
-				npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getNpcId(), MESSAGES[0]));
-				switch (npc.getNpcId())
+			case "training":
+				if (!npc.isInCombat() && getRandom(100) < 25)
 				{
-					case 22124:
-					case 22126:
-					{
-						L2Skill skill = SkillTable.getInstance().getInfo(4589, 8);
-						npc.doCast(skill);
-						break;
-					}
-					default:
+					for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(300))
 					{
-						npc.setIsRunning(true);
-						((L2Attackable) npc).addDamageHate(player, 0, 999);
-						npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-						break;
+						if (!character.isPlayable() && (((L2Npc) character).getNpcId() == SCARECROW))
+						{
+							for (L2Skill skill : npc.getAllSkills())
+							{
+								if (skill.isActive())
+								{
+									npc.disableSkill(skill, 0);
+								}
+							}
+							npc.setRunning();
+							((L2Attackable) npc).addDamageHate(character, 0, 100);
+							npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null);
+							break;
+						}
 					}
 				}
-			}
-			else if (((L2Attackable) npc).getMostHated() == null)
+		}
+		return super.onAdvEvent(event, npc, player);
+	}
+	
+	@Override
+	public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
+	{
+		if (player.getActiveWeaponInstance() == null)
+		{
+			npc.setTarget(null);
+			((L2Attackable) npc).disableAllSkills();
+			npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
+			return super.onAggroRangeEnter(npc, player, isPet);
+		}
+		
+		if (player.isVisible() && !player.isGM())
+		{
+			npc.setRunning();
+			npc.setTarget(player);
+			((L2Attackable) npc).enableAllSkills();
+			if (Util.contains(SOLINA_CLAN, npc.getNpcId()))
 			{
-				return null;
+				if (getRandom(10) < 3)
+				{
+					broadcastNpcSay(npc, Say2.ALL, NpcStringId.YOU_CANNOT_CARRY_A_WEAPON_WITHOUT_AUTHORIZATION);
+				}
+				npc.doCast(DECREASE_SPEED.getSkill());
 			}
+			((L2Attackable) npc).addDamageHate(player, 0, 100);
+			npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player, null);
 		}
 		return super.onAggroRangeEnter(npc, player, isPet);
 	}
@@ -108,21 +159,18 @@ public class Monastery extends AbstractNpcAI
 	@Override
 	public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
 	{
-		if (Util.contains(MOBS2, npc.getNpcId()))
+		if ((skill.getSkillType() == L2SkillType.AGGDAMAGE) && (targets.length != 0))
 		{
-			if ((skill.getSkillType() == L2SkillType.AGGDAMAGE) && (targets.length != 0))
+			for (L2Object obj : targets)
 			{
-				for (L2Object obj : targets)
+				if (obj.equals(npc))
 				{
-					if (obj.equals(npc))
-					{
-						NpcSay packet = new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getNpcId(), MESSAGES[getRandom(2) + 1]);
-						packet.addStringParameter(caster.getName());
-						npc.broadcastPacket(packet);
-						((L2Attackable) npc).addDamageHate(caster, 0, 999);
-						npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
-						break;
-					}
+					NpcSay packet = new NpcSay(npc.getObjectId(), Say2.ALL, npc.getNpcId(), DIVINITY_MSG[getRandom(1)]);
+					packet.addStringParameter(caster.getName());
+					npc.broadcastPacket(packet);
+					((L2Attackable) npc).addDamageHate(caster, 0, 999);
+					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
+					break;
 				}
 			}
 		}
@@ -130,61 +178,26 @@ public class Monastery extends AbstractNpcAI
 	}
 	
 	@Override
-	public String onSpawn(L2Npc npc)
+	public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isPet)
 	{
-		if (Util.contains(MOBS1, npc.getNpcId()))
+		if (getRandom(10) < 1)
 		{
-			FastList<L2Playable> result = new FastList<>();
-			Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
-			for (L2Object obj : objs)
-			{
-				if ((obj instanceof L2PcInstance) || (obj instanceof L2PetInstance))
-				{
-					if (Util.checkIfInRange(npc.getAggroRange(), npc, obj, true) && !((L2Character) obj).isDead())
-					{
-						result.add((L2Playable) obj);
-					}
-				}
-			}
-			if (!result.isEmpty() && (result.size() != 0))
-			{
-				Object[] characters = result.toArray();
-				for (Object obj : characters)
-				{
-					L2Playable target = (L2Playable) (obj instanceof L2PcInstance ? obj : ((L2Summon) obj).getOwner());
-					if ((target.getActiveWeaponInstance() != null) && !npc.isInCombat() && (npc.getTarget() == null))
-					{
-						npc.setTarget(target);
-						npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getNpcId(), MESSAGES[0]));
-						switch (npc.getNpcId())
-						{
-							case 22124:
-							case 22126:
-							case 22127:
-							{
-								L2Skill skill = SkillTable.getInstance().getInfo(4589, 8);
-								npc.doCast(skill);
-								break;
-							}
-							default:
-							{
-								npc.setIsRunning(true);
-								((L2Attackable) npc).addDamageHate(target, 0, 999);
-								npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
-								break;
-							}
-						}
-					}
-				}
-			}
+			broadcastNpcSay(npc, Say2.ALL, SOLINA_KNIGHTS_MSG[getRandom(2)]);
 		}
+		return super.onAttack(npc, player, damage, isPet);
+	}
+	
+	@Override
+	public String onSpawn(L2Npc npc)
+	{
+		broadcastNpcSay(npc, Say2.ALL, NpcStringId.FOR_THE_GLORY_OF_SOLINA);
 		return super.onSpawn(npc);
 	}
 	
 	@Override
 	public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
 	{
-		if (Util.contains(MOBS1, npc.getNpcId()) && (skill.getId() == 4589))
+		if (skill.getId() == DECREASE_SPEED.getSkillId())
 		{
 			npc.setIsRunning(true);
 			((L2Attackable) npc).addDamageHate(player, 0, 999);
@@ -195,6 +208,6 @@ public class Monastery extends AbstractNpcAI
 	
 	public static void main(String[] args)
 	{
-		new Monastery(Monastery.class.getSimpleName(), "ai");
+		new Monastery(Monastery.class.getSimpleName(), "ai/group_template");
 	}
 }
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-01.htm
new file mode 100644
index 0000000000..9c36277227
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-01.htm
@@ -0,0 +1,5 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Ah, so my eyes do not deceive me! You are real, aren't you? And you don't look like one of those bloody monks, thank goodness. I've got a story to tell, if you'd listen. Thing is... I'm in disguise. I snuck into this Monastery because I heard there was a great treasure here but I'm so lost I was starting to fear I'd end up hunkered down in a corner and eventually end up a bag of bones for all time.<br>
+You look like you still have your wits about you, you might be able to help me out. Could you show me the way? Please?!<br>
+<a action="bypass -h Quest Q00457_LostAndFound 32759-04.html">"Okay. I will do that."</a>
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-01a.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-01a.html
new file mode 100644
index 0000000000..b42701f22d
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-01a.html
@@ -0,0 +1,3 @@
+<html><body>Treasure hunter Gumiel:<br>
+Well this is a strange problem to have. Someone is actually helping me out of this labyrinth right now. And I don't know if they'll like me talking to anyone, so please don't.
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-02.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-02.html
new file mode 100644
index 0000000000..619b533ecf
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-02.html
@@ -0,0 +1,5 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Hm... could it be over here? I think I saw that column before. In fact I'm sure of it. Blast, how do I tell the difference between a real wall and a fake wall!<br>
+Oh, sorry, you have that look of someone who needs help but I really can't. I mean, don't I look pretty busy right now? Sheez.<br>
+(This is a quest that can be taken once a day. It resets at 6:30am.)
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-03.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-03.html
new file mode 100644
index 0000000000..e010bb79ad
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-03.html
@@ -0,0 +1,4 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Guh, OK, I know I've been in this room before, because I've seen that ugly painting and smelled that stinky monk. Seriously, that one monk stinks so bad, he's become a landmark in this place for a treasure hunter like me. They say to follow your nose, but I never really took that saying seriously...<br>
+(Only characters level 82 and above can take this quest.)
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-04.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-04.html
new file mode 100644
index 0000000000..2a98f264aa
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-04.html
@@ -0,0 +1,5 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Oh thank you so much! I don't care which exit, west or east, just as long as I get out of here.<br>
+<a action="bypass -h Quest Q00457_LostAndFound 32759-06.html">"Follow me then, and don't get lost."</a><br>
+<a action="bypass -h Quest Q00457_LostAndFound 32759-05.html">"OK but wait a moment while I prepare."</a>
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-05.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-05.html
new file mode 100644
index 0000000000..6b5b0b9be8
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-05.html
@@ -0,0 +1,5 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Seriously, I don't care which exit, I just want out of here. I NEED out of here. PLEASE.<br>
+<a action="bypass -h Quest Q00457_LostAndFound 32759-06.html">"Then, follow me."</a><br>
+<a action="bypass -h Quest Q00457_LostAndFound 32759-07.html">"OK but wait a moment while I prepare."</a>
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-06.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-06.html
new file mode 100644
index 0000000000..ff4e4742de
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-06.html
@@ -0,0 +1,3 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Phew alright! Let's get going!
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-07.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-07.html
new file mode 100644
index 0000000000..e12be2d166
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-07.html
@@ -0,0 +1,3 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Alright alright, I'll wait. But just for you!
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-08.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-08.html
new file mode 100644
index 0000000000..da4e07c972
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-08.html
@@ -0,0 +1,3 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Oh man... how much longer 'til we get there? I'm getting seriously thirsty. Maybe we should ask for directions? Ugh, I hope there's a bathroom around here somewhere.
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-09.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-09.html
new file mode 100644
index 0000000000..1584a7e648
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759-09.html
@@ -0,0 +1,3 @@
+<html><body>Treasure Hunter Gumiel:<br>
+Wow, great! We finally got out of that place! If I never see a monk again, it'll be too soon. Following rumors can be dangerous, eh? Well anyway, I did find SOMETHING that seems valuable, but since you helped me out of there, I think you deserve it.
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759.html
new file mode 100644
index 0000000000..5d897d36d7
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/32759.html
@@ -0,0 +1,5 @@
+<html><body>Treasure Hunter Gumiel<br>
+Oh crap... I think I took a wrong turn back there... ugh, no treasure's worth this! And these monks, they're all so terribly weird. I'm sure you've had problems here too. Without food and rest, you're liable to pass out.<br>
+Maybe, I should leave this place... anyway, what brought you here?<br>
+<a action="bypass -h npc_%objectId%_Quest Q00457_LostAndFound">Quest</a>
+</body></html>
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/Q00457_LostAndFound.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/Q00457_LostAndFound.java
new file mode 100644
index 0000000000..f4f4e69d1c
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00457_LostAndFound/Q00457_LostAndFound.java
@@ -0,0 +1,242 @@
+/*
+ * 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 quests.Q00457_LostAndFound;
+
+import com.l2jserver.gameserver.ai.CtrlIntention;
+import com.l2jserver.gameserver.datatables.SpawnTable;
+import com.l2jserver.gameserver.model.L2Spawn;
+import com.l2jserver.gameserver.model.Location;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.quest.Quest;
+import com.l2jserver.gameserver.model.quest.QuestState;
+import com.l2jserver.gameserver.model.quest.QuestState.QuestType;
+import com.l2jserver.gameserver.model.quest.State;
+import com.l2jserver.gameserver.network.NpcStringId;
+import com.l2jserver.gameserver.network.clientpackets.Say2;
+import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
+
+/**
+ * Lost and Found (457)
+ * @author nonom
+ */
+public final class Q00457_LostAndFound extends Quest
+{
+	private static final int GUMIEL = 32759;
+	private static final int ESCORT_CHECKER = 32764;
+	private static final int[] SOLINA_CLAN =
+	{
+		22789, // Guide Solina
+		22790, // Seeker Solina
+		22791, // Savior Solina
+		22793, // Ascetic Solina
+	};
+	
+	private static final int PACKAGED_BOOK = 15716;
+	
+	private static final int CHANCE_SPAWN = 1; // 1%
+	
+	private static int _count = 0;
+	private static L2Npc[] _escortCheckers = new L2Npc[2];
+	private static L2Npc _gumiel = null;
+	
+	@Override
+	public String onFirstTalk(L2Npc npc, L2PcInstance player)
+	{
+		if (npc.getTarget() != null)
+		{
+			if (npc.getTarget().equals(player))
+			{
+				return "32759-08.html";
+			}
+			else if (_gumiel != null)
+			{
+				return "32759-01a.html";
+			}
+		}
+		return "32759.html";
+	}
+	
+	@Override
+	public String onTalk(L2Npc npc, L2PcInstance player)
+	{
+		String htmltext = getNoQuestMsg(player);
+		QuestState st = player.getQuestState(getName());
+		if (st == null)
+		{
+			st = newQuestState(player);
+		}
+		
+		switch (st.getState())
+		{
+			case State.CREATED:
+				htmltext = (player.getLevel() > 81) ? "32759-01.htm" : "32759-03.html";
+				break;
+			case State.COMPLETED:
+				if (st.isNowAvailable())
+				{
+					st.setState(State.CREATED);
+					htmltext = (player.getLevel() > 81) ? "32759-01.htm" : "32759-03.html";
+				}
+				else
+				{
+					htmltext = "32759-02.html";
+				}
+				break;
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		final QuestState st = player.getQuestState(getName());
+		if (st == null)
+		{
+			return getNoQuestMsg(player);
+		}
+		
+		String htmltext = null;
+		switch (event)
+		{
+			case "32759-06.html":
+				_count = 0;
+				st.startQuest();
+				npc.setTarget(player);
+				npc.setWalking();
+				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
+				startQuestTimer("check", 1000, npc, player, true);
+				startQuestTimer("time_limit", 600000, npc, player);
+				startQuestTimer("talk_time", 120000, npc, player);
+				startQuestTimer("talk_time2", 30000, npc, player);
+				break;
+			case "talk_time":
+				npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), NpcStringId.AH_I_THINK_I_REMEMBER_THIS_PLACE));
+				break;
+			case "talk_time2":
+				npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), NpcStringId.WHAT_WERE_YOU_DOING_HERE));
+				startQuestTimer("talk_time3", 10 * 1000, npc, player);
+				break;
+			case "talk_time3":
+				npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), NpcStringId.I_GUESS_YOURE_THE_SILENT_TYPE_THEN_ARE_YOU_LOOKING_FOR_TREASURE_LIKE_ME));
+				break;
+			case "time_limit":
+				startQuestTimer("stop", 2000, npc, player);
+				st.exitQuest(QuestType.DAILY);
+				break;
+			case "check":
+				final double distance = Math.sqrt(npc.getPlanDistanceSq(player.getX(), player.getY()));
+				if (distance > 1000)
+				{
+					if (distance > 5000)
+					{
+						startQuestTimer("stop", 2000, npc, player);
+						st.exitQuest(QuestType.DAILY);
+					}
+					else if (_count == 0)
+					{
+						npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), NpcStringId.HEY_DONT_GO_SO_FAST));
+						_count = 1;
+					}
+					else if (_count == 1)
+					{
+						npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), NpcStringId.ITS_HARD_TO_FOLLOW));
+						_count = 2;
+					}
+					else if (_count == 2)
+					{
+						startQuestTimer("stop", 2000, npc, player);
+						st.exitQuest(QuestType.DAILY);
+					}
+				}
+				for (L2Npc escort : _escortCheckers)
+				{
+					if (npc.isInsideRadius(escort, 1000, false, false))
+					{
+						startQuestTimer("stop", 1000, npc, player);
+						startQuestTimer("bye", 3000, npc, player);
+						cancelQuestTimer("check", npc, player);
+						npc.broadcastPacket(new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), NpcStringId.AH_FRESH_AIR));
+						st.giveItems(PACKAGED_BOOK, 1);
+						st.exitQuest(QuestType.DAILY, true);
+						break;
+					}
+				}
+				break;
+			case "stop":
+				npc.setTarget(null);
+				npc.getAI().stopFollow();
+				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
+				cancelQuestTimer("check", npc, player);
+				cancelQuestTimer("time_limit", npc, player);
+				cancelQuestTimer("talk_time", npc, player);
+				cancelQuestTimer("talk_time2", npc, player);
+				_gumiel = null;
+				break;
+			case "bye":
+				npc.deleteMe();
+				break;
+			default:
+			{
+				htmltext = event;
+				break;
+			}
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
+	{
+		if (_gumiel == null && getRandom(100) < CHANCE_SPAWN)
+		{
+			addSpawn(GUMIEL, new Location(npc.getX(), npc.getY(), npc.getZ()), false, 0);
+		}
+		return super.onKill(npc, player, isPet);
+	}
+	
+	@Override
+	public String onSpawn(L2Npc npc)
+	{
+		_gumiel = npc;
+		_gumiel.getSpawn().stopRespawn();
+		return super.onSpawn(npc);
+	}
+	
+	private Q00457_LostAndFound(int id, String name, String descr)
+	{
+		super(id, name, descr);
+		addStartNpc(GUMIEL);
+		addFirstTalkId(GUMIEL);
+		addTalkId(GUMIEL);
+		addSpawnId(GUMIEL);
+		addKillId(SOLINA_CLAN);
+		
+		int i = 0;
+		for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
+		{
+			if (spawn.getNpcid() == ESCORT_CHECKER)
+			{
+				_escortCheckers[i] = spawn.getLastSpawn();
+				i++;
+			}
+		}
+	}
+	
+	public static void main(String[] args)
+	{
+		new Q00457_LostAndFound(457, Q00457_LostAndFound.class.getSimpleName(), "Lost and Found");
+	}
+}
diff --git a/L2J_DataPack_BETA/dist/sql/game/npcaidata.sql b/L2J_DataPack_BETA/dist/sql/game/npcaidata.sql
index 355fb2a420..c7e100a7ca 100644
--- a/L2J_DataPack_BETA/dist/sql/game/npcaidata.sql
+++ b/L2J_DataPack_BETA/dist/sql/game/npcaidata.sql
@@ -4874,11 +4874,11 @@ INSERT INTO `npcaidata` VALUES
 (22786, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "xel_private_clan", 400, "null", 0, 0, "fighter"), -- Sel Mahum Squad Leader
 (22787, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "xel_private_clan", 400, "null", 0, 0, "fighter"), -- Sel Mahum Squad Leader
 (22788, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "xel_private_clan", 400, "null", 0, 0, "fighter"), -- Sel Mahum Squad Leader
-(22789, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Guide Solina
-(22790, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Seeker Solina
-(22791, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Savior Solina
-(22792, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Disciple Solina
-(22793, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Ascetic Solina
+(22789, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Guide Solina
+(22790, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Seeker Solina
+(22791, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Savior Solina
+(22792, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Disciple Solina
+(22793, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, "solina_n_clan", 300, "null", 0, 0, "balanced"), -- Ascetic Solina
 (22794, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 600, 0, "divine_n_clan", 300, "null", 0, 0, "balanced"), -- Divinity Judge
 (22795, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 600, 0, "divine_n_clan", 300, "null", 0, 0, "balanced"), -- Divinity Manager
 (22796, 7, 15, 0, 300, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 600, 0, "divine_n_clan", 300, "null", 0, 0, "balanced"), -- Divinity Supervisor
diff --git a/L2J_DataPack_BETA/dist/sql/game/spawnlist.sql b/L2J_DataPack_BETA/dist/sql/game/spawnlist.sql
index a9634a0c31..a27161575f 100644
--- a/L2J_DataPack_BETA/dist/sql/game/spawnlist.sql
+++ b/L2J_DataPack_BETA/dist/sql/game/spawnlist.sql
@@ -32920,6 +32920,9 @@ INSERT INTO `spawnlist` VALUES
 ("unset", 1, 32028, 112801, -76510, 85, 0, 0, 0, 60, 0, 0),
 -- Greymore
 ("MonasteryOfSilence_NPC", 1, 32757, 119120, -80576, -2688, 0, 0, 33792, 60, 0, 0),
+-- Escort Checkers
+("escort_checker_q0457", 1, 32764, 108457, -87835, -2888, 0, 0, 0, 60, 0, 0),
+("escort_checker_q0457", 1, 32764, 122985, -74841, -2880, 0, 0, 0, 60, 0, 0),
 -- Aquilani
 ("MonasteryOfSilence_NPC", 1, 32780, 108272, -88032, -2880, 0, 0, 21220, 60, 0, 0),
 
-- 
GitLab