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:
@@ -273,10 +273,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
private ScheduledFuture<?> extraRecoveryTask = null;
|
||||
private ScheduledFuture<?> chairRecoveryTask = null;
|
||||
private ScheduledFuture<?> pendantOfSpirit = null; //1122017
|
||||
private Lock chrLock = new MonitoredReentrantLock(MonitoredLockType.CHR, true);
|
||||
private Lock effLock = new MonitoredReentrantLock(MonitoredLockType.EFF, true);
|
||||
private Lock petLock = new MonitoredReentrantLock(MonitoredLockType.PET, true); // for quest tasks as well
|
||||
private Lock prtLock = new MonitoredReentrantLock(MonitoredLockType.PRT);
|
||||
private Lock chrLock = new MonitoredReentrantLock(MonitoredLockType.CHARACTER_CHR, true);
|
||||
private Lock effLock = new MonitoredReentrantLock(MonitoredLockType.CHARACTER_EFF, true);
|
||||
private Lock petLock = new MonitoredReentrantLock(MonitoredLockType.CHARACTER_PET, true); // for quest tasks as well
|
||||
private Lock prtLock = new MonitoredReentrantLock(MonitoredLockType.CHARACTER_PRT);
|
||||
private Map<Integer, Set<Integer>> excluded = new LinkedHashMap<>();
|
||||
private Set<Integer> excludedItems = new LinkedHashSet<>();
|
||||
private static String[] ariantroomleader = new String[3];
|
||||
|
||||
@@ -107,8 +107,8 @@ public class MapleClient {
|
||||
private byte gender = -1;
|
||||
private boolean disconnecting = false;
|
||||
private final Lock lock = new MonitoredReentrantLock(MonitoredLockType.CLIENT, true);
|
||||
private final Lock encoderLock = new MonitoredReentrantLock(MonitoredLockType.CLIENT, true);
|
||||
private static final Lock loginLock = new MonitoredReentrantLock(MonitoredLockType.CLIENT, true);
|
||||
private final Lock encoderLock = new MonitoredReentrantLock(MonitoredLockType.CLIENT_ENCODER, true);
|
||||
private static final Lock loginLock = new MonitoredReentrantLock(MonitoredLockType.CLIENT_LOGIN, true);
|
||||
private int votePoints;
|
||||
private int voteTime = -1;
|
||||
private long lastNpcClick;
|
||||
|
||||
@@ -23,7 +23,6 @@ package client.status;
|
||||
|
||||
import client.Skill;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import server.life.MobSkill;
|
||||
import tools.ArrayMap;
|
||||
|
||||
@@ -33,9 +32,7 @@ public class MonsterStatusEffect {
|
||||
private Skill skill;
|
||||
private MobSkill mobskill;
|
||||
private boolean monsterSkill;
|
||||
private ScheduledFuture<?> cancelTask;
|
||||
private ScheduledFuture<?> damageSchedule;
|
||||
|
||||
|
||||
public MonsterStatusEffect(Map<MonsterStatus, Integer> stati, Skill skillId, MobSkill mobskill, boolean monsterSkill) {
|
||||
this.stati = new ArrayMap<>(stati);
|
||||
this.skill = skillId;
|
||||
@@ -59,35 +56,10 @@ public class MonsterStatusEffect {
|
||||
return monsterSkill;
|
||||
}
|
||||
|
||||
public final void cancelTask() {
|
||||
if (cancelTask != null) {
|
||||
cancelTask.cancel(false);
|
||||
}
|
||||
cancelTask = null;
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> getCancelTask() {
|
||||
return cancelTask;
|
||||
}
|
||||
|
||||
public void setCancelTask(ScheduledFuture<?> cancelTask) {
|
||||
this.cancelTask = cancelTask;
|
||||
}
|
||||
|
||||
public void removeActiveStatus(MonsterStatus stat) {
|
||||
stati.remove(stat);
|
||||
}
|
||||
|
||||
public void setDamageSchedule(ScheduledFuture<?> damageSchedule) {
|
||||
this.damageSchedule = damageSchedule;
|
||||
}
|
||||
|
||||
public void cancelDamageSchedule() {
|
||||
if (damageSchedule != null) {
|
||||
damageSchedule.cancel(false);
|
||||
}
|
||||
}
|
||||
|
||||
public MobSkill getMobSkill() {
|
||||
return mobskill;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user