cleanup: replace anonymous inner class with lambda
This commit is contained in:
@@ -21,11 +21,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package scripting.npc;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import client.*;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ItemFactory;
|
||||
import client.inventory.MaplePet;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import constants.inventory.ItemConstants;
|
||||
import constants.string.LanguageConstants;
|
||||
import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
import net.server.coordinator.matchchecker.MatchCheckerListenerFactory.MatchCheckerType;
|
||||
import net.server.guild.MapleAlliance;
|
||||
import net.server.guild.MapleGuild;
|
||||
import net.server.world.MapleParty;
|
||||
@@ -33,57 +39,33 @@ import net.server.world.MaplePartyCharacter;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import scripting.AbstractPlayerInteraction;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.MapleStatEffect;
|
||||
import server.MapleShop;
|
||||
import server.MapleShopFactory;
|
||||
import server.*;
|
||||
import server.MapleSkillbookInformationProvider.SkillBookEntry;
|
||||
import server.events.gm.MapleEvent;
|
||||
import server.expeditions.MapleExpedition;
|
||||
import server.expeditions.MapleExpeditionType;
|
||||
import server.gachapon.MapleGachapon;
|
||||
import server.gachapon.MapleGachapon.MapleGachaponItem;
|
||||
import server.life.MapleLifeFactory;
|
||||
import server.life.MaplePlayerNPC;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleMapManager;
|
||||
import server.partyquest.Pyramid;
|
||||
import server.partyquest.Pyramid.PyramidMode;
|
||||
import tools.LogHelper;
|
||||
import tools.MaplePacketCreator;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.MapleJob;
|
||||
import client.MapleSkinColor;
|
||||
import client.MapleStat;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ItemFactory;
|
||||
import client.inventory.MaplePet;
|
||||
import constants.game.GameConstants;
|
||||
import constants.inventory.ItemConstants;
|
||||
import constants.string.LanguageConstants;
|
||||
import net.server.channel.Channel;
|
||||
import net.server.coordinator.matchchecker.MatchCheckerListenerFactory.MatchCheckerType;
|
||||
import server.MapleMarriage;
|
||||
import server.MapleSkillbookInformationProvider;
|
||||
import server.MapleSkillbookInformationProvider.SkillBookEntry;
|
||||
import server.TimerManager;
|
||||
import server.life.MapleLifeFactory;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
import server.expeditions.MapleExpedition;
|
||||
import server.expeditions.MapleExpeditionType;
|
||||
import server.partyquest.AriantColiseum;
|
||||
import server.partyquest.MonsterCarnival;
|
||||
import server.partyquest.Pyramid;
|
||||
import server.partyquest.Pyramid.PyramidMode;
|
||||
import tools.FilePrinter;
|
||||
import tools.LogHelper;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.packets.Wedding;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import tools.FilePrinter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -697,19 +679,9 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
mc.changeMap(map, map.getPortal(0));
|
||||
mc.announce(MaplePacketCreator.serverNotice(6, LanguageConstants.getMessage(mc, LanguageConstants.CPQEntryLobby)));
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
tMan.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mapClock(3 * 60);
|
||||
}
|
||||
}, 1500);
|
||||
tMan.schedule(() -> mapClock(3 * 60), 1500);
|
||||
|
||||
mc.setCpqTimer(TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mc.changeMap(mapExit, mapExit.getPortal(0));
|
||||
}
|
||||
}, 3 * 60 * 1000));
|
||||
mc.setCpqTimer(TimerManager.getInstance().schedule(() -> mc.changeMap(mapExit, mapExit.getPortal(0)), 3 * 60 * 1000));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
@@ -794,57 +766,44 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
if (mc != null) {
|
||||
mc.changeMap(lobbyMap, lobbyMap.getPortal(0));
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
tMan.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mapClock(10);
|
||||
}
|
||||
}, 1500);
|
||||
tMan.schedule(() -> mapClock(10), 1500);
|
||||
}
|
||||
}
|
||||
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
tMan.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mapClock(10);
|
||||
}
|
||||
}, 1500);
|
||||
tMan.schedule(() -> mapClock(10), 1500);
|
||||
}
|
||||
}
|
||||
}
|
||||
final int mapid = c.getPlayer().getMapId() + 1;
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
tMan.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
mc.setMonsterCarnival(null);
|
||||
}
|
||||
tMan.schedule(() -> {
|
||||
try {
|
||||
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
mc.setMonsterCarnival(null);
|
||||
}
|
||||
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
mc.setMonsterCarnival(null);
|
||||
}
|
||||
}
|
||||
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
mc.setMonsterCarnival(null);
|
||||
}
|
||||
} catch (NullPointerException npe) {
|
||||
warpoutCPQLobby(lobbyMap);
|
||||
return;
|
||||
}
|
||||
|
||||
MapleParty lobbyParty = getPlayer().getParty(), challengerParty = challenger.getParty();
|
||||
int status = canStartCPQ(lobbyMap, lobbyParty, challengerParty);
|
||||
if (status == 0) {
|
||||
new MonsterCarnival(lobbyParty, challengerParty, mapid, true, (field / 100) % 10);
|
||||
} else {
|
||||
warpoutCPQLobby(lobbyMap);
|
||||
}
|
||||
} catch (NullPointerException npe) {
|
||||
warpoutCPQLobby(lobbyMap);
|
||||
return;
|
||||
}
|
||||
|
||||
MapleParty lobbyParty = getPlayer().getParty(), challengerParty = challenger.getParty();
|
||||
int status = canStartCPQ(lobbyMap, lobbyParty, challengerParty);
|
||||
if (status == 0) {
|
||||
new MonsterCarnival(lobbyParty, challengerParty, mapid, true, (field / 100) % 10);
|
||||
} else {
|
||||
warpoutCPQLobby(lobbyMap);
|
||||
}
|
||||
}, 11000);
|
||||
} catch (Exception e) {
|
||||
@@ -872,34 +831,31 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
}
|
||||
final int mapid = c.getPlayer().getMapId() + 100;
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
tMan.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
mc.setMonsterCarnival(null);
|
||||
}
|
||||
tMan.schedule(() -> {
|
||||
try {
|
||||
for (MaplePartyCharacter mpc : getPlayer().getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
mc.setMonsterCarnival(null);
|
||||
}
|
||||
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
mc.setMonsterCarnival(null);
|
||||
}
|
||||
}
|
||||
for (MaplePartyCharacter mpc : challenger.getParty().getMembers()) {
|
||||
MapleCharacter mc = mpc.getPlayer();
|
||||
if (mc != null) {
|
||||
mc.setMonsterCarnival(null);
|
||||
}
|
||||
} catch (NullPointerException npe) {
|
||||
warpoutCPQLobby(lobbyMap);
|
||||
return;
|
||||
}
|
||||
|
||||
MapleParty lobbyParty = getPlayer().getParty(), challengerParty = challenger.getParty();
|
||||
int status = canStartCPQ(lobbyMap, lobbyParty, challengerParty);
|
||||
if (status == 0) {
|
||||
new MonsterCarnival(lobbyParty, challengerParty, mapid, false, (field / 1000) % 10);
|
||||
} else {
|
||||
warpoutCPQLobby(lobbyMap);
|
||||
}
|
||||
} catch (NullPointerException npe) {
|
||||
warpoutCPQLobby(lobbyMap);
|
||||
return;
|
||||
}
|
||||
|
||||
MapleParty lobbyParty = getPlayer().getParty(), challengerParty = challenger.getParty();
|
||||
int status = canStartCPQ(lobbyMap, lobbyParty, challengerParty);
|
||||
if (status == 0) {
|
||||
new MonsterCarnival(lobbyParty, challengerParty, mapid, false, (field / 1000) % 10);
|
||||
} else {
|
||||
warpoutCPQLobby(lobbyMap);
|
||||
}
|
||||
}, 10000);
|
||||
} catch (Exception e) {
|
||||
@@ -972,19 +928,9 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
mc.changeMap(map, map.getPortal(0));
|
||||
mc.announce(MaplePacketCreator.serverNotice(6, LanguageConstants.getMessage(mc, LanguageConstants.CPQEntryLobby)));
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
tMan.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mapClock(3 * 60);
|
||||
}
|
||||
}, 1500);
|
||||
tMan.schedule(() -> mapClock(3 * 60), 1500);
|
||||
|
||||
mc.setCpqTimer(TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mc.changeMap(mapExit, mapExit.getPortal(0));
|
||||
}
|
||||
}, 3 * 60 * 1000));
|
||||
mc.setCpqTimer(TimerManager.getInstance().schedule(() -> mc.changeMap(mapExit, mapExit.getPortal(0)), 3 * 60 * 1000));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
Reference in New Issue
Block a user