Turn mob id magic numbers into constants
This commit is contained in:
@@ -37,6 +37,7 @@ import config.YamlConfig;
|
||||
import constants.game.ExpTable;
|
||||
import constants.game.GameConstants;
|
||||
import constants.id.ItemId;
|
||||
import constants.id.MobId;
|
||||
import constants.inventory.ItemConstants;
|
||||
import constants.skills.*;
|
||||
import net.packet.Packet;
|
||||
@@ -7518,12 +7519,12 @@ public class Character extends AbstractCharacterObject {
|
||||
public void raiseQuestMobCount(int id) {
|
||||
// It seems nexon uses monsters that don't exist in the WZ (except string) to merge multiple mobs together for these 3 monsters.
|
||||
// We also want to run mobKilled for both since there are some quest that don't use the updated ID...
|
||||
if (id == 1110100 || id == 1110130) {
|
||||
raiseQuestMobCount(9101000);
|
||||
} else if (id == 2230101 || id == 2230131) {
|
||||
raiseQuestMobCount(9101001);
|
||||
} else if (id == 1140100 || id == 1140130) {
|
||||
raiseQuestMobCount(9101002);
|
||||
if (id == MobId.GREEN_MUSHROOM || id == MobId.DEJECTED_GREEN_MUSHROOM) {
|
||||
raiseQuestMobCount(MobId.GREEN_MUSHROOM_QUEST);
|
||||
} else if (id == MobId.ZOMBIE_MUSHROOM || id == MobId.ANNOYED_ZOMBIE_MUSHROOM) {
|
||||
raiseQuestMobCount(MobId.ZOMBIE_MUSHROOM_QUEST);
|
||||
} else if (id == MobId.GHOST_STUMP || id == MobId.SMIRKING_GHOST_STUMP) {
|
||||
raiseQuestMobCount(MobId.GHOST_STUMP_QUEST);
|
||||
}
|
||||
|
||||
int lastQuestProcessed = 0;
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import constants.id.MobId;
|
||||
import net.server.Server;
|
||||
import server.life.LifeFactory;
|
||||
import tools.PacketCreator;
|
||||
@@ -41,13 +42,13 @@ public class BombCommand extends Command {
|
||||
if (params.length > 0) {
|
||||
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(9300166), victim.getPosition());
|
||||
victim.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.ARPQ_BOMB), victim.getPosition());
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, player.getName() + " used !bomb on " + victim.getName()));
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
}
|
||||
} else {
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(9300166), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.ARPQ_BOMB), player.getPosition());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm3;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import constants.id.MobId;
|
||||
import server.life.Monster;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapObjectType;
|
||||
@@ -47,7 +48,7 @@ public class KillAllCommand extends Command {
|
||||
int count = 0;
|
||||
for (MapObject monstermo : monsters) {
|
||||
Monster monster = (Monster) monstermo;
|
||||
if (!monster.getStats().isFriendly() && !(monster.getId() >= 8810010 && monster.getId() <= 8810018)) {
|
||||
if (!monster.getStats().isFriendly() && !(monster.getId() >= MobId.DEAD_HORNTAIL_MIN && monster.getId() <= MobId.HORNTAIL)) {
|
||||
map.damageMonster(player, monster, Integer.MAX_VALUE);
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm4;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import constants.id.MobId;
|
||||
import server.life.LifeFactory;
|
||||
import server.life.Monster;
|
||||
|
||||
@@ -37,7 +38,7 @@ public class CakeCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
Monster monster = LifeFactory.getMonster(9400606);
|
||||
Monster monster = LifeFactory.getMonster(MobId.GIANT_CAKE);
|
||||
if (params.length == 1) {
|
||||
double mobHp = Double.parseDouble(params[0]);
|
||||
int newHp = (mobHp <= 0) ? Integer.MAX_VALUE : ((mobHp > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int) mobHp);
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm4;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import constants.id.MobId;
|
||||
import server.life.LifeFactory;
|
||||
|
||||
public class PapCommand extends Command {
|
||||
@@ -38,6 +39,6 @@ public class PapCommand extends Command {
|
||||
Character player = c.getPlayer();
|
||||
|
||||
// thanks Conrad for noticing mobid typo here
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(8500001), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.PAPULATUS_CLOCK), player.getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm4;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import constants.id.MobId;
|
||||
import server.life.LifeFactory;
|
||||
|
||||
public class PianusCommand extends Command {
|
||||
@@ -36,6 +37,6 @@ public class PianusCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(8510000), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.PIANUS_R), player.getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm4;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import constants.id.MobId;
|
||||
import server.life.LifeFactory;
|
||||
|
||||
public class PinkbeanCommand extends Command {
|
||||
@@ -36,7 +37,7 @@ public class PinkbeanCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(8820001), player.getPosition());
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.PINK_BEAN), player.getPosition());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm4;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import constants.id.MobId;
|
||||
import server.life.LifeFactory;
|
||||
|
||||
public class ZakumCommand extends Command {
|
||||
@@ -36,9 +37,9 @@ public class ZakumCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
player.getMap().spawnFakeMonsterOnGroundBelow(LifeFactory.getMonster(8800000), player.getPosition());
|
||||
for (int x = 8800003; x < 8800011; x++) {
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(x), player.getPosition());
|
||||
player.getMap().spawnFakeMonsterOnGroundBelow(LifeFactory.getMonster(MobId.ZAKUM_1), player.getPosition());
|
||||
for (int mobId = MobId.ZAKUM_ARM_1; mobId <= MobId.ZAKUM_ARM_8; mobId++) {
|
||||
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(mobId), player.getPosition());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,10 +584,6 @@ public class GameConstants {
|
||||
return mapid >= 925030100 && mapid < 925040000;
|
||||
}
|
||||
|
||||
public static boolean isDojoBoss(int mobid) {
|
||||
return mobid >= 9300184 && mobid < 9300216;
|
||||
}
|
||||
|
||||
public static boolean isDojoBossArea(int mapid) {
|
||||
return isDojo(mapid) && (((mapid / 100) % 100) % 6) > 0;
|
||||
}
|
||||
|
||||
103
src/main/java/constants/id/MobId.java
Normal file
103
src/main/java/constants/id/MobId.java
Normal file
@@ -0,0 +1,103 @@
|
||||
package constants.id;
|
||||
|
||||
public class MobId {
|
||||
public static final int ARPQ_BOMB = 9300166;
|
||||
public static final int GIANT_CAKE = 9400606;
|
||||
public static final int TRANSPARENT_ITEM = 9300216;
|
||||
|
||||
public static final int GREEN_MUSHROOM = 1110100;
|
||||
public static final int DEJECTED_GREEN_MUSHROOM = 1110130;
|
||||
public static final int GREEN_MUSHROOM_QUEST = 9101000;
|
||||
public static final int ZOMBIE_MUSHROOM = 2230101;
|
||||
public static final int ANNOYED_ZOMBIE_MUSHROOM = 2230131;
|
||||
public static final int ZOMBIE_MUSHROOM_QUEST = 9101001;
|
||||
public static final int GHOST_STUMP = 1140100;
|
||||
public static final int SMIRKING_GHOST_STUMP = 1140130;
|
||||
public static final int GHOST_STUMP_QUEST = 9101002;
|
||||
|
||||
public static final int PAPULATUS_CLOCK = 8500001;
|
||||
public static final int HIGH_DARKSTAR = 8500003;
|
||||
public static final int LOW_DARKSTAR = 8500004;
|
||||
|
||||
public static final int PIANUS_R = 8510000;
|
||||
public static final int BLOODY_BOOM = 8510100;
|
||||
|
||||
public static final int PINK_BEAN = 8820001;
|
||||
|
||||
public static final int ZAKUM_1 = 8800000;
|
||||
public static final int ZAKUM_2 = 8800001;
|
||||
public static final int ZAKUM_3 = 8800002;
|
||||
public static final int ZAKUM_ARM_1 = 8800003;
|
||||
public static final int ZAKUM_ARM_2 = 8800004;
|
||||
public static final int ZAKUM_ARM_3 = 8800005;
|
||||
public static final int ZAKUM_ARM_4 = 8800006;
|
||||
public static final int ZAKUM_ARM_5 = 8800007;
|
||||
public static final int ZAKUM_ARM_6 = 8800008;
|
||||
public static final int ZAKUM_ARM_7 = 8800009;
|
||||
public static final int ZAKUM_ARM_8 = 8800010;
|
||||
|
||||
public static boolean isZakumArm(int mobId) {
|
||||
return mobId >= ZAKUM_ARM_1 && mobId <= ZAKUM_ARM_8;
|
||||
}
|
||||
|
||||
public static final int HORNTAIL_PREHEAD_LEFT = 8810000;
|
||||
public static final int HORNTAIL_PREHEAD_RIGHT = 8810001;
|
||||
public static final int HORNTAIL_HEAD_A = 8810002;
|
||||
public static final int HORNTAIL_HEAD_B = 8810003;
|
||||
public static final int HORNTAIL_HEAD_C = 8810004;
|
||||
public static final int HORNTAIL_HAND_LEFT = 8810005;
|
||||
public static final int HORNTAIL_HAND_RIGHT = 8810006;
|
||||
public static final int HORNTAIL_WINGS = 8810007;
|
||||
public static final int HORNTAIL_LEGS = 8810008;
|
||||
public static final int HORNTAIL_TAIL = 8810009;
|
||||
public static final int DEAD_HORNTAIL_MIN = 8810010;
|
||||
public static final int DEAD_HORNTAIL_MAX = 8810017;
|
||||
public static final int HORNTAIL = 8810018;
|
||||
public static final int SUMMON_HORNTAIL = 8810026;
|
||||
|
||||
public static boolean isDeadHorntailPart(int mobId) {
|
||||
return mobId >= DEAD_HORNTAIL_MIN && mobId <= DEAD_HORNTAIL_MAX;
|
||||
}
|
||||
|
||||
public static final int SCARLION_STATUE = 9420546;
|
||||
public static final int SCARLION = 9420547;
|
||||
public static final int ANGRY_SCARLION = 9420548;
|
||||
public static final int FURIOUS_SCARLION = 9420549;
|
||||
public static final int TARGA_STATUE = 9420541;
|
||||
public static final int TARGA = 9420542;
|
||||
public static final int ANGRY_TARGA = 9420543;
|
||||
public static final int FURIOUS_TARGA = 9420544;
|
||||
|
||||
// Catch mobs
|
||||
public static final int TAMABLE_HOG = 9300101;
|
||||
public static final int GHOST = 9500197;
|
||||
public static final int ARPQ_SCORPION = 9300157;
|
||||
public static final int LOST_RUDOLPH = 9500320;
|
||||
public static final int KING_SLIME_DOJO = 9300187;
|
||||
public static final int FAUST_DOJO = 9300189;
|
||||
public static final int MUSHMOM_DOJO = 9300191;
|
||||
public static final int POISON_FLOWER = 9300175;
|
||||
public static final int P_JUNIOR = 9500336;
|
||||
|
||||
// Friendly mobs
|
||||
public static final int WATCH_HOG = 9300102;
|
||||
public static final int MOON_BUNNY = 9300061;
|
||||
public static final int TYLUS = 9300093;
|
||||
public static final int JULIET = 9300137;
|
||||
public static final int ROMEO = 9300138;
|
||||
public static final int DELLI = 9300162;
|
||||
public static final int GIANT_SNOWMAN_LV1_EASY = 9400322;
|
||||
public static final int GIANT_SNOWMAN_LV1_MEDIUM = 9400327;
|
||||
public static final int GIANT_SNOWMAN_LV1_HARD = 9400332;
|
||||
public static final int GIANT_SNOWMAN_LV5_EASY = 9400326;
|
||||
public static final int GIANT_SNOWMAN_LV5_MEDIUM = 9400331;
|
||||
public static final int GIANT_SNOWMAN_LV5_HARD = 9400336;
|
||||
|
||||
// Dojo
|
||||
private static final int DOJO_BOSS_MIN = 9300184;
|
||||
private static final int DOJO_BOSS_MAX = 9300215;
|
||||
|
||||
public static boolean isDojoBoss(int mobId) {
|
||||
return mobId >= DOJO_BOSS_MIN && mobId <= DOJO_BOSS_MAX;
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import client.status.MonsterStatusEffect;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import constants.id.ItemId;
|
||||
import constants.id.MobId;
|
||||
import constants.skills.*;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -237,7 +238,7 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if (GameConstants.isDojoBoss(monster.getId())) {
|
||||
if (MobId.isDojoBoss(monster.getId())) {
|
||||
if (attack.skill == 1009 || attack.skill == 10001009 || attack.skill == 20001009) {
|
||||
int dmgLimit = (int) Math.ceil(0.3 * monster.getMaxHp());
|
||||
List<Integer> _onedList = new LinkedList<>();
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import constants.id.MobId;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import scripting.event.EventInstanceManager;
|
||||
@@ -51,19 +52,19 @@ public final class MobDamageMobFriendlyHandler extends AbstractPacketHandler {
|
||||
int damage = Randomizer.nextInt(((monster.getMaxHp() / 13 + monster.getPADamage() * 10)) * 2 + 500) / 10; // Formula planned by Beng.
|
||||
|
||||
if (monster.getHp() - damage < 1) { // friendly dies
|
||||
if (monster.getId() == 9300102) {
|
||||
if (monster.getId() == MobId.WATCH_HOG) {
|
||||
map.broadcastMessage(PacketCreator.serverNotice(6, "The Watch Hog has been injured by the aliens. Better luck next time..."));
|
||||
} else if (monster.getId() == 9300061) { //moon bunny
|
||||
} else if (monster.getId() == MobId.MOON_BUNNY) { //moon bunny
|
||||
map.broadcastMessage(PacketCreator.serverNotice(6, "The Moon Bunny went home because he was sick."));
|
||||
} else if (monster.getId() == 9300093) { //tylus
|
||||
} else if (monster.getId() == MobId.TYLUS) { //tylus
|
||||
map.broadcastMessage(PacketCreator.serverNotice(6, "Tylus has fallen by the overwhelming forces of the ambush."));
|
||||
} else if (monster.getId() == 9300137) { //juliet
|
||||
} else if (monster.getId() == MobId.JULIET) { //juliet
|
||||
map.broadcastMessage(PacketCreator.serverNotice(6, "Juliet has fainted in the middle of the combat."));
|
||||
} else if (monster.getId() == 9300138) { //romeo
|
||||
} else if (monster.getId() == MobId.ROMEO) { //romeo
|
||||
map.broadcastMessage(PacketCreator.serverNotice(6, "Romeo has fainted in the middle of the combat."));
|
||||
} else if (monster.getId() == 9400322 || monster.getId() == 9400327 || monster.getId() == 9400332) { //snowman
|
||||
} else if (monster.getId() == MobId.GIANT_SNOWMAN_LV1_EASY || monster.getId() == MobId.GIANT_SNOWMAN_LV1_MEDIUM || monster.getId() == MobId.GIANT_SNOWMAN_LV1_HARD) {
|
||||
map.broadcastMessage(PacketCreator.serverNotice(6, "The Snowman has melted on the heat of the battle."));
|
||||
} else if (monster.getId() == 9300162) { //delli
|
||||
} else if (monster.getId() == MobId.DELLI) { //delli
|
||||
map.broadcastMessage(PacketCreator.serverNotice(6, "Delli vanished after the ambush, sheets still laying on the ground..."));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import constants.id.MobId;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.life.Monster;
|
||||
@@ -35,7 +36,7 @@ public final class MonsterBombHandler extends AbstractPacketHandler {
|
||||
if (!c.getPlayer().isAlive() || monster == null) {
|
||||
return;
|
||||
}
|
||||
if (monster.getId() == 8500003 || monster.getId() == 8500004) {
|
||||
if (monster.getId() == MobId.HIGH_DARKSTAR || monster.getId() == MobId.LOW_DARKSTAR) {
|
||||
monster.getMap().broadcastMessage(PacketCreator.killMonster(monster.getObjectId(), 4));
|
||||
c.getPlayer().getMap().removeMapObject(oid);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import client.autoban.AutobanManager;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.id.ItemId;
|
||||
import constants.id.MobId;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -58,7 +59,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
}
|
||||
switch (itemId) {
|
||||
case ItemId.PHEROMONE_PERFUME:
|
||||
if (mob.getId() == 9300101) {
|
||||
if (mob.getId() == MobId.TAMABLE_HOG) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
@@ -67,7 +68,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
break;
|
||||
case ItemId.POUCH:
|
||||
if (mob.getId() == 9500197) {
|
||||
if (mob.getId() == MobId.GHOST) {
|
||||
if ((abm.getLastSpam(10) + 1000) < currentServerTime()) {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 4)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
@@ -83,7 +84,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
}
|
||||
break;
|
||||
case ItemId.ARPQ_ELEMENT_ROCK:
|
||||
if (mob.getId() == 9300157) {
|
||||
if (mob.getId() == MobId.ARPQ_SCORPION) {
|
||||
if ((abm.getLastSpam(10) + 800) < currentServerTime()) {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 4)) {
|
||||
if (chr.canHold(ItemId.ARPQ_SPIRIT_JEWEL, 1)) {
|
||||
@@ -108,7 +109,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
}
|
||||
break;
|
||||
case ItemId.MAGIC_CANE:
|
||||
if (mob.getId() == 9500320) {
|
||||
if (mob.getId() == MobId.LOST_RUDOLPH) {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 4)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
@@ -121,7 +122,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
break;
|
||||
case ItemId.TRANSPARENT_MARBLE_1:
|
||||
if (mob.getId() == 9300187) {
|
||||
if (mob.getId() == MobId.KING_SLIME_DOJO) {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 3)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
@@ -134,7 +135,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
break;
|
||||
case ItemId.TRANSPARENT_MARBLE_2:
|
||||
if (mob.getId() == 9300189) {
|
||||
if (mob.getId() == MobId.FAUST_DOJO) {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 3)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
@@ -147,7 +148,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
break;
|
||||
case ItemId.TRANSPARENT_MARBLE_3:
|
||||
if (mob.getId() == 9300191) {
|
||||
if (mob.getId() == MobId.MUSHMOM_DOJO) {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 3)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
@@ -160,7 +161,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
break;
|
||||
case ItemId.EPQ_PURIFICATION_MARBLE:
|
||||
if (mob.getId() == 9300175) {
|
||||
if (mob.getId() == MobId.POISON_FLOWER) {
|
||||
if (mob.getHp() < ((mob.getMaxHp() / 10) * 4)) {
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
@@ -173,7 +174,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
break;
|
||||
case ItemId.FISH_NET:
|
||||
if (mob.getId() == 9500336) {
|
||||
if (mob.getId() == MobId.P_JUNIOR) {
|
||||
if ((abm.getLastSpam(10) + 3000) < currentServerTime()) {
|
||||
abm.spam(10);
|
||||
chr.getMap().broadcastMessage(PacketCreator.catchMonster(monsterid, itemId, (byte) 1));
|
||||
@@ -203,7 +204,7 @@ public final class UseCatchItemHandler extends AbstractPacketHandler {
|
||||
mob.getMap().killMonster(mob, null, false);
|
||||
InventoryManipulator.removeById(c, InventoryType.USE, itemId, 1, true, true);
|
||||
InventoryManipulator.addById(c, itemGanho, (short) 1, "", -1);
|
||||
} else if (mob.getId() != 9500336) {
|
||||
} else if (mob.getId() != MobId.P_JUNIOR) {
|
||||
if (mobHp != 0) {
|
||||
abm.spam(10);
|
||||
c.sendPacket(PacketCreator.catchMessage(0));
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
package server.expeditions;
|
||||
|
||||
import client.Character;
|
||||
import constants.id.MobId;
|
||||
import net.packet.Packet;
|
||||
import net.server.PlayerStorage;
|
||||
import net.server.Server;
|
||||
@@ -51,35 +52,35 @@ import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
public class Expedition {
|
||||
|
||||
private static final int[] EXPEDITION_BOSSES = {
|
||||
8800000,// - Zakum's first body
|
||||
8800001,// - Zakum's second body
|
||||
8800002,// - Zakum's third body
|
||||
8800003,// - Zakum's Arm 1
|
||||
8800004,// - Zakum's Arm 2
|
||||
8800005,// - Zakum's Arm 3
|
||||
8800006,// - Zakum's Arm 4
|
||||
8800007,// - Zakum's Arm 5
|
||||
8800008,// - Zakum's Arm 6
|
||||
8800009,// - Zakum's Arm 7
|
||||
8800010,// - Zakum's Arm 8
|
||||
8810000,// - Horntail's Left Head
|
||||
8810001,// - Horntail's Right Head
|
||||
8810002,// - Horntail's Head A
|
||||
8810003,// - Horntail's Head B
|
||||
8810004,// - Horntail's Head C
|
||||
8810005,// - Horntail's Left Hand
|
||||
8810006,// - Horntail's Right Hand
|
||||
8810007,// - Horntail's Wings
|
||||
8810008,// - Horntail's Legs
|
||||
8810009,// - Horntail's Tails
|
||||
9420546,// - Scarlion Boss
|
||||
9420547,// - Scarlion Boss
|
||||
9420548,// - Angry Scarlion Boss
|
||||
9420549,// - Furious Scarlion Boss
|
||||
9420541,// - Targa
|
||||
9420542,// - Targa
|
||||
9420543,// - Angry Targa
|
||||
9420544,// - Furious Targa
|
||||
MobId.ZAKUM_1,
|
||||
MobId.ZAKUM_2,
|
||||
MobId.ZAKUM_3,
|
||||
MobId.ZAKUM_ARM_1,
|
||||
MobId.ZAKUM_ARM_2,
|
||||
MobId.ZAKUM_ARM_3,
|
||||
MobId.ZAKUM_ARM_4,
|
||||
MobId.ZAKUM_ARM_5,
|
||||
MobId.ZAKUM_ARM_6,
|
||||
MobId.ZAKUM_ARM_7,
|
||||
MobId.ZAKUM_ARM_8,
|
||||
MobId.HORNTAIL_PREHEAD_LEFT,
|
||||
MobId.HORNTAIL_PREHEAD_RIGHT,
|
||||
MobId.HORNTAIL_HEAD_A,
|
||||
MobId.HORNTAIL_HEAD_B,
|
||||
MobId.HORNTAIL_HEAD_C,
|
||||
MobId.HORNTAIL_HAND_LEFT,
|
||||
MobId.HORNTAIL_HAND_RIGHT,
|
||||
MobId.HORNTAIL_WINGS,
|
||||
MobId.HORNTAIL_LEGS,
|
||||
MobId.HORNTAIL_TAIL,
|
||||
MobId.SCARLION_STATUE,
|
||||
MobId.SCARLION,
|
||||
MobId.ANGRY_SCARLION,
|
||||
MobId.FURIOUS_SCARLION,
|
||||
MobId.TARGA_STATUE,
|
||||
MobId.TARGA,
|
||||
MobId.ANGRY_TARGA,
|
||||
MobId.FURIOUS_TARGA,
|
||||
};
|
||||
|
||||
private final Character leader;
|
||||
|
||||
@@ -25,6 +25,7 @@ import client.Character;
|
||||
import client.Disease;
|
||||
import client.status.MonsterStatus;
|
||||
import constants.game.GameConstants;
|
||||
import constants.id.MobId;
|
||||
import net.server.services.task.channel.OverallService;
|
||||
import net.server.services.type.ChannelServices;
|
||||
import server.maps.MapObject;
|
||||
@@ -265,17 +266,17 @@ public class MobSkill {
|
||||
xpos = (int) monster.getPosition().getX();
|
||||
ypos = (int) monster.getPosition().getY();
|
||||
switch (mobId) {
|
||||
case 8500003: // Pap bomb high
|
||||
case MobId.HIGH_DARKSTAR: // Pap bomb high
|
||||
toSpawn.setFh((int) Math.ceil(Math.random() * 19.0));
|
||||
ypos = -590;
|
||||
break;
|
||||
case 8500004: // Pap bomb
|
||||
case MobId.LOW_DARKSTAR: // Pap bomb
|
||||
xpos = (int) (monster.getPosition().getX() + Randomizer.nextInt(1000) - 500);
|
||||
if (ypos != -590) {
|
||||
ypos = (int) monster.getPosition().getY();
|
||||
}
|
||||
break;
|
||||
case 8510100: //Pianus bomb
|
||||
case MobId.BLOODY_BOOM: //Pianus bomb
|
||||
if (Math.ceil(Math.random() * 5) == 1) {
|
||||
ypos = 78;
|
||||
xpos = Randomizer.nextInt(5) + (Randomizer.nextInt(2) == 1 ? 180 : 0);
|
||||
@@ -301,7 +302,7 @@ public class MobSkill {
|
||||
break;
|
||||
}
|
||||
toSpawn.setPosition(new Point(xpos, ypos));
|
||||
if (toSpawn.getId() == 8500004) {
|
||||
if (toSpawn.getId() == MobId.LOW_DARKSTAR) {
|
||||
map.spawnFakeMonster(toSpawn);
|
||||
} else {
|
||||
map.spawnMonsterWithEffect(toSpawn, getSpawnEffect(), toSpawn.getPosition());
|
||||
|
||||
@@ -26,6 +26,7 @@ import client.*;
|
||||
import client.status.MonsterStatus;
|
||||
import client.status.MonsterStatusEffect;
|
||||
import config.YamlConfig;
|
||||
import constants.id.MobId;
|
||||
import constants.skills.*;
|
||||
import net.packet.Packet;
|
||||
import net.server.audit.LockCollector;
|
||||
@@ -761,7 +762,7 @@ public class Monster extends AbstractLoadedLife {
|
||||
final List<Integer> toSpawn = this.getRevives();
|
||||
if (toSpawn != null) {
|
||||
final MapleMap reviveMap = map;
|
||||
if (toSpawn.contains(9300216) && reviveMap.getId() > 925000000 && reviveMap.getId() < 926000000) {
|
||||
if (toSpawn.contains(MobId.TRANSPARENT_ITEM) && reviveMap.getId() > 925000000 && reviveMap.getId() < 926000000) {
|
||||
reviveMap.broadcastMessage(PacketCreator.playSound("Dojang/clear"));
|
||||
reviveMap.broadcastMessage(PacketCreator.showEffect("dojang/end/clear"));
|
||||
}
|
||||
@@ -790,9 +791,9 @@ public class Monster extends AbstractLoadedLife {
|
||||
}
|
||||
reviveMap.spawnMonster(mob);
|
||||
|
||||
if (mob.getId() >= 8810010 && mob.getId() <= 8810017 && reviveMap.isHorntailDefeated()) {
|
||||
if (MobId.isDeadHorntailPart(mob.getId()) && reviveMap.isHorntailDefeated()) {
|
||||
boolean htKilled = false;
|
||||
Monster ht = reviveMap.getMonsterById(8810018);
|
||||
Monster ht = reviveMap.getMonsterById(MobId.HORNTAIL);
|
||||
|
||||
if (ht != null) {
|
||||
ht.lockMonster();
|
||||
@@ -808,7 +809,7 @@ public class Monster extends AbstractLoadedLife {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 8810017; i >= 8810010; i--) {
|
||||
for (int i = MobId.DEAD_HORNTAIL_MAX; i >= MobId.DEAD_HORNTAIL_MIN; i--) {
|
||||
reviveMap.killMonster(reviveMap.getMonsterById(i), killer, true);
|
||||
}
|
||||
} else if (controller != null) {
|
||||
|
||||
@@ -33,6 +33,7 @@ import client.status.MonsterStatus;
|
||||
import client.status.MonsterStatusEffect;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import constants.id.MobId;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.packet.Packet;
|
||||
import net.server.Server;
|
||||
@@ -1301,11 +1302,11 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public boolean damageMonster(final Character chr, final Monster monster, final int damage) {
|
||||
if (monster.getId() == 8800000) {
|
||||
if (monster.getId() == MobId.ZAKUM_1) {
|
||||
for (MapObject object : chr.getMap().getMapObjects()) {
|
||||
Monster mons = chr.getMap().getMonsterByOid(object.getObjectId());
|
||||
if (mons != null) {
|
||||
if (mons.getId() >= 8800003 && mons.getId() <= 8800010) {
|
||||
if (mons.getId() >= MobId.ZAKUM_ARM_1 && mons.getId() <= MobId.ZAKUM_ARM_8) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1412,13 +1413,13 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
|
||||
if (monster.getId() >= 8800003 && monster.getId() <= 8800010) {
|
||||
if (MobId.isZakumArm(monster.getId())) {
|
||||
boolean makeZakReal = true;
|
||||
Collection<MapObject> objects = getMapObjects();
|
||||
for (MapObject object : objects) {
|
||||
Monster mons = getMonsterByOid(object.getObjectId());
|
||||
if (mons != null) {
|
||||
if (mons.getId() >= 8800003 && mons.getId() <= 8800010) {
|
||||
if (MobId.isZakumArm(mons.getId())) {
|
||||
makeZakReal = false;
|
||||
break;
|
||||
}
|
||||
@@ -1430,7 +1431,7 @@ public class MapleMap {
|
||||
for (MapObject object : objects) {
|
||||
Monster mons = map.getMonsterByOid(object.getObjectId());
|
||||
if (mons != null) {
|
||||
if (mons.getId() == 8800000) {
|
||||
if (mons.getId() == MobId.ZAKUM_1) {
|
||||
makeMonsterReal(mons);
|
||||
break;
|
||||
}
|
||||
@@ -1974,13 +1975,13 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
if (monster.getDropPeriodTime() > 0) { //9300102 - Watchhog, 9300061 - Moon Bunny (HPQ), 9300093 - Tylus
|
||||
if (monster.getId() == 9300102) {
|
||||
if (monster.getId() == MobId.WATCH_HOG) {
|
||||
monsterItemDrop(monster, monster.getDropPeriodTime());
|
||||
} else if (monster.getId() == 9300061) {
|
||||
} else if (monster.getId() == MobId.MOON_BUNNY) {
|
||||
monsterItemDrop(monster, monster.getDropPeriodTime() / 3);
|
||||
} else if (monster.getId() == 9300093) {
|
||||
} else if (monster.getId() == MobId.TYLUS) {
|
||||
monsterItemDrop(monster, monster.getDropPeriodTime());
|
||||
} else if (monster.getId() == 9400326 || monster.getId() == 9400331 || monster.getId() == 9400336) {
|
||||
} else if (monster.getId() == MobId.GIANT_SNOWMAN_LV5_EASY || monster.getId() == MobId.GIANT_SNOWMAN_LV5_MEDIUM || monster.getId() == MobId.GIANT_SNOWMAN_LV5_HARD) {
|
||||
monsterItemDrop(monster, monster.getDropPeriodTime());
|
||||
} else {
|
||||
FilePrinter.printError(FilePrinter.UNHANDLED_EVENT, "UNCODED TIMED MOB DETECTED: " + monster.getId());
|
||||
@@ -4033,7 +4034,7 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public boolean isHorntailDefeated() { // all parts of dead horntail can be found here?
|
||||
for (int i = 8810010; i <= 8810017; i++) {
|
||||
for (int i = MobId.DEAD_HORNTAIL_MIN; i <= MobId.DEAD_HORNTAIL_MAX; i++) {
|
||||
if (getMonsterById(i) == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -4043,10 +4044,10 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public void spawnHorntailOnGroundBelow(final Point targetPoint) { // ayy lmao
|
||||
Monster htIntro = LifeFactory.getMonster(8810026);
|
||||
Monster htIntro = LifeFactory.getMonster(MobId.SUMMON_HORNTAIL);
|
||||
spawnMonsterOnGroundBelow(htIntro, targetPoint); // htintro spawn animation converting into horntail detected thanks to Arnah
|
||||
|
||||
final Monster ht = LifeFactory.getMonster(8810018);
|
||||
final Monster ht = LifeFactory.getMonster(MobId.HORNTAIL);
|
||||
ht.setParentMobOid(htIntro.getObjectId());
|
||||
ht.addListener(new MonsterListener() {
|
||||
@Override
|
||||
@@ -4064,8 +4065,8 @@ public class MapleMap {
|
||||
});
|
||||
spawnMonsterOnGroundBelow(ht, targetPoint);
|
||||
|
||||
for (int x = 8810002; x <= 8810009; x++) {
|
||||
Monster m = LifeFactory.getMonster(x);
|
||||
for (int mobId = MobId.HORNTAIL_HEAD_A; mobId <= MobId.HORNTAIL_TAIL; mobId++) {
|
||||
Monster m = LifeFactory.getMonster(mobId);
|
||||
m.setParentMobOid(htIntro.getObjectId());
|
||||
|
||||
m.addListener(new MonsterListener() {
|
||||
|
||||
Reference in New Issue
Block a user