public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (!Room.CheckRights(Session, true)) { Session.SendWhisper("Oops, only the owner of this room can run this command!"); return; } Room.GetGameMap().DiagonalEnabled = !Room.GetGameMap().DiagonalEnabled; Session.SendWhisper("Successfully updated the diagonal boolean value for this room."); }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) return; if (!Room.GetGameMap().ValidTile(User.X + 2, User.Y + 2) && !Room.GetGameMap().ValidTile(User.X + 1, User.Y + 1)) { Session.SendWhisper("Oops, cannot lay down here - try elsewhere!"); return; } if (User.Statusses.ContainsKey("sit") || User.isSitting || User.RidingHorse || User.IsWalking) return; if (Session.GetHabbo().Effects().CurrentEffect > 0) Session.GetHabbo().Effects().ApplyEffect(0); if (!User.Statusses.ContainsKey("lay")) { if ((User.RotBody % 2) == 0) { if (User == null) return; try { User.Statusses.Add("lay", "1.0 null"); User.Z -= 0.35; User.isLying = true; User.UpdateNeeded = true; } catch { } } else { User.RotBody--;// User.Statusses.Add("lay", "1.0 null"); User.Z -= 0.35; User.isLying = true; User.UpdateNeeded = true; } } else { User.Z += 0.35; User.Statusses.Remove("lay"); User.Statusses.Remove("1.0"); User.isLying = false; User.UpdateNeeded = true; } }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (ThisUser == null) return; Session.SendNotification("X: " + ThisUser.X + "\n - Y: " + ThisUser.Y + "\n - Z: " + ThisUser.Z + "\n - Rot: " + ThisUser.RotBody + ", sqState: " + Room.GetGameMap().GameMap[ThisUser.X, ThisUser.Y].ToString() + "\n\n - RoomID: " + Session.GetHabbo().CurrentRoomId); }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) return; User.TeleportEnabled = !User.TeleportEnabled; Room.GetGameMap().GenerateMaps(); }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (!Room.CheckRights(Session, true)) { Session.SendWhisper("Oops, only the owner of this room can run this command!"); return; } Room.GetGameMap().GenerateMaps(); Session.SendWhisper("Game map of this room successfully re-generated."); }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (Params.Length == 1) { Session.SendWhisper("Please enter the username of the user you wish to push."); return; } if (!Room.SPushEnabled && !Room.CheckRights(Session, true) && !Session.GetHabbo().GetPermissions().HasRight("room_override_custom_config")) { Session.SendWhisper("Oops, it appears that the room owner has disabled the ability to use the push command in here."); return; } GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]); if (TargetClient == null) { Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online."); return; } RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id); if (TargetUser == null) { Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online or in this room."); return; } if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username) { Session.SendWhisper("Come on, surely you don't want to push yourself!"); return; } if (TargetUser.TeleportEnabled) { Session.SendWhisper("Oops, you cannot push a user whilst they have their teleport mode enabled."); return; } RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (ThisUser == null) return; if (!((Math.Abs(TargetUser.X - ThisUser.X) >= 2) || (Math.Abs(TargetUser.Y - ThisUser.Y) >= 2))) { if (TargetUser.SetX - 1 == Room.GetGameMap().Model.DoorX || TargetUser.SetY - 1 == Room.GetGameMap().Model.DoorY) { Session.SendWhisper("Please don't push that user out of the room :(!"); return; } if (TargetUser.SetX - 2 == Room.GetGameMap().Model.DoorX || TargetUser.SetY - 2 == Room.GetGameMap().Model.DoorY) { Session.SendWhisper("Please don't push that user out of the room :(!"); return; } if (TargetUser.SetX - 3 == Room.GetGameMap().Model.DoorX || TargetUser.SetY - 3 == Room.GetGameMap().Model.DoorY) { Session.SendWhisper("Please don't push that user out of the room :(!"); return; } if (TargetUser.RotBody == 4) { TargetUser.MoveTo(TargetUser.X, TargetUser.Y + 3); } if (ThisUser.RotBody == 0) { TargetUser.MoveTo(TargetUser.X, TargetUser.Y - 3); } if (ThisUser.RotBody == 6) { TargetUser.MoveTo(TargetUser.X - 3, TargetUser.Y); } if (ThisUser.RotBody == 2) { TargetUser.MoveTo(TargetUser.X + 3, TargetUser.Y); } if (ThisUser.RotBody == 3) { TargetUser.MoveTo(TargetUser.X + 3, TargetUser.Y); TargetUser.MoveTo(TargetUser.X, TargetUser.Y + 3); } if (ThisUser.RotBody == 1) { TargetUser.MoveTo(TargetUser.X + 3, TargetUser.Y); TargetUser.MoveTo(TargetUser.X, TargetUser.Y - 3); } if (ThisUser.RotBody == 7) { TargetUser.MoveTo(TargetUser.X - 3, TargetUser.Y); TargetUser.MoveTo(TargetUser.X, TargetUser.Y - 3); } if (ThisUser.RotBody == 5) { TargetUser.MoveTo(TargetUser.X - 3, TargetUser.Y); TargetUser.MoveTo(TargetUser.X, TargetUser.Y + 3); } Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "*super pushes " + Params[1] + "*", 0, ThisUser.LastBubble)); } else { Session.SendWhisper("Oops, " + Params[1] + " is not close enough!"); } }
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (Params.Length == 1) { Session.SendWhisper("Please enter the username of the user you wish to pull."); return; } if (!Room.PullEnabled && !Session.GetHabbo().GetPermissions().HasRight("room_override_custom_config")) { Session.SendWhisper("Oops, it appears that the room owner has disabled the ability to use the pull command in here."); return; } GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]); if (TargetClient == null) { Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online."); return; } RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id); if (TargetUser == null) { Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online or in this room."); return; } if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username) { Session.SendWhisper("Come on, surely you don't want to push yourself!"); return; } if (TargetUser.TeleportEnabled) { Session.SendWhisper("Oops, you cannot push a user whilst they have their teleport mode enabled."); return; } RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (ThisUser == null) return; if (ThisUser.SetX - 1 == Room.GetGameMap().Model.DoorX) { Session.SendWhisper("Please don't pull that user out of the room :(!"); return; } string PushDirection = "down"; if (TargetClient.GetHabbo().CurrentRoomId == Session.GetHabbo().CurrentRoomId && (Math.Abs(ThisUser.X - TargetUser.X) < 3 && Math.Abs(ThisUser.Y - TargetUser.Y) < 3)) { Room.SendMessage(new ChatComposer(ThisUser.VirtualId, "*pulls " + Params[1] + " to them*", 0, ThisUser.LastBubble)); if (ThisUser.RotBody == 0) PushDirection = "up"; if (ThisUser.RotBody == 2) PushDirection = "right"; if (ThisUser.RotBody == 4) PushDirection = "down"; if (ThisUser.RotBody == 6) PushDirection = "left"; if (PushDirection == "up") TargetUser.MoveTo(ThisUser.X, ThisUser.Y - 1); if (PushDirection == "right") TargetUser.MoveTo(ThisUser.X + 1, ThisUser.Y); if (PushDirection == "down") TargetUser.MoveTo(ThisUser.X, ThisUser.Y + 1); if (PushDirection == "left") TargetUser.MoveTo(ThisUser.X - 1, ThisUser.Y); return; } else { Session.SendWhisper("That user is not close enough to you to be pulled, try getting closer!"); return; } }