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

View File

@@ -978,4 +978,23 @@ public class AbstractPlayerInteraction {
return true;
}
}
public static String getFirstJobStatRequirement(int jobType) {
switch(jobType) {
case 1:
return "STR " + 35;
case 2:
return "INT " + 20;
case 3:
case 4:
return "DEX " + 25;
case 5:
return "DEX " + 20;
}
return null;
}
}

View File

@@ -69,7 +69,7 @@ public abstract class AbstractScriptManager {
}
try (FileReader fr = new FileReader(scriptFile)) {
if (ServerConstants.JAVA_8){
engine.eval("load('nashorn:mozilla_compat.js');");
engine.eval("load('nashorn:mozilla_compat.js');" + System.lineSeparator());
}
engine.eval(fr);
} catch (final ScriptException | IOException t) {

View File

@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package scripting.item;
import client.MapleClient;
import constants.ServerConstants;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
@@ -29,7 +30,6 @@ import java.lang.reflect.UndeclaredThrowableException;
import java.util.HashMap;
import java.util.Map;
import javax.script.Compilable;
import javax.script.CompiledScript;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;
@@ -76,8 +76,13 @@ public class ItemScriptManager {
ScriptEngine portal = sef.getScriptEngine();
try {
fr = new FileReader(scriptFile);
CompiledScript compiled = ((Compilable) portal).compile(fr);
compiled.eval();
// java 8 support here thanks to Arufonsu
if (ServerConstants.JAVA_8){
portal.eval("load('nashorn:mozilla_compat.js');" + System.lineSeparator());
}
((Compilable) portal).compile(fr).eval();
final Invocable script = ((Invocable) portal);
scripts.put(scriptName, script);

View File

@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package scripting.map;
import client.MapleClient;
import constants.ServerConstants;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
@@ -29,7 +30,6 @@ import java.lang.reflect.UndeclaredThrowableException;
import java.util.HashMap;
import java.util.Map;
import javax.script.Compilable;
import javax.script.CompiledScript;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;
@@ -80,8 +80,14 @@ public class MapScriptManager {
ScriptEngine portal = sef.getScriptEngine();
try {
fr = new FileReader(scriptFile);
CompiledScript compiled = ((Compilable) portal).compile(fr);
compiled.eval();
// java 8 support here thanks to Arufonsu
if (ServerConstants.JAVA_8){
portal.eval("load('nashorn:mozilla_compat.js');" + System.lineSeparator());
}
((Compilable) portal).compile(fr).eval();
final Invocable script = ((Invocable) portal);
scripts.put(scriptName, script);
script.invokeFunction("start", new MapScriptMethods(c));

View File

@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package scripting.portal;
import client.MapleClient;
import constants.ServerConstants;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
@@ -65,6 +66,12 @@ public class PortalScriptManager {
ScriptEngine portal = sef.getScriptEngine();
try {
fr = new FileReader(scriptFile);
// java 8 support here thanks to Arufonsu
if (ServerConstants.JAVA_8){
portal.eval("load('nashorn:mozilla_compat.js');" + System.lineSeparator());
}
((Compilable) portal).compile(fr).eval();
} catch (ScriptException | IOException | UndeclaredThrowableException e) {
FilePrinter.printError(FilePrinter.PORTAL + scriptName + ".txt", e);