cleanup: replace anonymous inner class with lambda
This commit is contained in:
@@ -23,13 +23,14 @@
|
||||
package server.events.gm;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import server.TimerManager;
|
||||
import server.maps.MapleMap;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevintjuh93
|
||||
@@ -58,35 +59,32 @@ public class MapleCoconut extends MapleEvent {
|
||||
setCoconutsHittable(true);
|
||||
map.broadcastMessage(MaplePacketCreator.getClock(300));
|
||||
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (map.getId() == 109080000) {
|
||||
if (getMapleScore() == getStoryScore()) {
|
||||
bonusTime();
|
||||
} else if (getMapleScore() > getStoryScore()) {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
if (chr.getTeam() == 0) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/victory"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Victory"));
|
||||
} else {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
TimerManager.getInstance().schedule(() -> {
|
||||
if (map.getId() == 109080000) {
|
||||
if (getMapleScore() == getStoryScore()) {
|
||||
bonusTime();
|
||||
} else if (getMapleScore() > getStoryScore()) {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
if (chr.getTeam() == 0) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/victory"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Victory"));
|
||||
} else {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
warpOut();
|
||||
} else {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
if (chr.getTeam() == 1) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/victory"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Victory"));
|
||||
} else {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
}
|
||||
warpOut();
|
||||
}
|
||||
warpOut();
|
||||
} else {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
if (chr.getTeam() == 1) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/victory"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Victory"));
|
||||
} else {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
}
|
||||
warpOut();
|
||||
}
|
||||
}
|
||||
}, 300000);
|
||||
@@ -94,59 +92,53 @@ public class MapleCoconut extends MapleEvent {
|
||||
|
||||
public void bonusTime() {
|
||||
map.broadcastMessage(MaplePacketCreator.getClock(120));
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (getMapleScore() == getStoryScore()) {
|
||||
TimerManager.getInstance().schedule(() -> {
|
||||
if (getMapleScore() == getStoryScore()) {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
warpOut();
|
||||
} else if (getMapleScore() > getStoryScore()) {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
if (chr.getTeam() == 0) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/victory"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Victory"));
|
||||
} else {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
}
|
||||
warpOut();
|
||||
} else if (getMapleScore() > getStoryScore()) {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
if (chr.getTeam() == 0) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/victory"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Victory"));
|
||||
} else {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
} else {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
if (chr.getTeam() == 1) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/victory"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Victory"));
|
||||
} else {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
warpOut();
|
||||
} else {
|
||||
for (MapleCharacter chr : map.getCharacters()) {
|
||||
if (chr.getTeam() == 1) {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/victory"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Victory"));
|
||||
} else {
|
||||
chr.getClient().announce(MaplePacketCreator.showEffect("event/coconut/lose"));
|
||||
chr.getClient().announce(MaplePacketCreator.playSound("Coconut/Failed"));
|
||||
}
|
||||
}
|
||||
warpOut();
|
||||
}
|
||||
}
|
||||
warpOut();
|
||||
}
|
||||
}, 120000);
|
||||
|
||||
}
|
||||
|
||||
public void warpOut() {
|
||||
setCoconutsHittable(false);
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<MapleCharacter> chars = new ArrayList<>(map.getCharacters());
|
||||
|
||||
for (MapleCharacter chr : chars) {
|
||||
if ((getMapleScore() > getStoryScore() && chr.getTeam() == 0) || (getStoryScore() > getMapleScore() && chr.getTeam() == 1)) {
|
||||
chr.changeMap(109050000);
|
||||
} else {
|
||||
chr.changeMap(109050001);
|
||||
}
|
||||
}
|
||||
map.setCoconut(null);
|
||||
TimerManager.getInstance().schedule(() -> {
|
||||
List<MapleCharacter> chars = new ArrayList<>(map.getCharacters());
|
||||
|
||||
for (MapleCharacter chr : chars) {
|
||||
if ((getMapleScore() > getStoryScore() && chr.getTeam() == 0) || (getStoryScore() > getMapleScore() && chr.getTeam() == 1)) {
|
||||
chr.changeMap(109050000);
|
||||
} else {
|
||||
chr.changeMap(109050001);
|
||||
}
|
||||
}
|
||||
map.setCoconut(null);
|
||||
}, 12000);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,10 +23,11 @@
|
||||
package server.events.gm;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import server.TimerManager;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevintjuh93
|
||||
@@ -40,12 +41,9 @@ public class MapleFitness {
|
||||
|
||||
public MapleFitness(final MapleCharacter chr) {
|
||||
this.chr = chr;
|
||||
this.schedule = TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getMapId() >= 109040000 && chr.getMapId() <= 109040004)
|
||||
chr.changeMap(chr.getMap().getReturnMap());
|
||||
}
|
||||
this.schedule = TimerManager.getInstance().schedule(() -> {
|
||||
if (chr.getMapId() >= 109040000 && chr.getMapId() <= 109040004)
|
||||
chr.changeMap(chr.getMap().getReturnMap());
|
||||
}, 900000);
|
||||
}
|
||||
|
||||
@@ -80,42 +78,39 @@ public class MapleFitness {
|
||||
}
|
||||
|
||||
public void checkAndMessage() {
|
||||
this.schedulemsg = TimerManager.getInstance().register(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getFitness() == null) {
|
||||
resetTimes();
|
||||
}
|
||||
if (chr.getMap().getId() >= 109040000 && chr.getMap().getId() <= 109040004) {
|
||||
if (getTimeLeft() > 9000 && getTimeLeft() < 11000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "You have 10 sec left. Those of you unable to beat the game, we hope you beat it next time! Great job everyone!! See you later~"));
|
||||
} else if (getTimeLeft() > 99000 && getTimeLeft() < 101000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "Alright, you don't have much time remaining. Please hurry up a little!"));
|
||||
} else if (getTimeLeft() > 239000 && getTimeLeft() < 241000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "The 4th stage is the last one for [The Maple Physical Fitness Test]. Please don't give up at the last minute and try your best. The reward is waiting for you at the very top!"));
|
||||
} else if (getTimeLeft() > 299000 && getTimeLeft() < 301000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "The 3rd stage offers traps where you may see them, but you won't be able to step on them. Please be careful of them as you make your way up."));
|
||||
} else if (getTimeLeft() > 359000 && getTimeLeft() < 361000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "For those who have heavy lags, please make sure to move slowly to avoid falling all the way down because of lags."));
|
||||
} else if (getTimeLeft() > 499000 && getTimeLeft() < 501000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "Please remember that if you die during the event, you'll be eliminated from the game. If you're running out of HP, either take a potion or recover HP first before moving on."));
|
||||
} else if (getTimeLeft() > 599000 && getTimeLeft() < 601000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "The most important thing you'll need to know to avoid the bananas thrown by the monkeys is *Timing* Timing is everything in this!"));
|
||||
} else if (getTimeLeft() > 659000 && getTimeLeft() < 661000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "The 2nd stage offers monkeys throwing bananas. Please make sure to avoid them by moving along at just the right timing."));
|
||||
} else if (getTimeLeft() > 699000 && getTimeLeft() < 701000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "Please remember that if you die during the event, you'll be eliminated from the game. You still have plenty of time left, so either take a potion or recover HP first before moving on."));
|
||||
} else if (getTimeLeft() > 779000 && getTimeLeft() < 781000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "Everyone that clears [The Maple Physical Fitness Test] on time will be given an item, regardless of the order of finish, so just relax, take your time, and clear the 4 stages."));
|
||||
} else if (getTimeLeft() > 839000 && getTimeLeft() < 841000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "There may be a heavy lag due to many users at stage 1 all at once. It won't be difficult, so please make sure not to fall down because of heavy lag."));
|
||||
} else if (getTimeLeft() > 869000 && getTimeLeft() < 871000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "[MapleStory Physical Fitness Test] consists of 4 stages, and if you happen to die during the game, you'll be eliminated from the game, so please be careful of that."));
|
||||
}
|
||||
} else {
|
||||
resetTimes();
|
||||
}
|
||||
this.schedulemsg = TimerManager.getInstance().register(() -> {
|
||||
if (chr.getFitness() == null) {
|
||||
resetTimes();
|
||||
}
|
||||
if (chr.getMap().getId() >= 109040000 && chr.getMap().getId() <= 109040004) {
|
||||
if (getTimeLeft() > 9000 && getTimeLeft() < 11000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "You have 10 sec left. Those of you unable to beat the game, we hope you beat it next time! Great job everyone!! See you later~"));
|
||||
} else if (getTimeLeft() > 99000 && getTimeLeft() < 101000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "Alright, you don't have much time remaining. Please hurry up a little!"));
|
||||
} else if (getTimeLeft() > 239000 && getTimeLeft() < 241000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "The 4th stage is the last one for [The Maple Physical Fitness Test]. Please don't give up at the last minute and try your best. The reward is waiting for you at the very top!"));
|
||||
} else if (getTimeLeft() > 299000 && getTimeLeft() < 301000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "The 3rd stage offers traps where you may see them, but you won't be able to step on them. Please be careful of them as you make your way up."));
|
||||
} else if (getTimeLeft() > 359000 && getTimeLeft() < 361000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "For those who have heavy lags, please make sure to move slowly to avoid falling all the way down because of lags."));
|
||||
} else if (getTimeLeft() > 499000 && getTimeLeft() < 501000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "Please remember that if you die during the event, you'll be eliminated from the game. If you're running out of HP, either take a potion or recover HP first before moving on."));
|
||||
} else if (getTimeLeft() > 599000 && getTimeLeft() < 601000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "The most important thing you'll need to know to avoid the bananas thrown by the monkeys is *Timing* Timing is everything in this!"));
|
||||
} else if (getTimeLeft() > 659000 && getTimeLeft() < 661000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "The 2nd stage offers monkeys throwing bananas. Please make sure to avoid them by moving along at just the right timing."));
|
||||
} else if (getTimeLeft() > 699000 && getTimeLeft() < 701000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "Please remember that if you die during the event, you'll be eliminated from the game. You still have plenty of time left, so either take a potion or recover HP first before moving on."));
|
||||
} else if (getTimeLeft() > 779000 && getTimeLeft() < 781000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "Everyone that clears [The Maple Physical Fitness Test] on time will be given an item, regardless of the order of finish, so just relax, take your time, and clear the 4 stages."));
|
||||
} else if (getTimeLeft() > 839000 && getTimeLeft() < 841000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "There may be a heavy lag due to many users at stage 1 all at once. It won't be difficult, so please make sure not to fall down because of heavy lag."));
|
||||
} else if (getTimeLeft() > 869000 && getTimeLeft() < 871000) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(0, "[MapleStory Physical Fitness Test] consists of 4 stages, and if you happen to die during the game, you'll be eliminated from the game, so please be careful of that."));
|
||||
}
|
||||
} else {
|
||||
resetTimes();
|
||||
}
|
||||
}, 5000, 29500);
|
||||
}
|
||||
// 14:30 [Notice][MapleStory Physical Fitness Test] consists of 4 stages, and if you happen to die during the game, you'll be eliminated from the game, so please be careful of that.
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
package server.events.gm;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import server.TimerManager;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevintjuh93
|
||||
@@ -38,13 +39,10 @@ public class MapleOla {
|
||||
|
||||
public MapleOla(final MapleCharacter chr) {
|
||||
this.chr = chr;
|
||||
this.schedule = TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getMapId() >= 109030001 && chr.getMapId() <= 109030303)
|
||||
chr.changeMap(chr.getMap().getReturnMap());
|
||||
resetTimes();
|
||||
}
|
||||
this.schedule = TimerManager.getInstance().schedule(() -> {
|
||||
if (chr.getMapId() >= 109030001 && chr.getMapId() <= 109030303)
|
||||
chr.changeMap(chr.getMap().getReturnMap());
|
||||
resetTimes();
|
||||
}, 360000);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,16 +22,17 @@
|
||||
package server.events.gm;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import tools.Randomizer;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
import server.TimerManager;
|
||||
import server.maps.MapleMap;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Randomizer;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -69,39 +70,36 @@ public final class MapleOxQuiz {
|
||||
}
|
||||
final int number = gm;
|
||||
map.broadcastMessage(MaplePacketCreator.showOXQuiz(round, question, true));
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
map.broadcastMessage(MaplePacketCreator.showOXQuiz(round, question, true));
|
||||
List<MapleCharacter> chars = new ArrayList<>(map.getCharacters());
|
||||
|
||||
for (MapleCharacter chr : chars) {
|
||||
if (chr != null) // make sure they aren't null... maybe something can happen in 12 seconds.
|
||||
{
|
||||
if (!isCorrectAnswer(chr, getOXAnswer(round, question)) && !chr.isGM()) {
|
||||
chr.changeMap(chr.getMap().getReturnMap());
|
||||
} else {
|
||||
chr.gainExp(expGain, true, true);
|
||||
}
|
||||
TimerManager.getInstance().schedule(() -> {
|
||||
map.broadcastMessage(MaplePacketCreator.showOXQuiz(round, question, true));
|
||||
List<MapleCharacter> chars = new ArrayList<>(map.getCharacters());
|
||||
|
||||
for (MapleCharacter chr : chars) {
|
||||
if (chr != null) // make sure they aren't null... maybe something can happen in 12 seconds.
|
||||
{
|
||||
if (!isCorrectAnswer(chr, getOXAnswer(round, question)) && !chr.isGM()) {
|
||||
chr.changeMap(chr.getMap().getReturnMap());
|
||||
} else {
|
||||
chr.gainExp(expGain, true, true);
|
||||
}
|
||||
}
|
||||
//do question
|
||||
if ((round == 1 && question == 29) || ((round == 2 || round == 3) && question == 17) || ((round == 4 || round == 8) && question == 12) || (round == 5 && question == 26) || (round == 9 && question == 44) || ((round == 6 || round == 7) && question == 16)) {
|
||||
question = 100;
|
||||
} else {
|
||||
question++;
|
||||
}
|
||||
//send question
|
||||
if (map.getCharacters().size() - number <= 2) {
|
||||
map.broadcastMessage(MaplePacketCreator.serverNotice(6, "The event has ended"));
|
||||
map.getPortal("join00").setPortalStatus(true);
|
||||
map.setOx(null);
|
||||
map.setOxQuiz(false);
|
||||
//prizes here
|
||||
return;
|
||||
}
|
||||
sendQuestion();
|
||||
}
|
||||
//do question
|
||||
if ((round == 1 && question == 29) || ((round == 2 || round == 3) && question == 17) || ((round == 4 || round == 8) && question == 12) || (round == 5 && question == 26) || (round == 9 && question == 44) || ((round == 6 || round == 7) && question == 16)) {
|
||||
question = 100;
|
||||
} else {
|
||||
question++;
|
||||
}
|
||||
//send question
|
||||
if (map.getCharacters().size() - number <= 2) {
|
||||
map.broadcastMessage(MaplePacketCreator.serverNotice(6, "The event has ended"));
|
||||
map.getPortal("join00").setPortalStatus(true);
|
||||
map.setOx(null);
|
||||
map.setOxQuiz(false);
|
||||
//prizes here
|
||||
return;
|
||||
}
|
||||
sendQuestion();
|
||||
}, 30000); // Time to answer = 30 seconds ( Ox Quiz packet shows a 30 second timer.
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package server.events.gm;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import server.TimerManager;
|
||||
import server.maps.MapleMap;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevintjuh93
|
||||
@@ -62,24 +63,21 @@ public class MapleSnowball {
|
||||
}
|
||||
}
|
||||
hittable = true;
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (map.getSnowball(team).getPosition() > map.getSnowball(team == 0 ? 1 : 0).getPosition()) {
|
||||
for (MapleCharacter chr : characters) {
|
||||
if (chr != null)
|
||||
chr.announce(MaplePacketCreator.rollSnowBall(false, 3, map.getSnowball(0), map.getSnowball(0)));
|
||||
}
|
||||
winner = true;
|
||||
} else if (map.getSnowball(team == 0 ? 1 : 0).getPosition() > map.getSnowball(team).getPosition()) {
|
||||
for (MapleCharacter chr : characters) {
|
||||
if (chr != null)
|
||||
chr.announce(MaplePacketCreator.rollSnowBall(false, 4, map.getSnowball(0), map.getSnowball(0)));
|
||||
}
|
||||
winner = true;
|
||||
} //Else
|
||||
warpOut();
|
||||
}
|
||||
TimerManager.getInstance().schedule(() -> {
|
||||
if (map.getSnowball(team).getPosition() > map.getSnowball(team == 0 ? 1 : 0).getPosition()) {
|
||||
for (MapleCharacter chr : characters) {
|
||||
if (chr != null)
|
||||
chr.announce(MaplePacketCreator.rollSnowBall(false, 3, map.getSnowball(0), map.getSnowball(0)));
|
||||
}
|
||||
winner = true;
|
||||
} else if (map.getSnowball(team == 0 ? 1 : 0).getPosition() > map.getSnowball(team).getPosition()) {
|
||||
for (MapleCharacter chr : characters) {
|
||||
if (chr != null)
|
||||
chr.announce(MaplePacketCreator.rollSnowBall(false, 4, map.getSnowball(0), map.getSnowball(0)));
|
||||
}
|
||||
winner = true;
|
||||
} //Else
|
||||
warpOut();
|
||||
}, 600000);
|
||||
|
||||
}
|
||||
@@ -112,13 +110,9 @@ public class MapleSnowball {
|
||||
if (this.snowmanhp - damage < 0) {
|
||||
this.snowmanhp = 0;
|
||||
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
setSnowmanHP(7500);
|
||||
message(5);
|
||||
}
|
||||
TimerManager.getInstance().schedule(() -> {
|
||||
setSnowmanHP(7500);
|
||||
message(5);
|
||||
}, 10000);
|
||||
} else
|
||||
this.snowmanhp -= damage;
|
||||
@@ -149,17 +143,13 @@ public class MapleSnowball {
|
||||
}
|
||||
|
||||
public void warpOut() {
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
TimerManager.getInstance().schedule(() -> {
|
||||
if (winner == true)
|
||||
map.warpOutByTeam(team, 109050000);
|
||||
else
|
||||
map.warpOutByTeam(team, 109050001);
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (winner == true)
|
||||
map.warpOutByTeam(team, 109050000);
|
||||
else
|
||||
map.warpOutByTeam(team, 109050001);
|
||||
|
||||
map.setSnowball(team, null);
|
||||
}
|
||||
map.setSnowball(team, null);
|
||||
}, 10000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user