forked from MagicBane/Server
Dev cmd cleanup
This commit is contained in:
@@ -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 {
|
||||
|
||||
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 {
|
||||
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 {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Mob mob = Mob.createMob(loadID, pc.getLoc(),
|
||||
null, zone, null, null, "", 1, Enum.AIAgentType.MOBILE);
|
||||
|
||||
if (mob != null) {
|
||||
mob.updateDatabase();
|
||||
ChatManager.chatSayInfo(pc,
|
||||
|
||||
Reference in New Issue
Block a user