diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/WalkerRoutes.xml b/L2J_Mobius_C6_Interlude/dist/game/data/WalkerRoutes.xml new file mode 100644 index 0000000000..4e8787e6d5 --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/game/data/WalkerRoutes.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/csv/walker_routes.csv b/L2J_Mobius_C6_Interlude/dist/game/data/csv/walker_routes.csv deleted file mode 100644 index 363ca259d6..0000000000 --- a/L2J_Mobius_C6_Interlude/dist/game/data/csv/walker_routes.csv +++ /dev/null @@ -1,169 +0,0 @@ -# route_id;npc_id;move_point;chatText;move_x;move_y;move_z;delay;running - -1;31361;1;NULL;22418;10249;-3648;61;True -1;31361;2;NULL;23423;11165;-3720;1;True -1;31361;3;NULL;20182;11101;-3720;1;True -1;31361;4;NULL;17327;13603;-3728;1;True -1;31361;5;The mass of darkness will start in a couple of days. Pay more attention to the guard!;17410;13038;-3736;10;True -1;31361;6;NULL;20176;12902;-3712;1;True -1;31361;7;NULL;21669;13378;-3616;1;True -1;31361;8;NULL;20675;10401;-3712;1;True -2;31360;1;NULL;10826;14777;-4240;62;False -2;31360;2;NULL;10966;14626;-4240;1;False -2;31360;3;NULL;11264;15838;-4584;1;False -2;31360;4;NULL;12100;16378;-4590;2;False -2;31360;5;Youre a hard worker Rayla!;15088;15664;-4376;6;False -2;31360;6;NULL;15232;16279;-4383;7;False -2;31360;7;NULL;12217;16916;-4590;1;False -2;31360;8;NULL;11811;17553;-4580;1;False -2;31360;9;NULL;11275;17628;-4589;1;False -2;31360;10;NULL;10649;17284;-4584;1;False -2;31360;11;Youre a hard worker!;7691;18030;-4376;6;False -2;31360;12;NULL;10593;16738;-4590;2;False -2;31360;13;NULL;11127;16044;-4589;2;False -3;31362;1;Mr. Lid Murdoc and Airy! How are you doing?;114847;-180066;-877;30;False -3;31362;2;NULL;114834;-179685;-877;2;False -3;31362;3;NULL;116122;-179457;-1068;1;False -3;31362;4;NULL;116798;-180391;-1200;2;False -3;31362;5;NULL;116324;-181564;-1384;2;False -3;31362;6;NULL;115797;-181563;-1336;1;False -3;31362;7;Care to go a round?;116054;-181575;-1352;1;False -3;31362;8;NULL;116506;-181478;-1384;2;False -3;31362;9;NULL;116634;-180029;-1160;1;False -3;31362;10;NULL;115347;-178623;-928;1;False -3;31362;11;NULL;115763;-177591;-888;2;False -3;31362;12;Have a nice day Mr. Garita and Mion!;115801;-177342;-880;1;False -3;31362;13;NULL;115869;-177340;-880;15;False -3;31362;14;NULL;115788;-177482;-880;3;False -3;31362;15;NULL;115124;-179821;-885;1;False -3;31362;16;NULL;115103;-180065;-877;1;False -4;31363;1;Where is that fool hiding?;116731;-182477;-1512;10;True -4;31363;2;NULL;115870;-183280;-1472;1;True -4;31363;3;NULL;115746;-183428;-1472;1;True -4;31363;4;NULL;115870;-183280;-1472;1;True -4;31363;5;NULL;115999;-183246;-1480;1;True -4;31363;6;NULL;116094;-183113;-1480;1;True -4;31363;7;Have you seen Torocco today?;116584;-184294;-1568;11;True -4;31363;8;NULL;116392;-184100;-1560;1;True -4;31363;9;NULL;117093;-182524;-1528;1;True -4;31363;10;Have you seen Torocco?;117789;-182540;-1528;11;True -5;31359;1;NULL;45744;50561;-3065;61;False -5;31359;2;NULL;46444;49742;-3065;2;False -5;31359;3;How can we save the Mother Tree?;46103;48798;-3065;5;False -5;31359;4;The Mother Tree is slowly dying;45403;48436;-3065;5;False -5;31359;5;NULL;44444;49078;-3065;1;False -5;31359;6;NULL;44414;50025;-3065;1;False -5;31359;7;NULL;44957;50568;-3065;1;False -5;31359;8;NULL;44414;50025;-3065;1;False -5;31359;9;NULL;44444;49078;-3065;1;False -5;31359;10;The Mother Tree is slowly dying;45403;48436;-3065;5;False -5;31359;11;How can we save the Mother Tree?;46103;48798;-3065;5;False -5;31359;12;NULL;46444;49742;-3065;2;False -6;31358;1;Lady Mirabel may the peace of the lake be with you!;47015;51278;-2992;65;False -6;31358;2;NULL;47437;50441;-2992;1;False -6;31358;3;NULL;47509;49038;-2992;1;False -6;31358;4;NULL;46725;47755;-2992;1;False -6;31358;5;The Mother Tree is always so gorgeous!;45319;47339;-2992;5;False -6;31358;6;NULL;43998;47672;-2992;1;False -6;31358;7;NULL;43037;49310;-2992;1;False -6;31358;8;NULL;43310;50382;-2992;1;False -6;31358;9;NULL;43896;51060;-2992;1;False -6;31358;10;NULL;43312;50362;-2992;1;False -6;31358;11;NULL;43040;49311;-2992;1;False -6;31358;12;NULL;44018;47645;-2992;1;False -6;31358;13;The Mother Tree is always so gorgeous!;45301;47340;-2992;5;False -6;31358;14;NULL;46693;47752;-2992;1;False -6;31358;15;NULL;47489;48976;-2992;1;False -6;31358;16;NULL;47441;50455;-2992;1;False -7;31357;1;Where did he go?;-86328;241120;-3734;60;False -7;31357;2;NULL;-86505;240727;-3704;1;False -7;31357;3;NULL;-86081;240402;-3712;1;False -7;31357;4;Have you seen Windawood?;-86078;240853;-3720;15;False -7;31357;5;NULL;-85957;241389;-3728;1;False -7;31357;6;Where has he gone?;-83993;242766;-3728;10;False -7;31357;7;NULL;-82952;244461;-3728;1;False -7;31357;8;NULL;-82370;244919;-3720;1;False -7;31357;9;NULL;-82129;245020;-3720;1;False -7;31357;10;NULL;-82198;245350;-3712;1;False -7;31357;11;NULL;-82554;245137;-3716;1;False -7;31357;12;NULL;-82198;245350;-3712;1;False -7;31357;13;NULL;-82129;245020;-3720;1;False -7;31357;14;NULL;-82370;244919;-3720;1;False -7;31357;15;NULL;-82952;244461;-3728;1;False -7;31357;16;Where has he gone?;-83993;242766;-3728;10;False -7;31357;17;NULL;-85957;241389;-3728;1;False -7;31357;18;Have you seen Windawood?;-86078;240853;-3720;15;False -7;31357;19;NULL;-86081;240402;-3712;1;False -7;31357;20;NULL;-86505;240727;-3704;1;False -8;31356;1;A delivery for Mr. Lector? Very good!;-81681;243384;-3712;61;True -8;31356;2;NULL;-81915;243870;-3712;1;True -8;31356;3;NULL;-82084;243659;-3712;1;True -8;31356;4;NULL;-83148;243731;-3728;1;True -8;31356;5;I need a break!;-84497;243241;-3728;6;True -8;31356;6;NULL;-85212;243184;-3728;1;True -8;31356;7;NULL;-86161;242898;-3728;1;True -8;31356;8;NULL;-86281;242963;-3720;1;True -8;31356;9;Hello Mr. Lector! Long time no see Mr. Jackson!;-86356;243201;-3720;7;True -8;31356;10;NULL;-86491;242781;-3720;1;True -8;31356;11;NULL;-86497;242585;-3728;1;True -8;31356;12;NULL;-86114;241587;-3728;1;True -8;31356;13;NULL;-85184;240679;-3728;1;True -8;31356;14;Lulu! Lulu!;-84099;241264;-3728;6;True -8;31356;15;Lulu!;-83709;241238;-3728;1;True -8;31356;16;NULL;-83075;241150;-3728;1;True -8;31356;17;NULL;-82383;242926;-3720;1;True -9;31364;1;NULL;-46506;-109402;-238;10;False -9;31364;2;NULL;-45752;-111652;-240;1;False -9;31364;3;NULL;-44028;-112688;-240;1;False -9;31364;4;NULL;-44049;-114536;-240;1;False -9;31364;5;NULL;-45540;-115415;-240;1;False -9;31364;6;NULL;-46526;-117731;-240;1;False -9;31364;7;NULL;-45540;-115415;-240;1;False -9;31364;8;NULL;-44049;-114536;-240;1;False -9;31364;9;NULL;-44028;-112688;-240;1;False -9;31364;10;NULL;-45752;-111652;-240;1;False -10;31365;1;NULL;-48807;-113489;-241;61;False -10;31365;2;NULL;-48821;-113746;-232;1;False -10;31365;3;NULL;-48823;-113505;-232;61;False -10;31365;4;NULL;-47339;-113581;-232;1;False -10;31365;5;NULL;-45740;-113562;-240;1;False -10;31365;6;NULL;-44851;-112965;-240;1;False -10;31365;7;NULL;-44308;-113207;-240;1;False -10;31365;8;NULL;-44204;-113743;-240;1;False -10;31365;9;NULL;-44659;-114171;-240;1;False -10;31365;10;NULL;-45167;-114034;-224;1;False -10;31365;11;NULL;-45658;-113633;-240;1;False -10;31365;12;NULL;-47363;-113621;-224;1;False -10;31365;13;NULL;-48829;-113746;-232;1;False -10;31365;14;NULL;-47363;-113621;-224;1;False -10;31365;15;NULL;-45658;-113633;-240;1;False -10;31365;16;NULL;-45167;-114034;-224;1;False -10;31365;17;NULL;-44659;-114171;-240;1;False -10;31365;18;NULL;-44204;-113743;-240;1;False -10;31365;19;NULL;-44308;-113207;-240;1;False -10;31365;20;NULL;-44851;-112965;-240;1;False -10;31365;21;NULL;-45740;-113562;-240;1;False -11;32072;1;NULL;84429;-144065;-1542;10;False -11;32072;2;NULL;84465;-142493;-1536;1;False -11;32072;3;NULL;85234;-140963;-1536;1;False -11;32072;4;NULL;87351;-140059;-1536;5;False -11;32072;5;NULL;89343;-140746;-1536;1;False -11;32072;6;NULL;90605;-143167;-1536;1;False -11;32072;7;NULL;90271;-143869;-1536;10;False -11;32072;8;NULL;90605;-143167;-1536;1;False -11;32072;9;NULL;89343;-140746;-1536;1;False -11;32072;10;NULL;87351;-140059;-1536;5;False -11;32072;11;NULL;85234;-140963;-1536;1;False -11;32072;12;NULL;84465;-142493;-1536;1;False -12;32070;1;NULL;90271;-143869;-1547;10;True -12;32070;2;NULL;90605;-143167;-1536;1;True -12;32070;3;NULL;89343;-140746;-1536;1;True -12;32070;4;NULL;87351;-140059;-1536;5;True -12;32070;5;NULL;85234;-140963;-1536;1;True -12;32070;6;NULL;84465;-142493;-1536;1;True -12;32070;7;NULL;84434;-144061;-1528;10;True -12;32070;8;NULL;84465;-142493;-1536;1;True -12;32070;9;NULL;85234;-140963;-1536;1;True -12;32070;10;NULL;87351;-140059;-1536;5;True -12;32070;11;NULL;89343;-140746;-1536;1;True -12;32070;12;NULL;90605;-143167;-1536;1;True diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/xsd/WalkerRoutes.xsd b/L2J_Mobius_C6_Interlude/dist/game/data/xsd/WalkerRoutes.xsd new file mode 100644 index 0000000000..67a7cf7827 --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/game/data/xsd/WalkerRoutes.xsd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java index 6dd91bee0a..297a8f1c92 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java @@ -47,7 +47,6 @@ import org.l2jmobius.gameserver.datatables.NobleSkillTable; import org.l2jmobius.gameserver.datatables.OfflineTradeTable; import org.l2jmobius.gameserver.datatables.SchemeBufferTable; import org.l2jmobius.gameserver.datatables.SkillTable; -import org.l2jmobius.gameserver.datatables.csv.NpcWalkerRouteTable; import org.l2jmobius.gameserver.datatables.sql.CharNameTable; import org.l2jmobius.gameserver.datatables.sql.CharTemplateTable; import org.l2jmobius.gameserver.datatables.sql.ClanTable; @@ -74,6 +73,7 @@ import org.l2jmobius.gameserver.datatables.xml.MapRegionData; import org.l2jmobius.gameserver.datatables.xml.RecipeData; import org.l2jmobius.gameserver.datatables.xml.StaticObjectData; import org.l2jmobius.gameserver.datatables.xml.SummonItemData; +import org.l2jmobius.gameserver.datatables.xml.WalkerRouteData; import org.l2jmobius.gameserver.datatables.xml.ZoneData; import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.handler.AdminCommandHandler; @@ -245,7 +245,7 @@ public class GameServer Util.printSection("Npc"); SchemeBufferTable.getInstance(); - NpcWalkerRouteTable.getInstance().load(); + WalkerRouteData.getInstance(); if (!NpcTable.getInstance().isInitialized()) { LOGGER.info("Could not find the extracted files. Please Check Your Data."); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java index 3efbbbfac6..f2494bb6cc 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java @@ -20,7 +20,7 @@ import java.util.List; import org.l2jmobius.Config; import org.l2jmobius.commons.concurrent.ThreadPool; -import org.l2jmobius.gameserver.datatables.csv.NpcWalkerRouteTable; +import org.l2jmobius.gameserver.datatables.xml.WalkerRouteData; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.NpcWalkerNode; import org.l2jmobius.gameserver.model.actor.Creature; @@ -52,7 +52,7 @@ public class NpcWalkerAI extends CreatureAI implements Runnable /** * route of the current npc */ - private final List _route = NpcWalkerRouteTable.getInstance().getRouteForNpc(getActor().getNpcId()); + private final List _route = WalkerRouteData.getInstance().getRouteForNpc(getActor().getNpcId()); /** * current node @@ -134,8 +134,7 @@ public class NpcWalkerAI extends CreatureAI implements Runnable if ((getActor().getX() == destinationX) && (getActor().getY() == destinationY) && (getActor().getZ() == destinationZ)) { final String chat = _route.get(_currentPos).getChatText(); - - if ((chat != null) && !chat.equals("NULL")) + if ((chat != null) && !chat.isEmpty()) { try { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/datatables/csv/NpcWalkerRouteTable.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/datatables/csv/NpcWalkerRouteTable.java deleted file mode 100644 index d15982c17b..0000000000 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/datatables/csv/NpcWalkerRouteTable.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.l2jmobius.gameserver.datatables.csv; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.LineNumberReader; -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; -import java.util.logging.Logger; - -import org.l2jmobius.Config; -import org.l2jmobius.gameserver.model.NpcWalkerNode; - -/** - * Main Table to Load Npc Walkers Routes and Chat SQL Table.
- * @author Rayan RPG for L2Emu Project - * @since 927 - */ -public class NpcWalkerRouteTable -{ - protected static final Logger LOGGER = Logger.getLogger(NpcWalkerRouteTable.class.getName()); - - private List _routes; - - private NpcWalkerRouteTable() - { - } - - public void load() - { - _routes = new ArrayList<>(); - - FileReader reader = null; - BufferedReader buff = null; - LineNumberReader lnr = null; - - try - { - final File fileData = new File(Config.DATAPACK_ROOT + "/data/csv/walker_routes.csv"); - - reader = new FileReader(fileData); - buff = new BufferedReader(reader); - lnr = new LineNumberReader(buff); - - NpcWalkerNode route; - String line = null; - - // format: - // route_id;npc_id;move_point;chatText;move_x;move_y;move_z;delay;running - while ((line = lnr.readLine()) != null) - { - // ignore comments - if ((line.trim().length() == 0) || line.startsWith("#")) - { - continue; - } - route = new NpcWalkerNode(); - final StringTokenizer st = new StringTokenizer(line, ";"); - - final int route_id = Integer.parseInt(st.nextToken()); - final int npc_id = Integer.parseInt(st.nextToken()); - final String move_point = st.nextToken(); - final String chatText = st.nextToken(); - final int move_x = Integer.parseInt(st.nextToken()); - final int move_y = Integer.parseInt(st.nextToken()); - final int move_z = Integer.parseInt(st.nextToken()); - final int delay = Integer.parseInt(st.nextToken()); - final boolean running = Boolean.parseBoolean(st.nextToken()); - - route.setRouteId(route_id); - route.setNpcId(npc_id); - route.setMovePoint(move_point); - route.setChatText(chatText); - route.setMoveX(move_x); - route.setMoveY(move_y); - route.setMoveZ(move_z); - route.setDelay(delay); - route.setRunning(running); - - _routes.add(route); - } - - LOGGER.info("WalkerRoutesTable: Loaded " + _routes.size() + " Npc Walker Routes."); - } - catch (FileNotFoundException e) - { - LOGGER.warning("walker_routes.csv is missing in data folder"); - } - catch (IOException e0) - { - LOGGER.warning("Error while creating table: " + e0.getMessage() + "\n" + e0); - } - finally - { - if (lnr != null) - { - try - { - lnr.close(); - } - catch (Exception e1) - { - LOGGER.warning("Problem with NpcWalkerRoutesTable: " + e1.getMessage()); - } - } - - if (buff != null) - { - try - { - buff.close(); - } - catch (Exception e1) - { - LOGGER.warning("Problem with NpcWalkerRoutesTable: " + e1.getMessage()); - } - } - - if (reader != null) - { - try - { - reader.close(); - } - catch (Exception e1) - { - LOGGER.warning("Problem with NpcWalkerRoutesTable: " + e1.getMessage()); - } - } - } - } - - public List getRouteForNpc(int id) - { - final List result = new ArrayList<>(); - for (NpcWalkerNode node : _routes) - { - if (node.getNpcId() == id) - { - result.add(node); - } - } - return result; - } - - public static NpcWalkerRouteTable getInstance() - { - return SingletonHolder.INSTANCE; - } - - private static class SingletonHolder - { - protected static final NpcWalkerRouteTable INSTANCE = new NpcWalkerRouteTable(); - } -} diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/datatables/xml/WalkerRouteData.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/datatables/xml/WalkerRouteData.java new file mode 100644 index 0000000000..d0e8e9dbc2 --- /dev/null +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/datatables/xml/WalkerRouteData.java @@ -0,0 +1,117 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.l2jmobius.gameserver.datatables.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.model.NpcWalkerNode; +import org.l2jmobius.gameserver.model.StatSet; + +/** + * @author Mobius + */ +public class WalkerRouteData implements IXmlReader +{ + protected static final Logger LOGGER = Logger.getLogger(WalkerRouteData.class.getName()); + + private final Map> _routes = new HashMap<>(); + + protected WalkerRouteData() + { + load(); + } + + @Override + public void load() + { + _routes.clear(); + parseDatapackFile("data/WalkerRoutes.xml"); + } + + @Override + public void parseDocument(Document doc, File f) + { + try + { + final Node n = doc.getFirstChild(); + for (Node node = n.getFirstChild(); node != null; node = node.getNextSibling()) + { + if ("route".equalsIgnoreCase(node.getNodeName())) + { + final List points = new ArrayList<>(); + for (Node b = node.getFirstChild(); b != null; b = b.getNextSibling()) + { + if (!"point".equalsIgnoreCase(b.getNodeName())) + { + continue; + } + + final StatSet set = new StatSet(); + final NamedNodeMap attrs = b.getAttributes(); + for (int i = 0; i < attrs.getLength(); i++) + { + final Node attr = attrs.item(i); + set.set(attr.getNodeName(), attr.getNodeValue()); + } + + final NpcWalkerNode route = new NpcWalkerNode(); + route.setMoveX(set.getInt("x")); + route.setMoveY(set.getInt("y")); + route.setMoveZ(set.getInt("z")); + route.setDelay(set.getInt("delay")); + route.setRunning(set.getBoolean("run")); + route.setChatText(set.getString("chat", null)); + + points.add(route); + } + _routes.put(Integer.parseInt(node.getAttributes().getNamedItem("npcId").getNodeValue()), points); + } + } + + LOGGER.info(getClass().getSimpleName() + ": Loaded " + _routes.size() + " walker routes."); + } + catch (Exception e) + { + LOGGER.warning(getClass().getSimpleName() + ": Error while reading walker route data: " + e); + } + } + + public List getRouteForNpc(int id) + { + return _routes.get(id); + } + + public static WalkerRouteData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final WalkerRouteData INSTANCE = new WalkerRouteData(); + } +} diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminReload.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminReload.java index f82547d0b2..c7ab063d93 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminReload.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminReload.java @@ -24,9 +24,9 @@ import org.l2jmobius.gameserver.TradeController; import org.l2jmobius.gameserver.cache.HtmCache; import org.l2jmobius.gameserver.datatables.ItemTable; import org.l2jmobius.gameserver.datatables.SkillTable; -import org.l2jmobius.gameserver.datatables.csv.NpcWalkerRouteTable; import org.l2jmobius.gameserver.datatables.sql.NpcTable; import org.l2jmobius.gameserver.datatables.sql.TeleportLocationTable; +import org.l2jmobius.gameserver.datatables.xml.WalkerRouteData; import org.l2jmobius.gameserver.handler.IAdminCommandHandler; import org.l2jmobius.gameserver.instancemanager.DatatablesManager; import org.l2jmobius.gameserver.instancemanager.Manager; @@ -108,7 +108,7 @@ public class AdminReload implements IAdminCommandHandler } else if (type.startsWith("npcwalkers")) { - NpcWalkerRouteTable.getInstance().load(); + WalkerRouteData.getInstance().load(); sendReloadPage(activeChar); BuilderUtil.sendSysMessage(activeChar, "All NPC walker routes have been reloaded"); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/NpcWalkerNode.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/NpcWalkerNode.java index 2e8859dd7b..a0d8831299 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/NpcWalkerNode.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/NpcWalkerNode.java @@ -22,42 +22,18 @@ package org.l2jmobius.gameserver.model; */ public class NpcWalkerNode { - private int _routeId; - private int _npcId; - private String _movePoint; - private String _chatText; private int _moveX; private int _moveY; private int _moveZ; private int _delay; - private boolean _running; + private String _chatText; public void setRunning(boolean value) { _running = value; } - public void setRouteId(int id) - { - _routeId = id; - } - - public void setNpcId(int id) - { - _npcId = id; - } - - public void setMovePoint(String value) - { - _movePoint = value; - } - - public void setChatText(String value) - { - _chatText = value; - } - public void setMoveX(int value) { _moveX = value; @@ -78,24 +54,9 @@ public class NpcWalkerNode _delay = value; } - public int getRouteId() + public void setChatText(String value) { - return _routeId; - } - - public int getNpcId() - { - return _npcId; - } - - public String getMovePoint() - { - return _movePoint; - } - - public String getChatText() - { - return _chatText; + _chatText = value; } public int getMoveX() @@ -123,26 +84,8 @@ public class NpcWalkerNode return _running; } - /** - * Constructor of NpcWalker. - */ - public NpcWalkerNode() + public String getChatText() { - } - - /** - * Constructor of NpcWalker.
- *
- * @param set The StatSet object to transfert data to the method - */ - public NpcWalkerNode(StatSet set) - { - _npcId = set.getInt("npc_id"); - _movePoint = set.getString("move_point"); - _chatText = set.getString("chatText"); - _moveX = set.getInt("move_x"); - _moveX = set.getInt("move_y"); - _moveX = set.getInt("move_z"); - _delay = set.getInt("delay"); + return _chatText; } } diff --git a/L2J_Mobius_C6_Interlude/readme.txt b/L2J_Mobius_C6_Interlude/readme.txt index 2e3d45bb32..d23df96c46 100644 --- a/L2J_Mobius_C6_Interlude/readme.txt +++ b/L2J_Mobius_C6_Interlude/readme.txt @@ -85,6 +85,5 @@ Dueling system. TODO: -Convert CSV files to XML. -Drop knownlists -> Use L2World. +Drop knownlists -> Use World. Drop MmoCore -> Use Netty.