📄 l1townlocation.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 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 l1j.server.server.model;
import java.util.logging.Logger;
import java.util.Random;
import l1j.server.server.datatables.TownTable;
import l1j.server.server.templates.L1Town;
import l1j.server.server.types.Point;
// Referenced classes of package l1j.server.server.model:
// L1CastleLocation
public class L1TownLocation {
private static final Logger _log = Logger.getLogger(L1TownLocation.class
.getName());
// town_id
public static final int TOWNID_TALKING_ISLAND = 1;
public static final int TOWNID_SILVER_KNIGHT_TOWN = 2;
public static final int TOWNID_GLUDIO = 3;
public static final int TOWNID_ORCISH_FOREST = 4;
public static final int TOWNID_WINDAWOOD = 5;
public static final int TOWNID_KENT = 6;
public static final int TOWNID_GIRAN = 7;
public static final int TOWNID_HEINE = 8;
public static final int TOWNID_WERLDAN = 9;
public static final int TOWNID_OREN = 10;
// 下記、町税なし
public static final int TOWNID_ELVEN_FOREST = 11;
public static final int TOWNID_ADEN = 12;
public static final int TOWNID_SILENT_CAVERN = 13;
public static final int TOWNID_OUM_DUNGEON = 14;
public static final int TOWNID_RESISTANCE = 15;
public static final int TOWNID_PIRATE_ISLAND = 16;
public static final int TOWNID_RECLUSE_VILLAGE = 17;
// 帰還ロケーション
private static final short GETBACK_MAP_TALKING_ISLAND = 0;
private static final Point[] GETBACK_LOC_TALKING_ISLAND = {
new Point(32600, 32942), new Point(32574, 32944),
new Point(32580, 32923), new Point(32557, 32975),
new Point(32597, 32914), new Point(32580, 32974), };
private static final short GETBACK_MAP_SILVER_KNIGHT_TOWN = 4;
private static final Point[] GETBACK_LOC_SILVER_KNIGHT_TOWN = {
new Point(33071, 33402), new Point(33091, 33396),
new Point(33085, 33402), new Point(33097, 33366),
new Point(33110, 33365), new Point(33072, 33392), };
private static final short GETBACK_MAP_GLUDIO = 4;
private static final Point[] GETBACK_LOC_GLUDIO = {
new Point(32601, 32757), new Point(32625, 32809),
new Point(32611, 32726), new Point(32612, 32781),
new Point(32605, 32761), new Point(32614, 32739),
new Point(32612, 32775), };
private static final short GETBACK_MAP_ORCISH_FOREST = 4;
private static final Point[] GETBACK_LOC_ORCISH_FOREST = {
new Point(32750, 32435), new Point(32745, 32447),
new Point(32738, 32452), new Point(32741, 32436),
new Point(32749, 32446), };
private static final short GETBACK_MAP_WINDAWOOD = 4;
private static final Point[] GETBACK_LOC_WINDAWOOD = {
new Point(32608, 33178), new Point(32626, 33185),
new Point(32630, 33179), new Point(32625, 33207),
new Point(32638, 33203), new Point(32621, 33179), };
private static final short GETBACK_MAP_KENT = 4;
private static final Point[] GETBACK_LOC_KENT = { new Point(33048, 32750),
new Point(33059, 32768), new Point(33047, 32761),
new Point(33059, 32759), new Point(33051, 32775),
new Point(33048, 32778), new Point(33064, 32773),
new Point(33057, 32748), };
private static final short GETBACK_MAP_GIRAN = 4;
private static final Point[] GETBACK_LOC_GIRAN = { new Point(33435, 32803),
new Point(33439, 32817), new Point(33440, 32809),
new Point(33419, 32810), new Point(33426, 32823),
new Point(33418, 32818), new Point(33432, 32824), };
private static final short GETBACK_MAP_HEINE = 4;
private static final Point[] GETBACK_LOC_HEINE = { new Point(33593, 33242),
new Point(33593, 33248), new Point(33604, 33236),
new Point(33599, 33236), new Point(33610, 33247),
new Point(33610, 33241), new Point(33599, 33252),
new Point(33605, 33252), };
private static final short GETBACK_MAP_WERLDAN = 4;
private static final Point[] GETBACK_LOC_WERLDAN = {
new Point(33702, 32492), new Point(33747, 32508),
new Point(33696, 32498), new Point(33723, 32512),
new Point(33710, 32521), new Point(33724, 32488),
new Point(33693, 32513), };
private static final short GETBACK_MAP_OREN = 4;
private static final Point[] GETBACK_LOC_OREN = { new Point(34086, 32280),
new Point(34037, 32230), new Point(34022, 32254),
new Point(34021, 32269), new Point(34044, 32290),
new Point(34049, 32316), new Point(34081, 32249),
new Point(34074, 32313), new Point(34064, 32230), };
private static final short GETBACK_MAP_ELVEN_FOREST = 4;
private static final Point[] GETBACK_LOC_ELVEN_FOREST = {
new Point(33065, 32358), new Point(33052, 32313),
new Point(33030, 32342), new Point(33068, 32320),
new Point(33071, 32314), new Point(33030, 32370),
new Point(33076, 32324), new Point(33068, 32336), };
private static final short GETBACK_MAP_ADEN = 4;
private static final Point[] GETBACK_LOC_ADEN = { new Point(33915, 33114),
new Point(34061, 33115), new Point(34090, 33168),
new Point(34011, 33136), new Point(34093, 33117),
new Point(33959, 33156), new Point(33992, 33120),
new Point(34047, 33156), };
private static final short GETBACK_MAP_SILENT_CAVERN = 304;
private static final Point[] GETBACK_LOC_SILENT_CAVERN = {
new Point(32856, 32898), new Point(32860, 32916),
new Point(32868, 32893), new Point(32875, 32903),
new Point(32855, 32898), };
private static final short GETBACK_MAP_OUM_DUNGEON = 310;
private static final Point[] GETBACK_LOC_OUM_DUNGEON = {
new Point(32818, 32805), new Point(32800, 32798),
new Point(32815, 32819), new Point(32823, 32811),
new Point(32817, 32828), };
private static final short GETBACK_MAP_RESISTANCE = 400;
private static final Point[] GETBACK_LOC_RESISTANCE = {
new Point(32570, 32667), new Point(32559, 32678),
new Point(32564, 32683), new Point(32574, 32661),
new Point(32576, 32669), new Point(32572, 32662), };
private static final short GETBACK_MAP_PIRATE_ISLAND = 440;
private static final Point[] GETBACK_LOC_PIRATE_ISLAND = {
new Point(32431, 33058), new Point(32407, 33054), };
private static final short GETBACK_MAP_RECLUSE_VILLAGE = 400;
private static final Point[] GETBACK_LOC_RECLUSE_VILLAGE = {
new Point(32599, 32916), new Point(32599, 32923),
new Point(32603, 32908), new Point(32595, 32908),
new Point(32591, 32918), };
private L1TownLocation() {
}
public static int[] getGetBackLoc(int town_id) { // town_idから帰還先の座標をランダムに返す
Random random = new Random();
int[] loc = new int[3];
if (town_id == TOWNID_TALKING_ISLAND) { // TI
int rnd = random.nextInt(GETBACK_LOC_TALKING_ISLAND.length);
loc[0] = GETBACK_LOC_TALKING_ISLAND[rnd].getX();
loc[1] = GETBACK_LOC_TALKING_ISLAND[rnd].getY();
loc[2] = GETBACK_MAP_TALKING_ISLAND;
} else if (town_id == TOWNID_SILVER_KNIGHT_TOWN) { // SKT
int rnd = random.nextInt(GETBACK_LOC_SILVER_KNIGHT_TOWN.length);
loc[0] = GETBACK_LOC_SILVER_KNIGHT_TOWN[rnd].getX();
loc[1] = GETBACK_LOC_SILVER_KNIGHT_TOWN[rnd].getY();
loc[2] = GETBACK_MAP_SILVER_KNIGHT_TOWN;
} else if (town_id == TOWNID_KENT) { // ケント
int rnd = random.nextInt(GETBACK_LOC_KENT.length);
loc[0] = GETBACK_LOC_KENT[rnd].getX();
loc[1] = GETBACK_LOC_KENT[rnd].getY();
loc[2] = GETBACK_MAP_KENT;
} else if (town_id == TOWNID_GLUDIO) { // グル
int rnd = random.nextInt(GETBACK_LOC_GLUDIO.length);
loc[0] = GETBACK_LOC_GLUDIO[rnd].getX();
loc[1] = GETBACK_LOC_GLUDIO[rnd].getY();
loc[2] = GETBACK_MAP_GLUDIO;
} else if (town_id == TOWNID_ORCISH_FOREST) { // 火田村
int rnd = random.nextInt(GETBACK_LOC_ORCISH_FOREST.length);
loc[0] = GETBACK_LOC_ORCISH_FOREST[rnd].getX();
loc[1] = GETBACK_LOC_ORCISH_FOREST[rnd].getY();
loc[2] = GETBACK_MAP_ORCISH_FOREST;
} else if (town_id == TOWNID_WINDAWOOD) { // ウッドベック
int rnd = random.nextInt(GETBACK_LOC_WINDAWOOD.length);
loc[0] = GETBACK_LOC_WINDAWOOD[rnd].getX();
loc[1] = GETBACK_LOC_WINDAWOOD[rnd].getY();
loc[2] = GETBACK_MAP_WINDAWOOD;
} else if (town_id == TOWNID_GIRAN) { // ギラン
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -