mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 04:12:37 +01:00
Make invisible command toggleable
This commit is contained in:
parent
5aed82c72b
commit
2b02012ecd
@ -11,4 +11,6 @@ INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('scripter.modtool.ticket
|
||||
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('invisible.prevent.chat', '0');
|
||||
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('invisible.prevent.chat.error', 'While being invisible you cannot talk.');
|
||||
|
||||
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('commands.succes.cmd_invisible.updated.back', 'You are now visible again.');
|
||||
|
||||
#END DATABASE UPDATE: 2.0.0 RC-2 -> 2.0.0 RC-3
|
@ -2,8 +2,14 @@ package com.eu.habbo.habbohotel.commands;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUserRotation;
|
||||
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
||||
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserRemoveComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUsersComposer;
|
||||
|
||||
public class InvisibleCommand extends Command
|
||||
{
|
||||
@ -17,10 +23,30 @@ public class InvisibleCommand extends Command
|
||||
{
|
||||
RoomUnit roomUnit = gameClient.getHabbo().getRoomUnit();
|
||||
|
||||
if (roomUnit.isInvisible()) {
|
||||
RoomLayout roomLayout = roomUnit.getRoom().getLayout();
|
||||
|
||||
roomUnit.setLocation(roomLayout.getDoorTile());
|
||||
roomUnit.clearStatus();
|
||||
roomUnit.clearWalking();
|
||||
roomUnit.setBodyRotation(RoomUserRotation.values()[roomLayout.getDoorDirection()]);
|
||||
roomUnit.setHeadRotation(RoomUserRotation.values()[roomLayout.getDoorDirection()]);
|
||||
roomUnit.setInvisible(false);
|
||||
roomUnit.setInRoom(true);
|
||||
|
||||
roomUnit.getRoom().sendComposer(new RoomUsersComposer(gameClient.getHabbo()).compose());
|
||||
roomUnit.getRoom().sendComposer(new RoomUserStatusComposer(roomUnit).compose());
|
||||
|
||||
WiredHandler.handle(WiredTriggerType.ENTER_ROOM, roomUnit, roomUnit.getRoom(), null);
|
||||
roomUnit.getRoom().habboEntered(gameClient.getHabbo());
|
||||
|
||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated.back"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
roomUnit.setInvisible(true);
|
||||
|
||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated"));
|
||||
|
||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserRemoveComposer(roomUnit).compose());
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user