Rename and clean up MapleMonster

This commit is contained in:
P0nk
2021-09-09 22:06:11 +02:00
parent 38c700ca48
commit 02786eab63
42 changed files with 520 additions and 529 deletions

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm1;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleMonster;
import server.life.Monster;
public class BossHpCommand extends Command {
{
@@ -36,7 +36,7 @@ public class BossHpCommand extends Command {
@Override
public void execute(Client c, String[] params) {
Character player = c.getPlayer();
for(MapleMonster monster : player.getMap().getAllMonsters()) {
for(Monster monster : player.getMap().getAllMonsters()) {
if(monster != null && monster.isBoss() && monster.getHp() > 0) {
long percent = monster.getHp() * 100L / monster.getMaxHp();
String bar = "[";

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm1;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleMonster;
import server.life.Monster;
public class MobHpCommand extends Command {
{
@@ -36,7 +36,7 @@ public class MobHpCommand extends Command {
@Override
public void execute(Client c, String[] params) {
Character player = c.getPlayer();
for(MapleMonster monster : player.getMap().getAllMonsters()) {
for(Monster monster : player.getMap().getAllMonsters()) {
if (monster != null && monster.getHp() > 0) {
player.yellowMessage(monster.getName() + " (" + monster.getId() + ") has " + monster.getHp() + " / " + monster.getMaxHp() + " HP.");

View File

@@ -26,9 +26,9 @@ package client.command.commands.gm2;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleMonster;
import server.life.MapleNPC;
import server.life.MaplePlayerNPC;
import server.life.Monster;
import server.maps.MapleMapObject;
import java.util.HashSet;
@@ -45,7 +45,7 @@ public class WhereaMiCommand extends Command {
HashSet<Character> chars = new HashSet<>();
HashSet<MapleNPC> npcs = new HashSet<>();
HashSet<MaplePlayerNPC> playernpcs = new HashSet<>();
HashSet<MapleMonster> mobs = new HashSet<>();
HashSet<Monster> mobs = new HashSet<>();
for (MapleMapObject mmo : player.getMap().getMapObjects()) {
if (mmo instanceof MapleNPC) {
@@ -54,8 +54,8 @@ public class WhereaMiCommand extends Command {
} else if (mmo instanceof Character) {
Character mc = (Character) mmo;
chars.add(mc);
} else if (mmo instanceof MapleMonster) {
MapleMonster mob = (MapleMonster) mmo;
} else if (mmo instanceof Monster) {
Monster mob = (Monster) mmo;
if (mob.isAlive()) {
mobs.add(mob);
}
@@ -88,7 +88,7 @@ public class WhereaMiCommand extends Command {
if (!mobs.isEmpty()) {
player.yellowMessage("Monsters on this map:");
for (MapleMonster mob : mobs) {
for (Monster mob : mobs) {
if (mob.isAlive()) {
player.dropMessage(5, ">> " + mob.getName() + " - " + mob.getId() + " - Oid: " + mob.getObjectId());
}

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm3;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleMonster;
import server.life.Monster;
import server.maps.MapleMap;
import server.maps.MapleMapObject;
import server.maps.MapleMapObjectType;
@@ -46,7 +46,7 @@ public class KillAllCommand extends Command {
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
int count = 0;
for (MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
Monster monster = (Monster) monstermo;
if (!monster.getStats().isFriendly() && !(monster.getId() >= 8810010 && monster.getId() <= 8810018)) {
map.damageMonster(player, monster, Integer.MAX_VALUE);
count++;

View File

@@ -27,7 +27,7 @@ import client.Character;
import client.Client;
import client.command.Command;
import server.life.LifeFactory;
import server.life.MapleMonster;
import server.life.Monster;
public class SpawnCommand extends Command {
{
@@ -42,7 +42,7 @@ public class SpawnCommand extends Command {
return;
}
MapleMonster monster = LifeFactory.getMonster(Integer.parseInt(params[0]));
Monster monster = LifeFactory.getMonster(Integer.parseInt(params[0]));
if (monster == null) {
return;
}

View File

@@ -27,7 +27,7 @@ import client.Character;
import client.Client;
import client.command.Command;
import server.life.LifeFactory;
import server.life.MapleMonster;
import server.life.Monster;
public class CakeCommand extends Command {
{
@@ -37,7 +37,7 @@ public class CakeCommand extends Command {
@Override
public void execute(Client c, String[] params) {
Character player = c.getPlayer();
MapleMonster monster = LifeFactory.getMonster(9400606);
Monster monster = LifeFactory.getMonster(9400606);
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);

View File

@@ -28,7 +28,7 @@ import client.Client;
import client.command.Command;
import net.server.channel.Channel;
import server.life.LifeFactory;
import server.life.MapleMonster;
import server.life.Monster;
import server.maps.MapleMap;
import tools.DatabaseConnection;
@@ -60,7 +60,7 @@ public class PmobCommand extends Command {
int ypos = checkpos.y;
int fh = player.getMap().getFootholds().findBelow(checkpos).getId();
MapleMonster mob = LifeFactory.getMonster(mobId);
Monster mob = LifeFactory.getMonster(mobId);
if (mob != null && !mob.getName().equals("MISSINGNO")) {
mob.setPosition(checkpos);
mob.setCy(ypos);

View File

@@ -28,7 +28,7 @@ import client.Client;
import client.command.Command;
import net.server.Server;
import server.TimerManager;
import server.life.MapleMonster;
import server.life.Monster;
import server.life.SpawnPoint;
import server.maps.MapleMapObject;
import server.maps.MapleMapObjectType;
@@ -69,7 +69,7 @@ public class DebugCommand extends Command {
case "monster":
List<MapleMapObject> monsters = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
for (MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
Monster monster = (Monster) monstermo;
Character controller = monster.getController();
player.message("Monster ID: " + monster.getId() + " Aggro target: " + ((controller != null) ? controller.getName() + " Has aggro: " + monster.isControllerHasAggro() + " Knowns aggro: " + monster.isControllerKnowsAboutAggro() : "<none>"));
}