Browse Source

Dev cmd cleanup

magicbox-1.5.2^2
MagicBot 10 months ago
parent
commit
fcd37cbae2
  1. 35
      src/engine/devcmd/cmds/AddMobCmd.java

35
src/engine/devcmd/cmds/AddMobCmd.java

@ -10,18 +10,15 @@ @@ -10,18 +10,15 @@
package engine.devcmd.cmds;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable;
import engine.objects.*;
import engine.objects.AbstractGameObject;
import engine.objects.Mob;
import engine.objects.PlayerCharacter;
import engine.objects.Zone;
import org.pmw.tinylog.Logger;
/**
* @author Eighty
*/
public class AddMobCmd extends AbstractDevCmd {
public AddMobCmd() {
@ -38,27 +35,8 @@ public class AddMobCmd extends AbstractDevCmd { @@ -38,27 +35,8 @@ public class AddMobCmd extends AbstractDevCmd {
Zone zone = ZoneManager.findSmallestZone(pc.getLoc());
if (words[0].equals("all")) {
for (AbstractGameObject mobbaseAGO : DbManager.getList(GameObjectType.MobBase)) {
MobBase mb = (MobBase) mobbaseAGO;
int loadID = mb.getObjectUUID();
Mob mob = Mob.createMob(loadID, Vector3fImmutable.getRandomPointInCircle(pc.getLoc(), 100),
null, zone, null, null, "", 1, Enum.AIAgentType.MOBILE);
if (mob != null) {
mob.updateDatabase();
this.setResult(String.valueOf(mob.getDBID()));
} else {
throwbackError(pc, "Failed to create mob of type " + loadID);
Logger.error("Failed to create mob of type "
+ loadID);
}
}
return;
}
int loadID;
try {
loadID = Integer.parseInt(words[0]);
} catch (NumberFormatException e) {
@ -72,7 +50,6 @@ public class AddMobCmd extends AbstractDevCmd { @@ -72,7 +50,6 @@ public class AddMobCmd extends AbstractDevCmd {
return; // NaN
}
if (zone == null) {
throwbackError(pc, "Failed to find zone to place mob in.");
return;
@ -83,9 +60,9 @@ public class AddMobCmd extends AbstractDevCmd { @@ -83,9 +60,9 @@ public class AddMobCmd extends AbstractDevCmd {
return;
}
Mob mob = Mob.createMob(loadID, pc.getLoc(),
null, zone, null, null, "", 1, Enum.AIAgentType.MOBILE);
if (mob != null) {
mob.updateDatabase();
ChatManager.chatSayInfo(pc,

Loading…
Cancel
Save