EXP system & Mob buffs/diseases optimization

Solved a problem within EXP distribution system that would hand out less overall EXP than the expected when the amount to be earned is low.
Optimized mob buffs and diseases, now using a dedicated thread to process all status expirations on a batch.
Refactored MonitoredLockTypes names to something more easily identificable.
Added a delay on mob effect applications, to be registered in after the cast animation time.
Fixed Flame Thrower acting passively when a attacking skill is used by the player.
This commit is contained in:
ronancpl
2018-06-30 22:48:02 -03:00
parent dac5c43635
commit 94425ba616
57 changed files with 926 additions and 608 deletions
+29 -26
View File
@@ -59,7 +59,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
import java.lang.ref.WeakReference;
import java.util.Comparator;
import net.server.Server;
import net.server.channel.Channel;
import scripting.map.MapScriptManager;
@@ -255,15 +254,43 @@ public class MapleMap {
public int getId() {
return mapid;
}
public Channel getChannelServer() {
return Server.getInstance().getWorld(world).getChannel(channel);
}
public MapleMap getReturnMap() {
if(returnMapId == 999999999) return this;
return Server.getInstance().getWorld(world).getChannel(channel).getMapFactory().getMap(returnMapId);
return getChannelServer().getMapFactory().getMap(returnMapId);
}
public int getReturnMapId() {
return returnMapId;
}
public MapleMap getForcedReturnMap() {
return getChannelServer().getMapFactory().getMap(forcedReturnMap);
}
public int getForcedReturnId() {
return forcedReturnMap;
}
public void setForcedReturnMap(int map) {
this.forcedReturnMap = map;
}
public long getTimeLimit() {
return timeLimit;
}
public void setTimeLimit(int timeLimit) {
this.timeLimit = timeLimit;
}
public int getTimeLeft() {
return (int) ((timeLimit - System.currentTimeMillis()) / 1000);
}
public void setReactorState() {
chrRLock.lock();
@@ -322,30 +349,6 @@ public class MapleMap {
return true;
}
public int getForcedReturnId() {
return forcedReturnMap;
}
public MapleMap getForcedReturnMap() {
return Server.getInstance().getWorld(world).getChannel(channel).getMapFactory().getMap(forcedReturnMap);
}
public void setForcedReturnMap(int map) {
this.forcedReturnMap = map;
}
public long getTimeLimit() {
return timeLimit;
}
public void setTimeLimit(int timeLimit) {
this.timeLimit = timeLimit;
}
public int getTimeLeft() {
return (int) ((timeLimit - System.currentTimeMillis()) / 1000);
}
public int getCurrentPartyId() {
for (MapleCharacter chr : this.getCharacters()) {
if (chr.getPartyId() != -1) {
+1 -1
View File
@@ -55,7 +55,7 @@ public class MapleReactor extends AbstractMapleMapObject {
private boolean attackHit;
private ScheduledFuture<?> timeoutTask = null;
private Lock reactorLock = new MonitoredReentrantLock(MonitoredLockType.REACTOR, true);
private Lock hitLock = new MonitoredReentrantLock(MonitoredLockType.REACTOR, true);
private Lock hitLock = new MonitoredReentrantLock(MonitoredLockType.REACTOR_HIT, true);
public MapleReactor(MapleReactorStats stats, int rid) {
this.evstate = (byte)0;