Implemented CWKPQ
Made CWKPQ fully-functional, using the Expedition system (won't work with the lobby system).
This commit is contained in:
@@ -1216,10 +1216,8 @@ public class MapleMap {
|
||||
|
||||
public void spawnAllMonsterIdFromMapSpawnList(int id, int difficulty, boolean isPq) {
|
||||
for(SpawnPoint sp: allMonsterSpawn) {
|
||||
MapleMonster mm = sp.getMonster();
|
||||
|
||||
if(mm.getId() == id) {
|
||||
spawnMonster(mm, difficulty, isPq);
|
||||
if(sp.getMonsterId() == id) {
|
||||
spawnMonster(sp.getMonster(), difficulty, isPq);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1230,8 +1228,7 @@ public class MapleMap {
|
||||
|
||||
public void spawnAllMonstersFromMapSpawnList(int difficulty, boolean isPq) {
|
||||
for(SpawnPoint sp: allMonsterSpawn) {
|
||||
MapleMonster mm = sp.getMonster();
|
||||
spawnMonster(mm, difficulty, isPq);
|
||||
spawnMonster(sp.getMonster(), difficulty, isPq);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2065,6 +2062,13 @@ public class MapleMap {
|
||||
SpawnPoint sp = new SpawnPoint(monster, newpos, !monster.isMobile(), mobTime, mobInterval, team);
|
||||
allMonsterSpawn.add(sp);
|
||||
}
|
||||
|
||||
public void reportMonsterSpawnPoints(MapleCharacter chr) {
|
||||
chr.dropMessage(6, "Mob spawnpoints on map " + getId() + ", with available Mob SPs " + monsterSpawn.size() + ", used " + spawnedMonstersOnMap.get() + ":");
|
||||
for(SpawnPoint sp: allMonsterSpawn) {
|
||||
chr.dropMessage(6, " id: " + sp.getMonsterId() + " canSpawn: " + !sp.getDenySpawn() + " numSpawned: " + sp.getSpawned() + " x: " + sp.getPosition().getX() + " y: " + sp.getPosition().getY() + " time: " + sp.getMobTime() + " team: " + sp.getTeam());
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<MapleCharacter> getCharacters() {
|
||||
chrRLock.lock();
|
||||
@@ -2144,11 +2148,11 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
|
||||
// \/\/\/\/\/\/ CWKPQ things \/\/\/\/\/\/
|
||||
|
||||
public final void toggleEnvironment(final String ms) {
|
||||
if (environment.containsKey(ms)) {
|
||||
moveEnvironment(ms, environment.get(ms) == 1 ? 2 : 1);
|
||||
Map<String, Integer> env = getEnvironment();
|
||||
|
||||
if (env.containsKey(ms)) {
|
||||
moveEnvironment(ms, env.get(ms) == 1 ? 2 : 1);
|
||||
} else {
|
||||
moveEnvironment(ms, 1);
|
||||
}
|
||||
@@ -2156,14 +2160,23 @@ public class MapleMap {
|
||||
|
||||
public final void moveEnvironment(final String ms, final int type) {
|
||||
broadcastMessage(MaplePacketCreator.environmentMove(ms, type));
|
||||
environment.put(ms, type);
|
||||
|
||||
objectWLock.lock();
|
||||
try {
|
||||
environment.put(ms, type);
|
||||
} finally {
|
||||
objectWLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public final Map<String, Integer> getEnvironment() {
|
||||
return environment;
|
||||
objectRLock.lock();
|
||||
try {
|
||||
return Collections.unmodifiableMap(environment);
|
||||
} finally {
|
||||
objectRLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
// /\/\/\/\/\/\/\ CWKPQ things /\/\/\/\/\/\
|
||||
|
||||
public String getMapName() {
|
||||
return mapName;
|
||||
@@ -2352,8 +2365,7 @@ public class MapleMap {
|
||||
public void instanceMapFirstSpawn(int difficulty, boolean isPq) {
|
||||
for(SpawnPoint spawnPoint: allMonsterSpawn) {
|
||||
if(spawnPoint.getMobTime() == -1) { //just those allowed to be spawned only once
|
||||
MapleMonster monst = spawnPoint.getMonster();
|
||||
spawnMonster(monst);
|
||||
spawnMonster(spawnPoint.getMonster());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,32 +67,34 @@ public class MapleMapFactory {
|
||||
}
|
||||
String mapName = getMapName(mapid);
|
||||
MapleData mapData = source.getData(mapName);
|
||||
String link = MapleDataTool.getString(mapData.getChildByPath("info/link"), "");
|
||||
MapleData infoData = mapData.getChildByPath("info");
|
||||
|
||||
String link = MapleDataTool.getString(infoData.getChildByPath("link"), "");
|
||||
if (!link.equals("")) { //nexon made hundreds of dojo maps so to reduce the size they added links.
|
||||
mapName = getMapName(Integer.parseInt(link));
|
||||
mapData = source.getData(mapName);
|
||||
}
|
||||
float monsterRate = 0;
|
||||
MapleData mobRate = mapData.getChildByPath("info/mobRate");
|
||||
MapleData mobRate = infoData.getChildByPath("mobRate");
|
||||
if (mobRate != null) {
|
||||
monsterRate = ((Float) mobRate.getData()).floatValue();
|
||||
}
|
||||
map = new MapleMap(mapid, world, channel, MapleDataTool.getInt("info/returnMap", mapData), monsterRate);
|
||||
map = new MapleMap(mapid, world, channel, MapleDataTool.getInt("returnMap", infoData), monsterRate);
|
||||
map.setEventInstance(event);
|
||||
|
||||
String onFirstEnter = MapleDataTool.getString(mapData.getChildByPath("info/onFirstUserEnter"), String.valueOf(mapid));
|
||||
String onFirstEnter = MapleDataTool.getString(infoData.getChildByPath("onFirstUserEnter"), String.valueOf(mapid));
|
||||
map.setOnFirstUserEnter(onFirstEnter.equals("") ? String.valueOf(mapid) : onFirstEnter);
|
||||
|
||||
String onEnter = MapleDataTool.getString(mapData.getChildByPath("info/onUserEnter"), String.valueOf(mapid));
|
||||
String onEnter = MapleDataTool.getString(infoData.getChildByPath("onUserEnter"), String.valueOf(mapid));
|
||||
map.setOnUserEnter(onEnter.equals("") ? String.valueOf(mapid) : onEnter);
|
||||
|
||||
map.setFieldLimit(MapleDataTool.getInt(mapData.getChildByPath("info/fieldLimit"), 0));
|
||||
map.setMobInterval((short) MapleDataTool.getInt(mapData.getChildByPath("info/createMobInterval"), 5000));
|
||||
map.setFieldLimit(MapleDataTool.getInt(infoData.getChildByPath("fieldLimit"), 0));
|
||||
map.setMobInterval((short) MapleDataTool.getInt(infoData.getChildByPath("createMobInterval"), 5000));
|
||||
PortalFactory portalFactory = new PortalFactory();
|
||||
for (MapleData portal : mapData.getChildByPath("portal")) {
|
||||
map.addPortal(portalFactory.makePortal(MapleDataTool.getInt(portal.getChildByPath("pt")), portal));
|
||||
}
|
||||
MapleData timeMob = mapData.getChildByPath("info/timeMob");
|
||||
MapleData timeMob = infoData.getChildByPath("timeMob");
|
||||
if (timeMob != null) {
|
||||
map.timeMob(MapleDataTool.getInt(timeMob.getChildByPath("id")),
|
||||
MapleDataTool.getString(timeMob.getChildByPath("message")));
|
||||
@@ -198,15 +200,15 @@ public class MapleMapFactory {
|
||||
}
|
||||
|
||||
map.setClock(mapData.getChildByPath("clock") != null);
|
||||
map.setEverlast(mapData.getChildByPath("info/everlast") != null);
|
||||
map.setTown(mapData.getChildByPath("info/town") != null);
|
||||
map.setHPDec(MapleDataTool.getIntConvert("info/decHP", mapData, 0));
|
||||
map.setHPDecProtect(MapleDataTool.getIntConvert("info/protectItem", mapData, 0));
|
||||
map.setForcedReturnMap(MapleDataTool.getInt(mapData.getChildByPath("info/forcedReturn"), 999999999));
|
||||
map.setEverlast(infoData.getChildByPath("everlast") != null);
|
||||
map.setTown(infoData.getChildByPath("town") != null);
|
||||
map.setHPDec(MapleDataTool.getIntConvert("decHP", infoData, 0));
|
||||
map.setHPDecProtect(MapleDataTool.getIntConvert("protectItem", infoData, 0));
|
||||
map.setForcedReturnMap(MapleDataTool.getInt(infoData.getChildByPath("forcedReturn"), 999999999));
|
||||
map.setBoat(mapData.getChildByPath("shipObj") != null);
|
||||
map.setTimeLimit(MapleDataTool.getIntConvert("timeLimit", mapData.getChildByPath("info"), -1));
|
||||
map.setFieldType(MapleDataTool.getIntConvert("info/fieldType", mapData, 0));
|
||||
map.setMobCapacity(MapleDataTool.getIntConvert("fixedMobCapacity", mapData.getChildByPath("info"), 500));//Is there a map that contains more than 500 mobs?
|
||||
map.setTimeLimit(MapleDataTool.getIntConvert("timeLimit", infoData, -1));
|
||||
map.setFieldType(MapleDataTool.getIntConvert("fieldType", infoData, 0));
|
||||
map.setMobCapacity(MapleDataTool.getIntConvert("fixedMobCapacity", infoData, 500));//Is there a map that contains more than 500 mobs?
|
||||
|
||||
HashMap<Integer, Integer> backTypes = new HashMap<>();
|
||||
try {
|
||||
@@ -292,7 +294,7 @@ public class MapleMapFactory {
|
||||
builder.append("MasteriaGL");
|
||||
} else if (mapid >= 677000000 && mapid < 677100000) {
|
||||
builder.append("Episode1GL");
|
||||
} else if (mapid >= 670000000 && mapid < 690000000) {
|
||||
} else if (mapid >= 670000000 && mapid < 682000000) {
|
||||
builder.append("weddingGL");
|
||||
} else if (mapid >= 682000000 && mapid < 683000000) {
|
||||
builder.append("HalloweenGL");
|
||||
|
||||
Reference in New Issue
Block a user