Henesys PQ
Implemented Henesys PQ.
This commit is contained in:
@@ -5054,6 +5054,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
}
|
||||
|
||||
public void startFullnessSchedule(final int decrease, final MaplePet pet, int petSlot) {
|
||||
if(isGM() && ServerConstants.GM_PETS_NEVER_HUNGRY || ServerConstants.PETS_NEVER_HUNGRY) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScheduledFuture<?> schedule;
|
||||
schedule = TimerManager.getInstance().register(new Runnable() {
|
||||
@Override
|
||||
|
||||
@@ -86,17 +86,17 @@ public class ServerConstants {
|
||||
try {
|
||||
p.load(new FileInputStream("configuration.ini"));
|
||||
|
||||
//Server Host
|
||||
ServerConstants.HOST = p.getProperty("HOST");
|
||||
//Server Host
|
||||
ServerConstants.HOST = p.getProperty("HOST");
|
||||
|
||||
//Sql Database
|
||||
ServerConstants.DB_URL = p.getProperty("URL");
|
||||
ServerConstants.DB_USER = p.getProperty("DB_USER");
|
||||
ServerConstants.DB_PASS = p.getProperty("DB_PASS");
|
||||
//Sql Database
|
||||
ServerConstants.DB_URL = p.getProperty("URL");
|
||||
ServerConstants.DB_USER = p.getProperty("DB_USER");
|
||||
ServerConstants.DB_PASS = p.getProperty("DB_PASS");
|
||||
|
||||
//java8 And Shutdownhook
|
||||
ServerConstants.JAVA_8 = p.getProperty("JAVA8").equalsIgnoreCase("TRUE");
|
||||
ServerConstants.SHUTDOWNHOOK = p.getProperty("SHUTDOWNHOOK").equalsIgnoreCase("true");
|
||||
//java8 And Shutdownhook
|
||||
ServerConstants.JAVA_8 = p.getProperty("JAVA8").equalsIgnoreCase("TRUE");
|
||||
ServerConstants.SHUTDOWNHOOK = p.getProperty("SHUTDOWNHOOK").equalsIgnoreCase("true");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -48,12 +48,22 @@ public final class MobDamageMobFriendlyHandler extends AbstractMaplePacketHandle
|
||||
int damage = Randomizer.nextInt(((monster.getMaxHp() / 13 + monster.getPADamage() * 10)) * 2 + 500) / 10; //Beng's formula.
|
||||
// int damage = monster.getStats().getPADamage() + monster.getStats().getPDDamage() - 1;
|
||||
|
||||
if (monster.getHp() - damage < 1) { // friendly dies
|
||||
if(monster.getId() == 9300102) {
|
||||
monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "The Watch Hog has been injured by the aliens. Better luck next time..."));
|
||||
}
|
||||
else if (monster.getId() == 9300061) { //moon bunny
|
||||
monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny went home because he was sick."));
|
||||
}
|
||||
else if(monster.getId() == 9300093) { //tylus
|
||||
monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "Tylus has fallen by the overwhelming forces of this ambush."));
|
||||
}
|
||||
|
||||
c.getPlayer().getMap().killFriendlies(monster);
|
||||
}
|
||||
|
||||
if (monster.getId() == 9300061) {
|
||||
if (monster.getHp() - damage < 1) {
|
||||
monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny went home because he was sick."));
|
||||
c.getPlayer().getEventInstance().getMapInstance(monster.getMap().getId()).killFriendlies(monster);
|
||||
}
|
||||
MapleMap map = c.getPlayer().getEventInstance().getMapInstance(monster.getMap().getId());
|
||||
MapleMap map = c.getPlayer().getEventInstance().getMapInstance(monster.getMap().getId());
|
||||
map.addBunnyHit();
|
||||
}
|
||||
|
||||
|
||||
@@ -230,15 +230,15 @@ public class EventInstanceManager {
|
||||
|
||||
public void stopEventTimer() {
|
||||
if(event_schedule != null) {
|
||||
event_schedule.cancel(false);
|
||||
event_schedule = null;
|
||||
event_schedule.cancel(false);
|
||||
event_schedule = null;
|
||||
}
|
||||
dismissEventTimer();
|
||||
}
|
||||
|
||||
private void dismissEventTimer() {
|
||||
for(MapleCharacter chr: getPlayers()) {
|
||||
chr.getClient().getSession().write(MaplePacketCreator.removeClock());
|
||||
chr.getClient().getSession().write(MaplePacketCreator.removeClock());
|
||||
}
|
||||
|
||||
event_schedule = null;
|
||||
@@ -302,7 +302,7 @@ public class EventInstanceManager {
|
||||
private List<MapleCharacter> getPlayerList() {
|
||||
rL.lock();
|
||||
try {
|
||||
return new LinkedList<>(chars);
|
||||
return new LinkedList<>(chars);
|
||||
} finally {
|
||||
rL.unlock();
|
||||
}
|
||||
@@ -412,8 +412,8 @@ public class EventInstanceManager {
|
||||
|
||||
public void cancelSchedule() {
|
||||
if(event_schedule != null) {
|
||||
event_schedule.cancel(false);
|
||||
event_schedule = null;
|
||||
event_schedule.cancel(false);
|
||||
event_schedule = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -860,11 +860,14 @@ public class EventInstanceManager {
|
||||
}
|
||||
}
|
||||
|
||||
public final void linkToNextStage(int thisStage, String eventFamily, int thisMapId) {
|
||||
public final void giveEventPlayersStageReward(int thisStage) {
|
||||
List<Integer> list = getClearStageBonus(thisStage); // will give bonus exp & mesos to everyone in the event
|
||||
giveEventPlayersExp(list.get(0));
|
||||
giveEventPlayersMeso(list.get(1));
|
||||
|
||||
}
|
||||
|
||||
public final void linkToNextStage(int thisStage, String eventFamily, int thisMapId) {
|
||||
giveEventPlayersStageReward(thisStage);
|
||||
thisStage--; //stages counts from ONE, scripts from ZERO
|
||||
|
||||
MapleMap nextStage = getMapInstance(thisMapId);
|
||||
|
||||
@@ -754,7 +754,9 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public void softKillAllMonsters() {
|
||||
|
||||
for (SpawnPoint spawnPoint : monsterSpawn) {
|
||||
spawnPoint.setDenySpawn(true);
|
||||
}
|
||||
|
||||
for (MapleMapObject monstermo : getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER))) {
|
||||
MapleMonster monster = (MapleMonster) monstermo;
|
||||
@@ -768,6 +770,10 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public void killAllMonstersNotFriendly() {
|
||||
for (SpawnPoint spawnPoint : monsterSpawn) {
|
||||
spawnPoint.setDenySpawn(true);
|
||||
}
|
||||
|
||||
for (MapleMapObject monstermo : getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER))) {
|
||||
MapleMonster monster = (MapleMonster) monstermo;
|
||||
if (monster.getStats().isFriendly()) {
|
||||
@@ -1453,17 +1459,6 @@ public class MapleMap {
|
||||
}
|
||||
if (mapid == 923010000 && getMonsterById(9300102) == null) { // Kenta's Mount Quest
|
||||
spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300102), new Point(77, 426));
|
||||
} else if (mapid == 910010200) { // Henesys Party Quest Bonus
|
||||
chr.announce(MaplePacketCreator.getClock(60 * 5));
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (chr.getMapId() == 910010200) {
|
||||
chr.changeMap(910010400);
|
||||
}
|
||||
}
|
||||
}, 5 * 60 * 1000);
|
||||
} else if (mapid == 200090060) { // To Rien
|
||||
chr.announce(MaplePacketCreator.getClock(60));
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
@@ -2216,6 +2211,8 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public void instanceMapRespawn() {
|
||||
if(!allowSummons) return;
|
||||
|
||||
final int numShouldSpawn = (short) ((monsterSpawn.size() - spawnedMonstersOnMap.get()));//Fking lol'd
|
||||
if (numShouldSpawn > 0) {
|
||||
List<SpawnPoint> randomSpawn = new ArrayList<>(monsterSpawn);
|
||||
@@ -2256,9 +2253,11 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public void respawn() {
|
||||
if(!allowSummons) return;
|
||||
|
||||
chrRLock.lock();
|
||||
try {
|
||||
if (characters.isEmpty()) {
|
||||
if(characters.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2276,16 +2275,16 @@ public class MapleMap {
|
||||
*/
|
||||
|
||||
short numShouldSpawn = (short) ((monsterSpawn.size() - spawnedMonstersOnMap.get()));//Fking lol'd
|
||||
if (numShouldSpawn > 0) {
|
||||
if(numShouldSpawn > 0) {
|
||||
List<SpawnPoint> randomSpawn = new ArrayList<>(monsterSpawn);
|
||||
Collections.shuffle(randomSpawn);
|
||||
short spawned = 0;
|
||||
for (SpawnPoint spawnPoint : randomSpawn) {
|
||||
if (spawnPoint.shouldSpawn()) {
|
||||
for(SpawnPoint spawnPoint : randomSpawn) {
|
||||
if(spawnPoint.shouldSpawn()) {
|
||||
spawnMonster(spawnPoint.getMonster());
|
||||
spawned++;
|
||||
|
||||
if (spawned >= numShouldSpawn) {
|
||||
if(spawned >= numShouldSpawn) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user