Boss Daily Entry + Maker enable actions + Duey Quick Delivery

Fixed Legendary Spirit UI getting stuck when trying to apply scrolls in equipments without upgrade slots available.
Revised map leasing. Players no longer lose ownership when changing maps. Players are allowed to lease one map each time.
Revised expeditions warping players out as soon as the leader leaves the event or the number of players inside gets to be less than the minimum required to enter.
Fixed start/complete quest commands not acting properly for some quests.
Refactored quest loadouts unnecessarily reloading MapleData.
Implemented support for daily boss limit entry, usable on expeditions.
Revised potential exploit cases within chair, face expression, quest action, summon damage and mob damage mob handlers.
Adjusted displayed date in Duey. Value displayed now should be consistent with the expected expiration time.
Refactored damage for friendly mobs getting handled inside packet structure.
Implemented support for Quick Delivery from Duey.
Fixed Horntail specifically not dropping loots after recent updates.
Refactored commands system. All commands are instanced at boot time instead of at every call.
Fixed usage of Maker skill not sending MAKER_RESULT packet to players. This automatically reenables the actions button (such as create) in Maker UI.
Adjusted minidungeons, now using time limits specified in their respective recipes.
Reviewed the "timeLimit" property utilized by maps, which was poised to work on 2 different concepts altogether.
Fixed Gaga space event, should be functional now.
Added RPS minigame, resources implemented by Arnah.
Fixed damage taken from mob auto-destruction not working properly.
This commit is contained in:
ronancpl
2019-06-27 20:34:39 -03:00
parent a39a210c1f
commit fba27fb3b1
82 changed files with 2902 additions and 2611 deletions
+43 -47
View File
@@ -101,6 +101,7 @@ public class MapleMap {
private static final Map<Integer, Pair<Integer, Integer>> dropBoundsCache = new HashMap<>(100);
private Map<Integer, MapleMapObject> mapobjects = new LinkedHashMap<>();
private Set<Integer> selfDestructives = new LinkedHashSet<>();
private Collection<SpawnPoint> monsterSpawn = Collections.synchronizedList(new LinkedList<SpawnPoint>());
private Collection<SpawnPoint> allMonsterSpawn = Collections.synchronizedList(new LinkedList<SpawnPoint>());
private AtomicInteger spawnedMonstersOnMap = new AtomicInteger(0);
@@ -122,6 +123,7 @@ public class MapleMap {
private AtomicInteger runningOid = new AtomicInteger(1000000001);
private int returnMapId;
private int channel, world;
private int seats;
private byte monsterRate;
private boolean clock;
private boolean boat;
@@ -132,7 +134,8 @@ public class MapleMap {
private MapleMapEffect mapEffect = null;
private boolean everlast = false;
private int forcedReturnMap = 999999999;
private long timeLimit;
private int timeLimit;
private long mapTimer;
private int decHP = 0;
private int protectItem = 0;
private boolean town;
@@ -145,7 +148,6 @@ public class MapleMap {
private int fieldLimit = 0;
private int mobCapacity = -1;
private MapleMonsterAggroCoordinator aggroMonitor = null; // aggroMonitor activity in sync with itemMonitor
private ScheduledFuture<?> mapMonitor = null;
private ScheduledFuture<?> itemMonitor = null;
private ScheduledFuture<?> expireItemsTask = null;
private ScheduledFuture<?> mobSpawnLootTask = null;
@@ -307,7 +309,7 @@ public class MapleMap {
this.forcedReturnMap = map;
}
public long getTimeLimit() {
public int getTimeLimit() {
return timeLimit;
}
@@ -316,7 +318,7 @@ public class MapleMap {
}
public int getTimeLeft() {
return (int) ((timeLimit - System.currentTimeMillis()) / 1000);
return (int) ((mapTimer - System.currentTimeMillis()) / 1000);
}
public void setReactorState() {
@@ -398,6 +400,16 @@ public class MapleMap {
}
}
public void addSelfDestructive(MapleMonster mob) {
if (mob.getStats().selfDestruction() != null) {
this.selfDestructives.add(mob.getObjectId());
}
}
public boolean removeSelfDestructive(int mapobjectid) {
return this.selfDestructives.remove(mapobjectid);
}
private void spawnAndAddRangedMapObject(MapleMapObject mapobject, DelayedPacketCreation packetbakery) {
spawnAndAddRangedMapObject(mapobject, packetbakery, null);
}
@@ -1331,9 +1343,11 @@ public class MapleMap {
}
if (monster.isAlive()) {
boolean killed = monster.damage(chr, damage, false);
if (monster.getStats().selfDestruction() != null && monster.getStats().selfDestruction().getHp() > -1) {// should work ;p
if (monster.getHp() <= monster.getStats().selfDestruction().getHp()) {
killMonster(monster, chr, true, monster.getStats().selfDestruction().getAction());
selfDestruction selfDestr = monster.getStats().selfDestruction();
if (selfDestr != null && selfDestr.getHp() > -1) {// should work ;p
if (monster.getHp() <= selfDestr.getHp()) {
killMonster(monster, chr, true, selfDestr.getAction());
return true;
}
}
@@ -1907,7 +1921,6 @@ public class MapleMap {
spawnAndAddRangedMapObject(monster, new DelayedPacketCreation() {
@Override
public void sendPackets(MapleClient c) {
c.announce(MaplePacketCreator.spawnMonster(monster, false));
}
});
@@ -1919,6 +1932,7 @@ public class MapleMap {
}
spawnedMonstersOnMap.incrementAndGet();
addSelfDestructive(monster);
applyRemoveAfter(monster);
}
@@ -2052,6 +2066,7 @@ public class MapleMap {
}
spawnedMonstersOnMap.incrementAndGet();
addSelfDestructive(monster);
applyRemoveAfter(monster); // thanks LightRyuzaki for pointing issues with spawned CWKPQ mobs not applying this
}
@@ -2088,6 +2103,7 @@ public class MapleMap {
}
spawnedMonstersOnMap.incrementAndGet();
addSelfDestructive(monster);
applyRemoveAfter(monster);
}
@@ -2102,6 +2118,7 @@ public class MapleMap {
});
spawnedMonstersOnMap.incrementAndGet();
addSelfDestructive(monster);
}
public void makeMonsterReal(final MapleMonster monster) {
@@ -3812,6 +3829,14 @@ public class MapleMap {
public boolean getDocked() {
return this.docked;
}
public void setSeats(int seats) {
this.seats = seats;
}
public int getSeats() {
return seats;
}
public void broadcastGMMessage(MapleCharacter source, final byte[] packet, boolean repeatToSource) {
broadcastGMMessage(repeatToSource ? null : source, packet, Double.POSITIVE_INFINITY, source.getPosition());
@@ -3904,35 +3929,7 @@ public class MapleMap {
this.broadcastMessage(MaplePacketCreator.removeItemFromMap(i.getObjectId(), 0, 0));
}
}
public void addMapTimer(int time) {
timeLimit = System.currentTimeMillis() + (time * 1000);
broadcastMessage(MaplePacketCreator.getClock(time));
mapMonitor = TimerManager.getInstance().register(new Runnable() {
@Override
public void run() {
if (timeLimit != 0 && timeLimit < System.currentTimeMillis()) {
warpEveryone(getForcedReturnId());
}
if (getCharacters().isEmpty()) {
resetReactors();
killAllMonsters();
clearDrops();
timeLimit = 0;
if (mapid >= 922240100 && mapid <= 922240119) {
toggleHiddenNPC(9001108);
}
if (mapMonitor != null) {
mapMonitor.cancel(true);
mapMonitor = null;
}
}
}
}, 1000);
}
public void setFieldLimit(int fieldLimit) {
this.fieldLimit = fieldLimit;
}
@@ -4079,7 +4076,7 @@ public class MapleMap {
return this.mapid >= 109010000 && this.mapid < 109050000 || this.mapid > 109050001 && this.mapid <= 109090000;
}
public void timeMob(int id, String msg) {
public void setTimeMob(int id, String msg) {
timeMob = new Pair<>(id, msg);
}
@@ -4206,8 +4203,8 @@ public class MapleMap {
@Override
public void monsterDamaged(MapleCharacter from, int trueDmg) {
ht.applyAndGetHpDamage(trueDmg, true);
ht.broadcastMobHpBar(from);
// thanks Halcyon for noticing HT not dropping loots due to propagated damage not registering attacker
ht.applyFakeDamage(from, trueDmg, true);
}
@Override
@@ -4222,7 +4219,9 @@ public class MapleMap {
public boolean claimOwnership(MapleCharacter chr) {
if (mapOwner == null) {
mapOwner = chr;
this.mapOwner = chr;
chr.setOwnedMap(this);
mapOwnerLastActivityTime = Server.getInstance().getCurrentTime();
getChannelServer().registerOwnedMap(this);
@@ -4234,7 +4233,9 @@ public class MapleMap {
public boolean unclaimOwnership(MapleCharacter chr) {
if (mapOwner == chr) {
mapOwner = null;
this.mapOwner = null;
chr.setOwnedMap(null);
mapOwnerLastActivityTime = Long.MAX_VALUE;
getChannelServer().unregisterOwnedMap(this);
@@ -4533,11 +4534,6 @@ public class MapleMap {
portals.clear();
mapEffect = null;
if(mapMonitor != null) {
mapMonitor.cancel(false);
mapMonitor = null;
}
chrWLock.lock();
try {
aggroMonitor.dispose();
+5 -2
View File
@@ -172,8 +172,7 @@ public class MapleMapFactory {
}
MapleData timeMob = infoData.getChildByPath("timeMob");
if (timeMob != null) {
map.timeMob(MapleDataTool.getInt(timeMob.getChildByPath("id")),
MapleDataTool.getString(timeMob.getChildByPath("message")));
map.setTimeMob(MapleDataTool.getInt(timeMob.getChildByPath("id")), MapleDataTool.getString(timeMob.getChildByPath("message")));
}
int bounds[] = new int[4];
@@ -243,6 +242,10 @@ public class MapleMapFactory {
map.addMapleArea(new Rectangle(x1, y1, (x2 - x1), (y2 - y1)));
}
}
if (mapData.getChildByPath("seat") != null) {
int seats = mapData.getChildByPath("seat").getChildren().size();
map.setSeats(seats);
}
if (event == null) {
try {
Connection con = DatabaseConnection.getConnection();
+2 -2
View File
@@ -42,9 +42,9 @@ public class MapleMiniDungeon {
int baseMap;
long expireTime;
public MapleMiniDungeon(int base, int durationMin) {
public MapleMiniDungeon(int base, long timeLimit) {
baseMap = base;
expireTime = durationMin * 60 * 1000;
expireTime = timeLimit * 1000;
timeoutTask = TimerManager.getInstance().schedule(new Runnable() {
@Override