Added stand command from habbo.

This commit is contained in:
KrewsOrg 2020-03-13 17:00:48 +00:00
parent ce9aae174f
commit b11923452f
5 changed files with 32 additions and 0 deletions

View File

@ -1 +1,2 @@
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('commands.generic.cmd_commands.text', 'Your Commands');
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('commands.keys.cmd_stand', 'stand');

View File

@ -245,6 +245,7 @@ public class CommandHandler {
addCommand(new ShoutCommand());
addCommand(new ShutdownCommand());
addCommand(new SitCommand());
addCommand(new StandCommand());
addCommand(new SitDownCommand());
addCommand(new StaffAlertCommand());
addCommand(new StaffOnlineCommand());

View File

@ -0,0 +1,18 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public class StandCommand extends Command {
public StandCommand() {
super(null, Emulator.getTexts().getValue("commands.keys.cmd_stand").split(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
if (gameClient.getHabbo().getHabboInfo().getRiding() == null)
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeStand(gameClient.getHabbo());
return true;
}
}

View File

@ -3993,6 +3993,17 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
this.sendComposer(new RoomUserStatusComposer(habbo.getRoomUnit()).compose());
}
public void makeStand(Habbo habbo) {
if (habbo.getRoomUnit() == null) return;
HabboItem item = this.getTopItemAt(habbo.getRoomUnit().getX(), habbo.getRoomUnit().getY());
if (item == null || !item.getBaseItem().allowSit()) {
habbo.getRoomUnit().cmdStand = true;
habbo.getRoomUnit().setBodyRotation(RoomUserRotation.values()[habbo.getRoomUnit().getBodyRotation().getValue() - habbo.getRoomUnit().getBodyRotation().getValue() % 2]);
habbo.getRoomUnit().removeStatus(RoomUnitStatus.SIT);
this.sendComposer(new RoomUserStatusComposer(habbo.getRoomUnit()).compose());
}
}
public void giveEffect(Habbo habbo, int effectId, int duration) {
if (this.currentHabbos.containsKey(habbo.getHabboInfo().getId())) {
this.giveEffect(habbo.getRoomUnit(), effectId, duration);

View File

@ -38,6 +38,7 @@ public class RoomUnit {
public boolean animateWalk = false;
public boolean cmdTeleport = false;
public boolean cmdSit = false;
public boolean cmdStand = false;
public boolean cmdLay = false;
public boolean sitUpdate = false;
public boolean isTeleporting = false;