🆙 Added Dance CMD

This commit is contained in:
duckietm
2025-12-22 16:36:31 +01:00
parent 32d6269560
commit e2114d5358
5 changed files with 55 additions and 2 deletions
@@ -0,0 +1,5 @@
ALTER TABLE `camwijs`.`permissions`
ADD COLUMN `cms_dance` ENUM('0', '1') NULL DEFAULT '0' AFTER `cmd_credits`;
INSERT INTO emulator_texts (`key`, `value`) VALUES ('commands.description.cmd_dance', 'dance around the world ! use 1 t/m 4 and 0 to stop');
INSERT INTO emulator_texts (`key`, `value`) VALUES ('commands.keys.cmd_dance', 'dance');
@@ -191,6 +191,7 @@ public class CommandHandler {
addCommand(new ControlCommand());
addCommand(new CoordsCommand());
addCommand(new CreditsCommand());
addCommand(new DanceCommand());
addCommand(new DiagonalCommand());
addCommand(new DisconnectCommand());
addCommand(new EjectAllCommand());
@@ -0,0 +1,48 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.DanceType;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserDanceComposer;
public class DanceCommand extends Command {
public DanceCommand() {
super("cmd_dance", Emulator.getTexts().getValue("commands.keys.cmd_dance").split(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
Habbo habbo = gameClient.getHabbo();
if (habbo == null || habbo.getHabboInfo().getCurrentRoom() == null) {
return true;
}
if (params.length == 2) {
int danceId;
try {
danceId = Integer.parseInt(params[1]);
} catch (NumberFormatException e) {
habbo.whisper(Emulator.getTexts().getValue("commands.error.cmd_dance.invalid_dance"), RoomChatMessageBubbles.ALERT);
return true;
}
if (danceId < 0 || danceId > 4) {
habbo.whisper(Emulator.getTexts().getValue("commands.error.cmd_dance.outside_bounds"), RoomChatMessageBubbles.ALERT);
return true;
}
habbo.getRoomUnit().setDanceType(DanceType.values()[danceId]);
habbo.getHabboInfo().getCurrentRoom().sendComposer(new RoomUserDanceComposer(habbo.getRoomUnit()).compose());
String danceName = danceId == 0 ? "stop" : "dance " + danceId;
habbo.whisper("You are now doing " + danceName + "!", RoomChatMessageBubbles.NORMAL);
} else {
habbo.whisper(Emulator.getTexts().getValue("commands.error.cmd_dance.usage"), RoomChatMessageBubbles.ALERT);
}
return true;
}
}
+1 -2
View File
@@ -7,7 +7,7 @@ and is developed for free by talented developers and is compatible with the foll
| ------------- | ------------- |
## Download ##
[Latest compiled version](https://git.camwijs.eu/duckietm/Arcturus-Morningstar-Extended/src/branch/main/Latest_Compiled_Version)
[Latest compiled version](https://github.com/duckietm/Arcturus-Morningstar-Extended/tree/main/Latest_Compiled_Version)
## Connection ##
Use the Websocket plugin!
@@ -81,7 +81,6 @@ The robust Plugin System included in the original Arcturus release is also inclu
- ArpyAge
- Mikkel
- Rodolfo
- Rasmus - for selling me the banners and height code
- Kitt Mustang
- Snaiker
- nttzx