Map region data moved from CSV to XML.
This commit is contained in:
parent
0bb9dc685b
commit
2a47acc03b
@ -66,7 +66,7 @@ AltKarmaPlayerCanTrade = True
|
||||
AltKarmaPlayerCanUseWareHouse = True
|
||||
|
||||
# The dead player and the player that will use a SOE of any type will be teleported to floran
|
||||
AltKarmaTeleportToFloran = True
|
||||
AltKarmaTeleportToFloran = False
|
||||
|
||||
# --------------------------------
|
||||
# PvP Color System
|
||||
|
41
L2J_Mobius_C6_Interlude/dist/game/data/MapRegions.xml
vendored
Normal file
41
L2J_Mobius_C6_Interlude/dist/game/data/MapRegions.xml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!-- 0 = Talking Island Village -->
|
||||
<!-- 1 = Elven Village -->
|
||||
<!-- 2 = Dark Elven Village -->
|
||||
<!-- 3 = Orc Village -->
|
||||
<!-- 4 = Dwarven Village -->
|
||||
<!-- 5 = Town of Gludio -->
|
||||
<!-- 6 = Gludin Village -->
|
||||
<!-- 7 = Town of Dion -->
|
||||
<!-- 8 = Town of Giran -->
|
||||
<!-- 9 = Town of Oren -->
|
||||
<!-- 10 = Town of Aden -->
|
||||
<!-- 11 = Hunters Village -->
|
||||
<!-- 12 = Giran Harbor -->
|
||||
<!-- 13 = Heine -->
|
||||
<!-- 14 = Rune Township -->
|
||||
<!-- 15 = Town of Goddard -->
|
||||
<!-- 16 = Town of Shuttgart -->
|
||||
<!-- 17 = Floran Village -->
|
||||
<!-- 18 = Primeval Isle -->
|
||||
<!-- default = Town of Aden -->
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/MapRegions.xsd">
|
||||
<map id="0" region1="3" region2="3" region3="3" region4="3" region5="3" region6="4" region7="4" region8="4" region9="4" region10="4" />
|
||||
<map id="1" region1="3" region2="3" region3="3" region4="3" region5="3" region6="4" region7="4" region8="4" region9="4" region10="4" />
|
||||
<map id="2" region1="3" region2="3" region3="7" region4="9" region5="11" region6="4" region7="4" region8="4" region9="4" region10="4" />
|
||||
<map id="3" region1="3" region2="3" region3="3" region4="3" region5="3" region6="4" region7="4" region8="4" region9="4" region10="4" />
|
||||
<map id="4" region1="3" region2="3" region3="3" region4="3" region5="3" region6="4" region7="4" region8="4" region9="4" region10="4" />
|
||||
<map id="5" region1="3" region2="3" region3="3" region4="3" region5="3" region6="16" region7="16" region8="16" region9="15" region10="15" />
|
||||
<map id="6" region1="3" region2="3" region3="3" region4="3" region5="3" region6="16" region7="16" region8="16" region9="15" region10="15" />
|
||||
<map id="7" region1="3" region2="3" region3="3" region4="3" region5="3" region6="14" region7="14" region8="15" region9="15" region10="15" />
|
||||
<map id="8" region1="3" region2="3" region3="3" region4="14" region5="14" region6="14" region7="14" region8="15" region9="15" region10="15" />
|
||||
<map id="9" region1="2" region2="2" region3="2" region4="2" region5="18" region6="2" region7="9" region8="9" region9="10" region10="10" />
|
||||
<map id="10" region1="2" region2="2" region3="2" region4="2" region5="2" region6="9" region7="9" region8="10" region9="10" region10="10" />
|
||||
<map id="11" region1="2" region2="2" region3="2" region4="2" region5="1" region6="1" region7="9" region8="11" region9="10" region10="10" />
|
||||
<map id="12" region1="6" region2="6" region3="2" region4="5" region5="1" region6="1" region7="9" region8="11" region9="11" region10="11" />
|
||||
<map id="13" region1="6" region2="6" region3="5" region4="5" region5="7" region6="7" region7="8" region8="8" region9="8" region10="8" />
|
||||
<map id="14" region1="6" region2="6" region3="6" region4="5" region5="7" region6="7" region7="8" region8="8" region9="8" region10="8" />
|
||||
<map id="15" region1="0" region2="6" region3="6" region4="5" region5="17" region6="12" region7="13" region8="13" region9="13" region10="13" />
|
||||
<map id="16" region1="0" region2="0" region3="6" region4="6" region5="12" region6="12" region7="13" region8="13" region9="13" region10="13" />
|
||||
<map id="17" region1="0" region2="0" region3="0" region4="0" region5="0" region6="0" region7="13" region8="13" region9="13" region10="13" />
|
||||
</list>
|
@ -1,58 +0,0 @@
|
||||
# region;sec0;sec1;sec2;sec3;sec4;sec5;sec6;sec7;sec8;sec9
|
||||
|
||||
# 0 = "Talking Island Village"
|
||||
# 1 = "Elven Village"
|
||||
# 2 = "Dark Elven Village"
|
||||
# 3 = "Orc Village"
|
||||
# 4 = "Dwarven Village"
|
||||
# 5 = "Town of Gludio"
|
||||
# 6 = "Gludin Village"
|
||||
# 7 = "Town of Dion"
|
||||
# 8 = "Town of Giran"
|
||||
# 9 = "Town of Oren"
|
||||
# 10 = "Town of Aden"
|
||||
# 11 = "Hunters Village"
|
||||
# 12 = "Giran Harbor"
|
||||
# 13 = "Heine"
|
||||
# 14 = "Rune Township"
|
||||
# 15 = "Town of Goddard"
|
||||
# 16 = "Town of Shuttgart"
|
||||
# 17 = "Floran Village"
|
||||
# 18 = "Primeval Isle"
|
||||
# default = "Town of Aden"
|
||||
# _8
|
||||
0;3;3;3;3;3;4;4;4;4;4
|
||||
# _9
|
||||
1;3;3;3;3;3;4;4;4;4;4
|
||||
# _10
|
||||
2;3;3;7;9;11;4;4;4;4;4
|
||||
# _11
|
||||
3;3;3;3;3;3;4;4;4;4;4
|
||||
# _12
|
||||
4;3;3;3;3;3;4;4;4;4;4
|
||||
# _13
|
||||
5;3;3;3;3;3;16;16;16;15;15
|
||||
# _14
|
||||
6;3;3;3;3;3;16;16;16;15;15
|
||||
# _15
|
||||
7;3;3;3;3;3;14;14;15;15;15
|
||||
# _16
|
||||
8;3;3;3;14;14;14;14;15;15;15
|
||||
# _17
|
||||
9;2;2;2;2;18;2;9;9;10;10
|
||||
# _18
|
||||
10;2;2;2;2;2;9;9;10;10;10
|
||||
# _19
|
||||
11;2;2;2;2;1;1;9;11;10;10
|
||||
# _20
|
||||
12;6;6;2;5;1;1;9;11;11;11
|
||||
# _21
|
||||
13;6;6;5;5;7;7;8;8;8;8
|
||||
# _22
|
||||
14;6;6;6;5;7;7;8;8;8;8
|
||||
# _23
|
||||
15;0;6;6;5;17;12;13;13;13;13
|
||||
# _24
|
||||
16;0;0;6;6;12;12;13;13;13;13
|
||||
# _25
|
||||
17;0;0;0;0;0;0;13;13;13;13
|
Can't render this file because it contains an unexpected character in line 3 and column 7.
|
27
L2J_Mobius_C6_Interlude/dist/game/data/xsd/MapRegions.xsd
vendored
Normal file
27
L2J_Mobius_C6_Interlude/dist/game/data/xsd/MapRegions.xsd
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="list">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="map" maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:byte" name="id" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region1" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region2" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region3" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region4" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region5" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region6" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region7" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region8" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region9" use="required"/>
|
||||
<xs:attribute type="xs:byte" name="region10" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
@ -2400,7 +2400,7 @@ public class Config
|
||||
ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pvpSettings.getProperty("AltKarmaPlayerCanTeleport", "true"));
|
||||
ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pvpSettings.getProperty("AltKarmaPlayerCanTrade", "true"));
|
||||
ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pvpSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
|
||||
ALT_KARMA_TELEPORT_TO_FLORAN = Boolean.parseBoolean(pvpSettings.getProperty("AltKarmaTeleportToFloran", "true"));
|
||||
ALT_KARMA_TELEPORT_TO_FLORAN = Boolean.parseBoolean(pvpSettings.getProperty("AltKarmaTeleportToFloran", "false"));
|
||||
/** Custom Reword **/
|
||||
PVP_REWARD_ENABLED = Boolean.parseBoolean(pvpSettings.getProperty("PvpRewardEnabled", "false"));
|
||||
PVP_REWARD_ID = Integer.parseInt(pvpSettings.getProperty("PvpRewardItemId", "6392"));
|
||||
|
@ -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.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.csv.NpcWalkerRouteTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.CharTemplateTable;
|
||||
@ -71,6 +70,7 @@ import org.l2jmobius.gameserver.datatables.xml.FenceData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.FishData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.HennaData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.ManorSeedData;
|
||||
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;
|
||||
@ -203,7 +203,7 @@ public class GameServer
|
||||
|
||||
Util.printSection("World");
|
||||
World.getInstance();
|
||||
MapRegionTable.getInstance();
|
||||
MapRegionData.getInstance();
|
||||
Announcements.getInstance();
|
||||
AutoAnnouncementHandler.getInstance();
|
||||
GlobalVariablesManager.getInstance();
|
||||
|
@ -1,610 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.instancemanager.ArenaManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.TownManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.entity.ClanHall;
|
||||
import org.l2jmobius.gameserver.model.entity.siege.Castle;
|
||||
import org.l2jmobius.gameserver.model.entity.siege.Fort;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.type.ArenaZone;
|
||||
import org.l2jmobius.gameserver.model.zone.type.ClanHallZone;
|
||||
import org.l2jmobius.gameserver.model.zone.type.TownZone;
|
||||
|
||||
public class MapRegionTable
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(MapRegionTable.class.getName());
|
||||
|
||||
private final int[][] _regions = new int[19][21];
|
||||
private final int[][] _pointsWithKarmas;
|
||||
|
||||
private MapRegionTable()
|
||||
{
|
||||
FileReader reader = null;
|
||||
BufferedReader buff = null;
|
||||
LineNumberReader lnr = null;
|
||||
|
||||
try
|
||||
{
|
||||
final File fileData = new File(Config.DATAPACK_ROOT + "/data/csv/mapregion.csv");
|
||||
|
||||
reader = new FileReader(fileData);
|
||||
buff = new BufferedReader(reader);
|
||||
lnr = new LineNumberReader(buff);
|
||||
|
||||
String line = null;
|
||||
|
||||
int region;
|
||||
|
||||
while ((line = lnr.readLine()) != null)
|
||||
{
|
||||
// ignore comments
|
||||
if ((line.trim().length() == 0) || line.startsWith("#"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final StringTokenizer st = new StringTokenizer(line, ";");
|
||||
|
||||
region = Integer.parseInt(st.nextToken());
|
||||
|
||||
for (int j = 0; j < 10; j++)
|
||||
{
|
||||
_regions[j][region] = Integer.parseInt(st.nextToken());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
LOGGER.warning("mapregion.csv is missing in data folder");
|
||||
}
|
||||
catch (NoSuchElementException e1)
|
||||
{
|
||||
LOGGER.warning("Error for structure CSV file: ");
|
||||
}
|
||||
catch (IOException e0)
|
||||
{
|
||||
LOGGER.warning("Error while creating table: " + e0);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lnr != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
lnr.close();
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
LOGGER.warning("Problem with MapRegionTable: " + e1.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
if (buff != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
buff.close();
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
LOGGER.warning("Problem with MapRegionTable: " + e1.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
if (reader != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
reader.close();
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
LOGGER.warning("Problem with MapRegionTable: " + e1.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_pointsWithKarmas = new int[19][3];
|
||||
// Talking Island
|
||||
_pointsWithKarmas[0][0] = -79077;
|
||||
_pointsWithKarmas[0][1] = 240355;
|
||||
_pointsWithKarmas[0][2] = -3440;
|
||||
// Elven
|
||||
_pointsWithKarmas[1][0] = 43503;
|
||||
_pointsWithKarmas[1][1] = 40398;
|
||||
_pointsWithKarmas[1][2] = -3450;
|
||||
// DarkElven
|
||||
_pointsWithKarmas[2][0] = 1675;
|
||||
_pointsWithKarmas[2][1] = 19581;
|
||||
_pointsWithKarmas[2][2] = -3110;
|
||||
// Orc
|
||||
_pointsWithKarmas[3][0] = -44413;
|
||||
_pointsWithKarmas[3][1] = -121762;
|
||||
_pointsWithKarmas[3][2] = -235;
|
||||
// Dwalf
|
||||
_pointsWithKarmas[4][0] = 12009;
|
||||
_pointsWithKarmas[4][1] = -187319;
|
||||
_pointsWithKarmas[4][2] = -3309;
|
||||
// Gludio
|
||||
_pointsWithKarmas[5][0] = -18872;
|
||||
_pointsWithKarmas[5][1] = 126216;
|
||||
_pointsWithKarmas[5][2] = -3280;
|
||||
// Gludin
|
||||
_pointsWithKarmas[6][0] = -85915;
|
||||
_pointsWithKarmas[6][1] = 150402;
|
||||
_pointsWithKarmas[6][2] = -3060;
|
||||
// Dion
|
||||
_pointsWithKarmas[7][0] = 23652;
|
||||
_pointsWithKarmas[7][1] = 144823;
|
||||
_pointsWithKarmas[7][2] = -3330;
|
||||
// Giran
|
||||
_pointsWithKarmas[8][0] = 79125;
|
||||
_pointsWithKarmas[8][1] = 154197;
|
||||
_pointsWithKarmas[8][2] = -3490;
|
||||
// Oren
|
||||
_pointsWithKarmas[9][0] = 73840;
|
||||
_pointsWithKarmas[9][1] = 58193;
|
||||
_pointsWithKarmas[9][2] = -2730;
|
||||
// Aden
|
||||
_pointsWithKarmas[10][0] = 44413;
|
||||
_pointsWithKarmas[10][1] = 22610;
|
||||
_pointsWithKarmas[10][2] = 235;
|
||||
// Hunters
|
||||
_pointsWithKarmas[11][0] = 114137;
|
||||
_pointsWithKarmas[11][1] = 72993;
|
||||
_pointsWithKarmas[11][2] = -2445;
|
||||
// Giran
|
||||
_pointsWithKarmas[12][0] = 79125;
|
||||
_pointsWithKarmas[12][1] = 154197;
|
||||
_pointsWithKarmas[12][2] = -3490;
|
||||
// heine
|
||||
_pointsWithKarmas[13][0] = 119536;
|
||||
_pointsWithKarmas[13][1] = 218558;
|
||||
_pointsWithKarmas[13][2] = -3495;
|
||||
// Rune Castle Town
|
||||
_pointsWithKarmas[14][0] = 42931;
|
||||
_pointsWithKarmas[14][1] = -44733;
|
||||
_pointsWithKarmas[14][2] = -1326;
|
||||
// Goddard
|
||||
_pointsWithKarmas[15][0] = 147419;
|
||||
_pointsWithKarmas[15][1] = -64980;
|
||||
_pointsWithKarmas[15][2] = -3457;
|
||||
// Schuttgart
|
||||
_pointsWithKarmas[16][0] = 85184;
|
||||
_pointsWithKarmas[16][1] = -138560;
|
||||
_pointsWithKarmas[16][2] = -2256;
|
||||
// TODO Primeval Isle
|
||||
_pointsWithKarmas[18][0] = 10468;
|
||||
_pointsWithKarmas[18][1] = -24569;
|
||||
_pointsWithKarmas[18][2] = -3645;
|
||||
}
|
||||
|
||||
public int getMapRegion(int posX, int posY)
|
||||
{
|
||||
return _regions[getMapRegionX(posX)][getMapRegionY(posY)];
|
||||
}
|
||||
|
||||
public int getMapRegionX(int posX)
|
||||
{
|
||||
return (posX >> 15) + 4; // + centerTileX;
|
||||
}
|
||||
|
||||
public int getMapRegionY(int posY)
|
||||
{
|
||||
return (posY >> 15) + 10; // + centerTileX;
|
||||
}
|
||||
|
||||
public int getAreaCastle(Creature creature)
|
||||
{
|
||||
final int area = getClosestTownNumber(creature);
|
||||
int castle;
|
||||
|
||||
switch (area)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
castle = 1;
|
||||
break; // Talking Island Village
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
castle = 4;
|
||||
break; // Elven Village
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
castle = 4;
|
||||
break; // Dark Elven Village
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
castle = 9;
|
||||
break; // Orc Village
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
castle = 9;
|
||||
break; // Dwarven Village
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
castle = 1;
|
||||
break; // Town of Gludio
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
castle = 1;
|
||||
break; // Gludin Village
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
castle = 2;
|
||||
break; // Town of Dion
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
castle = 3;
|
||||
break; // Town of Giran
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
castle = 4;
|
||||
break; // Town of Oren
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
castle = 5;
|
||||
break; // Town of Aden
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
castle = 5;
|
||||
break; // Hunters Village
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
castle = 3;
|
||||
break; // Giran Harbor
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
castle = 6;
|
||||
break; // Heine
|
||||
}
|
||||
case 14:
|
||||
{
|
||||
castle = 8;
|
||||
break; // Rune Township
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
castle = 7;
|
||||
break; // Town of Goddard
|
||||
}
|
||||
case 16:
|
||||
{
|
||||
castle = 9;
|
||||
break; // Town of Shuttgart
|
||||
}
|
||||
case 17:
|
||||
{
|
||||
castle = 4;
|
||||
break; // Ivory Tower
|
||||
}
|
||||
case 18:
|
||||
{
|
||||
castle = 8;
|
||||
break; // Primeval Isle Wharf
|
||||
}
|
||||
default:
|
||||
{
|
||||
castle = 5;
|
||||
break; // Town of Aden
|
||||
}
|
||||
}
|
||||
return castle;
|
||||
}
|
||||
|
||||
public int getClosestTownNumber(Creature creature)
|
||||
{
|
||||
return getMapRegion(creature.getX(), creature.getY());
|
||||
}
|
||||
|
||||
public String getClosestTownName(Creature creature)
|
||||
{
|
||||
final int nearestTownId = getMapRegion(creature.getX(), creature.getY());
|
||||
String nearestTown;
|
||||
|
||||
switch (nearestTownId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
nearestTown = "Talking Island Village";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
nearestTown = "Elven Village";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
nearestTown = "Dark Elven Village";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
nearestTown = "Orc Village";
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
nearestTown = "Dwarven Village";
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
nearestTown = "Town of Gludio";
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
nearestTown = "Gludin Village";
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
nearestTown = "Town of Dion";
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
nearestTown = "Town of Giran";
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
nearestTown = "Town of Oren";
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
nearestTown = "Town of Aden";
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
nearestTown = "Hunters Village";
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
nearestTown = "Giran Harbor";
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
nearestTown = "Heine";
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
{
|
||||
nearestTown = "Rune Township";
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
nearestTown = "Town of Goddard";
|
||||
break;
|
||||
}
|
||||
case 16:
|
||||
{
|
||||
nearestTown = "Town of Shuttgart";
|
||||
break;
|
||||
}
|
||||
case 18:
|
||||
{
|
||||
nearestTown = "Primeval Isle";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
nearestTown = "Town of Aden";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return nearestTown;
|
||||
}
|
||||
|
||||
public Location getTeleToLocation(Creature creature, TeleportWhereType teleportWhere)
|
||||
{
|
||||
int[] coord;
|
||||
|
||||
if (creature instanceof PlayerInstance)
|
||||
{
|
||||
final PlayerInstance player = (PlayerInstance) creature;
|
||||
|
||||
// If in Monster Derby Track
|
||||
if (player.isInsideZone(ZoneId.MONSTER_TRACK))
|
||||
{
|
||||
return new Location(12661, 181687, -3560);
|
||||
}
|
||||
|
||||
Castle castle = null;
|
||||
Fort fort = null;
|
||||
ClanHall clanhall = null;
|
||||
|
||||
if (player.getClan() != null)
|
||||
{
|
||||
// If teleport to clan hall
|
||||
if (teleportWhere == TeleportWhereType.CLANHALL)
|
||||
{
|
||||
clanhall = ClanHallManager.getInstance().getClanHallByOwner(player.getClan());
|
||||
if (clanhall != null)
|
||||
{
|
||||
final ClanHallZone zone = clanhall.getZone();
|
||||
if (zone != null)
|
||||
{
|
||||
return zone.getSpawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If teleport to castle
|
||||
if (teleportWhere == TeleportWhereType.CASTLE)
|
||||
{
|
||||
castle = CastleManager.getInstance().getCastleByOwner(player.getClan());
|
||||
}
|
||||
|
||||
// If teleport to fort
|
||||
if (teleportWhere == TeleportWhereType.FORTRESS)
|
||||
{
|
||||
fort = FortManager.getInstance().getFortByOwner(player.getClan());
|
||||
}
|
||||
|
||||
// Check if player is on castle&fortress ground
|
||||
if (castle == null)
|
||||
{
|
||||
castle = CastleManager.getInstance().getCastle(player);
|
||||
}
|
||||
|
||||
if (fort == null)
|
||||
{
|
||||
fort = FortManager.getInstance().getFort(player);
|
||||
}
|
||||
|
||||
if ((castle != null) && (castle.getCastleId() > 0))
|
||||
{
|
||||
// If Teleporting to castle or
|
||||
// If is on caslte with siege and player's clan is defender
|
||||
if ((teleportWhere == TeleportWhereType.CASTLE) || ((teleportWhere == TeleportWhereType.CASTLE) && castle.getSiege().isInProgress() && (castle.getSiege().getDefenderClan(player.getClan()) != null)))
|
||||
{
|
||||
coord = castle.getZone().getSpawn();
|
||||
return new Location(coord[0], coord[1], coord[2]);
|
||||
}
|
||||
|
||||
if ((teleportWhere == TeleportWhereType.SIEGEFLAG) && castle.getSiege().isInProgress())
|
||||
{
|
||||
// Check if player's clan is attacker
|
||||
final List<NpcInstance> flags = castle.getSiege().getFlag(player.getClan());
|
||||
if ((flags != null) && !flags.isEmpty())
|
||||
{
|
||||
// Spawn to flag - Need more work to get player to the nearest flag
|
||||
final NpcInstance flag = flags.get(0);
|
||||
return new Location(flag.getX(), flag.getY(), flag.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ((fort != null) && (fort.getFortId() > 0))
|
||||
{
|
||||
// teleporting to castle or fortress
|
||||
// is on caslte with siege and player's clan is defender
|
||||
if ((teleportWhere == TeleportWhereType.FORTRESS) || ((teleportWhere == TeleportWhereType.FORTRESS) && fort.getSiege().isInProgress() && (fort.getSiege().getDefenderClan(player.getClan()) != null)))
|
||||
{
|
||||
coord = fort.getZone().getSpawn();
|
||||
return new Location(coord[0], coord[1], coord[2]);
|
||||
}
|
||||
|
||||
if ((teleportWhere == TeleportWhereType.SIEGEFLAG) && fort.getSiege().isInProgress())
|
||||
{
|
||||
// check if player's clan is attacker
|
||||
final List<NpcInstance> flags = fort.getSiege().getFlag(player.getClan());
|
||||
|
||||
if ((flags != null) && !flags.isEmpty())
|
||||
{
|
||||
// spawn to flag
|
||||
final NpcInstance flag = flags.get(0);
|
||||
return new Location(flag.getX(), flag.getY(), flag.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// teleport RED PK 5+ to Floran Village
|
||||
if ((player.getPkKills() > 5) && (player.getKarma() > 1))
|
||||
{
|
||||
return new Location(17817, 170079, -3530);
|
||||
}
|
||||
|
||||
// Karma player land out of city
|
||||
if (player.getKarma() > 1)
|
||||
{
|
||||
final int closest = getMapRegion(creature.getX(), creature.getY());
|
||||
|
||||
if ((closest >= 0) && (closest < _pointsWithKarmas.length))
|
||||
{
|
||||
return new Location(_pointsWithKarmas[closest][0], _pointsWithKarmas[closest][1], _pointsWithKarmas[closest][2]);
|
||||
}
|
||||
return new Location(17817, 170079, -3530);
|
||||
}
|
||||
|
||||
// Checking if in arena
|
||||
final ArenaZone arena = ArenaManager.getInstance().getArena(player);
|
||||
if (arena != null)
|
||||
{
|
||||
coord = arena.getSpawnLoc();
|
||||
return new Location(coord[0], coord[1], coord[2]);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the nearest town
|
||||
TownZone localZone = null;
|
||||
if ((creature != null) && ((localZone = TownManager.getInstance().getClosestTown(creature)) != null))
|
||||
{
|
||||
coord = localZone.getSpawnLoc();
|
||||
return new Location(coord[0], coord[1], coord[2]);
|
||||
}
|
||||
|
||||
localZone = TownManager.getInstance().getTown(9); // giran
|
||||
coord = localZone.getSpawnLoc();
|
||||
return new Location(coord[0], coord[1], coord[2]);
|
||||
}
|
||||
|
||||
public static MapRegionTable getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final MapRegionTable INSTANCE = new MapRegionTable();
|
||||
}
|
||||
}
|
@ -27,7 +27,6 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.idfactory.IdFactory;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
@ -185,7 +184,7 @@ public class DoorData implements IXmlReader
|
||||
door.setRange(xMin, yMin, zMin, xMax, yMax, zMax);
|
||||
try
|
||||
{
|
||||
door.setMapRegion(MapRegionTable.getInstance().getMapRegion(x, y));
|
||||
door.setMapRegion(MapRegionData.getInstance().getMapRegion(x, y));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -248,7 +247,7 @@ public class DoorData implements IXmlReader
|
||||
int region;
|
||||
try
|
||||
{
|
||||
region = MapRegionTable.getInstance().getMapRegion(x, y);
|
||||
region = MapRegionData.getInstance().getMapRegion(x, y);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -0,0 +1,468 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.datatables.xml;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
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.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.instancemanager.ArenaManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.TownManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.entity.ClanHall;
|
||||
import org.l2jmobius.gameserver.model.entity.siege.Castle;
|
||||
import org.l2jmobius.gameserver.model.entity.siege.Fort;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.type.ArenaZone;
|
||||
import org.l2jmobius.gameserver.model.zone.type.ClanHallZone;
|
||||
import org.l2jmobius.gameserver.model.zone.type.TownZone;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class MapRegionData implements IXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(MapRegionData.class.getName());
|
||||
|
||||
public static final Location FLORAN_VILLAGE_LOCATION = new Location(17817, 170079, -3530);
|
||||
public static final Location JAIL_LOCATION = new Location(-114356, -249645, -2984);
|
||||
private static final Location EXIT_MONSTER_RACE_LOCATION = new Location(12661, 181687, -3560);
|
||||
private static final List<Location> KARMA_LOCATIONS = new ArrayList<>();
|
||||
static
|
||||
{
|
||||
KARMA_LOCATIONS.add(new Location(-79077, 240355, -3440)); // Talking Island Village
|
||||
KARMA_LOCATIONS.add(new Location(43503, 40398, -3450)); // Elven Village
|
||||
KARMA_LOCATIONS.add(new Location(1675, 19581, -3110)); // Dark Elven Village
|
||||
KARMA_LOCATIONS.add(new Location(-44413, -121762, -235)); // Orc Village
|
||||
KARMA_LOCATIONS.add(new Location(12009, -187319, -3309)); // Dwarven Village
|
||||
KARMA_LOCATIONS.add(new Location(-18872, 126216, -3280)); // Town of Gludio
|
||||
KARMA_LOCATIONS.add(new Location(-85915, 150402, -3060)); // Gludin Village
|
||||
KARMA_LOCATIONS.add(new Location(23652, 144823, -3330)); // Town of Dion
|
||||
KARMA_LOCATIONS.add(new Location(79125, 154197, -3490)); // Town of Giran
|
||||
KARMA_LOCATIONS.add(new Location(73840, 58193, -2730)); // Town of Oren
|
||||
KARMA_LOCATIONS.add(new Location(44413, 22610, 235)); // Town of Aden
|
||||
KARMA_LOCATIONS.add(new Location(114137, 72993, -2445)); // Hunters Village
|
||||
KARMA_LOCATIONS.add(new Location(79125, 154197, -3490)); // Giran Harbor
|
||||
KARMA_LOCATIONS.add(new Location(119536, 218558, -3495)); // Heine
|
||||
KARMA_LOCATIONS.add(new Location(42931, -44733, -1326)); // Rune Township
|
||||
KARMA_LOCATIONS.add(new Location(147419, -64980, -3457)); // Town of Goddard
|
||||
KARMA_LOCATIONS.add(new Location(85184, -138560, -2256)); // Town of Shuttgart
|
||||
KARMA_LOCATIONS.add(new Location(17817, 170079, -3530)); // Floran Village
|
||||
KARMA_LOCATIONS.add(new Location(9927, -24138, -3723)); // Primeval Isle Wharf
|
||||
}
|
||||
private static final int[][] REGIONS = new int[19][21];
|
||||
|
||||
protected MapRegionData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
parseDatapackFile("data/MapRegions.xml");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parseDocument(Document doc, File f)
|
||||
{
|
||||
try
|
||||
{
|
||||
int id = 0;
|
||||
final StatSet set = new StatSet();
|
||||
|
||||
final Node n = doc.getFirstChild();
|
||||
for (Node node = n.getFirstChild(); node != null; node = node.getNextSibling())
|
||||
{
|
||||
if ("map".equalsIgnoreCase(node.getNodeName()))
|
||||
{
|
||||
final NamedNodeMap attrs = node.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
final Node attr = attrs.item(i);
|
||||
set.set(attr.getNodeName(), attr.getNodeValue());
|
||||
}
|
||||
|
||||
id = set.getInt("id");
|
||||
REGIONS[0][id] = set.getInt("region1");
|
||||
REGIONS[1][id] = set.getInt("region2");
|
||||
REGIONS[2][id] = set.getInt("region3");
|
||||
REGIONS[3][id] = set.getInt("region4");
|
||||
REGIONS[4][id] = set.getInt("region5");
|
||||
REGIONS[5][id] = set.getInt("region6");
|
||||
REGIONS[6][id] = set.getInt("region7");
|
||||
REGIONS[7][id] = set.getInt("region8");
|
||||
REGIONS[8][id] = set.getInt("region9");
|
||||
REGIONS[9][id] = set.getInt("region10");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Error while reading map region data: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
public int getMapRegion(int posX, int posY)
|
||||
{
|
||||
return REGIONS[getMapRegionX(posX)][getMapRegionY(posY)];
|
||||
}
|
||||
|
||||
public int getMapRegionX(int posX)
|
||||
{
|
||||
// +4 to shift coords to center
|
||||
return (posX >> 15) + 4;
|
||||
}
|
||||
|
||||
public int getMapRegionY(int posY)
|
||||
{
|
||||
// +10 to shift coords to center
|
||||
return (posY >> 15) + 10;
|
||||
}
|
||||
|
||||
public int getAreaCastle(Creature creature)
|
||||
{
|
||||
switch (getClosestTownNumber(creature))
|
||||
{
|
||||
case 0:// Talking Island Village
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
case 1: // Elven Village
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
case 2: // Dark Elven Village
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
case 3: // Orc Village
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
case 4: // Dwarven Village
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
case 5: // Town of Gludio
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
case 6: // Gludin Village
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
case 7: // Town of Dion
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
case 8: // Town of Giran
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
case 9: // Town of Oren
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
case 10: // Town of Aden
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
case 11: // Hunters Village
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
case 12: // Giran Harbor
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
case 13: // Heine
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
case 14: // Rune Township
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
case 15: // Town of Goddard
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
case 16: // Town of Shuttgart
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
case 17: // Ivory Tower
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
case 18: // Primeval Isle Wharf
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
default: // Town of Aden
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getClosestTownNumber(Creature creature)
|
||||
{
|
||||
return getMapRegion(creature.getX(), creature.getY());
|
||||
}
|
||||
|
||||
public String getClosestTownName(Creature creature)
|
||||
{
|
||||
switch (getMapRegion(creature.getX(), creature.getY()))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
return "Talking Island Village";
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
return "Elven Village";
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
return "Dark Elven Village";
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
return "Orc Village";
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
return "Dwarven Village";
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
return "Town of Gludio";
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
return "Gludin Village";
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
return "Town of Dion";
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
return "Town of Giran";
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
return "Town of Oren";
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
return "Town of Aden";
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
return "Hunters Village";
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
return "Giran Harbor";
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
return "Heine";
|
||||
}
|
||||
case 14:
|
||||
{
|
||||
return "Rune Township";
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
return "Town of Goddard";
|
||||
}
|
||||
case 16:
|
||||
{
|
||||
return "Town of Shuttgart";
|
||||
}
|
||||
case 18:
|
||||
{
|
||||
return "Primeval Isle";
|
||||
}
|
||||
default:
|
||||
{
|
||||
return "Town of Aden";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Location getTeleToLocation(Creature creature, TeleportWhereType teleportWhere)
|
||||
{
|
||||
if (creature instanceof PlayerInstance)
|
||||
{
|
||||
final PlayerInstance player = creature.getActingPlayer();
|
||||
|
||||
// If in Monster Derby Track
|
||||
if (player.isInsideZone(ZoneId.MONSTER_TRACK))
|
||||
{
|
||||
return EXIT_MONSTER_RACE_LOCATION;
|
||||
}
|
||||
|
||||
Castle castle = null;
|
||||
Fort fort = null;
|
||||
ClanHall clanhall = null;
|
||||
|
||||
if (player.getClan() != null)
|
||||
{
|
||||
// If teleport to clan hall
|
||||
if (teleportWhere == TeleportWhereType.CLANHALL)
|
||||
{
|
||||
clanhall = ClanHallManager.getInstance().getClanHallByOwner(player.getClan());
|
||||
if (clanhall != null)
|
||||
{
|
||||
final ClanHallZone zone = clanhall.getZone();
|
||||
if (zone != null)
|
||||
{
|
||||
return zone.getSpawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If teleport to castle
|
||||
if (teleportWhere == TeleportWhereType.CASTLE)
|
||||
{
|
||||
castle = CastleManager.getInstance().getCastleByOwner(player.getClan());
|
||||
}
|
||||
|
||||
// If teleport to fort
|
||||
if (teleportWhere == TeleportWhereType.FORTRESS)
|
||||
{
|
||||
fort = FortManager.getInstance().getFortByOwner(player.getClan());
|
||||
}
|
||||
|
||||
// Check if player is on castle or fortress ground
|
||||
if (castle == null)
|
||||
{
|
||||
castle = CastleManager.getInstance().getCastle(player);
|
||||
}
|
||||
|
||||
if (fort == null)
|
||||
{
|
||||
fort = FortManager.getInstance().getFort(player);
|
||||
}
|
||||
|
||||
if ((castle != null) && (castle.getCastleId() > 0))
|
||||
{
|
||||
// If Teleporting to castle or if is on caslte with siege and player's clan is defender
|
||||
if ((teleportWhere == TeleportWhereType.CASTLE) || ((teleportWhere == TeleportWhereType.CASTLE) && castle.getSiege().isInProgress() && (castle.getSiege().getDefenderClan(player.getClan()) != null)))
|
||||
{
|
||||
return castle.getZone().getSpawn();
|
||||
}
|
||||
|
||||
if ((teleportWhere == TeleportWhereType.SIEGEFLAG) && castle.getSiege().isInProgress())
|
||||
{
|
||||
// Check if player's clan is attacker
|
||||
final List<NpcInstance> flags = castle.getSiege().getFlag(player.getClan());
|
||||
if ((flags != null) && !flags.isEmpty())
|
||||
{
|
||||
// Spawn to flag - Need more work to get player to the nearest flag
|
||||
final NpcInstance flag = flags.get(0);
|
||||
return new Location(flag.getX(), flag.getY(), flag.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((fort != null) && (fort.getFortId() > 0))
|
||||
{
|
||||
// Teleporting to castle or fortress is on castle with siege and player's clan is defender
|
||||
if ((teleportWhere == TeleportWhereType.FORTRESS) || ((teleportWhere == TeleportWhereType.FORTRESS) && fort.getSiege().isInProgress() && (fort.getSiege().getDefenderClan(player.getClan()) != null)))
|
||||
{
|
||||
return fort.getZone().getSpawn();
|
||||
}
|
||||
|
||||
if ((teleportWhere == TeleportWhereType.SIEGEFLAG) && fort.getSiege().isInProgress())
|
||||
{
|
||||
// Check if player's clan is attacker
|
||||
final List<NpcInstance> flags = fort.getSiege().getFlag(player.getClan());
|
||||
if ((flags != null) && !flags.isEmpty())
|
||||
{
|
||||
// Spawn to flag
|
||||
final NpcInstance flag = flags.get(0);
|
||||
return new Location(flag.getX(), flag.getY(), flag.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Teleport red pk 5+ to Floran Village
|
||||
if ((player.getPkKills() > 5) && (player.getKarma() > 1))
|
||||
{
|
||||
return FLORAN_VILLAGE_LOCATION;
|
||||
}
|
||||
|
||||
// Karma player land out of city
|
||||
if (player.getKarma() > 1)
|
||||
{
|
||||
final int closest = getMapRegion(creature.getX(), creature.getY());
|
||||
if ((closest >= 0) && (closest < KARMA_LOCATIONS.size()))
|
||||
{
|
||||
return KARMA_LOCATIONS.get(closest);
|
||||
}
|
||||
return FLORAN_VILLAGE_LOCATION;
|
||||
}
|
||||
|
||||
// Checking if in arena
|
||||
final ArenaZone arena = ArenaManager.getInstance().getArena(player);
|
||||
if (arena != null)
|
||||
{
|
||||
return arena.getSpawnLoc();
|
||||
}
|
||||
}
|
||||
|
||||
// Get the nearest town
|
||||
TownZone localZone = null;
|
||||
if ((creature != null) && ((localZone = TownManager.getInstance().getClosestTown(creature)) != null))
|
||||
{
|
||||
return localZone.getSpawnLoc();
|
||||
}
|
||||
|
||||
localZone = TownManager.getInstance().getTown(9); // Giran
|
||||
return localZone.getSpawnLoc();
|
||||
}
|
||||
|
||||
public static MapRegionData getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final MapRegionData INSTANCE = new MapRegionData();
|
||||
}
|
||||
}
|
@ -20,9 +20,9 @@ import java.util.StringTokenizer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
@ -120,7 +120,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
final PlayerInstance player = World.getInstance().getPlayer(targetName);
|
||||
if (player != null)
|
||||
{
|
||||
final Location loc = MapRegionTable.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN);
|
||||
final Location loc = MapRegionData.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN);
|
||||
player.setInstanceId(0);
|
||||
player.teleToLocation(loc, true);
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ package org.l2jmobius.gameserver.handler.admincommandhandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
@ -73,22 +73,22 @@ public class AdminZone implements IAdminCommandHandler
|
||||
BuilderUtil.sendSysMessage(activeChar, "This is NOT a no-store zone.");
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "MapRegion: x:" + MapRegionTable.getInstance().getMapRegionX(activeChar.getX()) + " y:" + MapRegionTable.getInstance().getMapRegionX(activeChar.getY()));
|
||||
BuilderUtil.sendSysMessage(activeChar, "MapRegion: x:" + MapRegionData.getInstance().getMapRegionX(activeChar.getX()) + " y:" + MapRegionData.getInstance().getMapRegionX(activeChar.getY()));
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Closest Town: " + MapRegionTable.getInstance().getClosestTownName(activeChar));
|
||||
BuilderUtil.sendSysMessage(activeChar, "Closest Town: " + MapRegionData.getInstance().getClosestTownName(activeChar));
|
||||
|
||||
Location loc;
|
||||
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CASTLE);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CASTLE);
|
||||
BuilderUtil.sendSysMessage(activeChar, "TeleToLocation (Castle): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
|
||||
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CLANHALL);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CLANHALL);
|
||||
BuilderUtil.sendSysMessage(activeChar, "TeleToLocation (ClanHall): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
|
||||
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, TeleportWhereType.SIEGEFLAG);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(activeChar, TeleportWhereType.SIEGEFLAG);
|
||||
BuilderUtil.sendSysMessage(activeChar, "TeleToLocation (SiegeFlag): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
|
||||
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, TeleportWhereType.TOWN);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(activeChar, TeleportWhereType.TOWN);
|
||||
BuilderUtil.sendSysMessage(activeChar, "TeleToLocation (Town): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
|
||||
}
|
||||
else if (actualCommand.equalsIgnoreCase("admin_zone_reload"))
|
||||
|
@ -17,8 +17,8 @@
|
||||
package org.l2jmobius.gameserver.handler.itemhandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.ManorSeedData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManorManager;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
@ -348,7 +348,7 @@ public class Seed implements IItemHandler
|
||||
|
||||
_seedId = item.getItemId();
|
||||
|
||||
if (areaValid(MapRegionTable.getInstance().getAreaCastle(player)))
|
||||
if (areaValid(MapRegionData.getInstance().getAreaCastle(player)))
|
||||
{
|
||||
// TODO: get right skill level
|
||||
monster.setSeeded(_seedId, player);
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.handler.usercommandhandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -32,7 +32,7 @@ public class Loc implements IUserCommandHandler
|
||||
@Override
|
||||
public boolean useUserCommand(int id, PlayerInstance player)
|
||||
{
|
||||
final int _nearestTown = MapRegionTable.getInstance().getClosestTownNumber(player);
|
||||
final int _nearestTown = MapRegionData.getInstance().getClosestTownNumber(player);
|
||||
SystemMessageId msg;
|
||||
|
||||
switch (_nearestTown)
|
||||
|
@ -19,7 +19,7 @@ package org.l2jmobius.gameserver.instancemanager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.entity.siege.Castle;
|
||||
import org.l2jmobius.gameserver.model.zone.type.TownZone;
|
||||
@ -44,7 +44,7 @@ public class TownManager
|
||||
|
||||
public TownZone getClosestTown(WorldObject activeObject)
|
||||
{
|
||||
switch (MapRegionTable.getInstance().getMapRegion(activeObject.getPosition().getX(), activeObject.getPosition().getY()))
|
||||
switch (MapRegionData.getInstance().getMapRegion(activeObject.getPosition().getX(), activeObject.getPosition().getY()))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
@ -129,7 +129,7 @@ public class TownManager
|
||||
|
||||
public static final int getClosestLocation(WorldObject activeObject)
|
||||
{
|
||||
switch (MapRegionTable.getInstance().getMapRegion(activeObject.getPosition().getX(), activeObject.getPosition().getY()))
|
||||
switch (MapRegionData.getInstance().getMapRegion(activeObject.getPosition().getX(), activeObject.getPosition().getY()))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
@ -242,7 +242,7 @@ public class TownManager
|
||||
|
||||
public boolean townHasCastleInSiege(int x, int y)
|
||||
{
|
||||
final int curtown = MapRegionTable.getInstance().getMapRegion(x, y);
|
||||
final int curtown = MapRegionData.getInstance().getMapRegion(x, y);
|
||||
final int[] castleidarray =
|
||||
{
|
||||
0,
|
||||
|
@ -38,8 +38,8 @@ import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.HeroSkillTable;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.handler.ISkillHandler;
|
||||
@ -807,7 +807,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
||||
*/
|
||||
public void teleToLocation(TeleportWhereType teleportWhere)
|
||||
{
|
||||
teleToLocation(MapRegionTable.getInstance().getTeleToLocation(this, teleportWhere), true);
|
||||
teleToLocation(MapRegionData.getInstance().getTeleToLocation(this, teleportWhere), true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@ import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.instancemanager.AuctionManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@ -602,7 +602,7 @@ public class AuctioneerInstance extends FolkInstance
|
||||
{
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(1);
|
||||
html.setFile("data/html/auction/location.htm");
|
||||
html.replace("%location%", MapRegionTable.getInstance().getClosestTownName(player));
|
||||
html.replace("%location%", MapRegionData.getInstance().getClosestTownName(player));
|
||||
html.replace("%LOCATION%", getPictureName(player));
|
||||
html.replace("%AGIT_LINK_BACK%", "bypass -h npc_" + getObjectId() + "_start");
|
||||
player.sendPacket(html);
|
||||
@ -655,7 +655,7 @@ public class AuctioneerInstance extends FolkInstance
|
||||
|
||||
private String getPictureName(PlayerInstance plyr)
|
||||
{
|
||||
final int nearestTownId = MapRegionTable.getInstance().getMapRegion(plyr.getX(), plyr.getY());
|
||||
final int nearestTownId = MapRegionData.getInstance().getMapRegion(plyr.getX(), plyr.getY());
|
||||
String nearestTown;
|
||||
|
||||
switch (nearestTownId)
|
||||
|
@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.ExperienceData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.FishData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.HennaData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.datatables.xml.RecipeData;
|
||||
import org.l2jmobius.gameserver.enums.Race;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
@ -16952,7 +16953,7 @@ public class PlayerInstance extends Playable
|
||||
setInstanceId(0);
|
||||
setIn7sDungeon(false);
|
||||
|
||||
teleToLocation(-114356, -249645, -2984, false); // Jail
|
||||
teleToLocation(MapRegionData.JAIL_LOCATION, false);
|
||||
break;
|
||||
}
|
||||
case CHAR: // Ban Character
|
||||
@ -17012,7 +17013,7 @@ public class PlayerInstance extends Playable
|
||||
// If player escaped, put him back in jail
|
||||
if ((getPunishLevel() == PunishLevel.JAIL) && !isInsideZone(ZoneId.JAIL))
|
||||
{
|
||||
teleToLocation(-114356, -249645, -2984, true);
|
||||
teleToLocation(MapRegionData.JAIL_LOCATION, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,9 +31,9 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.idfactory.IdFactory;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
@ -542,7 +542,7 @@ public class AutoSpawn
|
||||
}
|
||||
}
|
||||
|
||||
final String nearestTown = MapRegionTable.getInstance().getClosestTownName(npcInst);
|
||||
final String nearestTown = MapRegionData.getInstance().getClosestTownName(npcInst);
|
||||
|
||||
// Announce to all players that the spawn has taken place, with the nearest town location.
|
||||
if (spawnInst.isBroadcasting() && (npcInst != null))
|
||||
|
@ -17,6 +17,7 @@
|
||||
package org.l2jmobius.gameserver.model.zone.type;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
@ -29,13 +30,11 @@ import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
*/
|
||||
public class ArenaZone extends ZoneType
|
||||
{
|
||||
private final int[] _spawnLoc;
|
||||
private final Location _spawnLoc = new Location(0, 0, 0);
|
||||
|
||||
public ArenaZone(int id)
|
||||
{
|
||||
super(id);
|
||||
|
||||
_spawnLoc = new int[3];
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -45,17 +44,17 @@ public class ArenaZone extends ZoneType
|
||||
{
|
||||
case "spawnX":
|
||||
{
|
||||
_spawnLoc[0] = Integer.parseInt(value);
|
||||
_spawnLoc.setX(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
case "spawnY":
|
||||
{
|
||||
_spawnLoc[1] = Integer.parseInt(value);
|
||||
_spawnLoc.setY(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
case "spawnZ":
|
||||
{
|
||||
_spawnLoc[2] = Integer.parseInt(value);
|
||||
_spawnLoc.setZ(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -129,7 +128,7 @@ public class ArenaZone extends ZoneType
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getSpawnLoc()
|
||||
public Location getSpawnLoc()
|
||||
{
|
||||
return _spawnLoc;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.SiegeSummonInstance;
|
||||
@ -36,13 +37,11 @@ import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
public class CastleZone extends ZoneType
|
||||
{
|
||||
private Castle _castle;
|
||||
private final int[] _spawnLoc;
|
||||
private final Location _spawnLoc = new Location(0, 0, 0);
|
||||
|
||||
public CastleZone(int id)
|
||||
{
|
||||
super(id);
|
||||
|
||||
_spawnLoc = new int[3];
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,17 +59,17 @@ public class CastleZone extends ZoneType
|
||||
}
|
||||
case "spawnX":
|
||||
{
|
||||
_spawnLoc[0] = Integer.parseInt(value);
|
||||
_spawnLoc.setX(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
case "spawnY":
|
||||
{
|
||||
_spawnLoc[1] = Integer.parseInt(value);
|
||||
_spawnLoc.setY(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
case "spawnZ":
|
||||
{
|
||||
_spawnLoc[2] = Integer.parseInt(value);
|
||||
_spawnLoc.setZ(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -228,7 +227,7 @@ public class CastleZone extends ZoneType
|
||||
return players;
|
||||
}
|
||||
|
||||
public int[] getSpawn()
|
||||
public Location getSpawn()
|
||||
{
|
||||
return _spawnLoc;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.SiegeSummonInstance;
|
||||
@ -36,13 +37,11 @@ import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
public class FortZone extends ZoneType
|
||||
{
|
||||
private Fort _fort;
|
||||
private final int[] _spawnLoc;
|
||||
private final Location _spawnLoc = new Location(0, 0, 0);
|
||||
|
||||
public FortZone(int id)
|
||||
{
|
||||
super(id);
|
||||
|
||||
_spawnLoc = new int[3];
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,17 +59,17 @@ public class FortZone extends ZoneType
|
||||
}
|
||||
case "spawnX":
|
||||
{
|
||||
_spawnLoc[0] = Integer.parseInt(value);
|
||||
_spawnLoc.setX(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
case "spawnY":
|
||||
{
|
||||
_spawnLoc[1] = Integer.parseInt(value);
|
||||
_spawnLoc.setY(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
case "spawnZ":
|
||||
{
|
||||
_spawnLoc[2] = Integer.parseInt(value);
|
||||
_spawnLoc.setZ(Integer.parseInt(value));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -232,7 +231,7 @@ public class FortZone extends ZoneType
|
||||
* Get the forts defender spawn
|
||||
* @return
|
||||
*/
|
||||
public int[] getSpawn()
|
||||
public Location getSpawn()
|
||||
{
|
||||
return _spawnLoc;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.zone.type;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
@ -101,7 +102,7 @@ public class JailZone extends ZoneType
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_player.teleToLocation(-114356, -249645, -2984); // Jail
|
||||
_player.teleToLocation(MapRegionData.JAIL_LOCATION, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -23,6 +23,7 @@ import org.w3c.dom.Node;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
@ -39,7 +40,7 @@ public class TownZone extends ZoneType
|
||||
private int _redirectTownId;
|
||||
private int _taxById;
|
||||
private boolean _noPeace;
|
||||
private final List<int[]> _spawnLoc;
|
||||
private final List<Location> _spawnLoc;
|
||||
|
||||
public TownZone(int id)
|
||||
{
|
||||
@ -87,29 +88,7 @@ public class TownZone extends ZoneType
|
||||
@Override
|
||||
public void setSpawnLocs(Node node)
|
||||
{
|
||||
final int[] ai = new int[3];
|
||||
|
||||
Node node1 = node.getAttributes().getNamedItem("X");
|
||||
|
||||
if (node1 != null)
|
||||
{
|
||||
ai[0] = Integer.parseInt(node1.getNodeValue());
|
||||
}
|
||||
|
||||
node1 = node.getAttributes().getNamedItem("Y");
|
||||
|
||||
if (node1 != null)
|
||||
{
|
||||
ai[1] = Integer.parseInt(node1.getNodeValue());
|
||||
}
|
||||
|
||||
node1 = node.getAttributes().getNamedItem("Z");
|
||||
|
||||
if (node1 != null)
|
||||
{
|
||||
ai[2] = Integer.parseInt(node1.getNodeValue());
|
||||
}
|
||||
_spawnLoc.add(ai);
|
||||
_spawnLoc.add(new Location(Integer.parseInt(node.getAttributes().getNamedItem("X").getNodeValue()), Integer.parseInt(node.getAttributes().getNamedItem("Y").getNodeValue()), Integer.parseInt(node.getAttributes().getNamedItem("Z").getNodeValue())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -180,11 +159,9 @@ public class TownZone extends ZoneType
|
||||
* Returns this zones spawn location
|
||||
* @return
|
||||
*/
|
||||
public int[] getSpawnLoc()
|
||||
public Location getSpawnLoc()
|
||||
{
|
||||
int[] ai = new int[3];
|
||||
ai = _spawnLoc.get(Rnd.get(_spawnLoc.size()));
|
||||
return ai;
|
||||
return _spawnLoc.get(Rnd.get(_spawnLoc.size()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||
@ -68,7 +68,7 @@ public class RequestRestartPoint extends GameClientPacket
|
||||
{
|
||||
if ((_player._inEventTvT && TvT.isStarted()) || (_player._inEventDM && DM.hasStarted()) || (_player._inEventCTF && CTF.isStarted()))
|
||||
{
|
||||
_player.sendMessage("You can't restart in Event!");
|
||||
_player.sendMessage("You cannot restart while participating in an event!");
|
||||
return;
|
||||
}
|
||||
try
|
||||
@ -104,14 +104,14 @@ public class RequestRestartPoint extends GameClientPacket
|
||||
Util.handleIllegalPlayerAction(_player, "Player " + _player.getName() + " used respawn cheat.", IllegalPlayerAction.PUNISH_KICK);
|
||||
return;
|
||||
}
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(_player, TeleportWhereType.CLANHALL);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(_player, TeleportWhereType.CLANHALL);
|
||||
if ((ClanHallManager.getInstance().getClanHallByOwner(_player.getClan()) != null) && (ClanHallManager.getInstance().getClanHallByOwner(_player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP) != null))
|
||||
{
|
||||
_player.restoreExp(ClanHallManager.getInstance().getClanHallByOwner(_player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl());
|
||||
}
|
||||
break;
|
||||
}
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(_player, TeleportWhereType.TOWN);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(_player, TeleportWhereType.TOWN);
|
||||
break;
|
||||
}
|
||||
case 2: // to castle
|
||||
@ -143,7 +143,7 @@ public class RequestRestartPoint extends GameClientPacket
|
||||
{
|
||||
teleportWhere = TeleportWhereType.FORTRESS;
|
||||
}
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(_player, teleportWhere);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(_player, teleportWhere);
|
||||
break;
|
||||
}
|
||||
case 3: // to siege HQ
|
||||
@ -166,7 +166,7 @@ public class RequestRestartPoint extends GameClientPacket
|
||||
Util.handleIllegalPlayerAction(_player, "Player " + _player.getName() + " used respawn cheat.", IllegalPlayerAction.PUNISH_KICK);
|
||||
return;
|
||||
}
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(_player, TeleportWhereType.SIEGEFLAG);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(_player, TeleportWhereType.SIEGEFLAG);
|
||||
break;
|
||||
}
|
||||
case 4: // Fixed or Player is a festival participant
|
||||
@ -187,17 +187,17 @@ public class RequestRestartPoint extends GameClientPacket
|
||||
{
|
||||
return;
|
||||
}
|
||||
loc = new Location(-114356, -249645, -2984);
|
||||
loc = MapRegionData.JAIL_LOCATION;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
if ((_player.getKarma() > 0) && Config.ALT_KARMA_TELEPORT_TO_FLORAN)
|
||||
{
|
||||
loc = new Location(17836, 170178, -3507); // Floran Village
|
||||
loc = MapRegionData.FLORAN_VILLAGE_LOCATION; // Floran Village
|
||||
break;
|
||||
}
|
||||
loc = MapRegionTable.getInstance().getTeleToLocation(_player, TeleportWhereType.TOWN);
|
||||
loc = MapRegionData.getInstance().getTeleToLocation(_player, TeleportWhereType.TOWN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
||||
import org.l2jmobius.gameserver.handler.VoicedCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
|
||||
@ -287,10 +287,10 @@ public class Say2 extends GameClientPacket
|
||||
player.sendMessage("You must have at least " + Config.GLOBAL_PVP_AMOUNT + " pvp kills in order to speak in global chat");
|
||||
return;
|
||||
}
|
||||
final int region = MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
final int region = MapRegionData.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
for (PlayerInstance plr : World.getInstance().getAllPlayers())
|
||||
{
|
||||
if (region == MapRegionTable.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
if (region == MapRegionData.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
{
|
||||
// Like L2OFF if player is blocked can't read the message
|
||||
if (!plr.getBlockList().isInBlockList(player))
|
||||
@ -302,10 +302,10 @@ public class Say2 extends GameClientPacket
|
||||
}
|
||||
else
|
||||
{
|
||||
final int region = MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
final int region = MapRegionData.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
for (PlayerInstance plr : World.getInstance().getAllPlayers())
|
||||
{
|
||||
if (region == MapRegionTable.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
if (region == MapRegionData.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
{
|
||||
// Like L2OFF if player is blocked can't read the message
|
||||
if (!plr.getBlockList().isInBlockList(player))
|
||||
@ -389,10 +389,10 @@ public class Say2 extends GameClientPacket
|
||||
player.sendMessage("You must have at least " + Config.TRADE_PVP_AMOUNT + " pvp kills in order to speak in trade chat");
|
||||
return;
|
||||
}
|
||||
final int region = MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
final int region = MapRegionData.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
for (PlayerInstance plr : World.getInstance().getAllPlayers())
|
||||
{
|
||||
if (region == MapRegionTable.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
if (region == MapRegionData.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
{
|
||||
// Like L2OFF if player is blocked can't read the message
|
||||
if (!plr.getBlockList().isInBlockList(player))
|
||||
@ -409,10 +409,10 @@ public class Say2 extends GameClientPacket
|
||||
player.sendMessage("Only Nobless Players Can Use This Chat");
|
||||
return;
|
||||
}
|
||||
final int region = MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
final int region = MapRegionData.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
for (PlayerInstance plr : World.getInstance().getAllPlayers())
|
||||
{
|
||||
if (region == MapRegionTable.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
if (region == MapRegionData.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
{
|
||||
// Like L2OFF if player is blocked can't read the message
|
||||
if (!plr.getBlockList().isInBlockList(player))
|
||||
@ -424,10 +424,10 @@ public class Say2 extends GameClientPacket
|
||||
}
|
||||
else
|
||||
{
|
||||
final int region = MapRegionTable.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
final int region = MapRegionData.getInstance().getMapRegion(player.getX(), player.getY());
|
||||
for (PlayerInstance plr : World.getInstance().getAllPlayers())
|
||||
{
|
||||
if (region == MapRegionTable.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
if (region == MapRegionData.getInstance().getMapRegion(plr.getX(), plr.getY()))
|
||||
{
|
||||
// Like L2OFF if player is blocked can't read the message
|
||||
if (!plr.getBlockList().isInBlockList(player))
|
||||
|
@ -20,7 +20,6 @@ import org.l2jmobius.gameserver.GameTimeController;
|
||||
import org.l2jmobius.gameserver.RecipeController;
|
||||
import org.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.CharNameTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.CharTemplateTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.ClanTable;
|
||||
@ -29,6 +28,7 @@ import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SkillTreeTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.TeleportLocationTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
|
||||
import org.l2jmobius.gameserver.idfactory.IdFactory;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.entity.Announcements;
|
||||
@ -60,7 +60,7 @@ public interface EngineInterface
|
||||
SpawnTable spawnTable = SpawnTable.getInstance();
|
||||
GameTimeController gameTimeController = GameTimeController.getInstance();
|
||||
Announcements announcements = Announcements.getInstance();
|
||||
MapRegionTable mapRegions = MapRegionTable.getInstance();
|
||||
MapRegionData mapRegions = MapRegionData.getInstance();
|
||||
|
||||
void addQuestDrop(int npcID, int itemID, int min, int max, int chance, String questID, String[] states);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user