Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gameserver.java
- ------------------------
- ChaoticZone.getInstance();
- ------------------------
- NpcHtmlMessage.java
- ------------------------
- inside to
- public void replace(String pattern, String value)
- use this
- // Code by L2jLuna Dev.
- String ZoneCheck;
- switch (ChaoticZone.getInstance().state)
- {
- case ISLOADING:
- ZoneCheck = "Chaotic Zone is Loading...";
- case INCHANGE:
- ZoneCheck = "The Chaotic Zone is change soon!";
- break;
- default:
- ZoneCheck = String.valueOf("<center>Time Next Map: " + new SimpleDateFormat("mm:ss").format(ChaoticZone.getInstance().getTime())+"<br><a action=\"bypass -h npc_%objectId%_goto 50001\">CHAOTIC ZONE</a></center>");
- break;
- }
- //show time in npc and status
- _html = _html.replace("%ChaoticMap%", ZoneCheck);
- ------------------------
- ChaoticZone.java
- ------------------------
- /*
- * 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 com.l2jfrozen.gameserver.model.zone;
- import java.util.concurrent.ScheduledFuture;
- import java.util.concurrent.TimeUnit;
- import org.apache.log4j.Logger;
- import com.l2jfrozen.gameserver.datatables.csv.MapRegionTable;
- import com.l2jfrozen.gameserver.model.L2Character;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jfrozen.gameserver.model.entity.Announcements;
- import com.l2jfrozen.gameserver.model.zone.type.L2ChaoticZone;
- import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- import com.l2jfrozen.util.random.Rnd;
- /**
- * @author L2jLuna
- */
- public class ChaoticZone
- {
- private static Logger LOGGER = Logger.getLogger(L2ChaoticZone.class);
- private static ChaoticZone _instance;
- private ScheduledFuture<?> _startThread = null;
- private ScheduledFuture<?> _timer = null;
- int seconds;
- public static enum Map
- {
- CHAOTIC_ZONE,
- CHAOTIC_ZONE_NO1,
- CHAOTIC_ZONE_NO2,
- CHAOTIC_ZONE_NO3,
- CHAOTIC_ZONE_NO4,
- CHAOTIC_ZONE_NO5,
- NONE
- }
- public static enum CheckIsChange
- {
- INACTIVE,
- ISLOADING,
- INCHANGE,
- NORMAL
- }
- private static L2Character Zchar;
- public static Map currentMap = Map.CHAOTIC_ZONE;
- public CheckIsChange state = CheckIsChange.ISLOADING;
- public static int Random = Rnd.get(1, 5);
- public static ChaoticZone getInstance()
- {
- if (_instance == null)
- {
- _instance = new ChaoticZone();
- }
- return _instance;
- }
- public ChaoticZone()
- {
- LOGGER.info("Chaotic Zone is start!");
- if (state == CheckIsChange.ISLOADING)
- {
- seconds = 130;
- CounterStart();
- }
- }
- public void CounterStart()
- {
- _startThread = ThreadPoolManager.getInstance().scheduleAiAtFixedRate(new Runnable()
- {
- @Override
- public void run()
- {
- countDown();
- }
- }, 1000 * 5, 1000);
- }
- public void countDown()
- {
- switch (seconds)
- {
- case 3600: // 1 hour left
- Announcements.getInstance().gameAnnounceToAll("Chaotic Zone: Has Changed!");
- Announcements.getInstance().gameAnnounceToAll("Chaotic Zone: Next Map Change 1 hour!");
- state = CheckIsChange.INACTIVE;
- _timer = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
- {
- @Override
- public void run()
- {
- }
- }, 1000*seconds);
- break;
- case 300: // 5 minutes left
- Announcements.getInstance().gameAnnounceToAll("Chaotic Zone: Change 5 minute(s)!");
- break;
- case 120: // 2 minutes left
- Announcements.getInstance().gameAnnounceToAll("Chaotic Zone: Change 2 minute(s)!");
- break;
- case 30: // 30 seconds left
- Announcements.getInstance().gameAnnounceToAll("Chaotic Zone: Change 30 second(s)!");
- state = CheckIsChange.INCHANGE;
- break;
- case 10: // 10 seconds left
- Announcements.getInstance().gameAnnounceToAll("Chaotic Zone: Change 10 second(s)!");
- break;
- case 1: // 1 seconds left
- Announcements.getInstance().gameAnnounceToAll("Chaotic Zone: Change 1 second(s)!");
- ChangeMap();
- break;
- case 0:
- ChangeZone();
- _startThread.cancel(true);
- }
- seconds--;
- }
- public void ChangeZone()
- {
- int tempR = Random;
- while (tempR == Random)
- tempR = Rnd.get(1, 5);
- Random = tempR;
- switch (Random)
- {
- case 1:
- currentMap = Map.CHAOTIC_ZONE;
- Announcements.getInstance().gameAnnounceToAll("The Chaotic Map has added!");
- break;
- case 2:
- currentMap = Map.CHAOTIC_ZONE_NO1;
- Announcements.getInstance().gameAnnounceToAll("The Chaotic Map No(1) has added!");
- break;
- case 3:
- currentMap = Map.CHAOTIC_ZONE_NO2;
- Announcements.getInstance().gameAnnounceToAll("The Chaotic Map No(2) has added!");
- break;
- case 4:
- currentMap = Map.CHAOTIC_ZONE_NO3;
- Announcements.getInstance().gameAnnounceToAll("The Chaotic Map No(3) has added!");
- break;
- case 5:
- currentMap = Map.CHAOTIC_ZONE_NO4;
- Announcements.getInstance().gameAnnounceToAll("The Chaotic Map No(4) has added!");
- break;
- case 6:
- currentMap = Map.CHAOTIC_ZONE_NO5;
- Announcements.getInstance().gameAnnounceToAll("The Chaotic Map No(5) has added!");
- break;
- default:
- currentMap = Map.NONE;
- break;
- }
- seconds = 3610;
- CounterStart();
- }
- public void ChangeMap()
- {
- state = CheckIsChange.ISLOADING;
- Announcements.getInstance().gameAnnounceToAll("The Map Change soon!");
- /**
- * Check player if is inside zone teleport him in town.
- */
- if (Zchar instanceof L2PcInstance)
- {
- L2PcInstance CheckChar = (L2PcInstance) Zchar;
- if (CheckChar.isInsideZone(L2Character.ZONE_CHAOTIC) || CheckChar.isInsideZone(L2Character.ZONE_CHAOTIC1) || CheckChar.isInsideZone(L2Character.ZONE_CHAOTIC2) || CheckChar.isInsideZone(L2Character.ZONE_CHAOTIC3) || CheckChar.isInsideZone(L2Character.ZONE_CHAOTIC4) || CheckChar.isInsideZone(L2Character.ZONE_CHAOTIC5))
- {
- if (CheckChar.isOnline() == 1)
- {
- CheckChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- }
- CheckChar.sendMessage("Chaotic Zone: Automatical teleport in town. The map chance soon.");
- }
- }
- }
- public long getTime()
- {
- if (_timer != null)
- {
- return _timer.getDelay(TimeUnit.MILLISECONDS);
- }
- return 0;
- }
- }
- --------------------------------
- L2ChaoticZone.java
- --------------------------------
- /* L2jFrozen Project - www.l2jfrozen.com
- *
- * 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
- package com.l2jfrozen.gameserver.model.zone.type;
- import com.l2jfrozen.Config;
- import com.l2jfrozen.gameserver.model.L2Character;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jfrozen.gameserver.model.zone.ChaoticZone;
- import com.l2jfrozen.gameserver.model.zone.ChaoticZone.Map;
- import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
- import com.l2jfrozen.util.random.Rnd;
- /**
- * @author L2jLuna
- */
- public class L2ChaoticZone extends L2ZoneType
- {
- public L2ChaoticZone(int id)
- {
- super(id);
- }
- @Override
- public void setParameter(String name, String value)
- {
- super.setParameter(name, value);
- }
- @Override
- protected void onEnter(final L2Character character)
- {
- character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);
- switch (ChaoticZone.currentMap)
- {
- case CHAOTIC_ZONE:
- if (character instanceof L2PcInstance)
- {
- L2PcInstance aChar = (L2PcInstance) character;
- if (aChar.isInsideZone(L2Character.ZONE_CHAOTIC))
- {
- if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO1)
- {
- int[] loc = Config.SPAWN_LOC1[Rnd.get(Config.SPAWN_LOC1.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO2)
- {
- int[] loc = Config.SPAWN_LOC2[Rnd.get(Config.SPAWN_LOC2.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO3)
- {
- int[] loc = Config.SPAWN_LOC3[Rnd.get(Config.SPAWN_LOC3.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO4)
- {
- int[] loc = Config.SPAWN_LOC4[Rnd.get(Config.SPAWN_LOC4.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO5)
- {
- int[] loc = Config.SPAWN_LOC5[Rnd.get(Config.SPAWN_LOC5.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else
- {
- character.setInsideZone(L2Character.ZONE_CHAOTIC, true);
- }
- }
- }
- break;
- case CHAOTIC_ZONE_NO1:
- if (character instanceof L2PcInstance)
- {
- L2PcInstance aChar = (L2PcInstance) character;
- if (aChar.isInsideZone(L2Character.ZONE_CHAOTIC1))
- {
- if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE)
- {
- int[] loc = Config.SPAWN_LOC[Rnd.get(Config.SPAWN_LOC.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO2)
- {
- int[] loc = Config.SPAWN_LOC2[Rnd.get(Config.SPAWN_LOC2.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO3)
- {
- int[] loc = Config.SPAWN_LOC3[Rnd.get(Config.SPAWN_LOC3.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO4)
- {
- int[] loc = Config.SPAWN_LOC4[Rnd.get(Config.SPAWN_LOC4.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO5)
- {
- int[] loc = Config.SPAWN_LOC5[Rnd.get(Config.SPAWN_LOC5.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else
- {
- character.setInsideZone(L2Character.ZONE_CHAOTIC1, true);
- }
- }
- }
- break;
- case CHAOTIC_ZONE_NO2:
- if (character instanceof L2PcInstance)
- {
- L2PcInstance aChar = (L2PcInstance) character;
- if (aChar.isInsideZone(L2Character.ZONE_CHAOTIC2))
- {
- if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO1)
- {
- int[] loc = Config.SPAWN_LOC1[Rnd.get(Config.SPAWN_LOC1.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE)
- {
- int[] loc = Config.SPAWN_LOC[Rnd.get(Config.SPAWN_LOC.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO3)
- {
- int[] loc = Config.SPAWN_LOC3[Rnd.get(Config.SPAWN_LOC3.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO4)
- {
- int[] loc = Config.SPAWN_LOC4[Rnd.get(Config.SPAWN_LOC4.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO5)
- {
- int[] loc = Config.SPAWN_LOC5[Rnd.get(Config.SPAWN_LOC5.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else
- {
- character.setInsideZone(L2Character.ZONE_CHAOTIC2, true);
- }
- }
- }
- break;
- case CHAOTIC_ZONE_NO3:
- if (character instanceof L2PcInstance)
- {
- L2PcInstance aChar = (L2PcInstance) character;
- if (aChar.isInsideZone(L2Character.ZONE_CHAOTIC3))
- {
- if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO1)
- {
- int[] loc = Config.SPAWN_LOC1[Rnd.get(Config.SPAWN_LOC1.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO2)
- {
- int[] loc = Config.SPAWN_LOC2[Rnd.get(Config.SPAWN_LOC2.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE)
- {
- int[] loc = Config.SPAWN_LOC[Rnd.get(Config.SPAWN_LOC.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO4)
- {
- int[] loc = Config.SPAWN_LOC4[Rnd.get(Config.SPAWN_LOC4.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO5)
- {
- int[] loc = Config.SPAWN_LOC5[Rnd.get(Config.SPAWN_LOC5.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else
- {
- character.setInsideZone(L2Character.ZONE_CHAOTIC3, true);
- }
- }
- }
- break;
- case CHAOTIC_ZONE_NO4:
- if (character instanceof L2PcInstance)
- {
- L2PcInstance aChar = (L2PcInstance) character;
- if (aChar.isInsideZone(L2Character.ZONE_CHAOTIC4))
- {
- if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO1)
- {
- int[] loc = Config.SPAWN_LOC1[Rnd.get(Config.SPAWN_LOC1.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO2)
- {
- int[] loc = Config.SPAWN_LOC2[Rnd.get(Config.SPAWN_LOC2.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO3)
- {
- int[] loc = Config.SPAWN_LOC3[Rnd.get(Config.SPAWN_LOC3.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE)
- {
- int[] loc = Config.SPAWN_LOC[Rnd.get(Config.SPAWN_LOC.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO5)
- {
- int[] loc = Config.SPAWN_LOC5[Rnd.get(Config.SPAWN_LOC5.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else
- {
- character.setInsideZone(L2Character.ZONE_CHAOTIC4, true);
- }
- }
- }
- break;
- case CHAOTIC_ZONE_NO5:
- if (character instanceof L2PcInstance)
- {
- L2PcInstance aChar = (L2PcInstance) character;
- if (aChar.isInsideZone(L2Character.ZONE_CHAOTIC5))
- {
- if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO1)
- {
- int[] loc = Config.SPAWN_LOC1[Rnd.get(Config.SPAWN_LOC1.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO2)
- {
- int[] loc = Config.SPAWN_LOC2[Rnd.get(Config.SPAWN_LOC2.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO3)
- {
- int[] loc = Config.SPAWN_LOC3[Rnd.get(Config.SPAWN_LOC3.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE_NO4)
- {
- int[] loc = Config.SPAWN_LOC4[Rnd.get(Config.SPAWN_LOC4.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else if (ChaoticZone.currentMap == Map.CHAOTIC_ZONE)
- {
- int[] loc = Config.SPAWN_LOC[Rnd.get(Config.SPAWN_LOC.length)];
- aChar.teleToLocation(loc[0] + Rnd.get(-100, 200), loc[1] + Rnd.get(-100, 200), loc[2]);
- }
- else
- {
- character.setInsideZone(L2Character.ZONE_CHAOTIC5, true);
- }
- }
- }
- break;
- }
- }
- @Override
- protected void onExit(final L2Character character)
- {
- character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
- character.setInsideZone(L2Character.ZONE_CHAOTIC, false);
- character.setInsideZone(L2Character.ZONE_CHAOTIC1, false);
- character.setInsideZone(L2Character.ZONE_CHAOTIC2, false);
- character.setInsideZone(L2Character.ZONE_CHAOTIC3, false);
- character.setInsideZone(L2Character.ZONE_CHAOTIC4, false);
- character.setInsideZone(L2Character.ZONE_CHAOTIC5, false);
- }
- @Override
- protected void onDieInside(final L2Character character)
- {
- }
- static void heal(L2PcInstance activeChar)
- {
- }
- @Override
- protected void onReviveInside(final L2Character character)
- {
- onEnter(character);
- }
- /**
- * @return
- */
- public static int getInstance()
- {
- return 0;
- }
- }
- -----------------------------
- Config.java
- -----------------------------
- public static int[][] SPAWN_LOC;
- public static int[][] SPAWN_LOC1;
- public static int[][] SPAWN_LOC2;
- public static int[][] SPAWN_LOC3;
- public static int[][] SPAWN_LOC4;
- public static int[][] SPAWN_LOC5;
- public static void ChaoticConfig()
- {
- final String CZoneConfig = "./config/fun/L2ChaoticZone.properties";
- try
- {
- final Properties Chaotic = new Properties();
- final InputStream is = new FileInputStream(new File(CZoneConfig));
- Chaotic.load(is);
- is.close();
- SPAWN_LOC = ChaoticSpawn(Chaotic.getProperty("SpawnLoc", "150111,144740,-12248"));
- SPAWN_LOC1 = ChaoticSpawn(Chaotic.getProperty("SpawnLoc", "150111,144740,-12248"));
- SPAWN_LOC2 = ChaoticSpawn(Chaotic.getProperty("SpawnLoc", "150111,144740,-12248"));
- SPAWN_LOC3 = ChaoticSpawn(Chaotic.getProperty("SpawnLoc", "150111,144740,-12248"));
- SPAWN_LOC4 = ChaoticSpawn(Chaotic.getProperty("SpawnLoc", "150111,144740,-12248"));
- SPAWN_LOC5 = ChaoticSpawn(Chaotic.getProperty("SpawnLoc", "150111,144740,-12248"));
- }
- catch (final Exception e)
- {
- e.printStackTrace();
- throw new Error("Failed to Load " + CZoneConfig + " File.");
- }
- }
- private static int[][] ChaoticSpawn(String line)
- {
- final String[] propertySplit = line.split(";");
- if (propertySplit.length == 0)
- return null;
- int i = 0;
- String[] valueSplit;
- final int[][] result = new int[propertySplit.length][];
- for (String value : propertySplit)
- {
- valueSplit = value.split(",");
- if (valueSplit.length != 3)
- {
- return null;
- }
- result[i] = new int[3];
- try
- {
- result[i][0] = Integer.parseInt(valueSplit[0]);
- }
- catch (NumberFormatException e)
- {
- return null;
- }
- try
- {
- result[i][1] = Integer.parseInt(valueSplit[1]);
- }
- catch (NumberFormatException e)
- {
- return null;
- }
- try
- {
- result[i][2] = Integer.parseInt(valueSplit[2]);
- }
- catch (NumberFormatException e)
- {
- return null;
- }
- i++;
- }
- return result;
- }
- inside here
- public static void load()
- {
- if (ServerType.serverMode == ServerType.MODE_GAMESERVER)
- {
- put this
- //L2jLuna Dev.
- ChaoticConfig();
- ---------------------------------------
- L2Chatacter.java
- ---------------------------------------
- find this
- ZONE_NOSTORE
- and put this after
- public static final int ZONE_CHAOTIC = 67230; // The id from zone 1
- public static final int ZONE_CHAOTIC1 = 67231; // The id from zone 2
- public static final int ZONE_CHAOTIC2 = 67232; // The id from zone 3
- public static final int ZONE_CHAOTIC3 = 67233; // The id from zone 4
- public static final int ZONE_CHAOTIC4 = 67234; // The id from zone 5
- public static final int ZONE_CHAOTIC5 = 67235; // The id from zone 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement