Turn map id magic numbers into constants

This commit is contained in:
P0nk committed 2021-11-07 14:26:34 +01:00
1 parent c022c3595f
commit b15a7e61d4
51 files changed
+615 -341

No files matched your search

+27 -24
View File
@@ -37,6 +37,7 @@ import config.YamlConfig;
import constants.game.ExpTable; import constants.game.ExpTable;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.id.MobId; import constants.id.MobId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import constants.skills.*; import constants.skills.*;
@@ -405,10 +406,10 @@ public class Character extends AbstractCharacterObject {
//to fix the map 0 lol //to fix the map 0 lol
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
ret.trockmaps.add(999999999); ret.trockmaps.add(MapId.NONE);
} }
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
ret.viptrockmaps.add(999999999); ret.viptrockmaps.add(MapId.NONE);
} }
return ret; return ret;
@@ -583,7 +584,8 @@ public class Character extends AbstractCharacterObject {
String prop = eim.getProperty("groomId"); String prop = eim.getProperty("groomId");
if (prop != null) { if (prop != null) {
return (Integer.parseInt(prop) == id || eim.getIntProperty("brideId") == id) && (mapid == 680000110 || mapid == 680000210); return (Integer.parseInt(prop) == id || eim.getIntProperty("brideId") == id) &&
(mapid == MapId.CHAPEL_WEDDING_ALTAR || mapid == MapId.CATHEDRAL_WEDDING_ALTAR);
} }
} }
@@ -594,7 +596,7 @@ public class Character extends AbstractCharacterObject {
int pts = 0; int pts = 0;
if (dojoPoints < 17000) { if (dojoPoints < 17000) {
pts = 1 + ((mapid - 1) / 100 % 100) / 6; pts = 1 + ((mapid - 1) / 100 % 100) / 6;
if (!GameConstants.isDojoPartyArea(this.getMapId())) { if (!MapId.isPartyDojo(this.getMapId())) {
pts++; pts++;
} }
this.dojoPoints += pts; this.dojoPoints += pts;
@@ -1401,7 +1403,7 @@ public class Character extends AbstractCharacterObject {
// will actually enter the map given as parameter, regardless of being an eventmap or whatnot // will actually enter the map given as parameter, regardless of being an eventmap or whatnot
canWarpCounter++; canWarpCounter++;
eventChangedMap(999999999); eventChangedMap(MapId.NONE);
EventInstanceManager mapEim = target.getEventInstance(); EventInstanceManager mapEim = target.getEventInstance();
if (mapEim != null) { if (mapEim != null) {
@@ -1443,10 +1445,10 @@ public class Character extends AbstractCharacterObject {
if (mbs.getKey() == BuffStat.MAP_PROTECTION) { if (mbs.getKey() == BuffStat.MAP_PROTECTION) {
byte value = (byte) mbs.getValue().value; byte value = (byte) mbs.getValue().value;
if (value == 1 && ((returnMapid == 211000000 && thisMapid != 200082300) || returnMapid == 193000000)) { if (value == 1 && ((returnMapid == MapId.EL_NATH && thisMapid != MapId.ORBIS_TOWER_BOTTOM) || returnMapid == MapId.INTERNET_CAFE)) {
return true; //protection from cold return true; //protection from cold
} else { } else {
return value == 2 && (returnMapid == 230000000 || thisMapid == 200082300); //breathing underwater return value == 2 && (returnMapid == MapId.AQUARIUM || thisMapid == MapId.ORBIS_TOWER_BOTTOM); //breathing underwater
} }
} }
} }
@@ -1456,7 +1458,8 @@ public class Character extends AbstractCharacterObject {
} }
for (Item it : this.getInventory(InventoryType.EQUIPPED).list()) { for (Item it : this.getInventory(InventoryType.EQUIPPED).list()) {
if ((it.getFlag() & ItemConstants.COLD) == ItemConstants.COLD && ((returnMapid == 211000000 && thisMapid != 200082300) || returnMapid == 193000000)) { if ((it.getFlag() & ItemConstants.COLD) == ItemConstants.COLD &&
((returnMapid == MapId.EL_NATH && thisMapid != MapId.ORBIS_TOWER_BOTTOM) || returnMapid == MapId.INTERNET_CAFE)) {
return true; //protection from cold return true; //protection from cold
} }
} }
@@ -1951,7 +1954,7 @@ public class Character extends AbstractCharacterObject {
if (ItemId.isNxCard(mapitem.getItemId()) || mapitem.getMeso() > 0 || ii.isConsumeOnPickup(mapitem.getItemId()) || (hasSpaceInventory = InventoryManipulator.checkSpace(client, mapitem.getItemId(), mItem.getQuantity(), mItem.getOwner()))) { if (ItemId.isNxCard(mapitem.getItemId()) || mapitem.getMeso() > 0 || ii.isConsumeOnPickup(mapitem.getItemId()) || (hasSpaceInventory = InventoryManipulator.checkSpace(client, mapitem.getItemId(), mItem.getQuantity(), mItem.getOwner()))) {
int mapId = this.getMapId(); int mapId = this.getMapId();
if ((mapId > 209000000 && mapId < 209000016) || (mapId >= 990000500 && mapId <= 990000502)) {//happyville trees and guild PQ if ((MapId.isSelfLootableOnly(mapId))) {//happyville trees and guild PQ
if (!mapitem.isPlayerDrop() || mapitem.getDropper().getObjectId() == client.getPlayer().getObjectId()) { if (!mapitem.isPlayerDrop() || mapitem.getDropper().getObjectId() == client.getPlayer().getObjectId()) {
if (mapitem.getMeso() > 0) { if (mapitem.getMeso() > 0) {
if (!mpcs.isEmpty()) { if (!mpcs.isEmpty()) {
@@ -6209,7 +6212,7 @@ public class Character extends AbstractCharacterObject {
} }
public boolean attemptCatchFish(int baitLevel) { public boolean attemptCatchFish(int baitLevel) {
return YamlConfig.config.server.USE_FISHING_SYSTEM && GameConstants.isFishingArea(mapid) && return YamlConfig.config.server.USE_FISHING_SYSTEM && MapId.isFishingArea(mapid) &&
this.getPosition().getY() > 0 && this.getPosition().getY() > 0 &&
ItemConstants.isFishingChair(chair.get()) && ItemConstants.isFishingChair(chair.get()) &&
this.getWorldServer().registerFisherPlayer(this, baitLevel); this.getWorldServer().registerFisherPlayer(this, baitLevel);
@@ -7127,7 +7130,7 @@ public class Character extends AbstractCharacterObject {
ret.map = mapManager.getMap(ret.mapid); ret.map = mapManager.getMap(ret.mapid);
if (ret.map == null) { if (ret.map == null) {
ret.map = mapManager.getMap(100000000); ret.map = mapManager.getMap(MapId.HENESYS);
} }
Portal portal = ret.map.getPortal(ret.initialSpawnPoint); Portal portal = ret.map.getPortal(ret.initialSpawnPoint);
if (portal == null) { if (portal == null) {
@@ -7175,11 +7178,11 @@ public class Character extends AbstractCharacterObject {
} }
} }
while (vip < 10) { while (vip < 10) {
ret.viptrockmaps.add(999999999); ret.viptrockmaps.add(MapId.NONE);
vip++; vip++;
} }
while (reg < 5) { while (reg < 5) {
ret.trockmaps.add(999999999); ret.trockmaps.add(MapId.NONE);
reg++; reg++;
} }
} }
@@ -7585,7 +7588,7 @@ public class Character extends AbstractCharacterObject {
break; break;
} }
} }
if (possesed > 0 && !GameConstants.isDojo(getMapId())) { if (possesed > 0 && !MapId.isDojo(getMapId())) {
message("You have used a safety charm, so your EXP points have not been decreased."); message("You have used a safety charm, so your EXP points have not been decreased.");
InventoryManipulator.removeById(client, ItemConstants.getInventoryType(charmID[i]), charmID[i], 1, true, false); InventoryManipulator.removeById(client, ItemConstants.getInventoryType(charmID[i]), charmID[i], 1, true, false);
usedSafetyCharm = true; usedSafetyCharm = true;
@@ -8410,7 +8413,7 @@ public class Character extends AbstractCharacterObject {
if (map == null || (cashshop != null && cashshop.isOpened())) { if (map == null || (cashshop != null && cashshop.isOpened())) {
ps.setInt(21, mapid); ps.setInt(21, mapid);
} else { } else {
if (map.getForcedReturnId() != 999999999) { if (map.getForcedReturnId() != MapId.NONE) {
ps.setInt(21, map.getForcedReturnId()); ps.setInt(21, map.getForcedReturnId());
} else { } else {
ps.setInt(21, getHp() < 1 ? map.getReturnMapId() : map.getId()); ps.setInt(21, getHp() < 1 ? map.getReturnMapId() : map.getId());
@@ -8418,7 +8421,7 @@ public class Character extends AbstractCharacterObject {
} }
ps.setInt(22, meso.get()); ps.setInt(22, meso.get());
ps.setInt(23, hpMpApUsed); ps.setInt(23, hpMpApUsed);
if (map == null || map.getId() == 610020000 || map.getId() == 610020001) { // reset to first spawnpoint on those maps if (map == null || map.getId() == MapId.CRIMSONWOOD_VALLEY_1 || map.getId() == MapId.CRIMSONWOOD_VALLEY_2) { // reset to first spawnpoint on those maps
ps.setInt(24, 0); ps.setInt(24, 0);
} else { } else {
Portal closest = map.findClosestPlayerSpawnpoint(getPosition()); Portal closest = map.findClosestPlayerSpawnpoint(getPosition());
@@ -8613,7 +8616,7 @@ public class Character extends AbstractCharacterObject {
// Vip teleport rocks // Vip teleport rocks
try (PreparedStatement psVip = con.prepareStatement("INSERT INTO trocklocations(characterid, mapid, vip) VALUES (?, ?, 0)")) { try (PreparedStatement psVip = con.prepareStatement("INSERT INTO trocklocations(characterid, mapid, vip) VALUES (?, ?, 0)")) {
for (int i = 0; i < getTrockSize(); i++) { for (int i = 0; i < getTrockSize(); i++) {
if (trockmaps.get(i) != 999999999) { if (trockmaps.get(i) != MapId.NONE) {
psVip.setInt(1, getId()); psVip.setInt(1, getId());
psVip.setInt(2, trockmaps.get(i)); psVip.setInt(2, trockmaps.get(i));
psVip.addBatch(); psVip.addBatch();
@@ -8625,7 +8628,7 @@ public class Character extends AbstractCharacterObject {
// Regular teleport rocks // Regular teleport rocks
try (PreparedStatement psReg = con.prepareStatement("INSERT INTO trocklocations(characterid, mapid, vip) VALUES (?, ?, 1)")) { try (PreparedStatement psReg = con.prepareStatement("INSERT INTO trocklocations(characterid, mapid, vip) VALUES (?, ?, 1)")) {
for (int i = 0; i < getVipTrockSize(); i++) { for (int i = 0; i < getVipTrockSize(); i++) {
if (viptrockmaps.get(i) != 999999999) { if (viptrockmaps.get(i) != MapId.NONE) {
psReg.setInt(1, getId()); psReg.setInt(1, getId());
psReg.setInt(2, viptrockmaps.get(i)); psReg.setInt(2, viptrockmaps.get(i));
psReg.addBatch(); psReg.addBatch();
@@ -10246,7 +10249,7 @@ public class Character extends AbstractCharacterObject {
} }
public int getTrockSize() { public int getTrockSize() {
int ret = trockmaps.indexOf(999999999); int ret = trockmaps.indexOf(MapId.NONE);
if (ret == -1) { if (ret == -1) {
ret = 5; ret = 5;
} }
@@ -10257,12 +10260,12 @@ public class Character extends AbstractCharacterObject {
public void deleteFromTrocks(int map) { public void deleteFromTrocks(int map) {
trockmaps.remove(Integer.valueOf(map)); trockmaps.remove(Integer.valueOf(map));
while (trockmaps.size() < 10) { while (trockmaps.size() < 10) {
trockmaps.add(999999999); trockmaps.add(MapId.NONE);
} }
} }
public void addTrockMap() { public void addTrockMap() {
int index = trockmaps.indexOf(999999999); int index = trockmaps.indexOf(MapId.NONE);
if (index != -1) { if (index != -1) {
trockmaps.set(index, getMapId()); trockmaps.set(index, getMapId());
} }
@@ -10274,7 +10277,7 @@ public class Character extends AbstractCharacterObject {
} }
public int getVipTrockSize() { public int getVipTrockSize() {
int ret = viptrockmaps.indexOf(999999999); int ret = viptrockmaps.indexOf(MapId.NONE);
if (ret == -1) { if (ret == -1) {
ret = 10; ret = 10;
@@ -10286,12 +10289,12 @@ public class Character extends AbstractCharacterObject {
public void deleteFromVipTrocks(int map) { public void deleteFromVipTrocks(int map) {
viptrockmaps.remove(Integer.valueOf(map)); viptrockmaps.remove(Integer.valueOf(map));
while (viptrockmaps.size() < 10) { while (viptrockmaps.size() < 10) {
viptrockmaps.add(999999999); viptrockmaps.add(MapId.NONE);
} }
} }
public void addVipTrockMap() { public void addVipTrockMap() {
int index = viptrockmaps.indexOf(999999999); int index = viptrockmaps.indexOf(MapId.NONE);
if (index != -1) { if (index != -1) {
viptrockmaps.set(index, getMapId()); viptrockmaps.set(index, getMapId());
} }
+2 -1
View File
@@ -24,6 +24,7 @@ package client;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.MapId;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.timeout.IdleStateEvent; import io.netty.handler.timeout.IdleStateEvent;
@@ -930,7 +931,7 @@ public class Client extends ChannelInboundHandlerAdapter {
if (player.getMap() != null) { if (player.getMap() != null) {
int mapId = player.getMapId(); int mapId = player.getMapId();
player.getMap().removePlayer(player); player.getMap().removePlayer(player);
if (GameConstants.isDojo(mapId)) { if (MapId.isDojo(mapId)) {
this.getChannelServer().freeDojoSectionIfEmpty(mapId); this.getChannelServer().freeDojoSectionIfEmpty(mapId);
} }
} }
@@ -31,6 +31,7 @@ import client.command.commands.gm3.*;
import client.command.commands.gm4.*; import client.command.commands.gm4.*;
import client.command.commands.gm5.*; import client.command.commands.gm5.*;
import client.command.commands.gm6.*; import client.command.commands.gm6.*;
import constants.id.MapId;
import tools.FilePrinter; import tools.FilePrinter;
import tools.Pair; import tools.Pair;
@@ -87,7 +88,7 @@ public class CommandsExecutor {
} }
private void handleInternal(Client client, String message) { private void handleInternal(Client client, String message) {
if (client.getPlayer().getMapId() == 300000012) { if (client.getPlayer().getMapId() == MapId.JAIL) {
client.getPlayer().yellowMessage("You do not have permission to use commands while in jail."); client.getPlayer().yellowMessage("You do not have permission to use commands while in jail.");
return; return;
} }
@@ -26,6 +26,7 @@ package client.command.commands.gm0;
import client.Character; import client.Character;
import client.Client; import client.Client;
import client.command.Command; import client.command.Command;
import constants.id.MapId;
import server.events.gm.Event; import server.events.gm.Event;
import server.maps.FieldLimit; import server.maps.FieldLimit;
@@ -44,7 +45,7 @@ public class JoinEventCommand extends Command {
if (event.getLimit() > 0) { if (event.getLimit() > 0) {
player.saveLocation("EVENT"); player.saveLocation("EVENT");
if (event.getMapId() == 109080000 || event.getMapId() == 109060001) { if (event.getMapId() == MapId.EVENT_COCONUT_HARVEST || event.getMapId() == MapId.EVENT_SNOWBALL_ENTRANCE) {
player.setTeam(event.getLimit() % 2); player.setTeam(event.getLimit() % 2);
} }
@@ -97,7 +97,7 @@ public class GotoCommand extends Command {
} }
} }
HashMap<String, Integer> gotomaps; Map<String, Integer> gotomaps;
if (player.isGM()) { if (player.isGM()) {
gotomaps = new HashMap<>(GameConstants.GOTO_AREAS); // distinct map registry for GM/users suggested thanks to Vcoc gotomaps = new HashMap<>(GameConstants.GOTO_AREAS); // distinct map registry for GM/users suggested thanks to Vcoc
gotomaps.putAll(GameConstants.GOTO_TOWNS); // thanks Halcyon (UltimateMors) for pointing out duplicates on listed entries functionality gotomaps.putAll(GameConstants.GOTO_TOWNS); // thanks Halcyon (UltimateMors) for pointing out duplicates on listed entries functionality
@@ -26,6 +26,7 @@ package client.command.commands.gm2;
import client.Character; import client.Character;
import client.Client; import client.Client;
import client.command.Command; import client.command.Command;
import constants.id.MapId;
import server.maps.MapleMap; import server.maps.MapleMap;
import server.maps.Portal; import server.maps.Portal;
@@ -57,10 +58,8 @@ public class JailCommand extends Command {
if (victim != null) { if (victim != null) {
victim.addJailExpirationTime(MINUTES.toMillis(minutesJailed)); victim.addJailExpirationTime(MINUTES.toMillis(minutesJailed));
int mapid = 300000012; if (victim.getMapId() != MapId.JAIL) { // those gone to jail won't be changing map anyway
MapleMap target = c.getChannelServer().getMapFactory().getMap(MapId.JAIL);
if (victim.getMapId() != mapid) { // those gone to jail won't be changing map anyway
MapleMap target = c.getChannelServer().getMapFactory().getMap(mapid);
Portal targetPortal = target.getPortal(0); Portal targetPortal = target.getPortal(0);
victim.saveLocationOnWarp(); victim.saveLocationOnWarp();
victim.changeMap(target, targetPortal); victim.changeMap(target, targetPortal);
@@ -28,6 +28,7 @@ import client.Client;
import client.command.Command; import client.command.Command;
import client.inventory.Item; import client.inventory.Item;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import java.awt.*; import java.awt.*;
@@ -39,7 +40,7 @@ public class SeedCommand extends Command {
@Override @Override
public void execute(Client c, String[] params) { public void execute(Client c, String[] params) {
Character player = c.getPlayer(); Character player = c.getPlayer();
if (player.getMapId() != 910010000) { if (player.getMapId() != MapId.HENESYS_PQ) {
player.yellowMessage("This command can only be used in HPQ."); player.yellowMessage("This command can only be used in HPQ.");
return; return;
} }
@@ -25,6 +25,7 @@ import client.creator.CharacterFactory;
import client.creator.CharacterFactoryRecipe; import client.creator.CharacterFactoryRecipe;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
/** /**
* @author RonanLana * @author RonanLana
@@ -42,7 +43,7 @@ public class BeginnerCreator extends CharacterFactory {
} }
public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) { public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) {
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.BEGINNER, 1, 10000, top, bottom, shoes, weapon)); int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.BEGINNER, 1, MapId.MUSHROOM_TOWN, top, bottom, shoes, weapon));
return status; return status;
} }
} }
@@ -25,6 +25,7 @@ import client.creator.CharacterFactory;
import client.creator.CharacterFactoryRecipe; import client.creator.CharacterFactoryRecipe;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
/** /**
* @author RonanLana * @author RonanLana
@@ -42,7 +43,7 @@ public class LegendCreator extends CharacterFactory {
} }
public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) { public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) {
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.LEGEND, 1, 914000000, top, bottom, shoes, weapon)); int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.LEGEND, 1, MapId.ARAN_TUTORIAL_START, top, bottom, shoes, weapon));
return status; return status;
} }
} }
@@ -25,6 +25,7 @@ import client.creator.CharacterFactory;
import client.creator.CharacterFactoryRecipe; import client.creator.CharacterFactoryRecipe;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
/** /**
* @author RonanLana * @author RonanLana
@@ -42,7 +43,7 @@ public class NoblesseCreator extends CharacterFactory {
} }
public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) { public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) {
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.NOBLESSE, 1, 130030000, top, bottom, shoes, weapon)); int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.NOBLESSE, 1, MapId.STARTING_MAP_NOBLESSE, top, bottom, shoes, weapon));
return status; return status;
} }
} }
@@ -26,6 +26,7 @@ import client.creator.CharacterFactoryRecipe;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import client.inventory.Item; import client.inventory.Item;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import server.ItemInformationProvider; import server.ItemInformationProvider;
/** /**
@@ -71,6 +72,6 @@ public class BowmanCreator extends CharacterFactory {
} }
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) { public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.BOWMAN, 30, 100000000, equips[gender], equips[2 + gender], equips[4], weapons[0])); return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.BOWMAN, 30, MapId.HENESYS, equips[gender], equips[2 + gender], equips[4], weapons[0]));
} }
} }
@@ -28,6 +28,7 @@ import client.creator.CharacterFactoryRecipe;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import client.inventory.Item; import client.inventory.Item;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.skills.Magician; import constants.skills.Magician;
import server.ItemInformationProvider; import server.ItemInformationProvider;
@@ -93,6 +94,6 @@ public class MagicianCreator extends CharacterFactory {
} }
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) { public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.MAGICIAN, 30, 101000000, equips[gender], equips[2 + gender], equips[4], weapons[0], gender, improveSp)); return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.MAGICIAN, 30, MapId.ELLINIA, equips[gender], equips[2 + gender], equips[4], weapons[0], gender, improveSp));
} }
} }
@@ -26,6 +26,7 @@ import client.creator.CharacterFactoryRecipe;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import client.inventory.Item; import client.inventory.Item;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import server.ItemInformationProvider; import server.ItemInformationProvider;
/** /**
@@ -74,6 +75,6 @@ public class PirateCreator extends CharacterFactory {
} }
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) { public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.PIRATE, 30, 120000000, equips[gender], equips[2 + gender], equips[4], weapons[0])); return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.PIRATE, 30, MapId.NAUTILUS_HARBOR, equips[gender], equips[2 + gender], equips[4], weapons[0]));
} }
} }
@@ -26,6 +26,7 @@ import client.creator.CharacterFactoryRecipe;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import client.inventory.Item; import client.inventory.Item;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import server.ItemInformationProvider; import server.ItemInformationProvider;
/** /**
@@ -73,6 +74,6 @@ public class ThiefCreator extends CharacterFactory {
} }
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) { public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.THIEF, 30, 103000000, equips[gender], equips[2 + gender], equips[4], weapons[0])); return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.THIEF, 30, MapId.KERNING_CITY, equips[gender], equips[2 + gender], equips[4], weapons[0]));
} }
} }
@@ -28,6 +28,7 @@ import client.creator.CharacterFactoryRecipe;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import client.inventory.Item; import client.inventory.Item;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.skills.Warrior; import constants.skills.Warrior;
import server.ItemInformationProvider; import server.ItemInformationProvider;
@@ -93,6 +94,6 @@ public class WarriorCreator extends CharacterFactory {
} }
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) { public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.WARRIOR, 30, 102000000, equips[gender], equips[2 + gender], equips[4], weapons[0], gender, improveSp)); return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.WARRIOR, 30, MapId.PERION, equips[gender], equips[2 + gender], equips[4], weapons[0], gender, improveSp));
} }
} }
+86 -110
View File
@@ -3,6 +3,7 @@ package constants.game;
import client.Disease; import client.Disease;
import client.Job; import client.Job;
import config.YamlConfig; import config.YamlConfig;
import constants.id.MapId;
import constants.skills.Aran; import constants.skills.Aran;
import provider.*; import provider.*;
import provider.wz.WZFiles; import provider.wz.WZFiles;
@@ -52,69 +53,69 @@ public class GameConstants {
} }
// "goto" command for players // "goto" command for players
public static final HashMap<String, Integer> GOTO_TOWNS = new HashMap<String, Integer>() {{ public static final Map<String, Integer> GOTO_TOWNS = new HashMap<>() {{
put("southperry", 60000); put("southperry", MapId.SOUTHPERRY);
put("amherst", 1000000); put("amherst", MapId.AMHERST);
put("henesys", 100000000); put("henesys", MapId.HENESYS);
put("ellinia", 101000000); put("ellinia", MapId.ELLINIA);
put("perion", 102000000); put("perion", MapId.PERION);
put("kerning", 103000000); put("kerning", MapId.KERNING_CITY);
put("lith", 104000000); put("lith", MapId.LITH_HARBOUR);
put("sleepywood", 105040300); put("sleepywood", MapId.SLEEPYWOOD);
put("florina", 110000000); put("florina", MapId.FLORINA_BEACH);
put("nautilus", 120000000); put("nautilus", MapId.NAUTILUS_HARBOR);
put("ereve", 130000000); put("ereve", MapId.EREVE);
put("rien", 140000000); put("rien", MapId.RIEN);
put("orbis", 200000000); put("orbis", MapId.ORBIS);
put("happy", 209000000); put("happy", MapId.HAPPYVILLE);
put("elnath", 211000000); put("elnath", MapId.EL_NATH);
put("ludi", 220000000); put("ludi", MapId.LUDIBRIUM);
put("aqua", 230000000); put("aqua", MapId.AQUARIUM);
put("leafre", 240000000); put("leafre", MapId.LEAFRE);
put("mulung", 250000000); put("mulung", MapId.MU_LUNG);
put("herb", 251000000); put("herb", MapId.HERB_TOWN);
put("omega", 221000000); put("omega", MapId.OMEGA_SECTOR);
put("korean", 222000000); put("kft", MapId.KOREAN_FOLK_TOWN);
put("ellin", 300000000); put("ellin", MapId.ELLIN_FOREST);
put("nlc", 600000000); put("nlc", MapId.NEW_LEAF_CITY);
put("showa", 801000000); put("showa", MapId.SHOWA_TOWN);
put("shrine", 800000000); put("shrine", MapId.MUSHROOM_SHRINE);
put("ariant", 260000000); put("ariant", MapId.ARIANT);
put("magatia", 261000000); put("magatia", MapId.MAGATIA);
put("singapore", 540000000); put("singapore", MapId.SINGAPORE);
put("quay", 541000000); put("quay", MapId.BOAT_QUAY_TOWN);
put("kampung", 551000000); put("kampung", MapId.KAMPUNG_VILLAGE);
put("amoria", 680000000); put("amoria", MapId.AMORIA);
put("temple", 270000100); put("temple", MapId.TEMPLE_OF_TIME);
put("square", 103040000); put("square", MapId.KERNING_SQUARE);
put("neo", 240070000); put("neo", MapId.NEO_CITY);
put("mushking", 106020000); put("mushking", MapId.MUSHROOM_KINGDOM);
}}; }};
// "goto" command for only-GMs // "goto" command for only-GMs
public static final HashMap<String, Integer> GOTO_AREAS = new HashMap<String, Integer>() {{ public static final Map<String, Integer> GOTO_AREAS = new HashMap<>() {{
put("gmmap", 180000000); put("gmmap", MapId.GM_MAP);
put("excavation", 990000000); put("excavation", MapId.EXCAVATION_SITE);
put("mushmom", 100000005); put("mushmom", MapId.SOMEONE_ELSES_HOUSE);
put("griffey", 240020101); put("griffey", MapId.GRIFFEY_FOREST);
put("manon", 240020401); put("manon", MapId.MANONS_FOREST);
put("horseman", 682000001); put("horseman", MapId.HOLLOWED_GROUND);
put("balrog", 105090900); put("balrog", MapId.CURSED_SANCTUARY);
put("zakum", 211042300); put("zakum", MapId.DOOR_TO_ZAKUM);
put("papu", 220080001); put("papu", MapId.ORIGIN_OF_CLOCKTOWER);
put("guild", 200000301); put("guild", MapId.GUILD_HQ);
put("skelegon", 240040511); put("skelegon", MapId.DRAGON_NEST_LEFT_BEHIND);
put("hpq", 100000200); put("hpq", MapId.HENESYS_PARK);
put("pianus", 230040420); put("pianus", MapId.CAVE_OF_PIANUS);
put("horntail", 240050400); put("horntail", MapId.ENTRANCE_TO_HORNTAILS_CAVE);
put("pinkbean", 270050000); put("pinkbean", MapId.FORGOTTEN_TWILIGHT);
put("keep", 610020006); put("keep", MapId.CRIMSONWOOD_KEEP);
put("dojo", 925020001); put("dojo", MapId.MU_LUNG_DOJO_HALL);
put("bosspq", 970030000); put("bosspq", MapId.EXCLUSIVE_TRAINING_CENTER);
put("fm", 910000000); put("fm", MapId.FM_ENTRANCE);
}}; }};
public static final List<String> GAME_SONGS = new ArrayList<String>(170) {{ public static final List<String> GAME_SONGS = new ArrayList<>(170) {{
add("Jukebox/Congratulation"); add("Jukebox/Congratulation");
add("Bgm00/SleepyWood"); add("Bgm00/SleepyWood");
add("Bgm00/FloralLife"); add("Bgm00/FloralLife");
@@ -332,16 +333,16 @@ public class GameConstants {
public static boolean isHallOfFameMap(int mapid) { public static boolean isHallOfFameMap(int mapid) {
switch (mapid) { switch (mapid) {
case 102000004: // warrior case MapId.HALL_OF_WARRIORS: // warrior
case 101000004: // magician case MapId.HALL_OF_MAGICIANS: // magician
case 100000204: // bowman case MapId.HALL_OF_BOWMEN: // bowman
case 103000008: // thief case MapId.HALL_OF_THIEVES: // thief
case 120000105: // pirate case MapId.NAUTILUS_TRAINING_ROOM: // pirate
case 130000100: // cygnus case MapId.KNIGHTS_CHAMBER: // cygnus
case 130000101: // other cygnus case MapId.KNIGHTS_CHAMBER_LARGE: // other cygnus
case 130000110: // cygnus 2nd floor case MapId.KNIGHTS_CHAMBER_2: // cygnus 2nd floor
case 130000120: // cygnus 3rd floor (beginners) case MapId.KNIGHTS_CHAMBER_3: // cygnus 3rd floor (beginners)
case 140010110: // aran case MapId.PALACE_OF_THE_MASTER: // aran
return true; return true;
default: default:
@@ -351,11 +352,11 @@ public class GameConstants {
public static boolean isPodiumHallOfFameMap(int mapid) { public static boolean isPodiumHallOfFameMap(int mapid) {
switch (mapid) { switch (mapid) {
case 102000004: // warrior case MapId.HALL_OF_WARRIORS:
case 101000004: // magician case MapId.HALL_OF_MAGICIANS: // magician
case 100000204: // bowman case MapId.HALL_OF_BOWMEN: // bowman
case 103000008: // thief case MapId.HALL_OF_THIEVES: // thief
case 120000105: // pirate case MapId.NAUTILUS_TRAINING_ROOM: // pirate
return true; return true;
default: default:
@@ -428,22 +429,22 @@ public class GameConstants {
int jobid = job.getId(); int jobid = job.getId();
if (isCygnus(jobid)) { if (isCygnus(jobid)) {
return 130000100; return MapId.KNIGHTS_CHAMBER;
} else if (isAran(jobid)) { } else if (isAran(jobid)) {
return 140010110; return MapId.PALACE_OF_THE_MASTER;
} else { } else {
if (job.isA(Job.WARRIOR)) { if (job.isA(Job.WARRIOR)) {
return 102000004; return MapId.HALL_OF_WARRIORS;
} else if (job.isA(Job.MAGICIAN)) { } else if (job.isA(Job.MAGICIAN)) {
return 101000004; return MapId.HALL_OF_MAGICIANS;
} else if (job.isA(Job.BOWMAN)) { } else if (job.isA(Job.BOWMAN)) {
return 100000204; return MapId.HALL_OF_BOWMEN;
} else if (job.isA(Job.THIEF)) { } else if (job.isA(Job.THIEF)) {
return 103000008; return MapId.HALL_OF_THIEVES;
} else if (job.isA(Job.PIRATE)) { } else if (job.isA(Job.PIRATE)) {
return 120000105; return MapId.NAUTILUS_TRAINING_ROOM;
} else { } else {
return 130000110; // beginner explorers are allotted with the Cygnus, available map lul return MapId.KNIGHTS_CHAMBER_2; // beginner explorers are allotted with the Cygnus, available map lul
} }
} }
} }
@@ -556,7 +557,7 @@ public class GameConstants {
} }
public static boolean isFreeMarketRoom(int mapid) { public static boolean isFreeMarketRoom(int mapid) {
return mapid / 1000000 == 910 && mapid > 910000000; // FM rooms subset, thanks to shavitush (shavit) return mapid / 1000000 == 910 && mapid > MapId.FM_ENTRANCE; // FM rooms subset, thanks to shavitush (shavit)
} }
public static boolean isMerchantLocked(MapleMap map) { public static boolean isMerchantLocked(MapleMap map) {
@@ -564,32 +565,11 @@ public class GameConstants {
return true; return true;
} }
switch (map.getId()) { return map.getId() == MapId.FM_ENTRANCE;
case 910000000:
return true;
}
return false;
}
public static boolean isBossRush(int mapid) {
return mapid >= 970030100 && mapid <= 970042711;
}
public static boolean isDojo(int mapid) {
return mapid >= 925020000 && mapid < 925040000;
}
public static boolean isDojoPartyArea(int mapid) {
return mapid >= 925030100 && mapid < 925040000;
} }
public static boolean isDojoBossArea(int mapid) { public static boolean isDojoBossArea(int mapid) {
return isDojo(mapid) && (((mapid / 100) % 100) % 6) > 0; return MapId.isDojo(mapid) && (((mapid / 100) % 100) % 6) > 0;
}
public static boolean isPyramid(int mapid) {
return mapid >= 926010010 & mapid <= 930010000;
} }
public static boolean isAriantColiseumLobby(int mapid) { public static boolean isAriantColiseumLobby(int mapid) {
@@ -603,11 +583,7 @@ public class GameConstants {
} }
public static boolean isPqSkillMap(int mapid) { public static boolean isPqSkillMap(int mapid) {
return isDojo(mapid) || isPyramid(mapid); return MapId.isDojo(mapid) || MapId.isNettsPyramid(mapid);
}
public static boolean isFishingArea(int mapid) {
return mapid == 120010000 || mapid == 251000100 || mapid == 541010110;
} }
public static boolean isFinisherSkill(int skillId) { public static boolean isFinisherSkill(int skillId) {
+281
View File
@@ -0,0 +1,281 @@
package constants.id;
public class MapId {
// Special
public static final int NONE = 999999999;
public static final int GM_MAP = 180000000;
public static final int JAIL = 300000012; // "Cellar: Camp Conference Room"
public static final int DEVELOPERS_HQ = 777777777;
// Misc
public static final int ORBIS_TOWER_BOTTOM = 200082300;
public static final int INTERNET_CAFE = 193000000;
public static final int CRIMSONWOOD_VALLEY_1 = 610020000;
public static final int CRIMSONWOOD_VALLEY_2 = 610020001;
public static final int HENESYS_PQ = 910010000;
public static final int ORIGIN_OF_CLOCKTOWER = 220080001;
public static final int CAVE_OF_PIANUS = 230040420;
public static final int GUILD_HQ = 200000301;
public static final int FM_ENTRANCE = 910000000;
// Beginner
public static final int MUSHROOM_TOWN = 10000;
// Town
public static final int SOUTHPERRY = 60000;
public static final int AMHERST = 1000000;
public static final int HENESYS = 100000000;
public static final int ELLINIA = 101000000;
public static final int PERION = 102000000;
public static final int KERNING_CITY = 103000000;
public static final int LITH_HARBOUR = 104000000;
public static final int SLEEPYWOOD = 105040300;
public static final int MUSHROOM_KINGDOM = 106020000;
public static final int FLORINA_BEACH = 110000000;
public static final int EREVE = 130000000;
public static final int KERNING_SQUARE = 103040000;
public static final int RIEN = 140000000;
public static final int ORBIS = 200000000;
public static final int EL_NATH = 211000000;
public static final int LUDIBRIUM = 220000000;
public static final int AQUARIUM = 230000000;
public static final int LEAFRE = 240000000;
public static final int NEO_CITY = 240070000;
public static final int MU_LUNG = 250000000;
public static final int HERB_TOWN = 251000000;
public static final int OMEGA_SECTOR = 221000000;
public static final int KOREAN_FOLK_TOWN = 222000000;
public static final int ARIANT = 260000000;
public static final int MAGATIA = 261000000;
public static final int TEMPLE_OF_TIME = 270000100;
public static final int ELLIN_FOREST = 300000000;
public static final int SINGAPORE = 540000000;
public static final int BOAT_QUAY_TOWN = 541000000;
public static final int KAMPUNG_VILLAGE = 551000000;
public static final int NEW_LEAF_CITY = 600000000;
public static final int MUSHROOM_SHRINE = 800000000;
public static final int SHOWA_TOWN = 801000000;
public static final int NAUTILUS_HARBOR = 120000000;
public static final int HAPPYVILLE = 209000000;
public static final int SHOWA_SPA_M = 809000101;
public static final int SHOWA_SPA_F = 809000201;
private static final int MAPLE_ISLAND_MIN = 0;
private static final int MAPLE_ISLAND_MAX = 2000001;
public static boolean isMapleIsland(int mapId) {
return mapId >= MAPLE_ISLAND_MIN && mapId <= MAPLE_ISLAND_MAX;
}
// Travel
// There are 10 of each of these travel maps in the files
public static final int FROM_LITH_TO_RIEN = 200090060;
public static final int FROM_RIEN_TO_LITH = 200090070;
public static final int DANGEROUS_FOREST = 140020300; // Rien docks
public static final int FROM_ELLINIA_TO_EREVE = 200090030;
public static final int SKY_FERRY = 130000210; // Ereve platform
public static final int FROM_EREVE_TO_ELLINIA = 200090031;
public static final int ELLINIA_SKY_FERRY = 101000400;
public static final int FROM_EREVE_TO_ORBIS = 200090021;
public static final int ORBIS_STATION = 200000161;
public static final int FROM_ORBIS_TO_EREVE = 200090020;
// Aran
public static final int ARAN_TUTORIAL_START = 914000000;
public static final int ARAN_TUTORIAL_MAX = 914000500;
public static final int ARAN_INTRO = 140090000;
private static final int BURNING_FOREST_1 = 914000200;
private static final int BURNING_FOREST_2 = 914000210;
private static final int BURNING_FOREST_3 = 914000220;
// Aran tutorial
public static boolean isGodlyStatMap(int mapId) {
return mapId == BURNING_FOREST_1 || mapId == BURNING_FOREST_2 || mapId == BURNING_FOREST_3;
}
// Aran intro
public static final int ARAN_TUTO_1 = 914090010;
public static final int ARAN_TUTO_2 = 914090011;
public static final int ARAN_TUTO_3 = 914090012;
public static final int ARAN_TUTO_4 = 914090013;
public static final int ARAN_POLEARM = 914090100;
public static final int ARAN_MAHA = 914090200; // Black screen when warped to
// Starting map
public static final int STARTING_MAP_NOBLESSE = 130030000;
// Cygnus intro
// These are the actual maps
private static final int CYGNUS_INTRO_LOCATION_MIN = 913040000;
private static final int CYGNUS_INTRO_LOCATION_MAX = 913040006;
public static boolean isCygnusIntro(int mapId) {
return mapId >= CYGNUS_INTRO_LOCATION_MIN && mapId <= CYGNUS_INTRO_LOCATION_MAX;
}
// Cygnus intro video
public static final int CYGNUS_INTRO_LEAD = 913040100;
public static final int CYGNUS_INTRO_WARRIOR = 913040101;
public static final int CYGNUS_INTRO_BOWMAN = 913040102;
public static final int CYGNUS_INTRO_MAGE = 913040103;
public static final int CYGNUS_INTRO_PIRATE = 913040104;
public static final int CYGNUS_INTRO_THIEF = 913040105;
public static final int CYGNUS_INTRO_CONCLUSION = 913040106;
// Event
public static final int EVENT_COCONUT_HARVEST = 109080000;
public static final int EVENT_OX_QUIZ = 109020001;
public static final int EVENT_PHYSICAL_FITNESS = 109040000;
public static final int EVENT_OLA_OLA_0 = 109030001;
public static final int EVENT_OLA_OLA_1 = 109030101;
public static final int EVENT_OLA_OLA_2 = 109030201;
public static final int EVENT_OLA_OLA_3 = 109030301;
public static final int EVENT_OLA_OLA_4 = 109030401;
public static final int EVENT_SNOWBALL = 109060000;
public static final int EVENT_FIND_THE_JEWEL = 109010000;
public static final int FITNESS_EVENT_LAST = 109040004;
public static final int OLA_EVENT_LAST_1 = 109030003;
public static final int OLA_EVENT_LAST_2 = 109030103;
public static final int WITCH_TOWER_ENTRANCE = 980040000;
public static final int EVENT_WINNER = 109050000;
public static final int EVENT_EXIT = 109050001;
public static final int EVENT_SNOWBALL_ENTRANCE = 109060001;
private static final int PHYSICAL_FITNESS_MIN = EVENT_PHYSICAL_FITNESS;
private static final int PHYSICAL_FITNESS_MAX = FITNESS_EVENT_LAST;
public static boolean isPhysicalFitness(int mapId) {
return mapId >= PHYSICAL_FITNESS_MIN && mapId <= PHYSICAL_FITNESS_MAX;
}
private static final int OLA_OLA_MIN = EVENT_OLA_OLA_0;
private static final int OLA_OLA_MAX = 109030403; // OLA_OLA_4 level 3
public static boolean isOlaOla(int mapId) {
return mapId >= OLA_OLA_MIN && mapId <= OLA_OLA_MAX;
}
// Self lootable maps
private static final int HAPPYVILLE_TREE_MIN = 209000001;
private static final int HAPPYVILLE_TREE_MAX = 209000015;
private static final int GPQ_FOUNTAIN_MIN = 990000500;
private static final int GPQ_FOUNTAIN_MAX = 990000502;
public static boolean isSelfLootableOnly(int mapId) {
return (mapId >= HAPPYVILLE_TREE_MIN && mapId <= HAPPYVILLE_TREE_MAX) ||
(mapId >= GPQ_FOUNTAIN_MIN && mapId <= GPQ_FOUNTAIN_MAX);
}
// Dojo
public static final int DOJO_SOLO_BASE = 925020000;
public static final int DOJO_PARTY_BASE = 925030000;
public static final int DOJO_EXIT = 925020002;
private static final int DOJO_MIN = DOJO_SOLO_BASE;
private static final int DOJO_MAX = 925033804;
private static final int DOJO_PARTY_MIN = 925030100;
public static final int DOJO_PARTY_MAX = DOJO_MAX;
public static boolean isDojo(int mapId) {
return mapId >= DOJO_MIN && mapId <= DOJO_MAX;
}
public static boolean isPartyDojo(int mapId) {
return mapId >= DOJO_PARTY_MIN && mapId <= DOJO_PARTY_MAX;
}
// Mini dungeon
public static final int ANT_TUNNEL_2 = 105050100;
public static final int CAVE_OF_MUSHROOMS_BASE = 105050101;
public static final int SLEEPY_DUNGEON_4 = 105040304;
public static final int GOLEMS_CASTLE_RUINS_BASE = 105040320;
public static final int SAHEL_2 = 260020600;
public static final int HILL_OF_SANDSTORMS_BASE = 260020630;
public static final int RAIN_FOREST_EAST_OF_HENESYS = 100020000;
public static final int HENESYS_PIG_FARM_BASE = 100020100;
public static final int COLD_CRADLE = 105090311;
public static final int DRAKES_BLUE_CAVE_BASE = 105090320;
public static final int EOS_TOWER_76TH_TO_90TH_FLOOR = 221023400;
public static final int DRUMMER_BUNNYS_LAIR_BASE = 221023401;
public static final int BATTLEFIELD_OF_FIRE_AND_WATER = 240020500;
public static final int ROUND_TABLE_OF_KENTAURUS_BASE = 240020512;
public static final int RESTORING_MEMORY_BASE = 240040800;
public static final int DESTROYED_DRAGON_NEST = 240040520;
public static final int NEWT_SECURED_ZONE_BASE = 240040900;
public static final int RED_NOSE_PIRATE_DEN_2 = 251010402;
public static final int PILLAGE_OF_TREASURE_ISLAND_BASE = 251010410;
public static final int LAB_AREA_C1 = 261020300;
public static final int CRITICAL_ERROR_BASE = 261020301;
public static final int FANTASY_THEME_PARK_3 = 551030000;
public static final int LONGEST_RIDE_ON_BYEBYE_STATION = 551030001;
// Boss rush
private static final int BOSS_RUSH_MIN = 970030100;
private static final int BOSS_RUSH_MAX = 970042711;
public static boolean isBossRush(int mapId) {
return mapId >= BOSS_RUSH_MIN && mapId <= BOSS_RUSH_MAX;
}
// ARPQ
public static final int ARPQ_LOBBY = 980010000;
public static final int ARPQ_ARENA_1 = 980010101;
public static final int ARPQ_ARENA_2 = 980010201;
public static final int ARPQ_ARENA_3 = 980010301;
public static final int ARPQ_KINGS_ROOM = 980010010;
// Nett's pyramid
public static final int NETTS_PYRAMID = 926010001;
public static final int NETTS_PYRAMID_SOLO_BASE = 926010100;
public static final int NETTS_PYRAMID_PARTY_BASE = 926020100;
private static final int NETTS_PYRAMID_MIN = NETTS_PYRAMID_SOLO_BASE;
private static final int NETTS_PYRAMID_MAX = 926023500;
public static boolean isNettsPyramid(int mapId) {
return mapId >= NETTS_PYRAMID_MIN && mapId <= NETTS_PYRAMID_MAX;
}
// Fishing
private static final int ON_THE_WAY_TO_THE_HARBOR = 120010000;
private static final int PIER_ON_THE_BEACH = 251000100;
private static final int PEACEFUL_SHIP = 541010110;
public static boolean isFishingArea(int mapId) {
return mapId == ON_THE_WAY_TO_THE_HARBOR || mapId == PIER_ON_THE_BEACH || mapId == PEACEFUL_SHIP;
}
// Wedding
public static final int AMORIA = 680000000;
public static final int CHAPEL_WEDDING_ALTAR = 680000110;
public static final int CATHEDRAL_WEDDING_ALTAR = 680000210;
public static final int WEDDING_PHOTO = 680000300;
public static final int WEDDING_EXIT = 680000500;
// Statue
public static final int HALL_OF_WARRIORS = 102000004; // Explorer
public static final int HALL_OF_MAGICIANS = 101000004;
public static final int HALL_OF_BOWMEN = 100000204;
public static final int HALL_OF_THIEVES = 103000008;
public static final int NAUTILUS_TRAINING_ROOM = 120000105;
public static final int KNIGHTS_CHAMBER = 130000100; // Cygnus
public static final int KNIGHTS_CHAMBER_2 = 130000110;
public static final int KNIGHTS_CHAMBER_3 = 130000120;
public static final int KNIGHTS_CHAMBER_LARGE = 130000101;
public static final int PALACE_OF_THE_MASTER = 140010110; // Aran
// gm-goto
public static final int EXCAVATION_SITE = 990000000;
public static final int SOMEONE_ELSES_HOUSE = 100000005;
public static final int GRIFFEY_FOREST = 240020101;
public static final int MANONS_FOREST = 240020401;
public static final int HOLLOWED_GROUND = 682000001;
public static final int CURSED_SANCTUARY = 105090900;
public static final int DOOR_TO_ZAKUM = 211042300;
public static final int DRAGON_NEST_LEFT_BEHIND = 240040511;
public static final int HENESYS_PARK = 100000200;
public static final int ENTRANCE_TO_HORNTAILS_CAVE = 240050400;
public static final int FORGOTTEN_TWILIGHT = 270050000;
public static final int CRIMSONWOOD_KEEP = 610020006;
public static final int MU_LUNG_DOJO_HALL = 925020001;
public static final int EXCLUSIVE_TRAINING_CENTER = 970030000;
}
@@ -23,7 +23,7 @@ package net.server.channel;
import client.Character; import client.Character;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.id.MapId;
import net.netty.ChannelServer; import net.netty.ChannelServer;
import net.packet.Packet; import net.packet.Packet;
import net.server.PlayerStorage; import net.server.PlayerStorage;
@@ -499,7 +499,7 @@ public final class Channel {
} }
if (slot < range) { if (slot < range) {
int slotMapid = (isPartyDojo ? 925030000 : 925020000) + (100 * (fromStage + 1)) + slot; int slotMapid = (isPartyDojo ? MapId.DOJO_PARTY_BASE : MapId.DOJO_SOLO_BASE) + (100 * (fromStage + 1)) + slot;
int dojoSlot = getDojoSlot(slotMapid); int dojoSlot = getDojoSlot(slotMapid);
if (party != null) { if (party != null) {
@@ -574,7 +574,7 @@ public final class Channel {
final int slot = getDojoSlot(dojoMapId); final int slot = getDojoSlot(dojoMapId);
final int delta = (dojoMapId) % 100; final int delta = (dojoMapId) % 100;
final int stage = (dojoMapId / 100) % 100; final int stage = (dojoMapId / 100) % 100;
final int dojoBaseMap = (dojoMapId >= 925030000) ? 925030000 : 925020000; final int dojoBaseMap = (dojoMapId >= MapId.DOJO_PARTY_BASE) ? MapId.DOJO_PARTY_BASE : MapId.DOJO_SOLO_BASE;
for (int i = 0; i < 5; i++) { //only 32 stages, but 38 maps for (int i = 0; i < 5; i++) { //only 32 stages, but 38 maps
if (stage + i > 38) { if (stage + i > 38) {
@@ -605,7 +605,7 @@ public final class Channel {
} }
this.dojoTask[slot] = TimerManager.getInstance().schedule(() -> { this.dojoTask[slot] = TimerManager.getInstance().schedule(() -> {
final int delta = (dojoMapId) % 100; final int delta = (dojoMapId) % 100;
final int dojoBaseMap = (slot < 5) ? 925030000 : 925020000; final int dojoBaseMap = (slot < 5) ? MapId.DOJO_PARTY_BASE : MapId.DOJO_SOLO_BASE;
Party party = null; Party party = null;
for (int i = 0; i < 5; i++) { //only 32 stages, but 38 maps for (int i = 0; i < 5; i++) { //only 32 stages, but 38 maps
@@ -613,9 +613,9 @@ public final class Channel {
break; break;
} }
MapleMap dojoExit = getMapFactory().getMap(925020002); MapleMap dojoExit = getMapFactory().getMap(MapId.DOJO_EXIT);
for (Character chr : getMapFactory().getMap(dojoBaseMap + (100 * (stage + i)) + delta).getAllPlayers()) { for (Character chr : getMapFactory().getMap(dojoBaseMap + (100 * (stage + i)) + delta).getAllPlayers()) {
if (GameConstants.isDojo(chr.getMap().getId())) { if (MapId.isDojo(chr.getMap().getId())) {
chr.changeMap(dojoExit); chr.changeMap(dojoExit);
} }
party = chr.getParty(); party = chr.getParty();
@@ -29,6 +29,7 @@ import client.status.MonsterStatusEffect;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.id.MobId; import constants.id.MobId;
import constants.skills.*; import constants.skills.*;
import net.AbstractPacketHandler; import net.AbstractPacketHandler;
@@ -734,7 +735,7 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
calcDmgMax = (long) Math.ceil(calcDmgMax * dmgBuff); calcDmgMax = (long) Math.ceil(calcDmgMax * dmgBuff);
} }
if (chr.getMapId() >= 914000000 && chr.getMapId() <= 914000500) { if (chr.getMapId() >= MapId.ARAN_TUTORIAL_START && chr.getMapId() <= MapId.ARAN_TUTORIAL_MAX) {
calcDmgMax += 80000; // Aran Tutorial. calcDmgMax += 80000; // Aran Tutorial.
} }
@@ -26,6 +26,7 @@ import client.Client;
import client.inventory.InventoryType; import client.inventory.InventoryType;
import client.inventory.manipulator.InventoryManipulator; import client.inventory.manipulator.InventoryManipulator;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import net.AbstractPacketHandler; import net.AbstractPacketHandler;
import net.packet.InPacket; import net.packet.InPacket;
import server.Trade; import server.Trade;
@@ -121,17 +122,17 @@ public final class ChangeMapHandler extends AbstractPacketHandler {
warp = true; warp = true;
} }
} else if (divi == 20100) { } else if (divi == 20100) {
if (targetid == 104000000) { if (targetid == MapId.LITH_HARBOUR) {
c.sendPacket(PacketCreator.lockUI(false)); c.sendPacket(PacketCreator.lockUI(false));
c.sendPacket(PacketCreator.disableUI(false)); c.sendPacket(PacketCreator.disableUI(false));
warp = true; warp = true;
} }
} else if (divi == 9130401) { // Only allow warp if player is already in Intro map, or else = hack } else if (divi == 9130401) { // Only allow warp if player is already in Intro map, or else = hack
if (targetid == 130000000 || targetid / 100 == 9130401) { // Cygnus introduction if (targetid == MapId.EREVE || targetid / 100 == 9130401) { // Cygnus introduction
warp = true; warp = true;
} }
} else if (divi == 9140900) { // Aran Introduction } else if (divi == 9140900) { // Aran Introduction
if (targetid == 914090011 || targetid == 914090012 || targetid == 914090013 || targetid == 140090000) { if (targetid == MapId.ARAN_TUTO_2 || targetid == MapId.ARAN_TUTO_3 || targetid == MapId.ARAN_TUTO_4 || targetid == MapId.ARAN_INTRO) {
warp = true; warp = true;
} }
} else if (divi / 10 == 1020) { // Adventurer movie clip Intro } else if (divi / 10 == 1020) { // Adventurer movie clip Intro
@@ -139,7 +140,7 @@ public final class ChangeMapHandler extends AbstractPacketHandler {
warp = true; warp = true;
} }
} else if (divi / 10 >= 980040 && divi / 10 <= 980045) { } else if (divi / 10 >= 980040 && divi / 10 <= 980045) {
if (targetid == 980040000) { if (targetid == MapId.WITCH_TOWER_ENTRANCE) {
warp = true; warp = true;
} }
} }
@@ -157,9 +158,9 @@ public final class ChangeMapHandler extends AbstractPacketHandler {
return; return;
} }
if (chr.getMapId() == 109040004) { if (chr.getMapId() == MapId.FITNESS_EVENT_LAST) {
chr.getFitness().resetTimes(); chr.getFitness().resetTimes();
} else if (chr.getMapId() == 109030003 || chr.getMapId() == 109030103) { } else if (chr.getMapId() == MapId.OLA_EVENT_LAST_1 || chr.getMapId() == MapId.OLA_EVENT_LAST_2) {
chr.getOla().resetTimes(); chr.getOla().resetTimes();
} }
@@ -25,6 +25,7 @@ import client.Character;
import client.*; import client.*;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.MapId;
import constants.skills.*; import constants.skills.*;
import net.packet.InPacket; import net.packet.InPacket;
import server.StatEffect; import server.StatEffect;
@@ -62,7 +63,7 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler {
{ {
return; return;
} }
if (GameConstants.isDojo(chr.getMap().getId()) && attack.numAttacked > 0) { if (MapId.isDojo(chr.getMap().getId()) && attack.numAttacked > 0) {
chr.setDojoEnergy(chr.getDojoEnergy() + YamlConfig.config.server.DOJO_ENERGY_ATK); chr.setDojoEnergy(chr.getDojoEnergy() + YamlConfig.config.server.DOJO_ENERGY_ATK);
c.sendPacket(PacketCreator.getEnergy("energy", chr.getDojoEnergy())); c.sendPacket(PacketCreator.getEnergy("energy", chr.getDojoEnergy()));
} }
@@ -26,6 +26,7 @@ import client.Client;
import client.FamilyEntitlement; import client.FamilyEntitlement;
import client.FamilyEntry; import client.FamilyEntry;
import config.YamlConfig; import config.YamlConfig;
import constants.id.MapId;
import net.AbstractPacketHandler; import net.AbstractPacketHandler;
import net.packet.InPacket; import net.packet.InPacket;
import net.server.coordinator.world.InviteCoordinator; import net.server.coordinator.world.InviteCoordinator;
@@ -61,7 +62,7 @@ public final class FamilyUseHandler extends AbstractPacketHandler {
if (targetMap != null) { if (targetMap != null) {
if (type == FamilyEntitlement.FAMILY_REUINION) { if (type == FamilyEntitlement.FAMILY_REUINION) {
if (!FieldLimit.CANNOTMIGRATE.check(ownMap.getFieldLimit()) && !FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) if (!FieldLimit.CANNOTMIGRATE.check(ownMap.getFieldLimit()) && !FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit())
&& (targetMap.getForcedReturnId() == 999999999 || targetMap.getId() < 100000000) && targetMap.getEventInstance() == null) { && (targetMap.getForcedReturnId() == MapId.NONE || MapId.isMapleIsland(targetMap.getId())) && targetMap.getEventInstance() == null) {
c.getPlayer().changeMap(victim.getMap(), victim.getMap().getPortal(0)); c.getPlayer().changeMap(victim.getMap(), victim.getMap().getPortal(0));
useEntitlement(entry, type); useEntitlement(entry, type);
@@ -71,7 +72,7 @@ public final class FamilyUseHandler extends AbstractPacketHandler {
} }
} else { } else {
if (!FieldLimit.CANNOTMIGRATE.check(targetMap.getFieldLimit()) && !FieldLimit.CANNOTVIPROCK.check(ownMap.getFieldLimit()) if (!FieldLimit.CANNOTMIGRATE.check(targetMap.getFieldLimit()) && !FieldLimit.CANNOTVIPROCK.check(ownMap.getFieldLimit())
&& (ownMap.getForcedReturnId() == 999999999 || ownMap.getId() < 100000000) && ownMap.getEventInstance() == null) { && (ownMap.getForcedReturnId() == MapId.NONE || MapId.isMapleIsland(ownMap.getId())) && ownMap.getEventInstance() == null) {
if (InviteCoordinator.hasInvite(InviteType.FAMILY_SUMMON, victim.getId())) { if (InviteCoordinator.hasInvite(InviteType.FAMILY_SUMMON, victim.getId())) {
c.sendPacket(PacketCreator.sendFamilyMessage(74, 0)); c.sendPacket(PacketCreator.sendFamilyMessage(74, 0));
@@ -25,6 +25,7 @@ import client.Character;
import client.Client; import client.Client;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.MapId;
import net.AbstractPacketHandler; import net.AbstractPacketHandler;
import net.packet.InPacket; import net.packet.InPacket;
import net.server.Server; import net.server.Server;
@@ -216,7 +217,7 @@ public final class GuildOperationHandler extends AbstractPacketHandler {
Server.getInstance().changeRank(mc.getGuildId(), cid, newRank); Server.getInstance().changeRank(mc.getGuildId(), cid, newRank);
break; break;
case 0x0f: case 0x0f:
if (mc.getGuildId() <= 0 || mc.getGuildRank() != 1 || mc.getMapId() != 200000301) { if (mc.getGuildId() <= 0 || mc.getGuildRank() != 1 || mc.getMapId() != MapId.GUILD_HQ) {
System.out.println("[Hack] " + mc.getName() + " tried to change guild emblem without being the guild leader."); System.out.println("[Hack] " + mc.getName() + " tried to change guild emblem without being the guild leader.");
return; return;
} }
@@ -24,7 +24,7 @@ package net.server.channel.handlers;
import client.Character; import client.Character;
import client.*; import client.*;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.id.MapId;
import constants.skills.Bishop; import constants.skills.Bishop;
import constants.skills.Evan; import constants.skills.Evan;
import constants.skills.FPArchMage; import constants.skills.FPArchMage;
@@ -57,7 +57,7 @@ public final class MagicDamageHandler extends AbstractDealDamageHandler {
} }
} }
if (GameConstants.isDojo(chr.getMap().getId()) && attack.numAttacked > 0) { if (MapId.isDojo(chr.getMap().getId()) && attack.numAttacked > 0) {
chr.setDojoEnergy(chr.getDojoEnergy() + +YamlConfig.config.server.DOJO_ENERGY_ATK); chr.setDojoEnergy(chr.getDojoEnergy() + +YamlConfig.config.server.DOJO_ENERGY_ATK);
c.sendPacket(PacketCreator.getEnergy("energy", chr.getDojoEnergy())); c.sendPacket(PacketCreator.getEnergy("energy", chr.getDojoEnergy()));
} }
@@ -29,8 +29,8 @@ import client.inventory.Item;
import client.inventory.WeaponType; import client.inventory.WeaponType;
import client.inventory.manipulator.InventoryManipulator; import client.inventory.manipulator.InventoryManipulator;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import constants.skills.*; import constants.skills.*;
import net.packet.InPacket; import net.packet.InPacket;
@@ -65,7 +65,7 @@ public final class RangedAttackHandler extends AbstractDealDamageHandler {
} }
} }
if (GameConstants.isDojo(chr.getMap().getId()) && attack.numAttacked > 0) { if (MapId.isDojo(chr.getMap().getId()) && attack.numAttacked > 0) {
chr.setDojoEnergy(chr.getDojoEnergy() + YamlConfig.config.server.DOJO_ENERGY_ATK); chr.setDojoEnergy(chr.getDojoEnergy() + YamlConfig.config.server.DOJO_ENERGY_ATK);
c.sendPacket(PacketCreator.getEnergy("energy", chr.getDojoEnergy())); c.sendPacket(PacketCreator.getEnergy("energy", chr.getDojoEnergy()));
} }
@@ -30,7 +30,7 @@ import client.inventory.manipulator.InventoryManipulator;
import client.status.MonsterStatus; import client.status.MonsterStatus;
import client.status.MonsterStatusEffect; import client.status.MonsterStatusEffect;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.id.MapId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import constants.skills.Aran; import constants.skills.Aran;
import net.AbstractPacketHandler; import net.AbstractPacketHandler;
@@ -189,7 +189,7 @@ public final class TakeDamageHandler extends AbstractPacketHandler {
} }
//in dojo player cannot use pot, so deadly attacks should be turned off as well //in dojo player cannot use pot, so deadly attacks should be turned off as well
if (is_deadly && GameConstants.isDojo(chr.getMap().getId()) && !YamlConfig.config.server.USE_DEADLY_DOJO) { if (is_deadly && MapId.isDojo(chr.getMap().getId()) && !YamlConfig.config.server.USE_DEADLY_DOJO) {
damage = 0; damage = 0;
mpattack = 0; mpattack = 0;
} }
@@ -273,7 +273,7 @@ public final class TakeDamageHandler extends AbstractPacketHandler {
} else { } else {
map.broadcastGMMessage(chr, PacketCreator.damagePlayer(damagefrom, monsteridfrom, chr.getId(), damage, fake, direction, is_pgmr, pgmr, is_pg, oid, pos_x, pos_y), false); map.broadcastGMMessage(chr, PacketCreator.damagePlayer(damagefrom, monsteridfrom, chr.getId(), damage, fake, direction, is_pgmr, pgmr, is_pg, oid, pos_x, pos_y), false);
} }
if (GameConstants.isDojo(map.getId())) { if (MapId.isDojo(map.getId())) {
chr.setDojoEnergy(chr.getDojoEnergy() + YamlConfig.config.server.DOJO_ENERGY_DMG); chr.setDojoEnergy(chr.getDojoEnergy() + YamlConfig.config.server.DOJO_ENERGY_DMG);
c.sendPacket(PacketCreator.getEnergy("energy", chr.getDojoEnergy())); c.sendPacket(PacketCreator.getEnergy("energy", chr.getDojoEnergy()));
} }
@@ -34,6 +34,7 @@ import client.processor.stat.AssignSPProcessor;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import net.AbstractPacketHandler; import net.AbstractPacketHandler;
import net.packet.InPacket; import net.packet.InPacket;
@@ -106,7 +107,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
int mapId = p.readInt(); int mapId = p.readInt();
if (itemId / 1000 >= 5041 || mapId / 100000000 == player.getMapId() / 100000000) { //check vip or same continent if (itemId / 1000 >= 5041 || mapId / 100000000 == player.getMapId() / 100000000) { //check vip or same continent
MapleMap targetMap = c.getChannelServer().getMapFactory().getMap(mapId); MapleMap targetMap = c.getChannelServer().getMapFactory().getMap(mapId);
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == 999999999 || mapId < 100000000)) { if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == MapId.NONE || MapId.isMapleIsland(mapId))) {
player.forceChangeMap(targetMap, targetMap.getRandomPlayerSpawnpoint()); player.forceChangeMap(targetMap, targetMap.getRandomPlayerSpawnpoint());
success = true; success = true;
} else { } else {
@@ -121,7 +122,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
if (victim != null) { if (victim != null) {
MapleMap targetMap = victim.getMap(); MapleMap targetMap = victim.getMap();
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == 999999999 || targetMap.getId() < 100000000)) { if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == MapId.NONE || MapId.isMapleIsland(targetMap.getId()))) {
if (!victim.isGM() || victim.gmLevel() <= player.gmLevel()) { // thanks Yoboes for noticing non-GM's being unreachable through rocks if (!victim.isGM() || victim.gmLevel() <= player.gmLevel()) { // thanks Yoboes for noticing non-GM's being unreachable through rocks
player.forceChangeMap(targetMap, targetMap.findClosestPlayerSpawnpoint(victim.getPosition())); player.forceChangeMap(targetMap, targetMap.findClosestPlayerSpawnpoint(victim.getPosition()));
success = true; success = true;
@@ -22,6 +22,7 @@ package net.server.coordinator.matchchecker.listener;
import client.Character; import client.Character;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.MapId;
import net.packet.Packet; import net.packet.Packet;
import net.server.Server; import net.server.Server;
import net.server.coordinator.matchchecker.AbstractMatchCheckerListener; import net.server.coordinator.matchchecker.AbstractMatchCheckerListener;
@@ -92,7 +93,7 @@ public class MatchCheckerGuildCreation implements MatchCheckerListenerRecipe {
broadcastGuildCreationDismiss(matchPlayers); broadcastGuildCreationDismiss(matchPlayers);
return; return;
} }
if (leader.getMapId() != 200000301) { if (leader.getMapId() != MapId.GUILD_HQ) {
leader.dropMessage(1, "You cannot establish the creation of a new Guild outside of the Guild Headquarters."); leader.dropMessage(1, "You cannot establish the creation of a new Guild outside of the Guild Headquarters.");
broadcastGuildCreationDismiss(matchPlayers); broadcastGuildCreationDismiss(matchPlayers);
return; return;
@@ -22,6 +22,7 @@ package net.server.coordinator.partysearch;
import client.Character; import client.Character;
import client.Job; import client.Job;
import config.YamlConfig; import config.YamlConfig;
import constants.id.MapId;
import net.server.audit.locks.MonitoredLockType; import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.MonitoredReadLock; import net.server.audit.locks.MonitoredReadLock;
import net.server.audit.locks.MonitoredReentrantReadWriteLock; import net.server.audit.locks.MonitoredReentrantReadWriteLock;
@@ -76,9 +77,9 @@ public class PartySearchCoordinator {
mapLinks.put(mapid, neighborMaps); mapLinks.put(mapid, neighborMaps);
for (Data neighbordata : mapdata.getChildren()) { for (Data neighbordata : mapdata.getChildren()) {
int neighborid = DataTool.getInt(neighbordata, 999999999); int neighborid = DataTool.getInt(neighbordata, MapId.NONE);
if (neighborid != 999999999) { if (neighborid != MapId.NONE) {
neighborMaps.add(neighborid); neighborMaps.add(neighborid);
} }
} }
@@ -29,6 +29,7 @@ import client.inventory.manipulator.InventoryManipulator;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.id.NpcId; import constants.id.NpcId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import net.server.Server; import net.server.Server;
@@ -680,27 +681,15 @@ public class AbstractPlayerInteraction {
} }
public void displayAranIntro() { public void displayAranIntro() {
String intro = ""; String intro = switch (c.getPlayer().getMapId()) {
switch (c.getPlayer().getMapId()) { case MapId.ARAN_TUTO_1 -> "Effect/Direction1.img/aranTutorial/Scene0";
case 914090010: case MapId.ARAN_TUTO_2 -> "Effect/Direction1.img/aranTutorial/Scene1" + (c.getPlayer().getGender() == 0 ? "0" : "1");
intro = "Effect/Direction1.img/aranTutorial/Scene0"; case MapId.ARAN_TUTO_3 -> "Effect/Direction1.img/aranTutorial/Scene2" + (c.getPlayer().getGender() == 0 ? "0" : "1");
break; case MapId.ARAN_TUTO_4 -> "Effect/Direction1.img/aranTutorial/Scene3";
case 914090011: case MapId.ARAN_POLEARM -> "Effect/Direction1.img/aranTutorial/HandedPoleArm" + (c.getPlayer().getGender() == 0 ? "0" : "1");
intro = "Effect/Direction1.img/aranTutorial/Scene1" + (c.getPlayer().getGender() == 0 ? "0" : "1"); case MapId.ARAN_MAHA -> "Effect/Direction1.img/aranTutorial/Maha";
break; default -> "";
case 914090012: };
intro = "Effect/Direction1.img/aranTutorial/Scene2" + (c.getPlayer().getGender() == 0 ? "0" : "1");
break;
case 914090013:
intro = "Effect/Direction1.img/aranTutorial/Scene3";
break;
case 914090100:
intro = "Effect/Direction1.img/aranTutorial/HandedPoleArm" + (c.getPlayer().getGender() == 0 ? "0" : "1");
break;
case 914090200:
intro = "Effect/Direction1.img/aranTutorial/Maha";
break;
}
showIntro(intro); showIntro(intro);
} }
@@ -24,6 +24,7 @@ package scripting.map;
import client.Character.DelayedQuestUpdate; import client.Character.DelayedQuestUpdate;
import client.Client; import client.Client;
import client.QuestStatus; import client.QuestStatus;
import constants.id.MapId;
import scripting.AbstractPlayerInteraction; import scripting.AbstractPlayerInteraction;
import server.quest.Quest; import server.quest.Quest;
import tools.PacketCreator; import tools.PacketCreator;
@@ -38,51 +39,35 @@ public class MapScriptMethods extends AbstractPlayerInteraction {
public void displayCygnusIntro() { public void displayCygnusIntro() {
switch (c.getPlayer().getMapId()) { switch (c.getPlayer().getMapId()) {
case 913040100: case MapId.CYGNUS_INTRO_LEAD -> {
lockUI(); lockUI();
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene0")); c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene0"));
break; }
case 913040101: case MapId.CYGNUS_INTRO_WARRIOR -> c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene1"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene1")); case MapId.CYGNUS_INTRO_BOWMAN -> c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene2"));
break; case MapId.CYGNUS_INTRO_MAGE -> c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene3"));
case 913040102: case MapId.CYGNUS_INTRO_PIRATE -> c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene4"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene2")); case MapId.CYGNUS_INTRO_THIEF -> c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene5"));
break; case MapId.CYGNUS_INTRO_CONCLUSION -> {
case 913040103:
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene3"));
break;
case 913040104:
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene4"));
break;
case 913040105:
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene5"));
break;
case 913040106:
lockUI(); lockUI();
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene6")); c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene6"));
break; }
} }
} }
public void displayAranIntro() { public void displayAranIntro() {
switch (c.getPlayer().getMapId()) { switch (c.getPlayer().getMapId()) {
case 914090010: case MapId.ARAN_TUTO_1 -> {
lockUI(); lockUI();
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene0")); c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene0"));
break; }
case 914090011: case MapId.ARAN_TUTO_2 -> c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene1" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene1" + c.getPlayer().getGender())); case MapId.ARAN_TUTO_3 -> c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene2" + c.getPlayer().getGender()));
break; case MapId.ARAN_TUTO_4 -> c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene3"));
case 914090012: case MapId.ARAN_POLEARM -> {
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene2" + c.getPlayer().getGender()));
break;
case 914090013:
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene3"));
break;
case 914090100:
lockUI(); lockUI();
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/HandedPoleArm" + c.getPlayer().getGender())); c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/HandedPoleArm" + c.getPlayer().getGender()));
break; }
} }
} }
@@ -28,6 +28,7 @@ import client.inventory.ItemFactory;
import client.inventory.Pet; import client.inventory.Pet;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.MapId;
import constants.id.NpcId; import constants.id.NpcId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import constants.string.LanguageConstants; import constants.string.LanguageConstants;
@@ -406,7 +407,8 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
sendNext("You have obtained a #b#t" + item.getId() + "##k."); sendNext("You have obtained a #b#t" + item.getId() + "##k.");
int[] maps = {100000000, 101000000, 102000000, 103000000, 105040300, 800000000, 809000101, 809000201, 600000000, 120000000}; int[] maps = {MapId.HENESYS, MapId.ELLINIA, MapId.PERION, MapId.KERNING_CITY, MapId.SLEEPYWOOD, MapId.MUSHROOM_SHRINE,
MapId.SHOWA_SPA_M, MapId.SHOWA_SPA_F, MapId.NEW_LEAF_CITY, MapId.NAUTILUS_HARBOR};
final int mapId = maps[(getNpc() != NpcId.GACHAPON_NAUTILUS && getNpc() != NpcId.GACHAPON_NLC) ? final int mapId = maps[(getNpc() != NpcId.GACHAPON_NAUTILUS && getNpc() != NpcId.GACHAPON_NLC) ?
(getNpc() - NpcId.GACHAPON_HENESYS) : getNpc() == NpcId.GACHAPON_NLC ? 8 : 9]; (getNpc() - NpcId.GACHAPON_HENESYS) : getNpc() == NpcId.GACHAPON_NLC ? 8 : 9];
String map = c.getChannelServer().getMapFactory().getMap(mapId).getMapName(); String map = c.getChannelServer().getMapFactory().getMap(mapId).getMapName();
@@ -500,7 +502,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
MapManager mapManager = c.getChannelServer().getMapFactory(); MapManager mapManager = c.getChannelServer().getMapFactory();
MapleMap map = null; MapleMap map = null;
int mapid = 926010100; int mapid = MapId.NETTS_PYRAMID_SOLO_BASE;
if (party) { if (party) {
mapid += 10000; mapid += 10000;
} }
+2 -1
View File
@@ -31,6 +31,7 @@ import client.status.MonsterStatus;
import client.status.MonsterStatusEffect; import client.status.MonsterStatusEffect;
import config.YamlConfig; import config.YamlConfig;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import constants.skills.*; import constants.skills.*;
import net.packet.Packet; import net.packet.Packet;
@@ -908,7 +909,7 @@ public class StatEffect {
MapleMap target; MapleMap target;
Portal pt; Portal pt;
if (moveTo == 999999999) { if (moveTo == MapId.NONE) {
if (sourceid != ItemId.ANTI_BANISH_SCROLL) { if (sourceid != ItemId.ANTI_BANISH_SCROLL) {
target = applyto.getMap().getReturnMap(); target = applyto.getMap().getReturnMap();
pt = target.getRandomPlayerSpawnpoint(); pt = target.getRandomPlayerSpawnpoint();
+4 -3
View File
@@ -23,6 +23,7 @@
package server.events.gm; package server.events.gm;
import client.Character; import client.Character;
import constants.id.MapId;
import server.TimerManager; import server.TimerManager;
import server.maps.MapleMap; import server.maps.MapleMap;
import tools.PacketCreator; import tools.PacketCreator;
@@ -59,7 +60,7 @@ public class Coconut extends Event {
map.broadcastMessage(PacketCreator.getClock(300)); map.broadcastMessage(PacketCreator.getClock(300));
TimerManager.getInstance().schedule(() -> { TimerManager.getInstance().schedule(() -> {
if (map.getId() == 109080000) { if (map.getId() == MapId.EVENT_COCONUT_HARVEST) {
if (getMapleScore() == getStoryScore()) { if (getMapleScore() == getStoryScore()) {
bonusTime(); bonusTime();
} else if (getMapleScore() > getStoryScore()) { } else if (getMapleScore() > getStoryScore()) {
@@ -132,9 +133,9 @@ public class Coconut extends Event {
for (Character chr : chars) { for (Character chr : chars) {
if ((getMapleScore() > getStoryScore() && chr.getTeam() == 0) || (getStoryScore() > getMapleScore() && chr.getTeam() == 1)) { if ((getMapleScore() > getStoryScore() && chr.getTeam() == 0) || (getStoryScore() > getMapleScore() && chr.getTeam() == 1)) {
chr.changeMap(109050000); chr.changeMap(MapId.EVENT_WINNER);
} else { } else {
chr.changeMap(109050001); chr.changeMap(MapId.EVENT_EXIT);
} }
} }
map.setCoconut(null); map.setCoconut(null);
+3 -2
View File
@@ -23,6 +23,7 @@
package server.events.gm; package server.events.gm;
import client.Character; import client.Character;
import constants.id.MapId;
import server.TimerManager; import server.TimerManager;
import tools.PacketCreator; import tools.PacketCreator;
@@ -41,7 +42,7 @@ public class Fitness {
public Fitness(final Character chr) { public Fitness(final Character chr) {
this.chr = chr; this.chr = chr;
this.schedule = TimerManager.getInstance().schedule(() -> { this.schedule = TimerManager.getInstance().schedule(() -> {
if (chr.getMapId() >= 109040000 && chr.getMapId() <= 109040004) { if (MapId.isPhysicalFitness(chr.getMapId())) {
chr.changeMap(chr.getMap().getReturnMap()); chr.changeMap(chr.getMap().getReturnMap());
} }
}, 900000); }, 900000);
@@ -82,7 +83,7 @@ public class Fitness {
if (chr.getFitness() == null) { if (chr.getFitness() == null) {
resetTimes(); resetTimes();
} }
if (chr.getMap().getId() >= 109040000 && chr.getMap().getId() <= 109040004) { if (MapId.isPhysicalFitness(chr.getMapId())) {
if (getTimeLeft() > 9000 && getTimeLeft() < 11000) { if (getTimeLeft() > 9000 && getTimeLeft() < 11000) {
chr.sendPacket(PacketCreator.serverNotice(0, "You have 10 sec left. Those of you unable to beat the game, we hope you beat it next time! Great job everyone!! See you later~")); chr.sendPacket(PacketCreator.serverNotice(0, "You have 10 sec left. Those of you unable to beat the game, we hope you beat it next time! Great job everyone!! See you later~"));
} else if (getTimeLeft() > 99000 && getTimeLeft() < 101000) { } else if (getTimeLeft() > 99000 && getTimeLeft() < 101000) {
+2 -1
View File
@@ -22,6 +22,7 @@
package server.events.gm; package server.events.gm;
import client.Character; import client.Character;
import constants.id.MapId;
import server.TimerManager; import server.TimerManager;
import tools.PacketCreator; import tools.PacketCreator;
@@ -39,7 +40,7 @@ public class Ola {
public Ola(final Character chr) { public Ola(final Character chr) {
this.chr = chr; this.chr = chr;
this.schedule = TimerManager.getInstance().schedule(() -> { this.schedule = TimerManager.getInstance().schedule(() -> {
if (chr.getMapId() >= 109030001 && chr.getMapId() <= 109030303) { if (MapId.isOlaOla(chr.getMapId())) {
chr.changeMap(chr.getMap().getReturnMap()); chr.changeMap(chr.getMap().getReturnMap());
} }
resetTimes(); resetTimes();
+4 -3
View File
@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package server.events.gm; package server.events.gm;
import client.Character; import client.Character;
import constants.id.MapId;
import server.TimerManager; import server.TimerManager;
import server.maps.MapleMap; import server.maps.MapleMap;
import tools.PacketCreator; import tools.PacketCreator;
@@ -152,10 +153,10 @@ public class Snowball {
public void warpOut() { public void warpOut() {
TimerManager.getInstance().schedule(() -> { TimerManager.getInstance().schedule(() -> {
if (winner == true) { if (winner) {
map.warpOutByTeam(team, 109050000); map.warpOutByTeam(team, MapId.EVENT_WINNER);
} else { } else {
map.warpOutByTeam(team, 109050001); map.warpOutByTeam(team, MapId.EVENT_EXIT);
} }
map.setSnowball(team, null); map.setSnowball(team, null);
@@ -23,6 +23,7 @@
package server.expeditions; package server.expeditions;
import client.Character; import client.Character;
import constants.id.MapId;
import constants.id.MobId; import constants.id.MobId;
import net.packet.Packet; import net.packet.Packet;
import net.server.PlayerStorage; import net.server.PlayerStorage;
@@ -256,7 +257,7 @@ public class Expedition {
player.dropMessage(6, "[Expedition] You have been banned from this expedition."); player.dropMessage(6, "[Expedition] You have been banned from this expedition.");
} }
if (ExpeditionType.ARIANT.equals(type) || ExpeditionType.ARIANT1.equals(type) || ExpeditionType.ARIANT2.equals(type)) { if (ExpeditionType.ARIANT.equals(type) || ExpeditionType.ARIANT1.equals(type) || ExpeditionType.ARIANT2.equals(type)) {
player.changeMap(980010000); player.changeMap(MapId.ARPQ_LOBBY);
} }
} }
} }
+5 -5
View File
@@ -24,7 +24,7 @@ package server.life;
import client.Character; import client.Character;
import client.Disease; import client.Disease;
import client.status.MonsterStatus; import client.status.MonsterStatus;
import constants.game.GameConstants; import constants.id.MapId;
import constants.id.MobId; import constants.id.MobId;
import net.server.services.task.channel.OverallService; import net.server.services.task.channel.OverallService;
import net.server.services.type.ChannelServices; import net.server.services.type.ChannelServices;
@@ -244,7 +244,7 @@ public class MobSkill {
int skillLimit = this.getLimit(); int skillLimit = this.getLimit();
MapleMap map = monster.getMap(); MapleMap map = monster.getMap();
if (GameConstants.isDojo(map.getId())) { // spawns in dojo should be unlimited if (MapId.isDojo(map.getId())) { // spawns in dojo should be unlimited
skillLimit = Integer.MAX_VALUE; skillLimit = Integer.MAX_VALUE;
} }
@@ -252,7 +252,7 @@ public class MobSkill {
List<Integer> summons = getSummons(); List<Integer> summons = getSummons();
int summonLimit = monster.countAvailableMobSummons(summons.size(), skillLimit); int summonLimit = monster.countAvailableMobSummons(summons.size(), skillLimit);
if (summonLimit >= 1) { if (summonLimit >= 1) {
boolean bossRushMap = GameConstants.isBossRush(map.getId()); boolean bossRushMap = MapId.isBossRush(map.getId());
Collections.shuffle(summons); Collections.shuffle(summons);
for (Integer mobId : summons.subList(0, summonLimit)) { for (Integer mobId : summons.subList(0, summonLimit)) {
@@ -286,14 +286,14 @@ public class MobSkill {
break; break;
} }
switch (map.getId()) { switch (map.getId()) {
case 220080001: //Pap map case MapId.ORIGIN_OF_CLOCKTOWER: //Pap map
if (xpos < -890) { if (xpos < -890) {
xpos = (int) (Math.ceil(Math.random() * 150) - 890); xpos = (int) (Math.ceil(Math.random() * 150) - 890);
} else if (xpos > 230) { } else if (xpos > 230) {
xpos = (int) (230 - Math.ceil(Math.random() * 150)); xpos = (int) (230 - Math.ceil(Math.random() * 150));
} }
break; break;
case 230040420: // Pianus map case MapId.CAVE_OF_PIANUS: // Pianus map
if (xpos < -239) { if (xpos < -239) {
xpos = (int) (Math.ceil(Math.random() * 150) - 239); xpos = (int) (Math.ceil(Math.random() * 150) - 239);
} else if (xpos > 371) { } else if (xpos > 371) {
@@ -20,6 +20,7 @@
package server.life; package server.life;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.id.NpcId; import constants.id.NpcId;
import net.server.Server; import net.server.Server;
import provider.Data; import provider.Data;
@@ -51,7 +52,7 @@ public class PlayerNPCFactory {
if (thisData != null) { if (thisData != null) {
DataProvider map = DataProviderFactory.getDataProvider(WZFiles.MAP); DataProvider map = DataProviderFactory.getDataProvider(WZFiles.MAP);
thisData = map.getData("Map/Map7/777777777.img"); thisData = map.getData("Map/Map7/" + MapId.DEVELOPERS_HQ + ".img");
if (thisData != null) { if (thisData != null) {
DataProvider sound = DataProviderFactory.getDataProvider(WZFiles.SOUND); DataProvider sound = DataProviderFactory.getDataProvider(WZFiles.SOUND);
@@ -112,7 +113,7 @@ public class PlayerNPCFactory {
if (thisData != null) { if (thisData != null) {
byte[] encData = {0x52, 0x6F, 0x6E, 0x61, 0x6E}; byte[] encData = {0x52, 0x6F, 0x6E, 0x61, 0x6E};
String name = new String(encData); String name = new String(encData);
int face = 20104, hair = 30215, gender = 0, skin = 0, dir = 0, mapid = 777777777; int face = 20104, hair = 30215, gender = 0, skin = 0, dir = 0, mapid = MapId.DEVELOPERS_HQ;
int FH = 4, RX0 = -143, RX1 = -243, CX = -193, CY = 117, scriptId = NpcId.CUSTOM_DEV; int FH = 4, RX0 = -143, RX1 = -243, CX = -193, CY = 117, scriptId = NpcId.CUSTOM_DEV;
Map<Short, Integer> equips = new HashMap<>(); Map<Short, Integer> equips = new HashMap<>();
+3 -2
View File
@@ -21,6 +21,7 @@ package server.maps;
import client.Character; import client.Character;
import client.Client; import client.Client;
import constants.id.MapId;
import net.server.audit.locks.MonitoredLockType; import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.MonitoredReadLock; import net.server.audit.locks.MonitoredReadLock;
import net.server.audit.locks.MonitoredReentrantReadWriteLock; import net.server.audit.locks.MonitoredReentrantReadWriteLock;
@@ -128,7 +129,7 @@ public class DoorObject extends AbstractMapObject {
if (from.getId() == chr.getMapId()) { if (from.getId() == chr.getMapId()) {
Party party = chr.getParty(); Party party = chr.getParty();
if (party != null && (ownerId == chr.getId() || party.getMemberById(ownerId) != null)) { if (party != null && (ownerId == chr.getId() || party.getMemberById(ownerId) != null)) {
client.sendPacket(PacketCreator.partyPortal(999999999, 999999999, new Point(-1, -1))); client.sendPacket(PacketCreator.partyPortal(MapId.NONE, MapId.NONE, new Point(-1, -1)));
} }
client.sendPacket(PacketCreator.removeDoor(ownerId, inTown())); client.sendPacket(PacketCreator.removeDoor(ownerId, inTown()));
} }
@@ -136,7 +137,7 @@ public class DoorObject extends AbstractMapObject {
public void sendDestroyData(Client client, boolean partyUpdate) { public void sendDestroyData(Client client, boolean partyUpdate) {
if (client != null && from.getId() == client.getPlayer().getMapId()) { if (client != null && from.getId() == client.getPlayer().getMapId()) {
client.sendPacket(PacketCreator.partyPortal(999999999, 999999999, new Point(-1, -1))); client.sendPacket(PacketCreator.partyPortal(MapId.NONE, MapId.NONE, new Point(-1, -1)));
client.sendPacket(PacketCreator.removeDoor(ownerId, inTown())); client.sendPacket(PacketCreator.removeDoor(ownerId, inTown()));
} }
} }
+2 -1
View File
@@ -24,6 +24,7 @@ package server.maps;
import client.Character; import client.Character;
import client.Client; import client.Client;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.MapId;
import net.server.audit.locks.MonitoredLockType; import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.MonitoredReentrantLock; import net.server.audit.locks.MonitoredReentrantLock;
import net.server.audit.locks.factory.MonitoredReentrantLockFactory; import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
@@ -140,7 +141,7 @@ public class GenericPortal implements Portal {
} catch (NullPointerException npe) { } catch (NullPointerException npe) {
npe.printStackTrace(); npe.printStackTrace();
} }
} else if (getTargetMapId() != 999999999) { } else if (getTargetMapId() != MapId.NONE) {
Character chr = c.getPlayer(); Character chr = c.getPlayer();
if (!(chr.getChalkboard() != null && GameConstants.isFreeMarketRoom(getTargetMapId()))) { if (!(chr.getChalkboard() != null && GameConstants.isFreeMarketRoom(getTargetMapId()))) {
MapleMap to = chr.getEventInstance() == null ? c.getChannelServer().getMapFactory().getMap(getTargetMapId()) : chr.getEventInstance().getMapInstance(getTargetMapId()); MapleMap to = chr.getEventInstance() == null ? c.getChannelServer().getMapFactory().getMap(getTargetMapId()) : chr.getEventInstance().getMapInstance(getTargetMapId());
+8 -7
View File
@@ -21,6 +21,7 @@
*/ */
package server.maps; package server.maps;
import constants.id.MapId;
import provider.Data; import provider.Data;
import provider.DataProvider; import provider.DataProvider;
import provider.DataProviderFactory; import provider.DataProviderFactory;
@@ -309,7 +310,7 @@ public class MapFactory {
map.setTown(DataTool.getIntConvert("town", infoData, 0) != 0); map.setTown(DataTool.getIntConvert("town", infoData, 0) != 0);
map.setHPDec(DataTool.getIntConvert("decHP", infoData, 0)); map.setHPDec(DataTool.getIntConvert("decHP", infoData, 0));
map.setHPDecProtect(DataTool.getIntConvert("protectItem", infoData, 0)); map.setHPDecProtect(DataTool.getIntConvert("protectItem", infoData, 0));
map.setForcedReturnMap(DataTool.getInt(infoData.getChildByPath("forcedReturn"), 999999999)); map.setForcedReturnMap(DataTool.getInt(infoData.getChildByPath("forcedReturn"), MapId.NONE));
map.setBoat(mapData.getChildByPath("shipObj") != null); map.setBoat(mapData.getChildByPath("shipObj") != null);
map.setTimeLimit(DataTool.getIntConvert("timeLimit", infoData, -1)); map.setTimeLimit(DataTool.getIntConvert("timeLimit", infoData, -1));
map.setFieldType(DataTool.getIntConvert("fieldType", infoData, 0)); map.setFieldType(DataTool.getIntConvert("fieldType", infoData, 0));
@@ -381,15 +382,15 @@ public class MapFactory {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
if (mapid < 100000000) { if (mapid < 100000000) {
builder.append("maple"); builder.append("maple");
} else if (mapid >= 100000000 && mapid < 200000000) { } else if (mapid >= 100000000 && mapid < MapId.ORBIS) {
builder.append("victoria"); builder.append("victoria");
} else if (mapid >= 200000000 && mapid < 300000000) { } else if (mapid >= MapId.ORBIS && mapid < MapId.ELLIN_FOREST) {
builder.append("ossyria"); builder.append("ossyria");
} else if (mapid >= 300000000 && mapid < 400000000) { } else if (mapid >= MapId.ELLIN_FOREST && mapid < 400000000) {
builder.append("elin"); builder.append("elin");
} else if (mapid >= 540000000 && mapid < 560000000) { } else if (mapid >= MapId.SINGAPORE && mapid < 560000000) {
builder.append("singapore"); builder.append("singapore");
} else if (mapid >= 600000000 && mapid < 620000000) { } else if (mapid >= MapId.NEW_LEAF_CITY && mapid < 620000000) {
builder.append("MasteriaGL"); builder.append("MasteriaGL");
} else if (mapid >= 677000000 && mapid < 677100000) { } else if (mapid >= 677000000 && mapid < 677100000) {
builder.append("Episode1GL"); builder.append("Episode1GL");
@@ -403,7 +404,7 @@ public class MapFactory {
builder.append("HalloweenGL"); builder.append("HalloweenGL");
} else if (mapid >= 683000000 && mapid < 684000000) { } else if (mapid >= 683000000 && mapid < 684000000) {
builder.append("event"); builder.append("event");
} else if (mapid >= 800000000 && mapid < 900000000) { } else if (mapid >= MapId.MUSHROOM_SHRINE && mapid < 900000000) {
if ((mapid >= 889100000 && mapid < 889200000)) { if ((mapid >= 889100000 && mapid < 889200000)) {
builder.append("etc"); builder.append("etc");
} else { } else {
+41 -38
View File
@@ -33,6 +33,7 @@ import client.status.MonsterStatus;
import client.status.MonsterStatusEffect; import client.status.MonsterStatusEffect;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.MapId;
import constants.id.MobId; import constants.id.MobId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import net.packet.Packet; import net.packet.Packet;
@@ -120,7 +121,7 @@ public class MapleMap {
private String streetName; private String streetName;
private MapEffect mapEffect = null; private MapEffect mapEffect = null;
private boolean everlast = false; private boolean everlast = false;
private int forcedReturnMap = 999999999; private int forcedReturnMap = MapId.NONE;
private int timeLimit; private int timeLimit;
private long mapTimer; private long mapTimer;
private int decHP = 0; private int decHP = 0;
@@ -264,7 +265,7 @@ public class MapleMap {
} }
public MapleMap getReturnMap() { public MapleMap getReturnMap() {
if (returnMapId == 999999999) { if (returnMapId == MapId.NONE) {
return this; return this;
} }
return getChannelServer().getMapFactory().getMap(returnMapId); return getChannelServer().getMapFactory().getMap(returnMapId);
@@ -2388,7 +2389,7 @@ public class MapleMap {
} }
} }
if (onUserEnter.length() != 0) { if (onUserEnter.length() != 0) {
if (onUserEnter.equals("cygnusTest") && (mapid < 913040000 || mapid > 913040006)) { if (onUserEnter.equals("cygnusTest") && !MapId.isCygnusIntro(mapid)) {
chr.saveLocation("INTRO"); chr.saveLocation("INTRO");
} }
@@ -2399,52 +2400,52 @@ public class MapleMap {
chr.cancelBuffStats(BuffStat.MONSTER_RIDING); chr.cancelBuffStats(BuffStat.MONSTER_RIDING);
} }
if (mapid == 200090060) { // To Rien if (mapid == MapId.FROM_LITH_TO_RIEN) { // To Rien
int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(1)); int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(1));
chr.sendPacket(PacketCreator.getClock(travelTime / 1000)); chr.sendPacket(PacketCreator.getClock(travelTime / 1000));
TimerManager.getInstance().schedule(() -> { TimerManager.getInstance().schedule(() -> {
if (chr.getMapId() == 200090060) { if (chr.getMapId() == MapId.FROM_LITH_TO_RIEN) {
chr.changeMap(140020300, 0); chr.changeMap(MapId.DANGEROUS_FOREST, 0);
} }
}, travelTime); }, travelTime);
} else if (mapid == 200090070) { // To Lith Harbor } else if (mapid == MapId.FROM_RIEN_TO_LITH) { // To Lith Harbor
int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(1)); int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(1));
chr.sendPacket(PacketCreator.getClock(travelTime / 1000)); chr.sendPacket(PacketCreator.getClock(travelTime / 1000));
TimerManager.getInstance().schedule(() -> { TimerManager.getInstance().schedule(() -> {
if (chr.getMapId() == 200090070) { if (chr.getMapId() == MapId.FROM_RIEN_TO_LITH) {
chr.changeMap(104000000, 3); chr.changeMap(MapId.LITH_HARBOUR, 3);
} }
}, travelTime); }, travelTime);
} else if (mapid == 200090030) { // To Ereve (SkyFerry) } else if (mapid == MapId.FROM_ELLINIA_TO_EREVE) { // To Ereve (SkyFerry)
int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(2)); int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(2));
chr.sendPacket(PacketCreator.getClock(travelTime / 1000)); chr.sendPacket(PacketCreator.getClock(travelTime / 1000));
TimerManager.getInstance().schedule(() -> { TimerManager.getInstance().schedule(() -> {
if (chr.getMapId() == 200090030) { if (chr.getMapId() == MapId.FROM_ELLINIA_TO_EREVE) {
chr.changeMap(130000210, 0); chr.changeMap(MapId.SKY_FERRY, 0);
} }
}, travelTime); }, travelTime);
} else if (mapid == 200090031) { // To Victoria Island (SkyFerry) } else if (mapid == MapId.FROM_EREVE_TO_ELLINIA) { // To Victoria Island (SkyFerry)
int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(2)); int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(2));
chr.sendPacket(PacketCreator.getClock(travelTime / 1000)); chr.sendPacket(PacketCreator.getClock(travelTime / 1000));
TimerManager.getInstance().schedule(() -> { TimerManager.getInstance().schedule(() -> {
if (chr.getMapId() == 200090031) { if (chr.getMapId() == MapId.FROM_EREVE_TO_ELLINIA) {
chr.changeMap(101000400, 0); chr.changeMap(MapId.ELLINIA_SKY_FERRY, 0);
} }
}, travelTime); }, travelTime);
} else if (mapid == 200090021) { // To Orbis (SkyFerry) } else if (mapid == MapId.FROM_EREVE_TO_ORBIS) { // To Orbis (SkyFerry)
int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(8)); int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(8));
chr.sendPacket(PacketCreator.getClock(travelTime / 1000)); chr.sendPacket(PacketCreator.getClock(travelTime / 1000));
TimerManager.getInstance().schedule(() -> { TimerManager.getInstance().schedule(() -> {
if (chr.getMapId() == 200090021) { if (chr.getMapId() == MapId.FROM_EREVE_TO_ORBIS) {
chr.changeMap(200000161, 0); chr.changeMap(MapId.ORBIS_STATION, 0);
} }
}, travelTime); }, travelTime);
} else if (mapid == 200090020) { // To Ereve From Orbis (SkyFerry) } else if (mapid == MapId.FROM_ORBIS_TO_EREVE) { // To Ereve From Orbis (SkyFerry)
int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(8)); int travelTime = getWorldServer().getTransportationTime((int) MINUTES.toMillis(8));
chr.sendPacket(PacketCreator.getClock(travelTime / 1000)); chr.sendPacket(PacketCreator.getClock(travelTime / 1000));
TimerManager.getInstance().schedule(() -> { TimerManager.getInstance().schedule(() -> {
if (chr.getMapId() == 200090020) { if (chr.getMapId() == MapId.FROM_ORBIS_TO_EREVE) {
chr.changeMap(130000210, 0); chr.changeMap(MapId.SKY_FERRY, 0);
} }
}, travelTime); }, travelTime);
} else if (MiniDungeonInfo.isDungeonMap(mapid)) { } else if (MiniDungeonInfo.isDungeonMap(mapid)) {
@@ -2550,7 +2551,7 @@ public class MapleMap {
mapEffect.sendStartData(chr.getClient()); mapEffect.sendStartData(chr.getClient());
} }
chr.sendPacket(PacketCreator.resetForcedStats()); chr.sendPacket(PacketCreator.resetForcedStats());
if (mapid == 914000200 || mapid == 914000210 || mapid == 914000220) { if (MapId.isGodlyStatMap(mapid)) {
chr.sendPacket(PacketCreator.aranGodlyStats()); chr.sendPacket(PacketCreator.aranGodlyStats());
} }
if (chr.getEventInstance() != null && chr.getEventInstance().isTimerStarted()) { if (chr.getEventInstance() != null && chr.getEventInstance().isTimerStarted()) {
@@ -2564,7 +2565,7 @@ public class MapleMap {
chr.sendPacket(PacketCreator.getClock((int) (chr.getOla().getTimeLeft() / 1000))); chr.sendPacket(PacketCreator.getClock((int) (chr.getOla().getTimeLeft() / 1000)));
} }
if (mapid == 109060000) { if (mapid == MapId.EVENT_SNOWBALL) {
chr.sendPacket(PacketCreator.rollSnowBall(true, 0, null, null)); chr.sendPacket(PacketCreator.rollSnowBall(true, 0, null, null));
} }
@@ -2591,7 +2592,7 @@ public class MapleMap {
public Portal getRandomPlayerSpawnpoint() { public Portal getRandomPlayerSpawnpoint() {
List<Portal> spawnPoints = new ArrayList<>(); List<Portal> spawnPoints = new ArrayList<>();
for (Portal portal : portals.values()) { for (Portal portal : portals.values()) {
if (portal.getType() >= 0 && portal.getType() <= 1 && portal.getTargetMapId() == 999999999) { if (portal.getType() >= 0 && portal.getType() <= 1 && portal.getTargetMapId() == MapId.NONE) {
spawnPoints.add(portal); spawnPoints.add(portal);
} }
} }
@@ -2604,7 +2605,7 @@ public class MapleMap {
double shortestDistance = Double.POSITIVE_INFINITY; double shortestDistance = Double.POSITIVE_INFINITY;
for (Portal portal : portals.values()) { for (Portal portal : portals.values()) {
double distance = portal.getPosition().distanceSq(from); double distance = portal.getPosition().distanceSq(from);
if (portal.getType() == Portal.TELEPORT_PORTAL && distance < shortestDistance && portal.getTargetMapId() != 999999999) { if (portal.getType() == Portal.TELEPORT_PORTAL && distance < shortestDistance && portal.getTargetMapId() != MapId.NONE) {
closest = portal; closest = portal;
shortestDistance = distance; shortestDistance = distance;
} }
@@ -2617,7 +2618,7 @@ public class MapleMap {
double shortestDistance = Double.POSITIVE_INFINITY; double shortestDistance = Double.POSITIVE_INFINITY;
for (Portal portal : portals.values()) { for (Portal portal : portals.values()) {
double distance = portal.getPosition().distanceSq(from); double distance = portal.getPosition().distanceSq(from);
if (portal.getType() >= 0 && portal.getType() <= 1 && distance < shortestDistance && portal.getTargetMapId() == 999999999) { if (portal.getType() >= 0 && portal.getType() <= 1 && distance < shortestDistance && portal.getTargetMapId() == MapId.NONE) {
closest = portal; closest = portal;
shortestDistance = distance; shortestDistance = distance;
} }
@@ -3895,20 +3896,21 @@ public class MapleMap {
} }
public void startEvent(final Character chr) { public void startEvent(final Character chr) {
if (this.mapid == 109080000 && getCoconut() == null) { if (this.mapid == MapId.EVENT_COCONUT_HARVEST && getCoconut() == null) {
setCoconut(new Coconut(this)); setCoconut(new Coconut(this));
coconut.startEvent(); coconut.startEvent();
} else if (this.mapid == 109040000) { } else if (this.mapid == MapId.EVENT_PHYSICAL_FITNESS) {
chr.setFitness(new Fitness(chr)); chr.setFitness(new Fitness(chr));
chr.getFitness().startFitness(); chr.getFitness().startFitness();
} else if (this.mapid == 109030101 || this.mapid == 109030201 || this.mapid == 109030301 || this.mapid == 109030401) { } else if (this.mapid == MapId.EVENT_OLA_OLA_1 || this.mapid == MapId.EVENT_OLA_OLA_2 ||
this.mapid == MapId.EVENT_OLA_OLA_3 || this.mapid == MapId.EVENT_OLA_OLA_4) {
chr.setOla(new Ola(chr)); chr.setOla(new Ola(chr));
chr.getOla().startOla(); chr.getOla().startOla();
} else if (this.mapid == 109020001 && getOx() == null) { } else if (this.mapid == MapId.EVENT_OX_QUIZ && getOx() == null) {
setOx(new OxQuiz(this)); setOx(new OxQuiz(this));
getOx().sendQuestion(); getOx().sendQuestion();
setOxQuiz(true); setOxQuiz(true);
} else if (this.mapid == 109060000 && getSnowball(chr.getTeam()) == null) { } else if (this.mapid == MapId.EVENT_SNOWBALL && getSnowball(chr.getTeam()) == null) {
setSnowball(0, new Snowball(0, this)); setSnowball(0, new Snowball(0, this));
setSnowball(1, new Snowball(1, this)); setSnowball(1, new Snowball(1, this));
getSnowball(chr.getTeam()).startEvent(); getSnowball(chr.getTeam()).startEvent();
@@ -3930,13 +3932,13 @@ public class MapleMap {
public String getEventNPC() { public String getEventNPC() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Talk to "); sb.append("Talk to ");
if (mapid == 60000) { if (mapid == MapId.SOUTHPERRY) {
sb.append("Paul!"); sb.append("Paul!");
} else if (mapid == 104000000) { } else if (mapid == MapId.LITH_HARBOUR) {
sb.append("Jean!"); sb.append("Jean!");
} else if (mapid == 200000000) { } else if (mapid == MapId.ORBIS) {
sb.append("Martin!"); sb.append("Martin!");
} else if (mapid == 220000000) { } else if (mapid == MapId.LUDIBRIUM) {
sb.append("Tony!"); sb.append("Tony!");
} else { } else {
return null; return null;
@@ -3945,15 +3947,16 @@ public class MapleMap {
} }
public boolean hasEventNPC() { public boolean hasEventNPC() {
return this.mapid == 60000 || this.mapid == 104000000 || this.mapid == 200000000 || this.mapid == 220000000; return this.mapid == 60000 || this.mapid == MapId.LITH_HARBOUR || this.mapid == MapId.ORBIS || this.mapid == MapId.LUDIBRIUM;
} }
public boolean isStartingEventMap() { public boolean isStartingEventMap() {
return this.mapid == 109040000 || this.mapid == 109020001 || this.mapid == 109010000 || this.mapid == 109030001 || this.mapid == 109030101; return this.mapid == MapId.EVENT_PHYSICAL_FITNESS || this.mapid == MapId.EVENT_OX_QUIZ ||
this.mapid == MapId.EVENT_FIND_THE_JEWEL || this.mapid == MapId.EVENT_OLA_OLA_0 || this.mapid == MapId.EVENT_OLA_OLA_1;
} }
public boolean isEventMap() { public boolean isEventMap() {
return this.mapid >= 109010000 && this.mapid < 109050000 || this.mapid > 109050001 && this.mapid <= 109090000; return this.mapid >= MapId.EVENT_FIND_THE_JEWEL && this.mapid < MapId.EVENT_WINNER || this.mapid > MapId.EVENT_EXIT && this.mapid <= 109090000;
} }
public void setTimeMob(int id, String msg) { public void setTimeMob(int id, String msg) {
+14 -12
View File
@@ -21,6 +21,8 @@
*/ */
package server.maps; package server.maps;
import constants.id.MapId;
/** /**
* @author Alan (SharpAceX) * @author Alan (SharpAceX)
*/ */
@@ -29,18 +31,18 @@ public enum MiniDungeonInfo {
//http://bbb.hidden-street.net/search_finder/mini%20dungeon //http://bbb.hidden-street.net/search_finder/mini%20dungeon
CAVE_OF_MUSHROOMS(105050100, 105050101, 30), CAVE_OF_MUSHROOMS(MapId.ANT_TUNNEL_2, MapId.CAVE_OF_MUSHROOMS_BASE, 30), // Horny Mushroom, Zombie Mushroom
GOLEM_CASTLE_RUINS(105040304, 105040320, 34), GOLEM_CASTLE_RUINS(MapId.SLEEPY_DUNGEON_4, MapId.GOLEMS_CASTLE_RUINS_BASE, 34), // Stone Golem, Mixed Golem
HILL_OF_SANDSTORMS(260020600, 260020630, 30), HILL_OF_SANDSTORMS(MapId.SAHEL_2, MapId.HILL_OF_SANDSTORMS_BASE, 30), // Sand Rat
HENESYS_PIG_FARM(100020000, 100020100, 30), HENESYS_PIG_FARM(MapId.RAIN_FOREST_EAST_OF_HENESYS, MapId.HENESYS_PIG_FARM_BASE, 30), // Pig, Ribbon Pig
DRAKES_BLUE_CAVE(105090311, 105090320, 30), DRAKES_BLUE_CAVE(MapId.COLD_CRADLE, MapId.DRAKES_BLUE_CAVE_BASE, 30), // Dark Drake
DRUMMER_BUNNYS_LAIR(221023400, 221023401, 30), DRUMMER_BUNNYS_LAIR(MapId.EOS_TOWER_76TH_TO_90TH_FLOOR, MapId.DRUMMER_BUNNYS_LAIR_BASE, 30), // Drumming Bunny
THE_ROUND_TABLE_OF_KENTARUS(240020500, 240020512, 30), THE_ROUND_TABLE_OF_KENTARUS(MapId.BATTLEFIELD_OF_FIRE_AND_WATER, MapId.ROUND_TABLE_OF_KENTAURUS_BASE, 30), // Blue/Red/Black Kentaurus
THE_RESTORING_MEMORY(240040511, 240040800, 19), THE_RESTORING_MEMORY(MapId.DRAGON_NEST_LEFT_BEHIND, MapId.RESTORING_MEMORY_BASE, 19), // Skelegon, Skelosaurus
NEWT_SECURED_ZONE(240040520, 240040900, 19), NEWT_SECURED_ZONE(MapId.DESTROYED_DRAGON_NEST, MapId.NEWT_SECURED_ZONE_BASE, 19), // Jr. Newtie, Transforming Jr. Newtie
PILLAGE_OF_TREASURE_ISLAND(251010402, 251010410, 30), PILLAGE_OF_TREASURE_ISLAND(MapId.RED_NOSE_PIRATE_DEN_2, MapId.PILLAGE_OF_TREASURE_ISLAND_BASE, 30), // Captain
CRITICAL_ERROR(261020300, 261020301, 30), CRITICAL_ERROR(MapId.LAB_AREA_C1, MapId.CRITICAL_ERROR_BASE, 30), // Roid
LONGEST_RIDE_ON_BYEBYE_STATION(551030000, 551030001, 19); LONGEST_RIDE_ON_BYEBYE_STATION(MapId.FANTASY_THEME_PARK_3, MapId.LONGEST_RIDE_ON_BYEBYE_STATION, 19); // Froscola, Jester Scarlion
private final int baseId; private final int baseId;
private final int dungeonId; private final int dungeonId;
+4 -4
View File
@@ -22,16 +22,16 @@
package server.maps; package server.maps;
public class SavedLocation { public class SavedLocation {
private int mapid = 102000000; private final int mapId;
private final int portal; private final int portal;
public SavedLocation(int mapid, int portal) { public SavedLocation(int mapId, int portal) {
this.mapid = mapid; this.mapId = mapId;
this.portal = portal; this.portal = portal;
} }
public int getMapId() { public int getMapId() {
return mapid; return mapId;
} }
public int getPortal() { public int getPortal() {
@@ -22,6 +22,7 @@ package server.partyquest;
import client.Character; import client.Character;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import server.TimerManager; import server.TimerManager;
import server.expeditions.Expedition; import server.expeditions.Expedition;
import server.expeditions.ExpeditionType; import server.expeditions.ExpeditionType;
@@ -249,9 +250,9 @@ public class AriantColiseum {
private ExpeditionType getExpeditionType() { private ExpeditionType getExpeditionType() {
ExpeditionType type; ExpeditionType type;
if (map.getId() == 980010101) { if (map.getId() == MapId.ARPQ_ARENA_1) {
type = ExpeditionType.ARIANT; type = ExpeditionType.ARIANT;
} else if (map.getId() == 980010201) { } else if (map.getId() == MapId.ARPQ_ARENA_2) {
type = ExpeditionType.ARIANT1; type = ExpeditionType.ARIANT1;
} else { } else {
type = ExpeditionType.ARIANT2; type = ExpeditionType.ARIANT2;
@@ -265,7 +266,7 @@ public class AriantColiseum {
cancelAriantSchedules(); cancelAriantSchedules();
for (Character chr : map.getAllPlayers()) { for (Character chr : map.getAllPlayers()) {
chr.changeMap(980010010, 0); chr.changeMap(MapId.ARPQ_KINGS_ROOM, 0);
} }
} }
@@ -275,7 +276,7 @@ public class AriantColiseum {
for (Character chr : exped.getActiveMembers()) { for (Character chr : exped.getActiveMembers()) {
chr.setAriantColiseum(null); chr.setAriantColiseum(null);
chr.changeMap(980010000, 0); chr.changeMap(MapId.ARPQ_LOBBY, 0);
} }
map.getWorldServer().registerTimedMapObject(() -> { map.getWorldServer().registerTimedMapObject(() -> {
+2 -1
View File
@@ -24,6 +24,7 @@ package server.partyquest;
import client.Character; import client.Character;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import net.server.world.Party; import net.server.world.Party;
import server.ItemInformationProvider; import server.ItemInformationProvider;
import server.TimerManager; import server.TimerManager;
@@ -85,7 +86,7 @@ public class Pyramid extends PartyQuest {
gaugeSchedule = TimerManager.getInstance().register(() -> { gaugeSchedule = TimerManager.getInstance().register(() -> {
gauge -= decrease; gauge -= decrease;
if (gauge <= 0) { if (gauge <= 0) {
warp(926010001); warp(MapId.NETTS_PYRAMID);
} }
}, 1000); }, 1000);
+13 -12
View File
@@ -34,6 +34,7 @@ import config.YamlConfig;
import constants.game.ExpTable; import constants.game.ExpTable;
import constants.game.GameConstants; import constants.game.GameConstants;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.id.NpcId; import constants.id.NpcId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import constants.skills.Buccaneer; import constants.skills.Buccaneer;
@@ -1079,8 +1080,8 @@ public class PacketCreator {
final OutPacket p; final OutPacket p;
if (town) { if (town) {
p = OutPacket.create(SendOpcode.SPAWN_PORTAL); p = OutPacket.create(SendOpcode.SPAWN_PORTAL);
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(999999999); p.writeInt(MapId.NONE);
} else { } else {
p = OutPacket.create(SendOpcode.REMOVE_DOOR); p = OutPacket.create(SendOpcode.REMOVE_DOOR);
p.writeByte(0); p.writeByte(0);
@@ -3700,14 +3701,14 @@ public class PacketCreator {
p.writeInt(mdo.getPosition().x); p.writeInt(mdo.getPosition().x);
p.writeInt(mdo.getPosition().y); p.writeInt(mdo.getPosition().y);
} else { } else {
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(0); p.writeInt(0);
p.writeInt(0); p.writeInt(0);
} }
} else { } else {
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(0); p.writeInt(0);
p.writeInt(0); p.writeInt(0);
} }
@@ -3811,20 +3812,20 @@ public class PacketCreator {
p.writeInt(mdo.getPosition().x); p.writeInt(mdo.getPosition().x);
p.writeInt(mdo.getPosition().y); p.writeInt(mdo.getPosition().y);
} else { } else {
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(0); p.writeInt(0);
p.writeInt(0); p.writeInt(0);
} }
} else { } else {
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(0); p.writeInt(0);
p.writeInt(0); p.writeInt(0);
} }
} else { } else {
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(999999999); p.writeInt(MapId.NONE);
p.writeInt(0); p.writeInt(0);
p.writeInt(0); p.writeInt(0);
} }
+2 -2
View File
@@ -21,8 +21,8 @@ package tools.packets;
import client.Character; import client.Character;
import config.YamlConfig; import config.YamlConfig;
import constants.game.GameConstants;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import constants.inventory.ItemConstants; import constants.inventory.ItemConstants;
import server.ItemInformationProvider; import server.ItemInformationProvider;
import tools.PacketCreator; import tools.PacketCreator;
@@ -72,7 +72,7 @@ public class Fishing {
return; return;
} }
if (!GameConstants.isFishingArea(chr.getMapId())) { if (!MapId.isFishingArea(chr.getMapId())) {
chr.dropMessage("You are not in a fishing area!"); chr.dropMessage("You are not in a fishing area!");
return; return;
} }
@@ -9,6 +9,7 @@ package tools.packets;
import client.Character; import client.Character;
import client.inventory.Item; import client.inventory.Item;
import constants.id.ItemId; import constants.id.ItemId;
import constants.id.MapId;
import net.opcodes.SendOpcode; import net.opcodes.SendOpcode;
import net.packet.OutPacket; import net.packet.OutPacket;
import net.packet.Packet; import net.packet.Packet;
@@ -139,11 +140,11 @@ public class WeddingPackets extends PacketCreator {
} }
public enum WeddingMap { public enum WeddingMap {
WEDDINGTOWN(680000000), WEDDINGTOWN(MapId.AMORIA),
CHAPEL_STARTMAP(680000110), CHAPEL_STARTMAP(MapId.CHAPEL_WEDDING_ALTAR),
CATHEDRAL_STARTMAP(680000210), CATHEDRAL_STARTMAP(MapId.CATHEDRAL_WEDDING_ALTAR),
PHOTOMAP(680000300), PHOTOMAP(MapId.WEDDING_PHOTO),
EXITMAP(680000500); EXITMAP(MapId.WEDDING_EXIT);
private final int wm; private final int wm;
WeddingMap(int wm) { WeddingMap(int wm) {