Browse Source

Dev cmd cleanup

combat-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 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum; import engine.Enum;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.objects.AbstractGameObject;
import engine.objects.*; import engine.objects.Mob;
import engine.objects.PlayerCharacter;
import engine.objects.Zone;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
/**
* @author Eighty
*/
public class AddMobCmd extends AbstractDevCmd { public class AddMobCmd extends AbstractDevCmd {
public AddMobCmd() { public AddMobCmd() {
@ -38,27 +35,8 @@ public class AddMobCmd extends AbstractDevCmd {
Zone zone = ZoneManager.findSmallestZone(pc.getLoc()); 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; int loadID;
try { try {
loadID = Integer.parseInt(words[0]); loadID = Integer.parseInt(words[0]);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
@ -72,7 +50,6 @@ public class AddMobCmd extends AbstractDevCmd {
return; // NaN return; // NaN
} }
if (zone == null) { if (zone == null) {
throwbackError(pc, "Failed to find zone to place mob in."); throwbackError(pc, "Failed to find zone to place mob in.");
return; return;
@ -83,9 +60,9 @@ public class AddMobCmd extends AbstractDevCmd {
return; return;
} }
Mob mob = Mob.createMob(loadID, pc.getLoc(), Mob mob = Mob.createMob(loadID, pc.getLoc(),
null, zone, null, null, "", 1, Enum.AIAgentType.MOBILE); null, zone, null, null, "", 1, Enum.AIAgentType.MOBILE);
if (mob != null) { if (mob != null) {
mob.updateDatabase(); mob.updateDatabase();
ChatManager.chatSayInfo(pc, ChatManager.chatSayInfo(pc,

Loading…
Cancel
Save