using System;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using System.Threading;
namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun
{
class
CutCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_cut"; }
}
public string Parameters
{
get { return "%username%"; }
}
public string Description
{
get { return "Chops another user"; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("You must enter a username!");
return;
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient == null)
{
Session.SendWhisper("That user cannot be found, maybe they're offline or not in the room.");
return;
}
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
if (User == null)
{
Session.SendWhisper("The user cannot be found, maybe they're offline or not in the room.");
return;
}
RoomUser Self = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == Self)
{
Session.SendWhisper("You can't Cut yourself!");
return;
}
RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (ThisUser == null)
return;
if (Math.Abs(User.X - ThisUser.X) < 2 && Math.Abs(User.Y - ThisUser.Y) < 2)
{
Room.SendMessage(new ShoutComposer(ThisUser.VirtualId, "*Chops " + TargetClient.GetHabbo().Username + "'s Head*", 0, ThisUser.LastBubble));
Room.SendMessage(new ChatComposer(User.VirtualId, "*Dead*", 0, User.LastBubble));
User.GetClient().SendWhisper("You're gonna respawn in 3 seconds!");
ThisUser.ApplyEffect(117);
User.ApplyEffect(93);
TargetClient.SendMessage(new FloodControlComposer(3));
if (User != null)
User.Frozen = true;
System.Threading.Thread thrd = new System.Threading.Thread(delegate ()
{
Thread.Sleep(4000);
if (User != null)
User.Frozen = false;
User.ApplyEffect(23);
Thread.Sleep(2000);
ThisUser.ApplyEffect(0);
User.ApplyEffect(0);
Room.SendMessage(new ChatComposer(User.VirtualId, "*Successfully Respawned*", 0, User.LastBubble));
});
thrd.Start();
}
else
{
Session.SendWhisper("That user is too far away, try getting closer.");
return;
}
}
}
}
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.Communication.Packets.Outgoing.Rooms.Avatar;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.Items;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using Plus.Communication.Packets.Outgoing.Inventory.Furni;
using Plus.Database.Interfaces;
namespace Plus.HabboHotel.Rooms.Chat.Commands.User
{
class AfkCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_afk"; }
}
public string Parameters
{
get { return ""; }
}
public string Description
{
get { return "Go AFK"; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
User.IsAsleep = true;
Room.SendMessage(new SleepComposer(User, true));
Room.SendMessage(new ChatComposer(User.VirtualId, "* " + Session.GetHabbo().Username + " is now AFK! *", 1, User.LastBubble));
}
}
}