Clean up MapleMap
This commit is contained in:
@@ -82,29 +82,30 @@ public class MapleMap {
|
|||||||
private static final List<MapleMapObjectType> rangedMapobjectTypes = Arrays.asList(MapleMapObjectType.SHOP, MapleMapObjectType.ITEM, MapleMapObjectType.NPC, MapleMapObjectType.MONSTER, MapleMapObjectType.DOOR, MapleMapObjectType.SUMMON, MapleMapObjectType.REACTOR);
|
private static final List<MapleMapObjectType> rangedMapobjectTypes = Arrays.asList(MapleMapObjectType.SHOP, MapleMapObjectType.ITEM, MapleMapObjectType.NPC, MapleMapObjectType.MONSTER, MapleMapObjectType.DOOR, MapleMapObjectType.SUMMON, MapleMapObjectType.REACTOR);
|
||||||
private static final Map<Integer, Pair<Integer, Integer>> dropBoundsCache = new HashMap<>(100);
|
private static final Map<Integer, Pair<Integer, Integer>> dropBoundsCache = new HashMap<>(100);
|
||||||
|
|
||||||
private Map<Integer, MapleMapObject> mapobjects = new LinkedHashMap<>();
|
private final Map<Integer, MapleMapObject> mapobjects = new LinkedHashMap<>();
|
||||||
private Set<Integer> selfDestructives = new LinkedHashSet<>();
|
private final Set<Integer> selfDestructives = new LinkedHashSet<>();
|
||||||
private Collection<SpawnPoint> monsterSpawn = Collections.synchronizedList(new LinkedList<>());
|
private final Collection<SpawnPoint> monsterSpawn = Collections.synchronizedList(new LinkedList<>());
|
||||||
private Collection<SpawnPoint> allMonsterSpawn = Collections.synchronizedList(new LinkedList<>());
|
private final Collection<SpawnPoint> allMonsterSpawn = Collections.synchronizedList(new LinkedList<>());
|
||||||
private AtomicInteger spawnedMonstersOnMap = new AtomicInteger(0);
|
private final AtomicInteger spawnedMonstersOnMap = new AtomicInteger(0);
|
||||||
private AtomicInteger droppedItemCount = new AtomicInteger(0);
|
private final AtomicInteger droppedItemCount = new AtomicInteger(0);
|
||||||
private Collection<Character> characters = new LinkedHashSet<>();
|
private final Collection<Character> characters = new LinkedHashSet<>();
|
||||||
private Map<Integer, Set<Integer>> mapParty = new LinkedHashMap<>();
|
private final Map<Integer, Set<Integer>> mapParty = new LinkedHashMap<>();
|
||||||
private Map<Integer, MaplePortal> portals = new HashMap<>();
|
private final Map<Integer, MaplePortal> portals = new HashMap<>();
|
||||||
private Map<Integer, Integer> backgroundTypes = new HashMap<>();
|
private final Map<Integer, Integer> backgroundTypes = new HashMap<>();
|
||||||
private Map<String, Integer> environment = new LinkedHashMap<>();
|
private final Map<String, Integer> environment = new LinkedHashMap<>();
|
||||||
private Map<MapleMapItem, Long> droppedItems = new LinkedHashMap<>();
|
private final Map<MapleMapItem, Long> droppedItems = new LinkedHashMap<>();
|
||||||
private LinkedList<WeakReference<MapleMapObject>> registeredDrops = new LinkedList<>();
|
private final LinkedList<WeakReference<MapleMapObject>> registeredDrops = new LinkedList<>();
|
||||||
private Map<MobLootEntry, Long> mobLootEntries = new HashMap(20);
|
private final Map<MobLootEntry, Long> mobLootEntries = new HashMap(20);
|
||||||
private List<Runnable> statUpdateRunnables = new ArrayList(50);
|
private final List<Runnable> statUpdateRunnables = new ArrayList(50);
|
||||||
private List<Rectangle> areas = new ArrayList<>();
|
private final List<Rectangle> areas = new ArrayList<>();
|
||||||
private FootholdTree footholds = null;
|
private FootholdTree footholds = null;
|
||||||
private Pair<Integer, Integer> xLimits; // caches the min and max x's with available footholds
|
private Pair<Integer, Integer> xLimits; // caches the min and max x's with available footholds
|
||||||
private Rectangle mapArea = new Rectangle();
|
private final Rectangle mapArea = new Rectangle();
|
||||||
private int mapid;
|
private final int mapid;
|
||||||
private AtomicInteger runningOid = new AtomicInteger(1000000001);
|
private final AtomicInteger runningOid = new AtomicInteger(1000000001);
|
||||||
private int returnMapId;
|
private final int returnMapId;
|
||||||
private int channel, world;
|
private final int channel;
|
||||||
|
private final int world;
|
||||||
private int seats;
|
private int seats;
|
||||||
private byte monsterRate;
|
private byte monsterRate;
|
||||||
private boolean clock;
|
private boolean clock;
|
||||||
@@ -156,12 +157,12 @@ public class MapleMap {
|
|||||||
private int timeExpand;
|
private int timeExpand;
|
||||||
|
|
||||||
//locks
|
//locks
|
||||||
private MonitoredReadLock chrRLock;
|
private final MonitoredReadLock chrRLock;
|
||||||
private MonitoredWriteLock chrWLock;
|
private final MonitoredWriteLock chrWLock;
|
||||||
private MonitoredReadLock objectRLock;
|
private final MonitoredReadLock objectRLock;
|
||||||
private MonitoredWriteLock objectWLock;
|
private final MonitoredWriteLock objectWLock;
|
||||||
|
|
||||||
private Lock lootLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.MAP_LOOT, true);
|
private final Lock lootLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.MAP_LOOT, true);
|
||||||
|
|
||||||
// due to the nature of loadMapFromWz (synchronized), sole function that calls 'generateMapDropRangeCache', this lock remains optional.
|
// due to the nature of loadMapFromWz (synchronized), sole function that calls 'generateMapDropRangeCache', this lock remains optional.
|
||||||
private static final Lock bndLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.MAP_BOUNDS, true);
|
private static final Lock bndLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.MAP_BOUNDS, true);
|
||||||
@@ -493,7 +494,7 @@ public class MapleMap {
|
|||||||
try {
|
try {
|
||||||
Pair<Integer, Integer> bounds = dropBoundsCache.get(mapid);
|
Pair<Integer, Integer> bounds = dropBoundsCache.get(mapid);
|
||||||
|
|
||||||
if(bounds != null) {
|
if (bounds != null) {
|
||||||
xLimits = bounds;
|
xLimits = bounds;
|
||||||
} else {
|
} else {
|
||||||
// assuming MINIMAP always have an equal-greater picture representation of the map area (players won't walk beyond the area known by the minimap).
|
// assuming MINIMAP always have an equal-greater picture representation of the map area (players won't walk beyond the area known by the minimap).
|
||||||
@@ -523,13 +524,13 @@ public class MapleMap {
|
|||||||
int dx = distx / 2;
|
int dx = distx / 2;
|
||||||
|
|
||||||
int searchx = homex + dx;
|
int searchx = homex + dx;
|
||||||
if((res = calcPointBelow(new Point(searchx, y))) != null) {
|
if ((res = calcPointBelow(new Point(searchx, y))) != null) {
|
||||||
awayx = searchx;
|
awayx = searchx;
|
||||||
dropPos = res;
|
dropPos = res;
|
||||||
} else {
|
} else {
|
||||||
homex = searchx;
|
homex = searchx;
|
||||||
}
|
}
|
||||||
} while(Math.abs(homex - awayx) > 5);
|
} while (Math.abs(homex - awayx) > 5);
|
||||||
|
|
||||||
return (dropPos != null) ? dropPos : fallback;
|
return (dropPos != null) ? dropPos : fallback;
|
||||||
}
|
}
|
||||||
@@ -537,7 +538,7 @@ public class MapleMap {
|
|||||||
public Point calcDropPos(Point initial, Point fallback) {
|
public Point calcDropPos(Point initial, Point fallback) {
|
||||||
if (initial.x < xLimits.left) {
|
if (initial.x < xLimits.left) {
|
||||||
initial.x = xLimits.left;
|
initial.x = xLimits.left;
|
||||||
} else if(initial.x > xLimits.right) {
|
} else if (initial.x > xLimits.right) {
|
||||||
initial.x = xLimits.right;
|
initial.x = xLimits.right;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,7 +547,7 @@ public class MapleMap {
|
|||||||
ret = bsearchDropPos(initial, fallback);
|
ret = bsearchDropPos(initial, fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!mapArea.contains(ret)) { // found drop pos outside the map :O
|
if (!mapArea.contains(ret)) { // found drop pos outside the map :O
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -591,7 +592,7 @@ public class MapleMap {
|
|||||||
*/
|
*/
|
||||||
public static String getRoundedCoordinate(double angle) {
|
public static String getRoundedCoordinate(double angle) {
|
||||||
String[] directions = {"E", "SE", "S", "SW", "W", "NW", "N", "NE", "E"};
|
String[] directions = {"E", "SE", "S", "SW", "W", "NW", "N", "NE", "E"};
|
||||||
return directions[ (int)Math.round(( (angle % 360) / 45)) ];
|
return directions[(int) Math.round(((angle % 360) / 45))];
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pair<String, Integer> getDoorPositionStatus(Point pos) {
|
public Pair<String, Integer> getDoorPositionStatus(Point pos) {
|
||||||
@@ -600,7 +601,7 @@ public class MapleMap {
|
|||||||
double angle = getAngle(portal.getPosition(), pos);
|
double angle = getAngle(portal.getPosition(), pos);
|
||||||
double distn = pos.distanceSq(portal.getPosition());
|
double distn = pos.distanceSq(portal.getPosition());
|
||||||
|
|
||||||
if(distn <= 777777.7) {
|
if (distn <= 777777.7) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,11 +612,11 @@ public class MapleMap {
|
|||||||
private static void sortDropEntries(List<MonsterDropEntry> from, List<MonsterDropEntry> item, List<MonsterDropEntry> visibleQuest, List<MonsterDropEntry> otherQuest, Character chr) {
|
private static void sortDropEntries(List<MonsterDropEntry> from, List<MonsterDropEntry> item, List<MonsterDropEntry> visibleQuest, List<MonsterDropEntry> otherQuest, Character chr) {
|
||||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||||
|
|
||||||
for(MonsterDropEntry mde : from) {
|
for (MonsterDropEntry mde : from) {
|
||||||
if(!ii.isQuestItem(mde.itemId)) {
|
if (!ii.isQuestItem(mde.itemId)) {
|
||||||
item.add(mde);
|
item.add(mde);
|
||||||
} else {
|
} else {
|
||||||
if(chr.needQuestItem(mde.questid, mde.itemId)) {
|
if (chr.needQuestItem(mde.questid, mde.itemId)) {
|
||||||
visibleQuest.add(mde);
|
visibleQuest.add(mde);
|
||||||
} else {
|
} else {
|
||||||
otherQuest.add(mde);
|
otherQuest.add(mde);
|
||||||
@@ -625,7 +626,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private byte dropItemsFromMonsterOnMap(List<MonsterDropEntry> dropEntry, Point pos, byte d, int chRate, byte droptype, int mobpos, Character chr, Monster mob) {
|
private byte dropItemsFromMonsterOnMap(List<MonsterDropEntry> dropEntry, Point pos, byte d, int chRate, byte droptype, int mobpos, Character chr, Monster mob) {
|
||||||
if(dropEntry.isEmpty()) {
|
if (dropEntry.isEmpty()) {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -757,7 +758,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void dropFromReactor(final Character chr, final MapleReactor reactor, Item drop, Point dropPos, short questid) {
|
public void dropFromReactor(final Character chr, final MapleReactor reactor, Item drop, Point dropPos, short questid) {
|
||||||
spawnDrop(drop, this.calcDropPos(dropPos, reactor.getPosition()), reactor, chr, (byte)(chr.getParty() != null ? 1 : 0), questid);
|
spawnDrop(drop, this.calcDropPos(dropPos, reactor.getPosition()), reactor, chr, (byte) (chr.getParty() != null ? 1 : 0), questid);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopItemMonitor() {
|
private void stopItemMonitor() {
|
||||||
@@ -767,7 +768,7 @@ public class MapleMap {
|
|||||||
expireItemsTask.cancel(false);
|
expireItemsTask.cancel(false);
|
||||||
expireItemsTask = null;
|
expireItemsTask = null;
|
||||||
|
|
||||||
if(YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
|
if (YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
|
||||||
mobSpawnLootTask.cancel(false);
|
mobSpawnLootTask.cancel(false);
|
||||||
mobSpawnLootTask = null;
|
mobSpawnLootTask = null;
|
||||||
}
|
}
|
||||||
@@ -796,8 +797,8 @@ public class MapleMap {
|
|||||||
chrWLock.lock();
|
chrWLock.lock();
|
||||||
try {
|
try {
|
||||||
if (characters.isEmpty()) {
|
if (characters.isEmpty()) {
|
||||||
if(itemMonitorTimeout == 0) {
|
if (itemMonitorTimeout == 0) {
|
||||||
if(itemMonitor != null) {
|
if (itemMonitor != null) {
|
||||||
stopItemMonitor();
|
stopItemMonitor();
|
||||||
aggroMonitor.stopAggroCoordinator();
|
aggroMonitor.stopAggroCoordinator();
|
||||||
}
|
}
|
||||||
@@ -828,7 +829,7 @@ public class MapleMap {
|
|||||||
|
|
||||||
expireItemsTask = TimerManager.getInstance().register(() -> makeDisappearExpiredItemDrops(), YamlConfig.config.server.ITEM_EXPIRE_CHECK, YamlConfig.config.server.ITEM_EXPIRE_CHECK);
|
expireItemsTask = TimerManager.getInstance().register(() -> makeDisappearExpiredItemDrops(), YamlConfig.config.server.ITEM_EXPIRE_CHECK, YamlConfig.config.server.ITEM_EXPIRE_CHECK);
|
||||||
|
|
||||||
if(YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
|
if (YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
|
||||||
lootLock.lock();
|
lootLock.lock();
|
||||||
try {
|
try {
|
||||||
mobLootEntries.clear();
|
mobLootEntries.clear();
|
||||||
@@ -861,7 +862,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void instantiateItemDrop(MapleMapItem mdrop) {
|
private void instantiateItemDrop(MapleMapItem mdrop) {
|
||||||
if(droppedItemCount.get() >= YamlConfig.config.server.ITEM_LIMIT_ON_MAP) {
|
if (droppedItemCount.get() >= YamlConfig.config.server.ITEM_LIMIT_ON_MAP) {
|
||||||
MapleMapObject mapobj;
|
MapleMapObject mapobj;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -912,8 +913,8 @@ public class MapleMap {
|
|||||||
try {
|
try {
|
||||||
long timeNow = Server.getInstance().getCurrentTime();
|
long timeNow = Server.getInstance().getCurrentTime();
|
||||||
|
|
||||||
for(Entry<MapleMapItem, Long> it : droppedItems.entrySet()) {
|
for (Entry<MapleMapItem, Long> it : droppedItems.entrySet()) {
|
||||||
if(it.getValue() < timeNow) {
|
if (it.getValue() < timeNow) {
|
||||||
toDisappear.add(it.getKey());
|
toDisappear.add(it.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -921,13 +922,13 @@ public class MapleMap {
|
|||||||
objectRLock.unlock();
|
objectRLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(MapleMapItem mmi : toDisappear) {
|
for (MapleMapItem mmi : toDisappear) {
|
||||||
makeDisappearItemFromMap(mmi);
|
makeDisappearItemFromMap(mmi);
|
||||||
}
|
}
|
||||||
|
|
||||||
objectWLock.lock();
|
objectWLock.lock();
|
||||||
try {
|
try {
|
||||||
for(MapleMapItem mmi : toDisappear) {
|
for (MapleMapItem mmi : toDisappear) {
|
||||||
droppedItems.remove(mmi);
|
droppedItems.remove(mmi);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -938,13 +939,13 @@ public class MapleMap {
|
|||||||
private void registerMobItemDrops(byte droptype, int mobpos, int chRate, Point pos, List<MonsterDropEntry> dropEntry, List<MonsterDropEntry> visibleQuestEntry, List<MonsterDropEntry> otherQuestEntry, List<MonsterGlobalDropEntry> globalEntry, Character chr, Monster mob) {
|
private void registerMobItemDrops(byte droptype, int mobpos, int chRate, Point pos, List<MonsterDropEntry> dropEntry, List<MonsterDropEntry> visibleQuestEntry, List<MonsterDropEntry> otherQuestEntry, List<MonsterGlobalDropEntry> globalEntry, Character chr, Monster mob) {
|
||||||
MobLootEntry mle = new MobLootEntry(droptype, mobpos, chRate, pos, dropEntry, visibleQuestEntry, otherQuestEntry, globalEntry, chr, mob);
|
MobLootEntry mle = new MobLootEntry(droptype, mobpos, chRate, pos, dropEntry, visibleQuestEntry, otherQuestEntry, globalEntry, chr, mob);
|
||||||
|
|
||||||
if(YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
|
if (YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
|
||||||
int animationTime = mob.getAnimationTime("die1");
|
int animationTime = mob.getAnimationTime("die1");
|
||||||
|
|
||||||
lootLock.lock();
|
lootLock.lock();
|
||||||
try {
|
try {
|
||||||
long timeNow = Server.getInstance().getCurrentTime();
|
long timeNow = Server.getInstance().getCurrentTime();
|
||||||
mobLootEntries.put(mle, timeNow + ((long)(0.42 * animationTime)));
|
mobLootEntries.put(mle, timeNow + ((long) (0.42 * animationTime)));
|
||||||
} finally {
|
} finally {
|
||||||
lootLock.unlock();
|
lootLock.unlock();
|
||||||
}
|
}
|
||||||
@@ -965,20 +966,20 @@ public class MapleMap {
|
|||||||
|
|
||||||
long timeNow = Server.getInstance().getCurrentTime();
|
long timeNow = Server.getInstance().getCurrentTime();
|
||||||
List<MobLootEntry> toRemove = new LinkedList<>();
|
List<MobLootEntry> toRemove = new LinkedList<>();
|
||||||
for(Entry<MobLootEntry, Long> mlee : mleList) {
|
for (Entry<MobLootEntry, Long> mlee : mleList) {
|
||||||
if(mlee.getValue() < timeNow) {
|
if (mlee.getValue() < timeNow) {
|
||||||
toRemove.add(mlee.getKey());
|
toRemove.add(mlee.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!toRemove.isEmpty()) {
|
if (!toRemove.isEmpty()) {
|
||||||
List<MobLootEntry> toSpawnLoot = new LinkedList<>();
|
List<MobLootEntry> toSpawnLoot = new LinkedList<>();
|
||||||
|
|
||||||
lootLock.lock();
|
lootLock.lock();
|
||||||
try {
|
try {
|
||||||
for(MobLootEntry mle : toRemove) {
|
for (MobLootEntry mle : toRemove) {
|
||||||
Long mler = mobLootEntries.remove(mle);
|
Long mler = mobLootEntries.remove(mle);
|
||||||
if(mler != null) {
|
if (mler != null) {
|
||||||
toSpawnLoot.add(mle);
|
toSpawnLoot.add(mle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -986,7 +987,7 @@ public class MapleMap {
|
|||||||
lootLock.unlock();
|
lootLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(MobLootEntry mle : toSpawnLoot) {
|
for (MobLootEntry mle : toSpawnLoot) {
|
||||||
mle.run();
|
mle.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1275,7 +1276,7 @@ public class MapleMap {
|
|||||||
public int countAlivePlayers() {
|
public int countAlivePlayers() {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for(Character mc: getAllPlayers()) {
|
for (Character mc : getAllPlayers()) {
|
||||||
if (mc.isAlive()) {
|
if (mc.isAlive()) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -1287,7 +1288,7 @@ public class MapleMap {
|
|||||||
public int countBosses() {
|
public int countBosses() {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for(Monster mob: getAllMonsters()) {
|
for (Monster mob : getAllMonsters()) {
|
||||||
if (mob.isBoss()) {
|
if (mob.isBoss()) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -1344,7 +1345,7 @@ public class MapleMap {
|
|||||||
private boolean removeKilledMonsterObject(Monster monster) {
|
private boolean removeKilledMonsterObject(Monster monster) {
|
||||||
monster.lockMonster();
|
monster.lockMonster();
|
||||||
try {
|
try {
|
||||||
if(monster.getHp() < 0) {
|
if (monster.getHp() < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1444,8 +1445,8 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (monster.hasBossHPBar()) {
|
if (monster.hasBossHPBar()) {
|
||||||
for(Character mc : this.getAllPlayers()) {
|
for (Character mc : this.getAllPlayers()) {
|
||||||
if(mc.getTargetHpBarHash() == monster.hashCode()) {
|
if (mc.getTargetHpBarHash() == monster.hashCode()) {
|
||||||
mc.resetPlayerAggro();
|
mc.resetPlayerAggro();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1478,7 +1479,7 @@ public class MapleMap {
|
|||||||
public void killMonsterWithDrops(int mobId) {
|
public void killMonsterWithDrops(int mobId) {
|
||||||
Map<Integer, Character> mapChars = this.getMapPlayers();
|
Map<Integer, Character> mapChars = this.getMapPlayers();
|
||||||
|
|
||||||
if(!mapChars.isEmpty()) {
|
if (!mapChars.isEmpty()) {
|
||||||
Character defaultChr = mapChars.entrySet().iterator().next().getValue();
|
Character defaultChr = mapChars.entrySet().iterator().next().getValue();
|
||||||
List<Monster> mobList = getAllMonsters();
|
List<Monster> mobList = getAllMonsters();
|
||||||
|
|
||||||
@@ -1504,7 +1505,7 @@ public class MapleMap {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(removeKilledMonsterObject(monster)) {
|
if (removeKilledMonsterObject(monster)) {
|
||||||
monster.dispatchMonsterKilled(false);
|
monster.dispatchMonsterKilled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1641,10 +1642,10 @@ public class MapleMap {
|
|||||||
objectRLock.lock();
|
objectRLock.lock();
|
||||||
try {
|
try {
|
||||||
for (Object ob : list) {
|
for (Object ob : list) {
|
||||||
if(ob instanceof MapleMapObject) {
|
if (ob instanceof MapleMapObject) {
|
||||||
MapleMapObject mmo = (MapleMapObject) ob;
|
MapleMapObject mmo = (MapleMapObject) ob;
|
||||||
|
|
||||||
if(mapobjects.containsValue(mmo) && mmo.getType() == MapleMapObjectType.REACTOR) {
|
if (mapobjects.containsValue(mmo) && mmo.getType() == MapleMapObjectType.REACTOR) {
|
||||||
listObjects.add(mmo);
|
listObjects.add(mmo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1915,8 +1916,8 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spawnAllMonsterIdFromMapSpawnList(int id, int difficulty, boolean isPq) {
|
public void spawnAllMonsterIdFromMapSpawnList(int id, int difficulty, boolean isPq) {
|
||||||
for(SpawnPoint sp: getAllMonsterSpawn()) {
|
for (SpawnPoint sp : getAllMonsterSpawn()) {
|
||||||
if(sp.getMonsterId() == id && sp.shouldForceSpawn()) {
|
if (sp.getMonsterId() == id && sp.shouldForceSpawn()) {
|
||||||
spawnMonster(sp.getMonster(), difficulty, isPq);
|
spawnMonster(sp.getMonster(), difficulty, isPq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1927,7 +1928,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spawnAllMonstersFromMapSpawnList(int difficulty, boolean isPq) {
|
public void spawnAllMonstersFromMapSpawnList(int difficulty, boolean isPq) {
|
||||||
for(SpawnPoint sp: getAllMonsterSpawn()) {
|
for (SpawnPoint sp : getAllMonsterSpawn()) {
|
||||||
spawnMonster(sp.getMonster(), difficulty, isPq);
|
spawnMonster(sp.getMonster(), difficulty, isPq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2052,7 +2053,7 @@ public class MapleMap {
|
|||||||
|
|
||||||
public MaplePortal getDoorPortal(int doorid) {
|
public MaplePortal getDoorPortal(int doorid) {
|
||||||
MaplePortal doorPortal = portals.get(0x80 + doorid);
|
MaplePortal doorPortal = portals.get(0x80 + doorid);
|
||||||
if(doorPortal == null) {
|
if (doorPortal == null) {
|
||||||
FilePrinter.printError(FilePrinter.EXCEPTION, "[Door] " + mapName + "(" + mapid + ") does not contain door portalid " + doorid);
|
FilePrinter.printError(FilePrinter.EXCEPTION, "[Door] " + mapName + "(" + mapid + ") does not contain door portalid " + doorid);
|
||||||
return portals.get(0x80);
|
return portals.get(0x80);
|
||||||
}
|
}
|
||||||
@@ -2126,7 +2127,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void spawnItemDrop(final MapleMapObject dropper, final Character owner, final Item item, Point pos, final boolean ffaDrop, final boolean playerDrop) {
|
public final void spawnItemDrop(final MapleMapObject dropper, final Character owner, final Item item, Point pos, final boolean ffaDrop, final boolean playerDrop) {
|
||||||
spawnItemDrop(dropper, owner, item, pos, (byte)(ffaDrop ? 2 : 0), playerDrop);
|
spawnItemDrop(dropper, owner, item, pos, (byte) (ffaDrop ? 2 : 0), playerDrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void spawnItemDrop(final MapleMapObject dropper, final Character owner, final Item item, Point pos, final byte dropType, final boolean playerDrop) {
|
public final void spawnItemDrop(final MapleMapObject dropper, final Character owner, final Item item, Point pos, final byte dropType, final boolean playerDrop) {
|
||||||
@@ -2170,7 +2171,7 @@ public class MapleMap {
|
|||||||
// spawns item instances of all defined item ids on a list
|
// spawns item instances of all defined item ids on a list
|
||||||
public final void spawnItemDropList(List<Integer> list, int minCopies, int maxCopies, final MapleMapObject dropper, final Character owner, Point pos, final boolean ffaDrop, final boolean playerDrop) {
|
public final void spawnItemDropList(List<Integer> list, int minCopies, int maxCopies, final MapleMapObject dropper, final Character owner, Point pos, final boolean ffaDrop, final boolean playerDrop) {
|
||||||
int copies = (maxCopies - minCopies) + 1;
|
int copies = (maxCopies - minCopies) + 1;
|
||||||
if(copies < 1) {
|
if (copies < 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2239,16 +2240,16 @@ public class MapleMap {
|
|||||||
objectRLock.unlock();
|
objectRLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(final MapleMapItem drop : list) {
|
for (final MapleMapItem drop : list) {
|
||||||
drop.lockItem();
|
drop.lockItem();
|
||||||
try {
|
try {
|
||||||
if(!drop.isPickedUp()) {
|
if (!drop.isPickedUp()) {
|
||||||
final Item item = drop.getItem();
|
final Item item = drop.getItem();
|
||||||
|
|
||||||
if (item != null && reactItem == item.getItemId() && reactQty == item.getQuantity()) {
|
if (item != null && reactItem == item.getItemId() && reactQty == item.getQuantity()) {
|
||||||
if (reactArea.contains(drop.getPosition())) {
|
if (reactArea.contains(drop.getPosition())) {
|
||||||
Client owner = drop.getOwnerClient();
|
Client owner = drop.getOwnerClient();
|
||||||
if(owner != null) {
|
if (owner != null) {
|
||||||
registerMapSchedule(new ActivateItemReactor(drop, react, owner), 5000);
|
registerMapSchedule(new ActivateItemReactor(drop, react, owner), 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2300,7 +2301,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Set<Integer> partyEntry = mapParty.get(partyid);
|
Set<Integer> partyEntry = mapParty.get(partyid);
|
||||||
if(partyEntry == null) {
|
if (partyEntry == null) {
|
||||||
partyEntry = new LinkedHashSet<>();
|
partyEntry = new LinkedHashSet<>();
|
||||||
partyEntry.add(chr.getId());
|
partyEntry.add(chr.getId());
|
||||||
|
|
||||||
@@ -2316,7 +2317,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Set<Integer> partyEntry = mapParty.get(partyid);
|
Set<Integer> partyEntry = mapParty.get(partyid);
|
||||||
if(partyEntry != null) {
|
if (partyEntry != null) {
|
||||||
if (partyEntry.size() > 1) {
|
if (partyEntry.size() > 1) {
|
||||||
partyEntry.remove(chr.getId());
|
partyEntry.remove(chr.getId());
|
||||||
} else {
|
} else {
|
||||||
@@ -2373,7 +2374,7 @@ public class MapleMap {
|
|||||||
|
|
||||||
MapScriptManager msm = MapScriptManager.getInstance();
|
MapScriptManager msm = MapScriptManager.getInstance();
|
||||||
if (chrSize == 1) {
|
if (chrSize == 1) {
|
||||||
if(!hasItemMonitor()) {
|
if (!hasItemMonitor()) {
|
||||||
startItemMonitor();
|
startItemMonitor();
|
||||||
aggroMonitor.startAggroCoordinator();
|
aggroMonitor.startAggroCoordinator();
|
||||||
}
|
}
|
||||||
@@ -2636,7 +2637,7 @@ public class MapleMap {
|
|||||||
public MaplePortal findMarketPortal() {
|
public MaplePortal findMarketPortal() {
|
||||||
for (MaplePortal portal : portals.values()) {
|
for (MaplePortal portal : portals.values()) {
|
||||||
String ptScript = portal.getScriptName();
|
String ptScript = portal.getScriptName();
|
||||||
if(ptScript != null && ptScript.contains("market")) {
|
if (ptScript != null && ptScript.contains("market")) {
|
||||||
return portal;
|
return portal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2682,8 +2683,8 @@ public class MapleMap {
|
|||||||
|
|
||||||
if (MapleMiniDungeonInfo.isDungeonMap(mapid)) {
|
if (MapleMiniDungeonInfo.isDungeonMap(mapid)) {
|
||||||
MapleMiniDungeon mmd = cserv.getMiniDungeon(mapid);
|
MapleMiniDungeon mmd = cserv.getMiniDungeon(mapid);
|
||||||
if(mmd != null) {
|
if (mmd != null) {
|
||||||
if(!mmd.unregisterPlayer(chr)) {
|
if (!mmd.unregisterPlayer(chr)) {
|
||||||
cserv.removeMiniDungeon(mapid);
|
cserv.removeMiniDungeon(mapid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3086,7 +3087,7 @@ public class MapleMap {
|
|||||||
checkpos.y -= 1;
|
checkpos.y -= 1;
|
||||||
|
|
||||||
List<SpawnPoint> toRemove = new LinkedList<>();
|
List<SpawnPoint> toRemove = new LinkedList<>();
|
||||||
for(SpawnPoint sp: getMonsterSpawn()) {
|
for (SpawnPoint sp : getMonsterSpawn()) {
|
||||||
Point pos = sp.getPosition();
|
Point pos = sp.getPosition();
|
||||||
if (sp.getMonsterId() == mobId && checkpos.equals(pos)) {
|
if (sp.getMonsterId() == mobId && checkpos.equals(pos)) {
|
||||||
toRemove.add(sp);
|
toRemove.add(sp);
|
||||||
@@ -3109,7 +3110,7 @@ public class MapleMap {
|
|||||||
checkpos.y -= 1;
|
checkpos.y -= 1;
|
||||||
|
|
||||||
List<SpawnPoint> toRemove = new LinkedList<>();
|
List<SpawnPoint> toRemove = new LinkedList<>();
|
||||||
for(SpawnPoint sp: getAllMonsterSpawn()) {
|
for (SpawnPoint sp : getAllMonsterSpawn()) {
|
||||||
Point pos = sp.getPosition();
|
Point pos = sp.getPosition();
|
||||||
if (sp.getMonsterId() == mobId && checkpos.equals(pos)) {
|
if (sp.getMonsterId() == mobId && checkpos.equals(pos)) {
|
||||||
toRemove.add(sp);
|
toRemove.add(sp);
|
||||||
@@ -3127,7 +3128,7 @@ public class MapleMap {
|
|||||||
|
|
||||||
public void reportMonsterSpawnPoints(Character chr) {
|
public void reportMonsterSpawnPoints(Character chr) {
|
||||||
chr.dropMessage(6, "Mob spawnpoints on map " + getId() + ", with available Mob SPs " + monsterSpawn.size() + ", used " + spawnedMonstersOnMap.get() + ":");
|
chr.dropMessage(6, "Mob spawnpoints on map " + getId() + ", with available Mob SPs " + monsterSpawn.size() + ", used " + spawnedMonstersOnMap.get() + ":");
|
||||||
for(SpawnPoint sp: getAllMonsterSpawn()) {
|
for (SpawnPoint sp : getAllMonsterSpawn()) {
|
||||||
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());
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3137,7 +3138,7 @@ public class MapleMap {
|
|||||||
try {
|
try {
|
||||||
Map<Integer, Character> mapChars = new HashMap<>(characters.size());
|
Map<Integer, Character> mapChars = new HashMap<>(characters.size());
|
||||||
|
|
||||||
for(Character chr : characters) {
|
for (Character chr : characters) {
|
||||||
mapChars.put(chr.getId(), chr);
|
mapChars.put(chr.getId(), chr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3331,7 +3332,7 @@ public class MapleMap {
|
|||||||
chrRLock.lock();
|
chrRLock.lock();
|
||||||
try {
|
try {
|
||||||
for (Character chr : this.characters) {
|
for (Character chr : this.characters) {
|
||||||
if (chr.getName().toLowerCase().equals(name.toLowerCase())) {
|
if (chr.getName().equalsIgnoreCase(name)) {
|
||||||
return chr;
|
return chr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3342,7 +3343,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean makeDisappearItemFromMap(MapleMapObject mapobj) {
|
public boolean makeDisappearItemFromMap(MapleMapObject mapobj) {
|
||||||
if(mapobj instanceof MapleMapItem) {
|
if (mapobj instanceof MapleMapItem) {
|
||||||
return makeDisappearItemFromMap((MapleMapItem) mapobj);
|
return makeDisappearItemFromMap((MapleMapItem) mapobj);
|
||||||
} else {
|
} else {
|
||||||
return mapobj == null; // no drop to make disappear...
|
return mapobj == null; // no drop to make disappear...
|
||||||
@@ -3369,16 +3370,16 @@ public class MapleMap {
|
|||||||
|
|
||||||
private class MobLootEntry implements Runnable {
|
private class MobLootEntry implements Runnable {
|
||||||
|
|
||||||
private byte droptype;
|
private final byte droptype;
|
||||||
private int mobpos;
|
private final int mobpos;
|
||||||
private int chRate;
|
private final int chRate;
|
||||||
private Point pos;
|
private final Point pos;
|
||||||
private List<MonsterDropEntry> dropEntry;
|
private final List<MonsterDropEntry> dropEntry;
|
||||||
private List<MonsterDropEntry> visibleQuestEntry;
|
private final List<MonsterDropEntry> visibleQuestEntry;
|
||||||
private List<MonsterDropEntry> otherQuestEntry;
|
private final List<MonsterDropEntry> otherQuestEntry;
|
||||||
private List<MonsterGlobalDropEntry> globalEntry;
|
private final List<MonsterGlobalDropEntry> globalEntry;
|
||||||
private Character chr;
|
private final Character chr;
|
||||||
private Monster mob;
|
private final Monster mob;
|
||||||
|
|
||||||
protected MobLootEntry(byte droptype, int mobpos, int chRate, Point pos, List<MonsterDropEntry> dropEntry, List<MonsterDropEntry> visibleQuestEntry, List<MonsterDropEntry> otherQuestEntry, List<MonsterGlobalDropEntry> globalEntry, Character chr, Monster mob) {
|
protected MobLootEntry(byte droptype, int mobpos, int chRate, Point pos, List<MonsterDropEntry> dropEntry, List<MonsterDropEntry> visibleQuestEntry, List<MonsterDropEntry> otherQuestEntry, List<MonsterGlobalDropEntry> globalEntry, Character chr, Monster mob) {
|
||||||
this.droptype = droptype;
|
this.droptype = droptype;
|
||||||
@@ -3411,9 +3412,9 @@ public class MapleMap {
|
|||||||
|
|
||||||
private class ActivateItemReactor implements Runnable {
|
private class ActivateItemReactor implements Runnable {
|
||||||
|
|
||||||
private MapleMapItem mapitem;
|
private final MapleMapItem mapitem;
|
||||||
private MapleReactor reactor;
|
private final MapleReactor reactor;
|
||||||
private Client c;
|
private final Client c;
|
||||||
|
|
||||||
public ActivateItemReactor(MapleMapItem mapitem, MapleReactor reactor, Client c) {
|
public ActivateItemReactor(MapleMapItem mapitem, MapleReactor reactor, Client c) {
|
||||||
this.mapitem = mapitem;
|
this.mapitem = mapitem;
|
||||||
@@ -3425,7 +3426,7 @@ public class MapleMap {
|
|||||||
public void run() {
|
public void run() {
|
||||||
reactor.hitLockReactor();
|
reactor.hitLockReactor();
|
||||||
try {
|
try {
|
||||||
if(reactor.getReactorType() == 100) {
|
if (reactor.getReactorType() == 100) {
|
||||||
if (reactor.getShouldCollect() == true && mapitem != null && mapitem == getMapObject(mapitem.getObjectId())) {
|
if (reactor.getShouldCollect() == true && mapitem != null && mapitem == getMapObject(mapitem.getObjectId())) {
|
||||||
mapitem.lockItem();
|
mapitem.lockItem();
|
||||||
try {
|
try {
|
||||||
@@ -3470,8 +3471,8 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void instanceMapFirstSpawn(int difficulty, boolean isPq) {
|
public void instanceMapFirstSpawn(int difficulty, boolean isPq) {
|
||||||
for(SpawnPoint spawnPoint: getAllMonsterSpawn()) {
|
for (SpawnPoint spawnPoint : getAllMonsterSpawn()) {
|
||||||
if(spawnPoint.getMobTime() == -1) { //just those allowed to be spawned only once
|
if (spawnPoint.getMobTime() == -1) { //just those allowed to be spawned only once
|
||||||
spawnMonster(spawnPoint.getMonster());
|
spawnMonster(spawnPoint.getMonster());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3488,7 +3489,7 @@ public class MapleMap {
|
|||||||
Collections.shuffle(randomSpawn);
|
Collections.shuffle(randomSpawn);
|
||||||
int spawned = 0;
|
int spawned = 0;
|
||||||
for (SpawnPoint spawnPoint : randomSpawn) {
|
for (SpawnPoint spawnPoint : randomSpawn) {
|
||||||
if(spawnPoint.shouldSpawn()) {
|
if (spawnPoint.shouldSpawn()) {
|
||||||
spawnMonster(spawnPoint.getMonster());
|
spawnMonster(spawnPoint.getMonster());
|
||||||
spawned++;
|
spawned++;
|
||||||
if (spawned >= numShouldSpawn) {
|
if (spawned >= numShouldSpawn) {
|
||||||
@@ -3510,7 +3511,7 @@ public class MapleMap {
|
|||||||
Collections.shuffle(randomSpawn);
|
Collections.shuffle(randomSpawn);
|
||||||
int spawned = 0;
|
int spawned = 0;
|
||||||
for (SpawnPoint spawnPoint : randomSpawn) {
|
for (SpawnPoint spawnPoint : randomSpawn) {
|
||||||
if(spawnPoint.shouldForceSpawn()) {
|
if (spawnPoint.shouldForceSpawn()) {
|
||||||
spawnMonster(spawnPoint.getMonster());
|
spawnMonster(spawnPoint.getMonster());
|
||||||
spawned++;
|
spawned++;
|
||||||
if (spawned >= numShouldSpawn) {
|
if (spawned >= numShouldSpawn) {
|
||||||
@@ -3534,16 +3535,16 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setAllowSpawnPointInBox(boolean allow, Rectangle box) {
|
public void setAllowSpawnPointInBox(boolean allow, Rectangle box) {
|
||||||
for(SpawnPoint sp: getMonsterSpawn()) {
|
for (SpawnPoint sp : getMonsterSpawn()) {
|
||||||
if(box.contains(sp.getPosition())) {
|
if (box.contains(sp.getPosition())) {
|
||||||
sp.setDenySpawn(!allow);
|
sp.setDenySpawn(!allow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllowSpawnPointInRange(boolean allow, Point from, double rangeSq) {
|
public void setAllowSpawnPointInRange(boolean allow, Point from, double rangeSq) {
|
||||||
for(SpawnPoint sp: getMonsterSpawn()) {
|
for (SpawnPoint sp : getMonsterSpawn()) {
|
||||||
if(from.distanceSq(sp.getPosition()) <= rangeSq) {
|
if (from.distanceSq(sp.getPosition()) <= rangeSq) {
|
||||||
sp.setDenySpawn(!allow);
|
sp.setDenySpawn(!allow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3576,7 +3577,7 @@ public class MapleMap {
|
|||||||
System.out.println("----------------------------------");
|
System.out.println("----------------------------------");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(YamlConfig.config.server.USE_ENABLE_FULL_RESPAWN) {
|
if (YamlConfig.config.server.USE_ENABLE_FULL_RESPAWN) {
|
||||||
return (monsterSpawn.size() - spawnedMonstersOnMap.get());
|
return (monsterSpawn.size() - spawnedMonstersOnMap.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3594,7 +3595,7 @@ public class MapleMap {
|
|||||||
try {
|
try {
|
||||||
numPlayers = characters.size();
|
numPlayers = characters.size();
|
||||||
|
|
||||||
if(numPlayers == 0) {
|
if (numPlayers == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -3602,16 +3603,16 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int numShouldSpawn = getNumShouldSpawn(numPlayers);
|
int numShouldSpawn = getNumShouldSpawn(numPlayers);
|
||||||
if(numShouldSpawn > 0) {
|
if (numShouldSpawn > 0) {
|
||||||
List<SpawnPoint> randomSpawn = new ArrayList<>(getMonsterSpawn());
|
List<SpawnPoint> randomSpawn = new ArrayList<>(getMonsterSpawn());
|
||||||
Collections.shuffle(randomSpawn);
|
Collections.shuffle(randomSpawn);
|
||||||
short spawned = 0;
|
short spawned = 0;
|
||||||
for(SpawnPoint spawnPoint : randomSpawn) {
|
for (SpawnPoint spawnPoint : randomSpawn) {
|
||||||
if(spawnPoint.shouldSpawn()) {
|
if (spawnPoint.shouldSpawn()) {
|
||||||
spawnMonster(spawnPoint.getMonster());
|
spawnMonster(spawnPoint.getMonster());
|
||||||
spawned++;
|
spawned++;
|
||||||
|
|
||||||
if(spawned >= numShouldSpawn) {
|
if (spawned >= numShouldSpawn) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4029,7 +4030,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHorntailDefeated() { // all parts of dead horntail can be found here?
|
public boolean isHorntailDefeated() { // all parts of dead horntail can be found here?
|
||||||
for(int i = 8810010; i <= 8810017; i++) {
|
for (int i = 8810010; i <= 8810017; i++) {
|
||||||
if (getMonsterById(i) == null) {
|
if (getMonsterById(i) == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -4149,8 +4150,8 @@ public class MapleMap {
|
|||||||
private final List<GuardianSpawnPoint> guardianSpawns = new LinkedList<>();
|
private final List<GuardianSpawnPoint> guardianSpawns = new LinkedList<>();
|
||||||
private final List<MCSkill> blueTeamBuffs = new ArrayList();
|
private final List<MCSkill> blueTeamBuffs = new ArrayList();
|
||||||
private final List<MCSkill> redTeamBuffs = new ArrayList();
|
private final List<MCSkill> redTeamBuffs = new ArrayList();
|
||||||
private List<Integer> skillIds = new ArrayList();
|
private final List<Integer> skillIds = new ArrayList();
|
||||||
private List<Pair<Integer, Integer>> mobsToSpawn = new ArrayList();
|
private final List<Pair<Integer, Integer>> mobsToSpawn = new ArrayList();
|
||||||
|
|
||||||
public List<MCSkill> getBlueTeamBuffs() {
|
public List<MCSkill> getBlueTeamBuffs() {
|
||||||
return blueTeamBuffs;
|
return blueTeamBuffs;
|
||||||
@@ -4314,7 +4315,9 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void buffMonsters(int team, MCSkill skill) {
|
public void buffMonsters(int team, MCSkill skill) {
|
||||||
if (skill == null) return;
|
if (skill == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (team == 0) {
|
if (team == 0) {
|
||||||
redTeamBuffs.add(skill);
|
redTeamBuffs.add(skill);
|
||||||
@@ -4395,7 +4398,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
for(Monster mm : this.getAllMonsters()) {
|
for (Monster mm : this.getAllMonsters()) {
|
||||||
mm.dispose();
|
mm.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4411,22 +4414,22 @@ public class MapleMap {
|
|||||||
aggroMonitor.dispose();
|
aggroMonitor.dispose();
|
||||||
aggroMonitor = null;
|
aggroMonitor = null;
|
||||||
|
|
||||||
if(itemMonitor != null) {
|
if (itemMonitor != null) {
|
||||||
itemMonitor.cancel(false);
|
itemMonitor.cancel(false);
|
||||||
itemMonitor = null;
|
itemMonitor = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(expireItemsTask != null) {
|
if (expireItemsTask != null) {
|
||||||
expireItemsTask.cancel(false);
|
expireItemsTask.cancel(false);
|
||||||
expireItemsTask = null;
|
expireItemsTask = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mobSpawnLootTask != null) {
|
if (mobSpawnLootTask != null) {
|
||||||
mobSpawnLootTask.cancel(false);
|
mobSpawnLootTask.cancel(false);
|
||||||
mobSpawnLootTask = null;
|
mobSpawnLootTask = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(characterStatUpdateTask != null) {
|
if (characterStatUpdateTask != null) {
|
||||||
characterStatUpdateTask.cancel(false);
|
characterStatUpdateTask.cancel(false);
|
||||||
characterStatUpdateTask = null;
|
characterStatUpdateTask = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user