Quest Item Restore + Packets w/ Timezone + Item/Exp-dec Field Limits
Fixed leaders being able to create expeditions even though the already passed the day limit. Fixed overflow case in calculated max value of skills. Implemented item expiration from DB after the due date. Refactored item flags using byte-length instead of short. Added FieldLimit checks for disappearing item drops and no EXP deduction in limited areas. Added "Quest Item Restore" functionality. Implemented item flag auto-instantiation when generating items. Added gate state update in Papulatus lobby area. Fixed a recent issue regarding bounding box calculation of AoE player skills. Implemented minidungeon close, to occur as soon as the party leader leaves the area. Refactored HenesysPQ attributed out of the MapleMap object, now they should be available from the respective event script. Fixed friendly mobs not dropping item periodically, a recent issue after tweaking the loot system. Fixed Papulatus expedition closing after the exped leader leaves or a minimum of player required to start is no longer there. Fixed several expeditions closing after performing party operations, such as "change party leader". Reviewed expected max damage calculation for summons, which would not work properly in several occasions. Normalized timezone from packets sent to client, now using the same timezone defined from the server flags. Fixed certain scenarios in CPQ that would happen within the stage between the "challenge accepted" and ingress in the battlefield. Revised credits script. Added GM checks in the autoban method.
This commit is contained in:
@@ -42,15 +42,15 @@ public enum FieldLimit {
|
||||
//CASH_WEATHER_CONSUME_LIMIT(0x4000),
|
||||
//NO_PET(0x8000), // Ariant colosseum-related?
|
||||
//ANTI_MACRO_LIMIT(0x10000), // No notes
|
||||
CANNOTJUMPDOWN(0x20000);
|
||||
CANNOTJUMPDOWN(0x20000),
|
||||
//SUMMON_NPC_LIMIT(0x40000); // Seems to .. disable Rush if 0x2 is set
|
||||
|
||||
//......... EVEN MORE LIMITS ............
|
||||
//SUMMON_NPC_LIMIT(0x40000),
|
||||
//NO_EXP_DECREASE(0x80000),
|
||||
NO_EXP_DECREASE(0x80000),
|
||||
//NO_DAMAGE_ON_FALLING(0x100000),
|
||||
//PARCEL_OPEN_LIMIT(0x200000),
|
||||
//DROP_LIMIT(0x400000),
|
||||
DROP_LIMIT(0x400000);
|
||||
//ROCKETBOOSTER_LIMIT(0x800000) //lol we don't even have mechanics <3
|
||||
|
||||
private long i;
|
||||
|
||||
@@ -159,9 +159,6 @@ public class MapleMap {
|
||||
private MapleCharacter mapOwner = null;
|
||||
private long mapOwnerLastActivityTime = Long.MAX_VALUE;
|
||||
|
||||
// HPQ
|
||||
private int riceCakes = 0;
|
||||
private int bunnyDamage = 0;
|
||||
// events
|
||||
private boolean eventstarted = false, isMuted = false;
|
||||
private MapleSnowball snowball0 = null;
|
||||
@@ -1864,35 +1861,8 @@ public class MapleMap {
|
||||
spawnMonster(mob);
|
||||
}
|
||||
|
||||
public void addBunnyHit() {
|
||||
bunnyDamage++;
|
||||
if (bunnyDamage > 5) {
|
||||
broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny is feeling sick. Please protect it so it can make delicious rice cakes."));
|
||||
bunnyDamage = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void monsterItemDrop(final MapleMonster m, long delay) {
|
||||
final ScheduledFuture<?> monsterItemDrop = TimerManager.getInstance().register(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<MapleMapObject> chrList = MapleMap.this.getPlayers();
|
||||
|
||||
if (m.isAlive() && !chrList.isEmpty()) {
|
||||
MapleCharacter chr = (MapleCharacter) chrList.get(0);
|
||||
|
||||
if (m.getId() == 9300061) {
|
||||
MapleMap.this.riceCakes++;
|
||||
MapleMap.this.broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny made rice cake number " + (MapleMap.this.riceCakes) + "."));
|
||||
}
|
||||
|
||||
dropFromFriendlyMonster(chr, m);
|
||||
}
|
||||
}
|
||||
}, delay, delay);
|
||||
if (!m.isAlive()) {
|
||||
monsterItemDrop.cancel(true);
|
||||
}
|
||||
m.dropFromFriendlyMonster(delay);
|
||||
}
|
||||
|
||||
public void spawnFakeMonsterOnGroundBelow(MapleMonster mob, Point pos) {
|
||||
@@ -2259,6 +2229,11 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public final void spawnItemDrop(final MapleMapObject dropper, final MapleCharacter owner, final Item item, Point pos, final byte dropType, final boolean playerDrop) {
|
||||
if (FieldLimit.DROP_LIMIT.check(this.getFieldLimit())) { // thanks Conrad for noticing some maps shouldn't have loots available
|
||||
this.disappearingItemDrop(dropper, owner, item, pos);
|
||||
return;
|
||||
}
|
||||
|
||||
final Point droppos = calcDropPos(pos, pos);
|
||||
final MapleMapItem mdrop = new MapleMapItem(item, droppos, dropper, owner, owner.getClient(), dropType, playerDrop);
|
||||
mdrop.setDropTime(Server.getInstance().getCurrentTime());
|
||||
@@ -3938,10 +3913,6 @@ public class MapleMap {
|
||||
return fieldLimit;
|
||||
}
|
||||
|
||||
public void resetRiceCakes() {
|
||||
this.riceCakes = 0;
|
||||
}
|
||||
|
||||
public void allowSummonState(boolean b) {
|
||||
MapleMap.this.allowSummons = b;
|
||||
}
|
||||
|
||||
@@ -19,17 +19,14 @@
|
||||
*/
|
||||
package server.maps;
|
||||
|
||||
import constants.ServerConstants;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.MonitoredReentrantReadWriteLock;
|
||||
import scripting.event.EventInstanceManager;
|
||||
import server.TimerManager;
|
||||
|
||||
public class MapleMapManager {
|
||||
|
||||
@@ -38,8 +35,6 @@ public class MapleMapManager {
|
||||
|
||||
private Map<Integer, MapleMap> maps = new HashMap<>();
|
||||
|
||||
private ScheduledFuture<?> updateTask;
|
||||
|
||||
private ReadLock mapsRLock;
|
||||
private WriteLock mapsWLock;
|
||||
|
||||
@@ -51,13 +46,6 @@ public class MapleMapManager {
|
||||
ReentrantReadWriteLock rrwl = new MonitoredReentrantReadWriteLock(MonitoredLockType.MAP_MANAGER);
|
||||
this.mapsRLock = rrwl.readLock();
|
||||
this.mapsWLock = rrwl.writeLock();
|
||||
|
||||
updateTask = TimerManager.getInstance().register(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateMaps();
|
||||
}
|
||||
}, ServerConstants.RESPAWN_INTERVAL);
|
||||
}
|
||||
|
||||
public MapleMap resetMap(int mapid) {
|
||||
@@ -136,7 +124,7 @@ public class MapleMapManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateMaps() {
|
||||
public void updateMaps() {
|
||||
for (MapleMap map : getMaps().values()) {
|
||||
map.respawn();
|
||||
map.mobMpRecovery();
|
||||
@@ -144,11 +132,6 @@ public class MapleMapManager {
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
if (updateTask != null) {
|
||||
updateTask.cancel(false);
|
||||
updateTask = null;
|
||||
}
|
||||
|
||||
for (MapleMap map : getMaps().values()) {
|
||||
map.dispose();
|
||||
}
|
||||
|
||||
@@ -49,19 +49,7 @@ public class MapleMiniDungeon {
|
||||
timeoutTask = TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
lock.lock();
|
||||
try {
|
||||
List<MapleCharacter> lchr = new ArrayList<>(players);
|
||||
|
||||
for(MapleCharacter chr : lchr) {
|
||||
chr.changeMap(baseMap);
|
||||
}
|
||||
|
||||
dispose();
|
||||
timeoutTask = null;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
close();
|
||||
}
|
||||
}, expireTime);
|
||||
|
||||
@@ -95,8 +83,28 @@ public class MapleMiniDungeon {
|
||||
dispose();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
if (chr.isPartyLeader()) { // thanks Conrad for noticing party is not sent out of the MD as soon as leader leaves it
|
||||
close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
lock.lock();
|
||||
try {
|
||||
List<MapleCharacter> lchr = new ArrayList<>(players);
|
||||
|
||||
for(MapleCharacter chr : lchr) {
|
||||
chr.changeMap(baseMap);
|
||||
}
|
||||
|
||||
dispose();
|
||||
timeoutTask = null;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user