From 23baf712c5f3a8505e5aa9eb315b516f573d4c81 Mon Sep 17 00:00:00 2001
From: St3eT <St3eT@users.noreply.github.com>
Date: Tue, 4 Mar 2014 23:08:17 +0000
Subject: [PATCH] BETA: Implementing '''Klemis''' AI, also fixed typo from
 [10229]. * Reviewed by: Nos, Adry_85, Zoey76

---
 L2J_DataPack_BETA/dist/game/data/scripts.cfg  |  1 +
 .../ai/npc/Teleports/Klemis/32734-01.html     |  4 ++
 .../ai/npc/Teleports/Klemis/32734.html}       |  2 +-
 .../ai/npc/Teleports/Klemis/Klemis.java       | 69 +++++++++++++++++++
 .../admincommandhandlers/AdminFortSiege.java  |  3 +-
 .../dist/game/data/stats/npcs/32700-32800.xml |  2 +-
 L2J_DataPack_BETA/dist/sql/game/teleport.sql  |  1 -
 7 files changed, 77 insertions(+), 5 deletions(-)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/32734-01.html
 rename L2J_DataPack_BETA/dist/game/data/{html/teleporter/32734.htm => scripts/ai/npc/Teleports/Klemis/32734.html} (79%)
 create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/Klemis.java

diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg
index 2c8abf4eae..0c4ccdb577 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg
+++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg
@@ -58,6 +58,7 @@ ai/npc/Teleports/ElrokiTeleporters/ElrokiTeleporters.java
 ai/npc/Teleports/GatekeeperSpirit/GatekeeperSpirit.java
 ai/npc/Teleports/GrandBossTeleporters/GrandBossTeleporters.java
 ai/npc/Teleports/HuntingGroundsTeleport/HuntingGroundsTeleport.java
+ai/npc/Teleports/Klemis/Klemis.java
 ai/npc/Teleports/MithrilMinesTeleporter/MithrilMinesTeleporter.java
 ai/npc/Teleports/NewbieTravelToken/NewbieTravelToken.java
 ai/npc/Teleports/NoblesseTeleport/NoblesseTeleport.java
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/32734-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/32734-01.html
new file mode 100644
index 0000000000..7923f40a71
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/32734-01.html
@@ -0,0 +1,4 @@
+<html><body>Officer Klemis:<br>
+I understand the situation is urgent, but I think this place is still too dangerous for you. I cannot let any tourists walk into such a deadly place and waste their lives. So, please understand. But of course I will always welcome you back if you become stronger and gain more skills.<br>
+(Only characters with <font color="LEVEL">level 80 or more</font> can enter the Seed of Extermination.)
+</body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/html/teleporter/32734.htm b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/32734.html
similarity index 79%
rename from L2J_DataPack_BETA/dist/game/data/html/teleporter/32734.htm
rename to L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/32734.html
index 8f7f237d73..1106b32fbd 100644
--- a/L2J_DataPack_BETA/dist/game/data/html/teleporter/32734.htm
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/32734.html
@@ -1,6 +1,6 @@
 <html><body>Officer Klemis:<br>
 Thank you for coming. I know the journey was long, but we have much to do. This place is in need of a good... how should I put it ...cleansing. That's why I've called you here.<br>
 Now go in and meet <font color="LEVEL">Ermian</font>. He has a mission for you.<br>
