summaryrefslogtreecommitdiff
path: root/NET/worlds/console/BBAppearDroneCommand.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/console/BBAppearDroneCommand.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/console/BBAppearDroneCommand.java')
-rw-r--r--NET/worlds/console/BBAppearDroneCommand.java70
1 files changed, 70 insertions, 0 deletions
diff --git a/NET/worlds/console/BBAppearDroneCommand.java b/NET/worlds/console/BBAppearDroneCommand.java
new file mode 100644
index 0000000..1a12af4
--- /dev/null
+++ b/NET/worlds/console/BBAppearDroneCommand.java
@@ -0,0 +1,70 @@
+package NET.worlds.console;
+
+import NET.worlds.scape.HoloDrone;
+import NET.worlds.scape.Room;
+import NET.worlds.scape.World;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+public class BBAppearDroneCommand extends BlackBoxCommand {
+ private short x;
+ private short y;
+ private short z;
+ private short dir;
+ private String room;
+ private String name;
+
+ public BBAppearDroneCommand(String roomName, String pName, short px, short py, short pz, short pdir) {
+ this();
+ this.x = px;
+ this.y = py;
+ this.z = pz;
+ this.dir = pdir;
+ this.room = new String(roomName);
+ this.name = new String(pName);
+ }
+
+ public BBAppearDroneCommand() {
+ this.commandType = 5;
+ }
+
+ @Override
+ public boolean execute() {
+ HoloDrone d = new HoloDrone(null, null);
+ d.setName(this.name);
+ Room r = World.findRoomByName(this.room);
+ if (r != null) {
+ d.appear(r, this.x, this.y, this.z, this.dir);
+ d.makeTag(true);
+ ArmyOfZombies.instance().addZombie(d);
+ this.doCallback(true);
+ } else {
+ this.doCallback(false);
+ }
+
+ return true;
+ }
+
+ @Override
+ public void save(DataOutputStream dos) throws IOException {
+ super.save(dos);
+ dos.writeShort(this.x);
+ dos.writeShort(this.y);
+ dos.writeShort(this.z);
+ dos.writeShort(this.dir);
+ dos.writeUTF(this.room);
+ dos.writeUTF(this.name);
+ }
+
+ @Override
+ public void load(DataInputStream dis) throws IOException {
+ super.load(dis);
+ this.x = dis.readShort();
+ this.y = dis.readShort();
+ this.z = dis.readShort();
+ this.dir = dis.readShort();
+ this.room = new String(dis.readUTF());
+ this.name = new String(dis.readUTF());
+ }
+}