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:
@@ -403,36 +403,29 @@ public class MapleQuestItemFetcher {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean foundMatchingDataOnFile(Scanner scan, String searchStr) {
|
||||
while(scan.hasNext()){
|
||||
String line = scan.nextLine().toLowerCase();
|
||||
if(line.contains(searchStr)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
private static boolean foundMatchingDataOnFile(String fileContent, String searchStr) {
|
||||
return fileContent.contains(searchStr);
|
||||
}
|
||||
|
||||
|
||||
private static void fileSearchMatchingData(File file, List<Pair<Integer, Integer>> itemsWithQuest) {
|
||||
try {
|
||||
Scanner scanner = new Scanner(file);
|
||||
|
||||
String fileContent = FileUtils.readFileToString(file, "UTF-8");
|
||||
|
||||
List<Pair<Integer, Integer>> copyItemsWithQuest = new ArrayList<>(itemsWithQuest);
|
||||
for(Pair<Integer, Integer> iq : copyItemsWithQuest) {
|
||||
scanner.reset();
|
||||
|
||||
if(foundMatchingDataOnFile(scanner, String.valueOf(iq.getLeft()))) {
|
||||
if(foundMatchingDataOnFile(fileContent, String.valueOf(iq.getLeft()))) {
|
||||
itemsWithQuest.remove(iq);
|
||||
}
|
||||
}
|
||||
} catch(FileNotFoundException e) {}
|
||||
} catch(IOException ioe) {
|
||||
System.out.println("Failed to read file: " + file.getAbsolutePath());
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static void printReportFileHeader() {
|
||||
printWriter.println(" # Report File autogenerated from the MapleQuestItemFetcher feature by Ronan Lana.");
|
||||
printWriter.println(" # Generated data takes into account several data info from the underlying DB and the server-side WZ.xmls.");
|
||||
printWriter.println(" # Generated data takes into account several data info from the underlying DB, server source files and the server-side WZ.xmls.");
|
||||
printWriter.println();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user