-<a action="bypass -h npc_%objectId%_goto 15004">Enter the Seed of Annihilation</a><br>
+<a action="bypass -h Quest Klemis portInside">Enter the Seed of Annihilation</a><br>
 <a action="bypass -h npc_%objectId%_Quest">Quest</a>
 </body></html>
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/Klemis.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/Klemis.java
new file mode 100644
index 0000000000..d8d9353522
--- /dev/null
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/Klemis/Klemis.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2004-2014 L2J DataPack
+ * 
+ * This file is part of L2J DataPack.
+ * 
+ * L2J DataPack is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * L2J DataPack is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package ai.npc.Teleports.Klemis;
+
+import ai.npc.AbstractNpcAI;
+
+import com.l2jserver.gameserver.model.Location;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * Klemis AI.
+ * @author St3eT
+ */
+public class Klemis extends AbstractNpcAI
+{
+	// NPC
+	private static final int KLEMIS = 32734; // Klemis
+	// Location
+	private static final Location LOCATION = new Location(-180218, 185923, -10576);
+	// Misc
+	private static final int MIN_LV = 80;
+	
+	private Klemis()
+	{
+		super(Klemis.class.getSimpleName(), "ai/npc/Teleports");
+		addStartNpc(KLEMIS);
+		addTalkId(KLEMIS);
+		addFirstTalkId(KLEMIS);
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		if (event.equals("portInside"))
+		{
+			if (player.getLevel() >= MIN_LV)
+			{
+				player.teleToLocation(LOCATION);
+			}
+			else
+			{
+				return "32734-01.html";
+			}
+		}
+		return super.onAdvEvent(event, npc, player);
+	}
+	
+	public static void main(String[] args)
+	{
+		new Klemis();
+	}
+}
\ No newline at end of file
diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminFortSiege.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminFortSiege.java
index 260f9f448d..62d9660702 100644
--- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminFortSiege.java
+++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminFortSiege.java
@@ -25,7 +25,6 @@ import com.l2jserver.gameserver.handler.IAdminCommandHandler;
 import com.l2jserver.gameserver.instancemanager.FortManager;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2Object;
-import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Fort;
 import com.l2jserver.gameserver.network.SystemMessageId;
@@ -93,7 +92,7 @@ public class AdminFortSiege implements IAdminCommandHandler
 					if (fort.getSiege().addAttacker(player, false) == 4)
 					{
 						final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.REGISTERED_TO_S1_FORTRESS_BATTLE);
-						sm.addString(((L2Npc) target).getFort().getName());
+						sm.addCastleId(fort.getResidenceId());
 						player.sendPacket(sm);
 					}
 					else
diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/32700-32800.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/32700-32800.xml
index 1ea1835b03..2da079ff55 100644
--- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/32700-32800.xml
+++ b/L2J_DataPack_BETA/dist/game/data/stats/npcs/32700-32800.xml
@@ -1188,7 +1188,7 @@
 			<height normal="27.5" />
 		</collision>
 	</npc>
-	<npc id="32734" level="80" type="L2Teleporter" name="Klemis" title="Officer">
+	<npc id="32734" level="80" type="L2Npc" name="Klemis" title="Officer">
 		<!-- Confirmed CT2.5 -->
 		<race>ELF</race>
 		<sex>MALE</sex>
diff --git a/L2J_DataPack_BETA/dist/sql/game/teleport.sql b/L2J_DataPack_BETA/dist/sql/game/teleport.sql
index 13681204b7..5f37897851 100644
--- a/L2J_DataPack_BETA/dist/sql/game/teleport.sql
+++ b/L2J_DataPack_BETA/dist/sql/game/teleport.sql
@@ -796,7 +796,6 @@ INSERT INTO `teleport` VALUES
 ('Oren -> Sel Mahum Training Grounds (South Gate)',15001,79414,71496,-3448,3700,0,57),
 ('Oren -> Sel Mahum Training Grounds (Center)',15002,87448,61460,-3664,1800,0,57),
 ('Schuttgart -> Mithril Mines',15003,171946,-173352,3440,5300,0,57),
-('Entrance SOA -> Enter the Seed of Annihilation',15004,-180218,185923,-10576,0,0,57),
 ('Enter the Seed of Annihilation -> Entrance SOA',15005,-178262,153430,2472,0,0,57),
 ('Seed of Infinity Dock',15006,-212843,209695,4280,150000,0,57), -- retail
 ('Seed of Destruction Dock',15007,-248535,250273,4336,150000,0,57), -- retail
-- 
GitLab