Rename and clean up MapleLifeFactory

This commit is contained in:
P0nk
2021-09-09 22:04:57 +02:00
parent 1f349d1dae
commit 38c700ca48
113 changed files with 309 additions and 308 deletions

View File

@@ -27,7 +27,7 @@ import client.Character;
import client.Client;
import client.command.Command;
import net.server.Server;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
import tools.PacketCreator;
public class BombCommand extends Command {
@@ -41,13 +41,13 @@ public class BombCommand extends Command {
if (params.length > 0) {
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null) {
victim.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), victim.getPosition());
victim.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(9300166), 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(MapleLifeFactory.getMonster(9300166), player.getPosition());
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(9300166), player.getPosition());
}
}
}

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm3;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
import server.life.MapleNPC;
import tools.PacketCreator;
@@ -42,7 +42,7 @@ public class NpcCommand extends Command {
player.yellowMessage("Syntax: !npc <npcid>");
return;
}
MapleNPC npc = MapleLifeFactory.getNPC(Integer.parseInt(params[0]));
MapleNPC npc = LifeFactory.getNPC(Integer.parseInt(params[0]));
if (npc != null) {
npc.setPosition(player.getPosition());
npc.setCy(player.getPosition().y);

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm3;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
import server.life.MapleMonster;
public class SpawnCommand extends Command {
@@ -42,16 +42,16 @@ public class SpawnCommand extends Command {
return;
}
MapleMonster monster = MapleLifeFactory.getMonster(Integer.parseInt(params[0]));
MapleMonster monster = LifeFactory.getMonster(Integer.parseInt(params[0]));
if (monster == null) {
return;
}
if (params.length == 2) {
for (int i = 0; i < Integer.parseInt(params[1]); i++) {
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(Integer.parseInt(params[0])), player.getPosition());
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(Integer.parseInt(params[0])), player.getPosition());
}
} else {
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(Integer.parseInt(params[0])), player.getPosition());
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(Integer.parseInt(params[0])), player.getPosition());
}
}
}

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm4;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
import server.life.MapleMonster;
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 = MapleLifeFactory.getMonster(9400606);
MapleMonster 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

@@ -26,7 +26,7 @@ package client.command.commands.gm4;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
public class PapCommand extends Command {
{
@@ -38,6 +38,6 @@ public class PapCommand extends Command {
Character player = c.getPlayer();
// thanks Conrad for noticing mobid typo here
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8500001), player.getPosition());
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(8500001), player.getPosition());
}
}

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm4;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
public class PianusCommand extends Command {
{
@@ -36,6 +36,6 @@ public class PianusCommand extends Command {
@Override
public void execute(Client c, String[] params) {
Character player = c.getPlayer();
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8510000), player.getPosition());
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(8510000), player.getPosition());
}
}

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm4;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
public class PinkbeanCommand extends Command {
{
@@ -36,7 +36,7 @@ public class PinkbeanCommand extends Command {
@Override
public void execute(Client c, String[] params) {
Character player = c.getPlayer();
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8820001), player.getPosition());
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(8820001), player.getPosition());
}
}

View File

@@ -27,7 +27,7 @@ import client.Character;
import client.Client;
import client.command.Command;
import net.server.channel.Channel;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
import server.life.MapleMonster;
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 = MapleLifeFactory.getMonster(mobId);
MapleMonster mob = LifeFactory.getMonster(mobId);
if (mob != null && !mob.getName().equals("MISSINGNO")) {
mob.setPosition(checkpos);
mob.setCy(ypos);

View File

@@ -27,7 +27,7 @@ import client.Character;
import client.Client;
import client.command.Command;
import net.server.channel.Channel;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
import server.life.MapleNPC;
import server.maps.MapleMap;
import tools.DatabaseConnection;
@@ -59,7 +59,7 @@ public class PnpcCommand extends Command {
return;
}
MapleNPC npc = MapleLifeFactory.getNPC(npcId);
MapleNPC npc = LifeFactory.getNPC(npcId);
Point checkpos = player.getMap().getGroundBelow(player.getPosition());
int xpos = checkpos.x;
@@ -85,7 +85,7 @@ public class PnpcCommand extends Command {
ps.executeUpdate();
for (Channel ch : player.getWorldServer().getChannels()) {
npc = MapleLifeFactory.getNPC(npcId);
npc = LifeFactory.getNPC(npcId);
npc.setPosition(checkpos);
npc.setCy(ypos);
npc.setRx0(xpos + 50);

View File

@@ -26,7 +26,7 @@ package client.command.commands.gm4;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MapleLifeFactory;
import server.life.LifeFactory;
public class ZakumCommand extends Command {
{
@@ -36,9 +36,9 @@ public class ZakumCommand extends Command {
@Override
public void execute(Client c, String[] params) {
Character player = c.getPlayer();
player.getMap().spawnFakeMonsterOnGroundBelow(MapleLifeFactory.getMonster(8800000), player.getPosition());
player.getMap().spawnFakeMonsterOnGroundBelow(LifeFactory.getMonster(8800000), player.getPosition());
for (int x = 8800003; x < 8800011; x++) {
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(x), player.getPosition());
player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(x), player.getPosition());
}
}
}