Exemplo n.º 1
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && (@class.AllowPet || @class.CheckRights(Session, true)))
			{
				uint uint_ = Event.PopWiredUInt();
				Pet class2 = Session.GetHabbo().GetInventoryComponent().GetPet(uint_);
				if (class2 != null && !class2.PlacedInRoom)
				{
					int num = Event.PopWiredInt32();
					int num2 = Event.PopWiredInt32();
					if (@class.CanWalk(num, num2, 0.0, true, false))
					{
						if (@class.Int32_2 >= GlobalClass.MaxPetsPerRoom)
						{
							Session.SendNotif(TextManager.GetText("error_maxpets") + GlobalClass.MaxPetsPerRoom);
						}
						else
						{
							class2.PlacedInRoom = true;
							class2.RoomId = @class.RoomId;
							List<RandomSpeech> list = new List<RandomSpeech>();
							List<BotResponse> list2 = new List<BotResponse>();
							@class.method_4(new RoomBot(class2.PetId, class2.RoomId, AIType.Pet, "freeroam", class2.Name, "", class2.Look, num, num2, 0, 0, 0, 0, 0, 0, ref list, ref list2, 0), class2);
							if (@class.CheckRights(Session, true))
							{
								Session.GetHabbo().GetInventoryComponent().MovePetToRoom(class2.PetId, @class.RoomId);
							}
						}
					}
				}
			}
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().HasRole("acc_supporttool"))
			{
				uint Id = Event.PopWiredUInt();
				if (PhoenixEnvironment.GetGame().GetClientManager().GetNameById(Id) != "Unknown User")
				{
					Session.SendMessage(PhoenixEnvironment.GetGame().GetModerationTool().SerializeUserInfo(Id));
				}
				else
				{
					Session.SendNotif("Could not load user info, invalid user.");
				}
			}
		}
Exemplo n.º 3
0
 internal void GiveMassBadge(string pBadge)
 {
     for (int i = 0; i < this.Session.Length; i++)
     {
         GameClient Session = this.Session[i];
         if (Session != null && Session.GetHabbo() != null)
         {
             try
             {
                 Session.GetHabbo().GetBadgeComponent().GiveBadge(Session, pBadge, true);
                 Session.SendNotif("You just received a badge from hotel staff!");
             }
             catch { }
         }
     }
 }
Exemplo n.º 4
0
 internal void GiveCredits(int Amount)
 {
     for (int i = 0; i < this.Session.Length; i++)
     {
         GameClient Session = this.Session[i];
         if (Session != null && Session.GetHabbo() != null)
         {
             try
             {
                 Session.GetHabbo().Credits += Amount;
                 Session.GetHabbo().UpdateCreditsBalance(true);
                 Session.SendNotif("You just received " + Amount + " credits from staff!");
             }
             catch { }
         }
     }
 }
Exemplo n.º 5
0
 internal void GivePixels(int Amount, bool indb)
 {
     for (int i = 0; i < this.Session.Length; i++)
     {
         GameClient Session = this.Session[i];
         if (Session != null && Session.GetHabbo() != null)
         {
             try
             {
                 Session.GetHabbo().ActivityPoints += Amount;
                 Session.GetHabbo().UpdateActivityPointsBalance(indb);
                 Session.SendNotif("You just received " + Amount + " pixels from staff!");
             }
             catch { }
         }
     }
 }
Exemplo n.º 6
0
 internal void GivePoints(int Amount, bool UpdateDB)
 {
     for (int i = 0; i < this.Session.Length; i++)
     {
         GameClient Session = this.Session[i];
         if (Session != null && Session.GetHabbo() != null)
         {
             try
             {
                 Session.GetHabbo().shells += Amount;
                 Session.GetHabbo().UpdateShellsBalance(false, UpdateDB);
                 Session.SendNotif("You just received " + Amount + " points from staff!");
             }
             catch { }
         }
     }
 }
        public void parse(GameClient session, ClientMessage message)
        {
            int id = message.PopWiredInt32();
            int userid = message.PopWiredInt32();

            if (id <= 0 || userid <= 0)
                return;

            using (DatabaseClient dbclient = PhoenixEnvironment.GetDatabase().GetClient())
            {
                DataRow datarow = dbclient.ReadDataRow("SELECT id FROM friend_stream_likes WHERE friend_stream_id = '" + id + "' AND userid = '" + userid + "' LIMIT 1");

                if (datarow == null)
                {
                    dbclient.AddParamWithValue("fsi", id);
                    dbclient.AddParamWithValue("userid", userid);
                    dbclient.ExecuteQuery("INSERT INTO friend_stream_likes (friend_stream_id, userid) VALUES (@fsi, @userid)");
                }
                else
                {
                    session.SendNotif("You cant like twice!");
                }
            }
        }
Exemplo n.º 8
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			CatalogPage Page = PhoenixEnvironment.GetGame().GetCatalog().GetPage(Event.PopWiredInt32());
			if (Page != null && Page.Enabled && Page.Visible && Page.MinRank <= Session.GetHabbo().Rank)
			{
				if (Page.ClubOnly && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
				{
					Session.SendNotif("This page is for Phoenix Club members only!");
				}
				else
				{
					Session.SendMessage(Page.GetMessage);
					if (Page.Layout == "recycler")
					{
						ServerMessage Message = new ServerMessage(507);
						Message.AppendBoolean(true);
						Message.AppendBoolean(false);
						Session.SendMessage(Message);
					}
					else
					{
						if (Page.Layout == "club_buy")
						{
							ServerMessage Message2 = new ServerMessage(625);
							if (Session.GetHabbo().Vip)
							{
								Message2.AppendInt32(2);
								Message2.AppendInt32(4535);
								Message2.AppendStringWithBreak("HABBO_CLUB_VIP_1_MONTH");
								Message2.AppendInt32(25);
								Message2.AppendInt32(0);
								Message2.AppendInt32(1);
								Message2.AppendInt32(1);
								Message2.AppendInt32(101);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Year);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Month);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Day);
								Message2.AppendInt32(4536);
								Message2.AppendStringWithBreak("HABBO_CLUB_VIP_3_MONTHS");
								Message2.AppendInt32(60);
								Message2.AppendInt32(0);
								Message2.AppendInt32(1);
								Message2.AppendInt32(3);
								Message2.AppendInt32(163);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Year);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Month);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Day);
							}
							else
							{
								Message2.AppendInt32(4);
								Message2.AppendInt32(4533);
								Message2.AppendStringWithBreak("HABBO_CLUB_BASIC_1_MONTH");
								Message2.AppendInt32(15);
								Message2.AppendInt32(0);
								Message2.AppendInt32(0);
								Message2.AppendInt32(1);
								Message2.AppendInt32(31);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Year);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Month);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Day);
								Message2.AppendInt32(4534);
								Message2.AppendStringWithBreak("HABBO_CLUB_BASIC_3_MONTHS");
								Message2.AppendInt32(45);
								Message2.AppendInt32(0);
								Message2.AppendInt32(0);
								Message2.AppendInt32(3);
								Message2.AppendInt32(93);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Year);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Month);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Day);
								Message2.AppendInt32(4535);
								Message2.AppendStringWithBreak("HABBO_CLUB_VIP_1_MONTH");
								Message2.AppendInt32(25);
								Message2.AppendInt32(0);
								Message2.AppendInt32(1);
								Message2.AppendInt32(1);
								Message2.AppendInt32(101);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Year);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Month);
								Message2.AppendInt32(DateTime.Today.AddDays(30.0).Day);
								Message2.AppendInt32(4536);
								Message2.AppendStringWithBreak("HABBO_CLUB_VIP_3_MONTHS");
								Message2.AppendInt32(60);
								Message2.AppendInt32(0);
								Message2.AppendInt32(1);
								Message2.AppendInt32(3);
								Message2.AppendInt32(163);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Year);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Month);
								Message2.AppendInt32(DateTime.Today.AddDays(90.0).Day);
							}
							Session.SendMessage(Message2);
						}
					}
				}
			}
		}
Exemplo n.º 9
0
		public void DeliverItems(GameClient Session, Item Item, int int_0, string string_0, bool bool_0, uint uint_1)
		{
			string text = Item.Type.ToString();
			if (text != null)
			{
				if (text == "i" || text == "s")
				{
					int i = 0;
					while (i < int_0)
					{
						uint num;
						if (!bool_0 && uint_1 > 0u)
						{
							num = uint_1;
						}
						else
						{
							num = this.GenerateItemId();
						}
						text = Item.InteractionType.ToLower();
						if (text == null)
						{
							goto IL_4CF;
						}
						if (!(text == "pet"))
						{
							if (!(text == "teleport"))
							{
								if (!(text == "dimmer"))
								{
									goto IL_4CF;
								}
								using (DatabaseClient @class = PhoenixEnvironment.GetDatabase().GetClient())
								{
									@class.ExecuteQuery("INSERT INTO room_items_moodlight (item_id,enabled,current_preset,preset_one,preset_two,preset_three) VALUES ('" + num + "','0','1','#000000,255,0','#000000,255,0','#000000,255,0')");
								}
								Session.GetHabbo().GetInventoryComponent().AddItem(num, Item.ItemId, string_0, bool_0);
							}
							else
							{
								uint num2 = this.GenerateItemId();
								using (DatabaseClient @class = PhoenixEnvironment.GetDatabase().GetClient())
								{
									@class.ExecuteQuery(string.Concat(new object[]
									{
										"INSERT INTO tele_links (tele_one_id,tele_two_id) VALUES ('",
										num,
										"','",
										num2,
										"')"
									}));
									@class.ExecuteQuery(string.Concat(new object[]
									{
										"INSERT INTO tele_links (tele_one_id,tele_two_id) VALUES ('",
										num2,
										"','",
										num,
										"')"
									}));
								}
								Session.GetHabbo().GetInventoryComponent().AddItem(num2, Item.ItemId, "0", bool_0);
								Session.GetHabbo().GetInventoryComponent().AddItem(num, Item.ItemId, "0", bool_0);
							}
						}
						else
						{
							string[] array = string_0.Split(new char[]
							{
								'\n'
							});
							Pet class15_ = this.CreatePet(Session.GetHabbo().Id, array[0], Convert.ToInt32(Item.Name.Split(new char[]
							{
								't'
							})[1]), array[1], array[2]);
							Session.GetHabbo().GetInventoryComponent().AddPet(class15_);
							Session.GetHabbo().GetInventoryComponent().AddItem(num, 320u, "0", bool_0);
						}
						IL_4EA:
						ServerMessage Message = new ServerMessage(832u);
						Message.AppendInt32(1);
						if (Item.InteractionType.ToLower() == "pet")
						{
							Message.AppendInt32(3);
						}
						else
						{
							if (Item.Type.ToString() == "i")
							{
								Message.AppendInt32(2);
							}
							else
							{
								Message.AppendInt32(1);
							}
						}
						Message.AppendInt32(1);
						Message.AppendUInt(num);
						Session.SendMessage(Message);
						i++;
						continue;
						IL_4CF:
						Session.GetHabbo().GetInventoryComponent().AddItem(num, Item.ItemId, string_0, bool_0);
						goto IL_4EA;
					}
					Session.GetHabbo().GetInventoryComponent().UpdateItems(false);
					return;
				}
				if (text == "e")
				{
					for (int i = 0; i < int_0; i++)
					{
						Session.GetHabbo().GetAvatarEffectsInventoryComponent().AddEffect(Item.SpriteId, 3600);
					}
					return;
				}
				if (text == "h")
				{
					for (int i = 0; i < int_0; i++)
					{
						Session.GetHabbo().GetSubscriptionManager().AddOrExtendSubscription("habbo_club", 2678400);
					}
					if (!Session.GetHabbo().GetBadgeComponent().HasBadge("HC1"))
					{
						Session.GetHabbo().GetBadgeComponent().GiveBadge(Session, "HC1", true);
					}
					ServerMessage Message2 = new ServerMessage(7u);
					Message2.AppendStringWithBreak("habbo_club");
					if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
					{
						double num3 = (double)Session.GetHabbo().GetSubscriptionManager().GetSubscription("habbo_club").ExpireTime;
						double num4 = num3 - PhoenixEnvironment.GetUnixTimestamp();
						int num5 = (int)Math.Ceiling(num4 / 86400.0);
						int num6 = num5 / 31;
						if (num6 >= 1)
						{
							num6--;
						}
						Message2.AppendInt32(num5 - num6 * 31);
						Message2.AppendBoolean(true);
						Message2.AppendInt32(num6);
					}
					else
					{
						for (int i = 0; i < 3; i++)
						{
							Message2.AppendInt32(0);
						}
					}
					Session.SendMessage(Message2);
					ServerMessage Message3 = new ServerMessage(2u);
					if (Session.GetHabbo().Vip || GlobalClass.VIPclothesforHCusers)
					{
						Message3.AppendInt32(2);
					}
					else
					{
						if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
						{
							Message3.AppendInt32(1);
						}
						else
						{
							Message3.AppendInt32(0);
						}
					}
					if (Session.GetHabbo().HasRole("acc_anyroomowner"))
					{
						Message3.AppendInt32(7);
					}
					else
					{
						if (Session.GetHabbo().HasRole("acc_anyroomrights"))
						{
							Message3.AppendInt32(5);
						}
						else
						{
							if (Session.GetHabbo().HasRole("acc_supporttool"))
							{
								Message3.AppendInt32(4);
							}
							else
							{
								if (Session.GetHabbo().Vip || GlobalClass.VIPclothesforHCusers || Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
								{
									Message3.AppendInt32(2);
								}
								else
								{
									Message3.AppendInt32(0);
								}
							}
						}
					}
					Session.SendMessage(Message3);
					return;
				}
			}
			Session.SendNotif("Something went wrong! The item type could not be processed. Please do not try to buy this item anymore, instead inform support as soon as possible.");
		}
Exemplo n.º 10
0
		public void RedeemCredits(GameClient Session)
		{
			int num = 0;
			List<UserItem> list = new List<UserItem>();
			foreach (UserItem current in this.InventoryItems)
			{
				if (current != null && (current.GetBaseItem().Name.StartsWith("CF_") || current.GetBaseItem().Name.StartsWith("CFC_")))
				{
					string[] array = current.GetBaseItem().Name.Split(new char[]
					{
						'_'
					});
					int num2 = int.Parse(array[1]);
					if (!this.mRemovedItems.Contains(current.Id))
					{
						if (num2 > 0)
						{
							num += num2;
						}
						list.Add(current);
					}
				}
			}
			foreach (UserItem current in list)
			{
				this.RemoveItem(current.Id, 0, false);
			}
			Session.GetHabbo().Credits += num;
			Session.GetHabbo().UpdateCreditsBalance(true);
			Session.SendNotif("All coins in your inventory have been converted back into " + num + " credits!");
		}
Exemplo n.º 11
0
 internal void method_20(GameClient Session)
 {
     int num1 = 0;
     List<UserItem> list = new List<UserItem>();
     foreach (UserItem userItem in this.InventoryItems)
     {
         if (userItem != null && userItem.GetBaseItem().Name.StartsWith("PixEx_"))
         {
             int num2 = int.Parse(userItem.GetBaseItem().Name.Split(new char[1]
             {
                 '_'
             })[1]);
             if (!this.mRemovedItems.Contains(userItem.Id))
             {
                 if (num2 > 0)
                     num1 += num2;
                 list.Add(userItem);
             }
         }    
     }      
     foreach (UserItem userItem in list)
     this.RemoveItem(userItem.Id, 0, false);
     Session.GetHabbo().ActivityPoints += num1;
     Session.GetHabbo().UpdateActivityPointsBalance(true);
     Session.SendNotif("All pixels ingots in your inventory were in " + num1 + " Pixel converted!");
 }
Exemplo n.º 12
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && @class.CheckRights(Session) && (GlobalClass.AllowFriendlyFurni || !(@class.Owner != Session.GetHabbo().Username)))
			{
				string text = Event.PopFixedString();
				string[] array = text.Split(new char[]
				{
					' '
				});
				if (array[0].Contains("-"))
				{
					array[0] = array[0].Replace("-", "");
				}
				uint uint_ = 0u;
				try
				{
					uint_ = uint.Parse(array[0]);
				}
				catch
				{
					return;
				}
				UserItem class2 = Session.GetHabbo().GetInventoryComponent().GetItem(uint_);
				if (class2 != null)
				{
					string text2 = class2.GetBaseItem().InteractionType.ToLower();
					if (text2 != null && text2 == "dimmer" && @class.method_72("dimmer") >= 1)
					{
						Session.SendNotif("You can only have one moodlight in a room.");
					}
                    else if (text2 != null && text2 == "jukebox" && @class.method_72("jukebox") >= 1)
                    {
                        Session.SendNotif("You can only have one jukebox in a room.");
                    }
					else
					{
						RoomItem RoomItem_;
						if (array[1].StartsWith(":"))
						{
							string text3 = @class.method_98(":" + text.Split(new char[]
							{
								':'
							})[1]);
							if (text3 == null)
							{
								ServerMessage Message = new ServerMessage(516u);
								Message.AppendInt32(11);
								Session.SendMessage(Message);
								return;
							}
							RoomItem_ = new RoomItem(class2.Id, @class.RoomId, class2.BaseItem, class2.ExtraData, 0, 0, 0.0, 0, text3, @class);
							if ([email protected]_82(Session, RoomItem_, true, null))
							{
								goto IL_32C;
							}
							Session.GetHabbo().GetInventoryComponent().RemoveItem(uint_, 1u, false);
							using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
							{
								class3.ExecuteQuery(string.Concat(new object[]
								{
									"UPDATE items SET room_id = '",
									@class.RoomId,
									"' WHERE Id = '",
									class2.Id,
									"' LIMIT 1"
								}));
								goto IL_32C;
							}
						}
						int int_ = int.Parse(array[1]);
						int int_2 = int.Parse(array[2]);
						int int_3 = int.Parse(array[3]);
						RoomItem_ = new RoomItem(class2.Id, @class.RoomId, class2.BaseItem, class2.ExtraData, 0, 0, 0.0, 0, "", @class);
						if (@class.method_79(Session, RoomItem_, int_, int_2, int_3, true, false, false))
						{
							Session.GetHabbo().GetInventoryComponent().RemoveItem(uint_, 1u, false);
							using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
							{
								class3.ExecuteQuery(string.Concat(new object[]
								{
									"UPDATE items SET room_id = '",
									@class.RoomId,
									"' WHERE Id = '",
									class2.Id,
									"' LIMIT 1"
								}));
							}
						}
						IL_32C:
						if (Session.GetHabbo().CurrentQuestId == 14u)
						{
							PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(14u, Session);
						}
					}
				}
			}
		}
Exemplo n.º 13
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			Room room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (room != null && Session != null)
			{
				if (Session.GetHabbo().Muted)
				{
					Session.SendNotif(TextManager.GetText("error_muted"));
				}
				else
				{
					if (Session.GetHabbo().HasRole("ignore_roommute") || !room.RoomMuted)
					{
						string str = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString());
						string name = str.Split(new char[]
						{
							' '
						})[0];
						string s = str.Substring(name.Length + 1);
						s = ChatCommandHandler.ApplyWordFilter(s);
						RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id);
						RoomUser user2 = room.GetRoomUserByHabbo(name);
						if (Session.GetHabbo().MaxFloodTime() > 0)
						{
							TimeSpan timeSpan = DateTime.Now - Session.GetHabbo().FloodTime;
							if (timeSpan.Seconds > 4)
							{
								Session.GetHabbo().FloodCount = 0;
							}
							if (timeSpan.Seconds < 4 && Session.GetHabbo().FloodCount > 5 && !roomUserByHabbo.IsBot)
							{
								ServerMessage Message = new ServerMessage(27);
								Message.AppendInt32(Session.GetHabbo().MaxFloodTime());
								Session.SendMessage(Message);
								Session.GetHabbo().Muted = true;
								Session.GetHabbo().MuteLength = Session.GetHabbo().MaxFloodTime();
								return;
							}
							Session.GetHabbo().FloodTime = DateTime.Now;
							Session.GetHabbo().FloodCount++;
						}
						ServerMessage Message2 = new ServerMessage(25);
						Message2.AppendInt32(roomUserByHabbo.VirtualId);
						Message2.AppendStringWithBreak(s);
						Message2.AppendBoolean(false);
						if (roomUserByHabbo != null && !roomUserByHabbo.IsBot)
						{
							roomUserByHabbo.GetClient().SendMessage(Message2);
						}
						roomUserByHabbo.Unidle();
						if (user2 != null && !user2.IsBot && (user2.GetClient().GetHabbo().MutedUsers.Count <= 0 || !user2.GetClient().GetHabbo().MutedUsers.Contains(Session.GetHabbo().Id)))
						{
							user2.GetClient().SendMessage(Message2);
							if (GlobalClass.RecordChatlogs && !Session.GetHabbo().isAaron)
							{
								using (DatabaseClient client = PhoenixEnvironment.GetDatabase().GetClient())
								{
									client.AddParamWithValue("message", "<Whisper to " + user2.GetClient().GetHabbo().Username + ">: " + s);
									client.ExecuteQuery(string.Concat(new object[]
									{
										"INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('",
										Session.GetHabbo().Id,
										"','",
										room.RoomId,
										"','",
										DateTime.Now.Hour,
										"','",
										DateTime.Now.Minute,
										"',UNIX_TIMESTAMP(),@message,'",
										Session.GetHabbo().Username,
										"','",
										DateTime.Now.ToLongDateString(),
										"')"
									}));
								}
							}
						}
					}
				}
			}
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
			if (@class != null && @class.CheckRights(Session, true))
			{
				Event.PopWiredInt32();
				string text = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString());
				string text2 = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString());
				if (text2.Length > 255)
				{
					text2 = text2.Substring(0, 255);
				}
				int num = Event.PopWiredInt32();
				string text3 = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString());
				int num2 = Event.PopWiredInt32();
				int num3 = Event.PopWiredInt32();
				int num4 = Event.PopWiredInt32();
				List<string> list = new List<string>();
				StringBuilder stringBuilder = new StringBuilder();
				for (int i = 0; i < num4; i++)
				{
					if (i > 0)
					{
						stringBuilder.Append(",");
					}
					string text4 = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString().ToLower());
					if (text4 == ChatCommandHandler.ApplyWordFilter(text4))
					{
						list.Add(text4);
						stringBuilder.Append(text4);
					}
				}
				if (stringBuilder.Length > 100)
				{
					stringBuilder.Clear();
					stringBuilder.Append("");
				}
				int num5 = 0;
				int num6 = 0;
				int num7 = 0;
				int num8 = 0;
				string a = Event.PlainReadBytes(1)[0].ToString();
				Event.AdvancePointer(1);
				string a2 = Event.PlainReadBytes(1)[0].ToString();
				Event.AdvancePointer(1);
				string a3 = Event.PlainReadBytes(1)[0].ToString();
				Event.AdvancePointer(1);
				string a4 = Event.PlainReadBytes(1)[0].ToString();
				Event.AdvancePointer(1);
				int num9 = Event.PopWiredInt32();
				int num10 = Event.PopWiredInt32();
				if (!(text != ChatCommandHandler.ApplyWordFilter(text)) && !(text2 != ChatCommandHandler.ApplyWordFilter(text2)) && text.Length >= 1 && (num9 >= -2 && num9 <= 1 && num10 >= -2 && num10 <= 1))
				{
					@class.Wallthick = num9;
					@class.Floorthick = num10;
					if (num >= 0 && num <= 2 && (num2 == 10 || num2 == 15 || num2 == 20 || num2 == 25 || num2 == 30 || num2 == 35 || num2 == 40 || num2 == 45 || num2 == 50 || num2 == 55 || num2 == 60 || num2 == 65 || num2 == 70 || num2 == 75 || num2 == 80 || num2 == 85 || num2 == 90 || num2 == 95 || num2 == 100))
					{
						FlatCat class2 = PhoenixEnvironment.GetGame().GetNavigator().GetFlatCat(num3);
						if (class2 != null)
						{
							if ((long)class2.MinRank > (long)((ulong)Session.GetHabbo().Rank))
							{
								Session.SendNotif("You are not allowed to use this category. Your room has been moved to no category instead.");
								num3 = 0;
							}
							if (num4 <= 2)
							{
								if (a == "65")
								{
									num5 = 1;
									@class.AllowPet = true;
								}
								else
								{
									@class.AllowPet = false;
								}
								if (a2 == "65")
								{
									num6 = 1;
									@class.AllowPetsEating = true;
								}
								else
								{
									@class.AllowPetsEating = false;
								}
								if (a3 == "65")
								{
									num7 = 1;
									@class.AllowWalkthrough = true;
								}
								else
								{
									@class.AllowWalkthrough = false;
								}
								@class.GenerateMaps();
								if (a4 == "65")
								{
									num8 = 1;
									@class.Hidewall = true;
								}
								else
								{
									@class.Hidewall = false;
								}
								@class.Name = text;
								@class.State = num;
								@class.Description = text2;
								@class.Category = num3;
								if (text3 != "")
								{
									@class.Password = text3;
								}
								@class.Tags = list;
								@class.UsersMax = num2;
								string text5 = "open";
								if (@class.State == 1)
								{
									text5 = "locked";
								}
								else
								{
									if (@class.State > 1)
									{
										text5 = "password";
									}
								}
								using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
								{
									class3.AddParamWithValue("caption", @class.Name);
									class3.AddParamWithValue("description", @class.Description);
									class3.AddParamWithValue("password", @class.Password);
									class3.AddParamWithValue("tags", stringBuilder.ToString());
									class3.ExecuteQuery(string.Concat(new object[]
									{
										"UPDATE rooms SET caption = @caption, description = @description, password = @password, category = '",
										num3,
										"', state = '",
										text5,
										"', tags = @tags, users_max = '",
										num2,
										"', allow_pets = '",
										num5,
										"', allow_pets_eat = '",
										num6,
										"', allow_walkthrough = '",
										num7,
										"', allow_hidewall = '",
										num8,
										"', wallthick = '",
										num9,
										"', floorthick = '",
										num10,
										"'  WHERE Id = '",
										@class.RoomId,
										"' LIMIT 1;"
									}));
								}
								ServerMessage Message = new ServerMessage(467u);
								Message.AppendUInt(@class.RoomId);
								Session.SendMessage(Message);
								ServerMessage Message2 = new ServerMessage(456u);
								Message2.AppendUInt(@class.RoomId);
								Session.SendMessage(Message2);
								ServerMessage Message3 = new ServerMessage(472u);
								Message3.AppendBoolean(@class.Hidewall);
								Message3.AppendInt32(@class.Wallthick);
								Message3.AppendInt32(@class.Floorthick);
								@class.SendMessage(Message3, null);
								ServerMessage Message4 = new ServerMessage(473u);
								Message4.AppendBoolean(true);
								Message4.AppendBoolean(true);
								@class.SendMessage(Message4, null);
                                RoomData class27_ = @class.RoomData;
								ServerMessage Message5 = new ServerMessage(454u);
								Message5.AppendBoolean(false);
								class27_.Serialize(Message5, false, false);
								Session.SendMessage(Message5);
							}
						}
					}
				}
			}
		}
		public void parse(GameClient Session, ClientMessage Event)
		{
			if (Session.GetHabbo().LoadingRoom > 0u && Session.GetHabbo().LoadingChecksPassed)
			{
                RoomData @class = PhoenixEnvironment.GetGame().GetRoomManager().GenerateRoomData(Session.GetHabbo().LoadingRoom);
				if (@class != null)
				{
					if (@class.Model == null)
					{
						Session.SendNotif("Error loading room, please try again soon! (Error Code: MdlData)");
						Session.SendMessage(new ServerMessage(18u));
						Session.GetMessageHandler().ClearRoomLoading();
					}
					else
					{
						Session.SendMessage(@class.Model.method_1());
						Session.SendMessage(@class.Model.method_2());
						Room class2 = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().LoadingRoom);
						if (class2 != null)
						{
							Session.GetMessageHandler().ClearRoomLoading();
							ServerMessage Message = new ServerMessage(30u);
							if (class2.Model.StaticFurniMap != "")
							{
								Message.AppendStringWithBreak(class2.Model.StaticFurniMap);
							}
							else
							{
								Message.AppendInt32(0);
							}
							Session.SendMessage(Message);
							if (class2.Type == "private")
							{
								Hashtable hashtable_ = class2.Hashtable_0;
								Hashtable hashtable_2 = class2.Hashtable_1;
								ServerMessage Message2 = new ServerMessage(32u);
								Message2.AppendInt32(hashtable_.Count);
								foreach (RoomItem class3 in hashtable_.Values)
								{
									class3.Serialize(Message2);
								}
								Session.SendMessage(Message2);
								ServerMessage Message3 = new ServerMessage(45u);
								Message3.AppendInt32(hashtable_2.Count);
								foreach (RoomItem class3 in hashtable_2.Values)
								{
									class3.Serialize(Message3);
								}
								Session.SendMessage(Message3);
							}
							class2.method_46(Session, Session.GetHabbo().SpectatorMode);
							List<RoomUser> list = new List<RoomUser>();
							for (int i = 0; i < class2.UserList.Length; i++)
							{
								RoomUser class4 = class2.UserList[i];
								if (class4 != null && (!class4.IsSpectator && class4.Visible))
								{
									list.Add(class4);
								}
							}
							ServerMessage Message4 = new ServerMessage(28u);
							Message4.AppendInt32(list.Count);
							foreach (RoomUser class4 in list)
							{
								class4.Serialize(Message4);
							}
							Session.SendMessage(Message4);
							ServerMessage Message5 = new ServerMessage(472u);
							Message5.AppendBoolean(class2.Hidewall);
							Message5.AppendInt32(class2.Wallthick);
							Message5.AppendInt32(class2.Floorthick);
							Session.SendMessage(Message5);
							if (class2.Type == "public")
							{
								ServerMessage Message6 = new ServerMessage(471u);
								Message6.AppendBoolean(false);
								Message6.AppendStringWithBreak(class2.ModelName);
								Message6.AppendBoolean(false);
								Session.SendMessage(Message6);
							}
							else
							{
								if (class2.Type == "private")
								{
									ServerMessage Message6 = new ServerMessage(471u);
									Message6.AppendBoolean(true);
									Message6.AppendUInt(class2.RoomId);
									if (class2.CheckRights(Session, true))
									{
										Message6.AppendBoolean(true);
									}
									else
									{
										Message6.AppendBoolean(false);
									}
									Session.SendMessage(Message6);
									ServerMessage Message7 = new ServerMessage(454u);
									Message7.AppendBoolean(false);
									@class.Serialize(Message7, false, false);
									Session.SendMessage(Message7);
								}
							}
							ServerMessage Message8 = class2.method_67(true);
							if (Message8 != null)
							{
								Session.SendMessage(Message8);
							}
							for (int i = 0; i < class2.UserList.Length; i++)
							{
								RoomUser class4 = class2.UserList[i];
								if (class4 != null && !class4.IsSpectator)
								{
									if (class4.IsDancing)
									{
										ServerMessage Message9 = new ServerMessage(480u);
										Message9.AppendInt32(class4.VirtualId);
										Message9.AppendInt32(class4.DanceId);
										Session.SendMessage(Message9);
									}
									if (class4.IsAsleep)
									{
										ServerMessage Message10 = new ServerMessage(486u);
										Message10.AppendInt32(class4.VirtualId);
										Message10.AppendBoolean(true);
										Session.SendMessage(Message10);
									}
									if (class4.CarryItemID > 0 && class4.CarryTimer > 0)
									{
										ServerMessage Message11 = new ServerMessage(482u);
										Message11.AppendInt32(class4.VirtualId);
										Message11.AppendInt32(class4.CarryItemID);
										Session.SendMessage(Message11);
									}
									if (!class4.IsBot)
									{
										try
										{
											if (class4.GetClient().GetHabbo() != null && class4.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent() != null && class4.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().CurrentEffect >= 1)
											{
												ServerMessage Message12 = new ServerMessage(485u);
												Message12.AppendInt32(class4.VirtualId);
												Message12.AppendInt32(class4.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().CurrentEffect);
												Session.SendMessage(Message12);
											}
											goto IL_5C5;
										}
										catch
										{
											goto IL_5C5;
										}
									}
									if (!class4.IsPet && class4.BotData.EffectId != 0)
									{
										ServerMessage Message12 = new ServerMessage(485u);
										Message12.AppendInt32(class4.VirtualId);
										Message12.AppendInt32(class4.BotData.EffectId);
										Session.SendMessage(Message12);
									}
								}
								IL_5C5:;
							}
							if (class2 != null && Session != null && Session.GetHabbo().CurrentRoom != null)
							{
								class2.method_8(Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id));
							}
							if (class2.Achievement > 0u)
							{
								PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, class2.Achievement, 1);
							}
							if (Session.GetHabbo().Muted && Session.GetHabbo().MuteLength > 0)
							{
								ServerMessage Message13 = new ServerMessage(27u);
								Message13.AppendInt32(Session.GetHabbo().MuteLength);
								Session.SendMessage(Message13);
							}
						}
					}
				}
			}
		}
Exemplo n.º 16
0
        public void KickUser(GameClient ModSession, uint UserId, string Message, bool Soft)
        {
            GameClient Client = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(UserId);
            if (Client == null || Client.GetHabbo().CurrentRoomId < 1 || Client.GetHabbo().Id == ModSession.GetHabbo().Id)
            {
                return;
            }
            if (Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
            {
                ModSession.SendNotif(TextManager.GetText("mod_error_permission_kick"));
            }

            Room Room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Client.GetHabbo().CurrentRoomId);

            if (Room != null)
            {
                Room.RemoveUserFromRoom(Client, true, false);
                if (!Soft)
                {
                    Client.SendNotif(Message);
                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        adapter.ExecuteQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = '" + UserId + "' LIMIT 1");
                    }
                }
            }
        }
Exemplo n.º 17
0
		public void AlertUser(GameClient ModSession, uint UserId, string Message, bool Caution)
		{
			GameClient Client = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(UserId);

			if (Client != null && Client.GetHabbo().Id != ModSession.GetHabbo().Id)
			{
				if (Caution && Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
				{
					ModSession.SendNotif(TextManager.GetText("mod_error_permission_caution"));
					Caution = false;
				}
				Client.SendNotif(Message, 0);
				if (Caution)
				{
					using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
					{
						adapter.ExecuteQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = '" + UserId + "' LIMIT 1");
					}
				}
			}
		}
Exemplo n.º 18
0
 public void method_21(GameClient Session)
 {
     int num1 = 0;
     List<UserItem> list = new List<UserItem>();
     foreach (UserItem userItem in this.InventoryItems)
     {
         if (userItem != null && userItem.GetBaseItem().Name.StartsWith("PntEx_"))
         {
             int num2 = int.Parse(userItem.GetBaseItem().Name.Split(new char[1]
             {
                 '_'
             })[1]);
             if (!this.mRemovedItems.Contains(userItem.Id))
             {
                 if (num2 > 0)
                     num1 += num2;
                 list.Add(userItem);
             }
         }
     }
     foreach (UserItem userItem in list)
         this.RemoveItem(userItem.Id, 0, false);
     Session.GetHabbo().shells += num1;
     Session.GetHabbo().UpdateShellsBalance(false, true);
     Session.SendNotif("All mussel bars in your inventory were in " + num1 + " Mussels converted!");
 }
Exemplo n.º 19
0
		public void BanUser(GameClient ModSession, uint UserId, int Length, string Message)
		{
			GameClient Client = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(UserId);

			if (Client != null && Client.GetHabbo().Id != ModSession.GetHabbo().Id)
			{
				if (Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
				{
					ModSession.SendNotif(TextManager.GetText("mod_error_permission_ban"));
				}
				else
				{
					Double dLength = Length;
					PhoenixEnvironment.GetGame().GetBanManager().BanUser(Client, ModSession.GetHabbo().Username, dLength, Message, false);
				}
			}
		}
Exemplo n.º 20
0
        public RoomData CreateRoom(GameClient Session, string Name, string Model)
        {
            Name = PhoenixEnvironment.FilterInjectionChars(Name);

            if (!this.Models.ContainsKey(Model))
            {
                Session.SendNotif("Sorry, this room model has not been added yet. Try again later.");
                return null;
            }
            else if (Models[Model].ClubOnly && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip"))
            {
                Session.SendNotif("You must be an Phoenix Club member to use that room layout.");
                return null;
            }
            else if (Name.Length < 3)
            {
                Session.SendNotif("Room name is too short for room creation!");
                return null;
            }
            else
            {
                uint RoomId = 0;
                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                {
                    adapter.AddParamWithValue("caption", Name);
                    adapter.AddParamWithValue("model", Model);
                    adapter.AddParamWithValue("username", Session.GetHabbo().Username);
                    adapter.ExecuteQuery("INSERT INTO rooms (roomtype,caption,owner,model_name) VALUES ('private',@caption,@username,@model)");
                    Session.GetHabbo().GetHabboData.GetUsersRooms = adapter.ReadDataTable("SELECT * FROM rooms WHERE owner = @username ORDER BY Id ASC");
                    RoomId = (uint)adapter.ReadDataRow("SELECT Id FROM rooms WHERE owner = @username AND caption = @caption ORDER BY Id DESC")[0];
                    Session.GetHabbo().UpdateRooms(adapter);
                }
                return this.GenerateRoomData(RoomId);
            }
        }
Exemplo n.º 21
0
		public void parse(GameClient Session, ClientMessage Event)
		{
			uint ItemId = Event.PopWiredUInt();
			DataRow Row = null;
			using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
			{
				Row = adapter.ReadDataRow("SELECT state, timestamp, total_price, extra_data, item_id, furni_id FROM catalog_marketplace_offers WHERE offer_id = '" + ItemId + "' LIMIT 1");
			}
			if (Row == null || (string)Row["state"] != "1" || (double)Row["timestamp"] <= PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().FormatTimestamp())
			{
				Session.SendNotif(TextManager.GetText("marketplace_error_expired"));
			}
			else
			{
				Item Item = PhoenixEnvironment.GetGame().GetItemManager().GetItem((uint)Row["item_id"]);
				if (Item != null)
				{
					if ((int)Row["total_price"] >= 1)
					{
						if (Session.GetHabbo().Credits < (int)Row["total_price"])
						{
							Session.SendNotif(TextManager.GetText("marketplace_error_credits"));
							return;
						}
						Session.GetHabbo().Credits -= (int)Row["total_price"];
						Session.GetHabbo().UpdateCreditsBalance(true);
					}
					PhoenixEnvironment.GetGame().GetCatalog().DeliverItems(Session, Item, 1, (string)Row["extra_data"], false, (uint)Row["furni_id"]);
					using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
					{
						adapter.ExecuteQuery("UPDATE catalog_marketplace_offers SET state = '2' WHERE offer_id = '" + ItemId + "' LIMIT 1");
						int num2 = 0;
						try
						{
							num2 = adapter.ReadInt32("SELECT Id FROM catalog_marketplace_data WHERE daysago = 0 AND sprite = " + Item.SpriteId + " LIMIT 1;");
						}
						catch
						{
						}
						if (num2 > 0)
						{
							adapter.ExecuteQuery(string.Concat(new object[]
							{
								"UPDATE catalog_marketplace_data SET sold = sold + 1, avgprice = (avgprice + ",
								(int)Row["total_price"],
								") WHERE Id = ",
								num2,
								" LIMIT 1;"
							}));
						}
						else
						{
							adapter.ExecuteQuery(string.Concat(new object[]
							{
								"INSERT INTO catalog_marketplace_data (sprite, sold, avgprice, daysago) VALUES ('",
								Item.SpriteId,
								"', 1, ",
								(int)Row["total_price"],
								", 0)"
							}));
						}
						if (PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketAverages.ContainsKey(Item.SpriteId) && PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketCounts.ContainsKey(Item.SpriteId))
						{
							int num3 = PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketCounts[Item.SpriteId];
							int num4 = PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketAverages[Item.SpriteId];
							num4 += (int)Row["total_price"];
							PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketAverages.Remove(Item.SpriteId);
							PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketAverages.Add(Item.SpriteId, num4);
							PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketCounts.Remove(Item.SpriteId);
							PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketCounts.Add(Item.SpriteId, num3 + 1);
						}
						else
						{
							if (!PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketAverages.ContainsKey(Item.SpriteId))
							{
								PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketAverages.Add(Item.SpriteId, (int)Row["total_price"]);
							}
							if (!PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketCounts.ContainsKey(Item.SpriteId))
							{
								PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().MarketCounts.Add(Item.SpriteId, 1);
							}
						}
					}
					ServerMessage Message = new ServerMessage(67);
					Message.AppendUInt(Item.ItemId);
					Message.AppendStringWithBreak(Item.Name);
					Message.AppendInt32((int)Row["total_price"]);
					Message.AppendInt32(0);
					Message.AppendInt32(0);
					Message.AppendInt32(1);
					Message.AppendStringWithBreak(Item.Type.ToString());
					Message.AppendInt32(Item.SpriteId);
					Message.AppendStringWithBreak("");
					Message.AppendInt32(1);
					Message.AppendInt32(-1);
					Message.AppendStringWithBreak("");
					Session.SendMessage(Message);
					Session.SendMessage(PhoenixEnvironment.GetGame().GetCatalog().GetMarketplace().SerializeOffersNew(-1, -1, "", 1));
				}
			}
		}
Exemplo n.º 22
0
        internal static Boolean Parse(GameClient Session, string Input)
        {
            string[] Params = Input.Split(' ');

            string TargetUser = null;
            GameClient TargetClient = null;
            Room TargetRoom = null;
            RoomUser TargetRoomUser = null;
            Habbo TargetHabbo = null;
            if (!PhoenixEnvironment.GetGame().GetRoleManager().CommandsList.ContainsKey(Params[0]))
            {
                return false;
            }
            else
            {
                try
                {
                    int num;
                    if (TargetRoom != null && TargetRoom.CheckRights(Session, true))
                    {
                        num = PhoenixEnvironment.GetGame().GetRoleManager().CommandsList[Params[0]];
                        if (num <= 33)
                        {
                            if (num == 8)
                            {
                                TargetRoom = Session.GetHabbo().CurrentRoom;
                                if (TargetRoom.bool_5)
                                {
                                    TargetRoom.bool_5 = false;
                                }
                                else
                                {
                                    TargetRoom.bool_5 = true;
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (num == 33)
                            {
                                TargetRoom = Session.GetHabbo().CurrentRoom;
                                if (TargetRoom != null && TargetRoom.CheckRights(Session, true))
                                {
                                    List<RoomItem> list = TargetRoom.RemoveAllFurniture(Session);
                                    Session.GetHabbo().GetInventoryComponent().AddItemArray(list);
                                    Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
                                    PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input + " " + Session.GetHabbo().CurrentRoomId);
                                    return true;
                                }
                                return false;
                            }
                        }
                        else
                        {
                            if (num == 46)
                            {
                                TargetRoom = Session.GetHabbo().CurrentRoom;
                                try
                                {
                                    int num2 = int.Parse(Params[1]);
                                    if (Session.GetHabbo().Rank >= 6)
                                    {
                                        TargetRoom.UsersMax = num2;
                                    }
                                    else
                                    {
                                        if (num2 > 100 || num2 < 5)
                                        {
                                            Session.SendNotif("ERROR: Use a number between 5 and 100");
                                        }
                                        else
                                        {
                                            TargetRoom.UsersMax = num2;
                                        }
                                    }
                                }
                                catch
                                {
                                    return false;
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (num == 53)
                            {
                                TargetRoom = Session.GetHabbo().CurrentRoom;
                                PhoenixEnvironment.GetGame().GetRoomManager().UnloadRoom(TargetRoom);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                        }
                    }
                    switch (PhoenixEnvironment.GetGame().GetRoleManager().CommandsList[Params[0]])
                    {
                        #region Moderation Commands
                        #region CMD Alert
                        case 2: //CMD Alert
                            if (!Session.GetHabbo().HasRole("cmd_alert"))
                            {
                                return false;
                            }

                            TargetUser = Params[1];
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(TargetUser);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"cmd_award"))
                            {
                                return false;
                            }

                            TargetUser = Params[1];
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(TargetUser);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"cmd_ban"))
                            {
                                return false;
                            }

                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User not found");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (TargetClient.GetHabbo().Rank >= Session.GetHabbo().Rank)
                            {
                                Session.SendNotif("You are not allowed to ban that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }

                            int BanTime = 0;
                            try
                            {
                                BanTime = int.Parse(Params[2]);
                            }
                            catch (FormatException) { }

                            if (BanTime <= 600)
                            {
                                Session.SendNotif("Ban time is in seconds and must be at least than 600 seconds (ten minutes). For more specific preset ban times, use the mod tool.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            PhoenixEnvironment.GetGame().GetBanManager().BanUser(TargetClient, Session.GetHabbo().Username, BanTime, MergeParams(Params, 3), false);
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Coins
                        case 6: //CMD Coins
                            if (!Session.GetHabbo().HasRole("cmd_coins"))
                            {
                                return false;
                            }

                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User could not be found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            int creditsToAdd;
                            if (int.TryParse(Params[2], out creditsToAdd))
                            {
                                TargetClient.GetHabbo().Credits = TargetClient.GetHabbo().Credits + creditsToAdd;
                                TargetClient.GetHabbo().UpdateCreditsBalance(true);
                                TargetClient.SendNotif(Session.GetHabbo().Username + " has awarded you " + creditsToAdd.ToString() + " credits.");
                                Session.SendNotif("Credit balance updated successful.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            Session.SendNotif("Please send a valid amount of credits.");
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Freeze
                        case 14: //CMD Freeze
                            if (Session.GetHabbo().HasRole("cmd_freeze"))
                            {

                                TargetRoomUser = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Params[1]);
                                if (TargetRoomUser != null)
                                {
                                    TargetRoomUser.bool_5 = !TargetRoomUser.bool_5;
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD GiveBadge
                        case 15: //CMD GiveBadge
                            if (Session.GetHabbo().HasRole("cmd_givebadge"))
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);

                                if (TargetClient != null)
                                {
                                    TargetClient.GetHabbo().GetBadgeComponent().GiveBadge(TargetClient, PhoenixEnvironment.FilterInjectionChars(Params[2]), true);
                                }
                                else
                                {
                                    Session.SendNotif("User: "******" could not be found in the database.\rPlease try your request again.");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD GlobalCredits
                        case 16: //CMD GlobalCredits
                            if (Session.GetHabbo().HasRole("cmd_globalcredits"))
                            {
                                try
                                {
                                    int GCreditsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GiveCredits(GCreditsToAdd);
                                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                    {
                                        adapter.ExecuteQuery("UPDATE users SET credits = credits + " + GCreditsToAdd);
                                    }
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD GlobalPixels
                        case 17: //CMD GlobalPixels
                            if (Session.GetHabbo().HasRole("cmd_globalpixels"))
                            {
                                try
                                {
                                    int pixelsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GivePixels(pixelsToAdd, false);
                                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                    {
                                        adapter.ExecuteQuery("UPDATE users SET activity_points = activity_points + " + pixelsToAdd);
                                    }
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD GlobalPoints
                        case 18: //CMD GlobalPoints
                            if (Session.GetHabbo().HasRole("cmd_globalpoints"))
                            {
                                try
                                {
                                    int pointsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GivePoints(pointsToAdd, false);
                                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                    {
                                        adapter.ExecuteQuery("UPDATE users SET vip_points = vip_points + " + pointsToAdd);
                                    }
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD HaL
                        case 19: //CMD HaL
                            if (Session.GetHabbo().HasRole("cmd_hal"))
                            {
                                string msg = Params[1];
                                Input = Input.Substring(4).Replace(msg, "");
                                string url = Input.Substring(1);
                                ServerMessage Message = new ServerMessage(161);
                                Message.AppendStringWithBreak(string.Concat(new string[]
							{
								TextManager.GetText("cmd_hal_title"),
								"\r\n",
								url,
								"\r\n-",
								Session.GetHabbo().Username
							}));
                                Message.AppendStringWithBreak(msg);
                                PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessage(Message);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Ha
                        case 20: //CMD Ha
                            if (Session.GetHabbo().HasRole("cmd_ha"))
                            {
                                string notice = Input.Substring(3);
                                ServerMessage Message2 = new ServerMessage(808);
                                Message2.AppendStringWithBreak(TextManager.GetText("cmd_ha_title"));
                                Message2.AppendStringWithBreak(notice + "\r\n- " + Session.GetHabbo().Username);
                                ServerMessage Message3 = new ServerMessage(161);
                                Message3.AppendStringWithBreak(notice + "\r\n- " + Session.GetHabbo().Username);
                                PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessage(Message2, Message3);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Invisible
                        case 21: //CMD Invisible
                            if (Session.GetHabbo().HasRole("cmd_invisible"))
                            {
                                Session.GetHabbo().Visible = !Session.GetHabbo().Visible;
                                Session.SendNotif("You are now " + (Session.GetHabbo().Visible ? "visible" : "invisible") + "\nTo apply the changes reload the room ;D");
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD IpBan
                        case 22: //CMD IpBan
                            if (!Session.GetHabbo().HasRole("cmd_ipban"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User not found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (TargetClient.GetHabbo().Rank >= Session.GetHabbo().Rank && !Session.GetHabbo().isAaron)
                            {
                                Session.SendNotif("You are not allowed to ban that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            PhoenixEnvironment.GetGame().GetBanManager().BanUser(TargetClient, Session.GetHabbo().Username, 360000000.0, ChatCommandHandler.MergeParams(Params, 2), true);
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Kick
                        case 23: //CMD Kick
                            if (!Session.GetHabbo().HasRole("cmd_kick"))
                            {
                                return false;
                            }
                            TargetUser = Params[1];
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(TargetUser);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"You are not allowed to kick that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (TargetClient.GetHabbo().CurrentRoomId < 1u)
                            {
                                Session.SendNotif("That user is not in a room and can not be kicked.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(TargetClient.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            TargetRoom.RemoveUserFromRoom(TargetClient, true, false);
                            if (Params.Length > 2)
                            {
                                TargetClient.SendNotif("A moderator has kicked you from the room for the following reason: " + ChatCommandHandler.MergeParams(Params, 2));
                            }
                            else
                            {
                                TargetClient.SendNotif("A moderator has kicked you from the room.");
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD MassBadge
                        case 24: //CMD MassBadge
                            if (Session.GetHabbo().HasRole("cmd_massbadge"))
                            {
                                PhoenixEnvironment.GetGame().GetClientManager().GiveMassBadge(Params[1]);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD MassCredits
                        case 25: //CMD MassCredits
                            if (Session.GetHabbo().HasRole("cmd_masscredits"))
                            {
                                try
                                {
                                    int MCreditsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GiveCredits(MCreditsToAdd);
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD MassPixels
                        case 26: //CMD MassPixels
                            if (Session.GetHabbo().HasRole("cmd_masspixels"))
                            {
                                try
                                {
                                    int MPixelsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GivePixels(MPixelsToAdd, true);
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD MassPoints
                        case 27: //CMD MassPoints
                            if (Session.GetHabbo().HasRole("cmd_masspoints"))
                            {
                                try
                                {
                                    int MPointsToAdd = int.Parse(Params[1]);
                                    PhoenixEnvironment.GetGame().GetClientManager().GivePoints(MPointsToAdd, true);
                                }
                                catch
                                {
                                    Session.SendNotif("Input must be a number");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Motd
                        case 30: //CMD Motd
                            if (!Session.GetHabbo().HasRole("cmd_motd"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"cmd_mute"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null || TargetClient.GetHabbo() == null)
                            {
                                Session.SendNotif("Could not find user: "******"You are not allowed to (un)mute that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            TargetClient.GetHabbo().Mute();
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Override
                        case 32: //CMD Override
                            if (!Session.GetHabbo().HasRole("cmd_override"))
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser == null)
                            {
                                return false;
                            }
                            if (TargetRoomUser.AllowOverride)
                            {
                                TargetRoomUser.AllowOverride = false;
                                Session.SendNotif("Walking override disabled.");
                            }
                            else
                            {
                                TargetRoomUser.AllowOverride = true;
                                Session.SendNotif("Walking override enabled.");
                            }
                            TargetRoom.GenerateMaps();
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Pixels
                        case 34: //CMD Pixels
                            if (!Session.GetHabbo().HasRole("cmd_pixels"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User could not be found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            int PixelsToAdd;
                            if (int.TryParse(Params[2], out PixelsToAdd))
                            {
                                TargetClient.GetHabbo().ActivityPoints = TargetClient.GetHabbo().ActivityPoints + PixelsToAdd;
                                TargetClient.GetHabbo().UpdateActivityPointsBalance(true);
                                TargetClient.SendNotif(Session.GetHabbo().Username + " has awarded you " + PixelsToAdd.ToString() + " Pixels!");
                                Session.SendNotif("Pixels balance updated successfully.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            Session.SendNotif("Please send a valid amount of pixels.");
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Points
                        case 35: //CMD Points
                            if (!Session.GetHabbo().HasRole("cmd_points"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User could not be found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            int PointsToAdd;
                            if (int.TryParse(Params[2], out PointsToAdd))
                            {
                                TargetClient.GetHabbo().shells = TargetClient.GetHabbo().shells + PointsToAdd;
                                TargetClient.GetHabbo().UpdateShellsBalance(false, true);
                                TargetClient.SendNotif(Session.GetHabbo().Username + " has awarded you " + PointsToAdd.ToString() + " Points!");
                                Session.SendNotif("Points balance updated successfully.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            Session.SendNotif("Please send a valid amount of points.");
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RemoveBadge
                        case 39: //CMD RemoveBadge
                            if (Session.GetHabbo().HasRole("cmd_removebadge"))
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                if (TargetClient != null)
                                {
                                    TargetClient.GetHabbo().GetBadgeComponent().RemoveBadge(PhoenixEnvironment.FilterInjectionChars(Params[2]));
                                }
                                else
                                {
                                    Session.SendNotif("User: "******" could not be found in the database.\rPlease try your request again.");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD RoomAlert
                        case 41: //CMD RoomAlert
                            if (!Session.GetHabbo().HasRole("cmd_roomalert"))
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            string alert = ChatCommandHandler.MergeParams(Params, 1);
                            for (int i = 0; i < TargetRoom.UserList.Length; i++)
                            {
                                TargetRoomUser = TargetRoom.UserList[i];
                                if (TargetRoomUser != null)
                                {
                                    TargetRoomUser.GetClient().SendNotif(alert);
                                }
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RoomBadge
                        case 42: //CMD RoomBadge
                            if (!Session.GetHabbo().HasRole("cmd_roombadge"))
                            {
                                return false;
                            }
                            if (Session.GetHabbo().CurrentRoom == null)
                            {
                                return false;
                            }
                            for (int i = 0; i < Session.GetHabbo().CurrentRoom.UserList.Length; i++)
                            {
                                try
                                {
                                    TargetRoomUser = Session.GetHabbo().CurrentRoom.UserList[i];
                                    if (TargetRoomUser != null)
                                    {
                                        if (!TargetRoomUser.IsBot)
                                        {
                                            if (TargetRoomUser.GetClient() != null)
                                            {
                                                if (TargetRoomUser.GetClient().GetHabbo() != null)
                                                {
                                                    TargetRoomUser.GetClient().GetHabbo().GetBadgeComponent().GiveBadge(TargetRoomUser.GetClient(), Params[1], true);
                                                }
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Session.SendNotif("Error: " + ex.ToString());
                                }
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RoomKick
                        case 43: //CMD RoomKick
                            if (!Session.GetHabbo().HasRole("cmd_roomkick"))
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            bool GenericMsg = true;
                            string ModMsg = ChatCommandHandler.MergeParams(Params, 1);
                            if (ModMsg.Length > 0)
                            {
                                GenericMsg = false;
                            }
                            for (int i = 0; i < TargetRoom.UserList.Length; i++)
                            {
                                TargetRoomUser = TargetRoom.UserList[i];
                                if (TargetRoomUser != null && TargetRoomUser.GetClient().GetHabbo().Rank < Session.GetHabbo().Rank)
                                {
                                    if (!GenericMsg)
                                    {
                                        TargetRoomUser.GetClient().SendNotif("You have been kicked by an moderator: " + ModMsg);
                                    }
                                    TargetRoom.RemoveUserFromRoom(TargetRoomUser.GetClient(), true, GenericMsg);
                                }
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RoomMute
                        case 44: //CMD RoomMute
                            if (Session.GetHabbo().HasRole("cmd_roommute"))
                            {
                                if (Session.GetHabbo().CurrentRoom.RoomMuted)
                                {
                                    Session.GetHabbo().CurrentRoom.RoomMuted = false;
                                }
                                else
                                {
                                    Session.GetHabbo().CurrentRoom.RoomMuted = true;
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD SA
                        case 45: //CMD SA
                            if (Session.GetHabbo().HasRole("cmd_sa"))
                            {
                                ServerMessage Logging = new ServerMessage(134);
                                Logging.AppendUInt(0);
                                Logging.AppendString(Session.GetHabbo().Username + ": " + Input.Substring(3));
                                PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessageToStaff(Logging, Logging);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD SetSpeed
                        case 47: //CMD SetSpeed
                            if (Session.GetHabbo().HasRole("cmd_setspeed"))
                            {
                                int.Parse(Params[1]);
                                Session.GetHabbo().CurrentRoom.method_102(int.Parse(Params[1]));
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Shutdown
                        case 48: //CMD Shutdown
                            if (Session.GetHabbo().HasRole("cmd_shutdown"))
                            {
                                Logging.LogCriticalException("User " + Session.GetHabbo().Username + " shut down the server " + DateTime.Now.ToString());
                                Task task = new Task(new Action(PhoenixEnvironment.BeginShutDown));
                                task.Start();
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Spull
                        case 49: //CMD Spull
                            if (Session.GetHabbo().HasRole("cmd_spull"))
                            {
                                try
                                {
                                    string a = "down";
                                    TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                    TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                    if (Session == null || TargetClient == null)
                                    {
                                        return false;
                                    }
                                    TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    RoomUser TargetClient2 = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                    if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
                                    {
                                        Session.GetHabbo().Sendselfwhisper("You cannot pull yourself");
                                        return true;
                                    }
                                    TargetRoomUser.Chat(Session, "*pulls " + TargetClient.GetHabbo().Username + " to them*", false);
                                    if (TargetRoomUser.RotBody == 0)
                                    {
                                        a = "up";
                                    }
                                    if (TargetRoomUser.RotBody == 2)
                                    {
                                        a = "right";
                                    }
                                    if (TargetRoomUser.RotBody == 4)
                                    {
                                        a = "down";
                                    }
                                    if (TargetRoomUser.RotBody == 6)
                                    {
                                        a = "left";
                                    }
                                    if (a == "up")
                                    {
                                        TargetClient2.MoveTo(TargetRoomUser.X, TargetRoomUser.Y - 1);
                                    }
                                    if (a == "right")
                                    {
                                        TargetClient2.MoveTo(TargetRoomUser.X + 1, TargetRoomUser.Y);
                                    }
                                    if (a == "down")
                                    {
                                        TargetClient2.MoveTo(TargetRoomUser.X, TargetRoomUser.Y + 1);
                                    }
                                    if (a == "left")
                                    {
                                        TargetClient2.MoveTo(TargetRoomUser.X - 1, TargetRoomUser.Y);
                                    }
                                    return true;
                                }
                                catch
                                {
                                    return false;
                                }
                            }
                            return false;
                        #endregion
                        #region CMD Summon
                        case 50: //CMD Summon
                            if (Session.GetHabbo().HasRole("cmd_summon"))
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                if (TargetClient != null && TargetClient.GetHabbo().CurrentRoom != Session.GetHabbo().CurrentRoom)
                                {
                                    ServerMessage Message5 = new ServerMessage(286u);
                                    Message5.AppendBoolean(Session.GetHabbo().CurrentRoom.IsPublic);
                                    Message5.AppendUInt(Session.GetHabbo().CurrentRoomId);
                                    TargetClient.SendMessage(Message5);
                                    TargetClient.SendNotif(Session.GetHabbo().Username + " has summoned you to them");
                                }
                                else
                                {
                                    Session.GetHabbo().Sendselfwhisper("User: "******" could not be found - Maybe they're not online anymore :(");
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD SuperBan
                        case 51: //CMD SuperBan
                            if (!Session.GetHabbo().HasRole("cmd_superban"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("User not found.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (TargetClient.GetHabbo().Rank >= Session.GetHabbo().Rank && !Session.GetHabbo().isAaron)
                            {
                                Session.SendNotif("You are not allowed to ban that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            PhoenixEnvironment.GetGame().GetBanManager().BanUser(TargetClient, Session.GetHabbo().Username, 360000000.0, ChatCommandHandler.MergeParams(Params, 2), false);
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Teleport
                        case 52: //CMD Teleport
                            if (!Session.GetHabbo().HasRole("cmd_teleport"))
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser == null)
                            {
                                return false;
                            }
                            if (TargetRoomUser.TeleportMode)
                            {
                                TargetRoomUser.TeleportMode = false;
                                Session.SendNotif("Teleporting disabled.");
                            }
                            else
                            {
                                TargetRoomUser.TeleportMode = true;
                                Session.SendNotif("Teleporting enabled.");
                            }
                            TargetRoom.GenerateMaps();
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD UnMute
                        case 54: //CMD UnMute
                            if (!Session.GetHabbo().HasRole("cmd_unmute"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null || TargetClient.GetHabbo() == null)
                            {
                                Session.SendNotif("Could not find user: "******"cmd_update_achievements"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    AchievementManager.LoadAchievements(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Bans
                        case 56: //CMD Update Bans
                            if (Session.GetHabbo().HasRole("cmd_update_bans"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetBanManager().LoadBans(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().CheckForAllBanConflicts();
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region  CMD Update Bots
                        case 57: //CMD Update Bots
                            if (Session.GetHabbo().HasRole("cmd_update_bots"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetBotManager().LoadBots(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Catalogue
                        case 58: //CMD Update Catalogue
                            if (Session.GetHabbo().HasRole("cmd_update_catalogue"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetCatalog().Initialize(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetCatalog().InitCache();
                                PhoenixEnvironment.GetGame().GetClientManager().BroadcastMessage(new ServerMessage(441u));
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Filter
                        case 59: //CMD Update Filter
                            if (Session.GetHabbo().HasRole("cmd_update_filter"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    ChatCommandHandler.UpdateFilters(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Items
                        case 60: //CMD Update Items
                            if (Session.GetHabbo().HasRole("cmd_update_items"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetItemManager().LoadItems(adapter);
                                }
                                Session.SendNotif("Item defenitions reloaded successfully.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Navigator
                        case 61: //CMD Update Navigator
                            if (Session.GetHabbo().HasRole("cmd_update_navigator"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetNavigator().Initialize(adapter);
                                    PhoenixEnvironment.GetGame().GetRoomManager().LoadModels(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Permissions
                        case 62: //CMD Update Premissions
                            if (Session.GetHabbo().HasRole("cmd_update_permissions"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().GetRoleManager().LoadRoles(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Settings
                        case 63: ///CMD Update Settings
                            if (Session.GetHabbo().HasRole("cmd_update_settings"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    PhoenixEnvironment.GetGame().LoadSettings(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Update Texts
                        case 65: //CMD Update Texts
                            if (Session.GetHabbo().HasRole("cmd_update_texts"))
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    TextManager.LoadTexts(adapter);
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD UserInfo
                        case 64: //CMD UserInfo
                            if (!Session.GetHabbo().HasRole("cmd_userinfo"))
                            {
                                return false;
                            }
                            bool flag2 = true;
                            if (string.IsNullOrEmpty(Params[1]))
                            {
                                Session.SendNotif("Please enter a username");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                flag2 = false;
                                TargetHabbo = Authenticator.GetHabboViaUsername(Params[1]);
                            }
                            else
                            {
                                TargetHabbo = TargetClient.GetHabbo();
                            }
                            if (TargetHabbo == null)
                            {
                                Session.SendNotif("Unable to find user " + Params[1]);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            StringBuilder Builderer = new StringBuilder();
                            if (TargetHabbo.CurrentRoom != null)
                            {
                                Builderer.Append(" - ROOM INFORMATION FOR ROOMID: " + TargetHabbo.CurrentRoom.RoomId + " - \r");
                                Builderer.Append("Owner: " + TargetHabbo.CurrentRoom.Owner + "\r");
                                Builderer.Append("Room name: " + TargetHabbo.CurrentRoom.Name + "\r");
                                Builderer.Append(string.Concat(new object[]
							{
								"Users in room: ",
								TargetHabbo.CurrentRoom.UserCount,
								"/",
								TargetHabbo.CurrentRoom.UsersMax
							}));
                            }
                            uint UserRank = TargetHabbo.Rank;
                            string UserIP = "";
                            if (Session.GetHabbo().HasRole("cmd_userinfo_viewip"))
                            {
                                UserIP = "UserIP: " + TargetHabbo.LastIp + " \r";
                            }
                            Session.SendNotif(string.Concat(new object[]
						{
							"User information for user: "******":\rRank: ",
							UserRank,
							" \rUser online: ",
							flag2.ToString(),
							" \rUserID: ",
							TargetHabbo.Id,
							" \r",
							UserIP,
							"Visiting room: ",
							TargetHabbo.CurrentRoomId,
							" \rUser motto: ",
							TargetHabbo.Motto,
							" \rUser credits: ",
							TargetHabbo.Credits,
							" \rUser pixels: ",
							TargetHabbo.ActivityPoints,
							" \rUser points: ",
							TargetHabbo.shells,
							" \rUser muted: ",
							TargetHabbo.Muted.ToString(),
							"\r\r\r",
							Builderer.ToString()
						}));
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Disconnect
                        case 66: //CMD Disconnect
                            if (!Session.GetHabbo().HasRole("cmd_disconnect"))
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.SendNotif("Could not find user: "******"You are not allowed to kick that user.");
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            if (!TargetClient.GetHabbo().isAaron)
                            {
                                TargetClient.Disconnect();
                            }
                            return true;
                        #endregion
                        #region CMD Empty
                        case 10: //CMD Empty
                            if (Session.GetHabbo().HasRole("cmd_empty") && Params[1] != null)
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                if (TargetClient != null && TargetClient.GetHabbo() != null)
                                {
                                    TargetClient.GetHabbo().GetInventoryComponent().ClearItems();
                                    Session.SendNotif("Inventory cleared! (Database and cache)");
                                }
                                else
                                {
                                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                    {
                                        adapter.AddParamWithValue("usrname", Params[1]);
                                        int userId = int.Parse(adapter.ReadString("SELECT Id FROM users WHERE username = @usrname LIMIT 1;"));
                                        adapter.ExecuteQuery("DELETE FROM items WHERE user_id = '" + userId + "' AND room_id = 0;");
                                        Session.SendNotif("Inventory cleared! (Database)");
                                    }
                                }
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                                return true;
                            }
                            return false;
                        #endregion
                        #endregion

                        #region VIP Commands
                        #region CMD Enable
                        case 11: //CMD Enable
                            if (!GlobalClass.cmdEnableEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            int effect = int.Parse(Params[1]);
                            Session.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(effect, true);
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD FlagMe
                        case 12: //CMD FlagMe
                            if (!GlobalClass.cmdFlagmeEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            ServerMessage message = new ServerMessage(573);
                            Session.SendMessage(message);
                            return true;
                        #endregion
                        #region CMD Follow
                        case 13: //CMD Follow
                            if (!GlobalClass.cmdFollowEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient != null && TargetClient.GetHabbo().InRoom && Session.GetHabbo().CurrentRoom != TargetClient.GetHabbo().CurrentRoom && !TargetClient.GetHabbo().HideInRom)
                            {
                                ServerMessage message2 = new ServerMessage(286);
                                message2.AppendBoolean(TargetClient.GetHabbo().CurrentRoom.IsPublic);
                                message2.AppendUInt(TargetClient.GetHabbo().CurrentRoomId);
                                Session.SendMessage(message2);
                            }
                            else
                            {
                                Session.GetHabbo().Sendselfwhisper("User: "******" could not be found - Maybe they're not online or not in a room anymore (or maybe they're a ninja)");
                            }
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD Mimic
                        case 28: //CMD Mimic    
                            if (!GlobalClass.cmdMimicEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            if (TargetClient == null)
                            {
                                Session.GetHabbo().Sendselfwhisper("Could not find user: "******"cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser == null)
                            {
                                return false;
                            }
                            if (TargetRoomUser.WalkBackwards)
                            {
                                TargetRoomUser.WalkBackwards = false;
                                Session.GetHabbo().Sendselfwhisper("Your moonwalk has been disabled.");
                                return true;
                            }
                            TargetRoomUser.WalkBackwards = true;
                            Session.GetHabbo().Sendselfwhisper("Your moonwalk has been enabled.");
                            return true;
                        #endregion
                        #region CMD Pull
                        case 36: //CMD Pull
                            try
                            {
                                if (!GlobalClass.cmdPullEnabled)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                    return true;
                                }
                                if (!Session.GetHabbo().Vip)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                    return true;
                                }
                                string a = "down";
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                if (Session == null || TargetClient == null)
                                {
                                    return false;
                                }
                                TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                RoomUser TargetRoomUser2 = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
                                {
                                    Session.GetHabbo().Sendselfwhisper("You cannot pull yourself");
                                    return true;
                                }
                                if (TargetClient.GetHabbo().CurrentRoomId == Session.GetHabbo().CurrentRoomId && Math.Abs(TargetRoomUser.X - TargetRoomUser2.X) < 3 && Math.Abs(TargetRoomUser.Y - TargetRoomUser2.Y) < 3)
                                {
                                    TargetRoomUser.Chat(Session, "*pulls " + TargetClient.GetHabbo().Username + " to them*", false);
                                    if (TargetRoomUser.RotBody == 0)
                                    {
                                        a = "up";
                                    }
                                    if (TargetRoomUser.RotBody == 2)
                                    {
                                        a = "right";
                                    }
                                    if (TargetRoomUser.RotBody == 4)
                                    {
                                        a = "down";
                                    }
                                    if (TargetRoomUser.RotBody == 6)
                                    {
                                        a = "left";
                                    }
                                    if (a == "up")
                                    {
                                        TargetRoomUser2.MoveTo(TargetRoomUser.X, TargetRoomUser.Y - 1);
                                    }
                                    if (a == "right")
                                    {
                                        TargetRoomUser2.MoveTo(TargetRoomUser.X + 1, TargetRoomUser.Y);
                                    }
                                    if (a == "down")
                                    {
                                        TargetRoomUser2.MoveTo(TargetRoomUser.X, TargetRoomUser.Y + 1);
                                    }
                                    if (a == "left")
                                    {
                                        TargetRoomUser2.MoveTo(TargetRoomUser.X - 1, TargetRoomUser.Y);
                                    }
                                    return true;
                                }
                                Session.GetHabbo().Sendselfwhisper("That user is not close enough to you to be pulled, try getting closer");
                                return true;
                            }
                            catch
                            {
                                return false;
                            }
                        #endregion
                        #region CMD Push
                        case 37: //CMD Push
                            try
                            {
                                if (!GlobalClass.cmdPushEnabled)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                    return true;
                                }
                                if (!Session.GetHabbo().Vip)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                    return true;
                                }
                                string a = "down";
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                if (Session == null || TargetClient == null)
                                {
                                    return false;
                                }
                                TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                RoomUser TargetRoomUser2 = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
                                {
                                    Session.GetHabbo().Sendselfwhisper("It can't be that bad mate, no need to push yourself!");
                                    return true;
                                }
                                bool arg_3DD2_0; //What is it? I don't know!
                                if (TargetClient.GetHabbo().CurrentRoomId == Session.GetHabbo().CurrentRoomId)
                                {
                                    if ((TargetRoomUser.X + 1 != TargetRoomUser2.X || TargetRoomUser.Y != TargetRoomUser2.Y) && (TargetRoomUser.X - 1 != TargetRoomUser2.X || TargetRoomUser.Y != TargetRoomUser2.Y) && (TargetRoomUser.Y + 1 != TargetRoomUser2.Y || TargetRoomUser.X != TargetRoomUser2.X))
                                    {
                                        if (TargetRoomUser.Y - 1 == TargetRoomUser2.Y)
                                        {
                                            if (TargetRoomUser.X == TargetRoomUser2.X)
                                            {
                                                arg_3DD2_0 = false;
                                            }
                                            else
                                            {
                                                arg_3DD2_0 = true;
                                            }
                                        }
                                        arg_3DD2_0 = (TargetRoomUser.X != TargetRoomUser2.X || TargetRoomUser.Y != TargetRoomUser2.Y);
                                        if (!arg_3DD2_0)
                                        {
                                            TargetRoomUser.Chat(Session, "*pushes " + TargetClient.GetHabbo().Username + "*", false);
                                            if (TargetRoomUser.RotBody == 0)
                                            {
                                                a = "up";
                                                a = "right";
                                            }
                                            if (TargetRoomUser.RotBody == 4)
                                            {
                                                a = "down";
                                            }
                                            if (TargetRoomUser.RotBody == 6)
                                            {
                                                a = "left";
                                            }
                                            if (TargetRoomUser.RotBody == 2)
                                            {
                                            }
                                            if (a == "up")
                                            {
                                                TargetRoomUser2.MoveTo(TargetRoomUser2.X, TargetRoomUser2.Y - 1);
                                            }
                                            if (a == "right")
                                            {
                                                TargetRoomUser2.MoveTo(TargetRoomUser2.X + 1, TargetRoomUser2.Y);
                                            }
                                            if (a == "down")
                                            {
                                                TargetRoomUser2.MoveTo(TargetRoomUser2.X, TargetRoomUser2.Y + 1);
                                            }
                                            if (a == "left")
                                            {
                                                TargetRoomUser2.MoveTo(TargetRoomUser2.X - 1, TargetRoomUser2.Y);
                                            }
                                        }
                                        return true;
                                    }
                                }
                                return false;
                            }
                            catch
                            {
                                return false;
                            }
                        #endregion
                        #region CMD Faceless
                        case 85: //CMD Faceless
                            string[] figureParts;
                            string[] headParts;

                            if (!GlobalClass.cmdFacelessEnabled)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                                return true;
                            }
                            if (!Session.GetHabbo().Vip)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_permission_vip"));
                                return true;
                            }

                            figureParts = Session.GetHabbo().Look.Split('.');
                            foreach (string Part in figureParts)
                            {
                                if(Part.StartsWith("hd"))
                                {
                                    headParts = Part.Split('-');

                                    if (!headParts[1].Equals("99999"))
                                        headParts[1] = "99999";
                                    else
                                        break;

                                    string NewHead = "hd-" + headParts[1] + "-" + headParts[2];

                                    Session.GetHabbo().Look = Session.GetHabbo().Look.Replace(Part, NewHead);
                                    break;
                                }
                            }

                            using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                            {
                                adapter.AddParamWithValue("look", Session.GetHabbo().Look);
                                adapter.AddParamWithValue("username", Session.GetHabbo().Username);
                                adapter.ExecuteQuery("UPDATE users SET look = @look WHERE username = @username");
                            }

                            Room Room = Session.GetHabbo().CurrentRoom;

                            if (Room == null)
                                break;

                            RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);

                            if (User == null)
                                break;
                            					    
                            ServerMessage UserUpdate = new ServerMessage(266);
					        UserUpdate.AppendInt32(-1);
					        UserUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
					        UserUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
					        UserUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
					        UserUpdate.AppendInt32(Session.GetHabbo().AchievementScore);
				        	UserUpdate.AppendStringWithBreak("");
					        Session.SendMessage(UserUpdate);
					
                            ServerMessage RoomUpdate = new ServerMessage(266);
					        RoomUpdate.AppendInt32(User.VirtualId);
					        RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
					        RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
					        RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
					        RoomUpdate.AppendInt32(Session.GetHabbo().AchievementScore);
					        RoomUpdate.AppendStringWithBreak("");
					        Room.SendMessage(RoomUpdate, null);
                            return true;
                        #endregion
                        #endregion

                        #region Normal Commands
                        #region CMD Buy
                        case 5: //CMD Buy
                            int amountToBuy = Convert.ToInt16(Params[1]);
                            if (amountToBuy > 0 && amountToBuy < 101)
                            {
                                Session.GetHabbo().BuyCount = (int)Convert.ToInt16(Params[1]);
                            }
                            else
                            {
                                Session.GetHabbo().Sendselfwhisper("Please choose a value between 1 - 100");
                            }
                            return true;
                        #endregion
                        #region CMD Ride
                        case 40: //CMD Ride
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            RoomUser TargetRoomUser3 = TargetRoom.method_57(Params[1]);
                            if (TargetRoomUser.Riding != null)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_err_riding"));
                                return true;
                            }
                            if (!TargetRoomUser3.IsBot || TargetRoomUser3.PetData.Type != 13)
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_err_nothorse"));
                                return true;
                            }
                            bool arg_40EB_0; //What is it? I don't know!
                            if ((TargetRoomUser.X + 1 != TargetRoomUser3.X || TargetRoomUser.Y != TargetRoomUser3.Y) && (TargetRoomUser.X - 1 != TargetRoomUser3.X || TargetRoomUser.Y != TargetRoomUser3.Y) && (TargetRoomUser.Y + 1 != TargetRoomUser3.Y || TargetRoomUser.X != TargetRoomUser3.X))
                            {
                                if (TargetRoomUser.Y - 1 == TargetRoomUser3.Y)
                                {
                                    if (TargetRoomUser.X == TargetRoomUser3.X)
                                    {
                                        arg_40EB_0 = false;
                                    }
                                }
                                arg_40EB_0 = (TargetRoomUser.X != TargetRoomUser3.X || TargetRoomUser.Y != TargetRoomUser3.Y);
                                if (arg_40EB_0)
                                {
                                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_err_toofar"));
                                    return true;
                                }
                            }
                            if (TargetRoomUser3.BotData.Rider == null)
                            {
                                TargetRoomUser3.BotData.Rider = TargetRoomUser;
                                TargetRoomUser.Riding = TargetRoomUser3.BotData;
                                TargetRoomUser.X = TargetRoomUser3.X;
                                TargetRoomUser.Y = TargetRoomUser3.Y;
                                TargetRoomUser.Z = TargetRoomUser3.Z + 1.0;
                                TargetRoomUser.RotBody = TargetRoomUser3.RotBody;
                                TargetRoomUser.RotHead = TargetRoomUser3.RotHead;
                                TargetRoomUser.UpdateNeeded = true;
                                TargetRoom.UpdateUserStatus(TargetRoomUser, false, false);
                                TargetRoomUser.Target = TargetRoomUser3;
                                TargetRoomUser.Statusses.Clear();
                                TargetRoomUser3.Statusses.Clear();
                                Session.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(77, true);
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_instr_getoff"));
                                TargetRoom.GenerateMaps();
                                return true;
                            }
                            Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_ride_err_tooslow"));
                            return true;
                        #endregion
                        #region CMD Dismount
                        case 80: //CMD Dismount
                        case 81:
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser.Riding != null)
                            {
                                Session.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1, true);
                                TargetRoomUser.Riding.Rider = null;
                                TargetRoomUser.Riding = null;
                                TargetRoomUser.Z -= 1.0;
                                TargetRoomUser.Statusses.Clear();
                                TargetRoomUser.UpdateNeeded = true;
                                int int_3 = PhoenixEnvironment.GetRandomNumber(0, TargetRoom.Model.MapSizeX);
                                int int_4 = PhoenixEnvironment.GetRandomNumber(0, TargetRoom.Model.MapSizeY);
                                TargetRoomUser.Target.MoveTo(int_3, int_4);
                                TargetRoomUser.Target = null;
                                TargetRoom.UpdateUserStatus(TargetRoomUser, false, false);
                            }
                            return true;
                        #endregion
                        #region CMD DisableDiagonal
                        case 8: //CMD DisableDiagonal
                            Session.SendNotif("Command disabled");
                            return true;
                        #endregion
                        #region CMD EmptyItems
                        case 9: //CMD EmptyItems
                            Session.GetHabbo().GetInventoryComponent().ClearItems();
                            Session.SendNotif(TextManager.GetText("cmd_emptyitems_success"));
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD EmptyPets
                        case 82: //CMD EmptyPets
                            Session.GetHabbo().GetInventoryComponent().ClearPets();
                            Session.SendNotif(TextManager.GetText("cmd_emptypets_success"));
                            PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            return true;
                        #endregion
                        #region CMD RedeemCreds
                        case 38: //CMD RedeemCreds
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser.IsTrading)
                            {
                                Session.GetHabbo().Sendselfwhisper("Command unavailable while trading");
                                return true;
                            }
                            if (GlobalClass.cmdRedeemCredits)
                            {
                                Session.GetHabbo().GetInventoryComponent().RedeemCredits(Session);
                            }
                            else
                            {
                                Session.GetHabbo().Sendselfwhisper(TextManager.GetText("cmd_error_disabled"));
                            }
                            return true;
                        #endregion
                        #region CMD Commands
                        case 67: //CMD Commands
                            string Command = "Your Commands:\r\r";
                            if (Session.GetHabbo().HasRole("cmd_update_settings"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_settings_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_bans"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_bans_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_permissions"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_permissions_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_filter"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_filter_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_bots"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_bots_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_catalogue"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_catalogue_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_items"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_items_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_navigator"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_navigator_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_achievements"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_achievements_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_award"))
                            {
                                Command = Command + TextManager.GetText("cmd_award_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_coords"))
                            {
                                Command = Command + TextManager.GetText("cmd_coords_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_override"))
                            {
                                Command = Command + TextManager.GetText("cmd_override_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_teleport"))
                            {
                                Command = Command + TextManager.GetText("cmd_teleport_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_coins"))
                            {
                                Command = Command + TextManager.GetText("cmd_coins_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_pixels"))
                            {
                                Command = Command + TextManager.GetText("cmd_pixels_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_points"))
                            {
                                Command = Command + TextManager.GetText("cmd_points_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_alert"))
                            {
                                Command = Command + TextManager.GetText("cmd_alert_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_motd"))
                            {
                                Command = Command + TextManager.GetText("cmd_motd_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_roomalert"))
                            {
                                Command = Command + TextManager.GetText("cmd_roomalert_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_ha"))
                            {
                                Command = Command + TextManager.GetText("cmd_ha_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_hal"))
                            {
                                Command = Command + TextManager.GetText("cmd_hal_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_freeze"))
                            {
                                Command = Command + TextManager.GetText("cmd_freeze_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_roommute"))
                            {
                                Command = Command + TextManager.GetText("cmd_roommute_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_setspeed"))
                            {
                                Command = Command + TextManager.GetText("cmd_setspeed_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_globalcredits"))
                            {
                                Command = Command + TextManager.GetText("cmd_globalcredits_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_globalpixels"))
                            {
                                Command = Command + TextManager.GetText("cmd_globalpixels_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_globalpoints"))
                            {
                                Command = Command + TextManager.GetText("cmd_globalpoints_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_masscredits"))
                            {
                                Command = Command + TextManager.GetText("cmd_masscredits_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_masspixels"))
                            {
                                Command = Command + TextManager.GetText("cmd_masspixels_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_masspoints"))
                            {
                                Command = Command + TextManager.GetText("cmd_masspoints_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_givebadge"))
                            {
                                Command = Command + TextManager.GetText("cmd_givebadge_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_removebadge"))
                            {
                                Command = Command + TextManager.GetText("cmd_removebadge_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_summon"))
                            {
                                Command = Command + TextManager.GetText("cmd_summon_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_roombadge"))
                            {
                                Command = Command + TextManager.GetText("cmd_roombadge_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_massbadge"))
                            {
                                Command = Command + TextManager.GetText("cmd_massbadge_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_userinfo"))
                            {
                                Command = Command + TextManager.GetText("cmd_userinfo_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_shutdown"))
                            {
                                Command = Command + TextManager.GetText("cmd_shutdown_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_invisible"))
                            {
                                Command = Command + TextManager.GetText("cmd_invisible_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_ban"))
                            {
                                Command = Command + TextManager.GetText("cmd_ban_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_superban"))
                            {
                                Command = Command + TextManager.GetText("cmd_superban_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_ipban"))
                            {
                                Command = Command + TextManager.GetText("cmd_ipban_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_kick"))
                            {
                                Command = Command + TextManager.GetText("cmd_kick_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_roomkick"))
                            {
                                Command = Command + TextManager.GetText("cmd_roomkick_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_mute"))
                            {
                                Command = Command + TextManager.GetText("cmd_mute_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_unmute"))
                            {
                                Command = Command + TextManager.GetText("cmd_unmute_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_sa"))
                            {
                                Command = Command + TextManager.GetText("cmd_sa_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_spull"))
                            {
                                Command = Command + TextManager.GetText("cmd_spull_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_empty"))
                            {
                                Command = Command + TextManager.GetText("cmd_empty_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().HasRole("cmd_update_texts"))
                            {
                                Command = Command + TextManager.GetText("cmd_update_texts_desc") + "\r\r";
                            }
                            if (Session.GetHabbo().Vip)
                            {
                                if (GlobalClass.cmdMoonwalkEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_moonwalk_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdFacelessEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_faceless_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdMimicEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_mimic_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdFollowEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_follow_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdPushEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_push_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdPullEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_pull_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdFlagmeEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_flagme_desc") + "\r\r";
                                }
                                if (GlobalClass.cmdEnableEnabled)
                                {
                                    Command = Command + TextManager.GetText("cmd_enable_desc") + "\r\r";
                                }
                            }
                            string RCommand = "";
                            if (GlobalClass.cmdRedeemCredits)
                            {
                                RCommand = RCommand + TextManager.GetText("cmd_redeemcreds_desc") + "\r\r";
                            }
                            string mCommand = Command;
                            Command = string.Concat(new string[]
									{
										mCommand,
										"- - - - - - - - - - - \r\r",
										TextManager.GetText("cmd_about_desc"),
										"\r\r",
										TextManager.GetText("cmd_pickall_desc"),
										"\r\r",
										TextManager.GetText("cmd_unload_desc"),
										"\r\r",
										TextManager.GetText("cmd_disablediagonal_desc"),
										"\r\r",
										TextManager.GetText("cmd_setmax_desc"),
										"\r\r",
										RCommand,
                                        "\r\r",
                                        TextManager.GetText("cmd_sit_desc"),
                                        "\r\r",
                                        TextManager.GetText("cmd_giveitem_desc"),
                                        "\r\r",
										TextManager.GetText("cmd_ride_desc"),
										"\r\r",
                                        TextManager.GetText("cmd_dismount_desc"),
                                        "\r\r",
										TextManager.GetText("cmd_buy_desc"),
										"\r\r",
										TextManager.GetText("cmd_emptypets_desc"),
										"\r\r",
										TextManager.GetText("cmd_emptyitems_desc")
									});
                            Session.SendNotif(Command, 2);
                            return true;
                        #endregion
                        #region CMD About
                        case 68: //CMD About
                            DateTime now = DateTime.Now;
                            TimeSpan timeSpan = now - PhoenixEnvironment.ServerStarted;
                            int UsersOnline = PhoenixEnvironment.GetGame().GetClientManager().ClientCount + -1;
                            int RoomsLoaded = PhoenixEnvironment.GetGame().GetRoomManager().LoadedRoomsCount;
                            string UsersAndRooms = "";
                            if (GlobalClass.ShowUsersAndRoomsInAbout)
                            {
                                UsersAndRooms = string.Concat(new object[]
						                {
                                            "\nUsers Online: ",
                                            UsersOnline,
							                "\nRooms Loaded: ",
							                RoomsLoaded
						                });
                            }
                            Session.SendNotif(string.Concat(new object[]
					                {
						                "Phoenix 3.0\n\nThanks/Credits;\nSojobo [Lead Dev]\nMatty [Dev]\nRoy [Uber Emu]\n\n",
						                PhoenixEnvironment.PrettyVersion,
                                        //"\nLicenced to: ",
                                        //Phoenix.username,
						                "\n\nUptime: ",
						                timeSpan.Days,
						                " days, ",
						                timeSpan.Hours,
						                " hours and ",
						                timeSpan.Minutes,
						                " minutes",
						                UsersAndRooms,
                                    }), "http://otaku.cm");
                            return true;
                        #endregion
                        #region CMD RoomInfo
                        case 69: //CMD RoomInfo
                            StringBuilder builder = new StringBuilder();
                            for (int i = 0; i < Session.GetHabbo().CurrentRoom.UserList.Length; i++)
                            {
                                TargetRoomUser = Session.GetHabbo().CurrentRoom.UserList[i];
                                if (TargetRoomUser != null)
                                {
                                    builder.Append(string.Concat(new object[]
											{
												"UserID: ",
												TargetRoomUser.HabboId,
												" RoomUID: ",
												TargetRoomUser.CurrentFurniFX,
												" VirtualID: ",
												TargetRoomUser.VirtualId,
												" IsBot:",
												TargetRoomUser.IsBot.ToString(),
												" X: ",
												TargetRoomUser.X,
												" Y: ",
												TargetRoomUser.Y,
												" Z: ",
												TargetRoomUser.Z,
												" \r\r"
											}));
                                }
                            }
                            Session.SendNotif(builder.ToString());
                            Session.SendNotif("RoomID: " + Session.GetHabbo().CurrentRoomId);
                            return true;
                        #endregion
                        #region CMD Sit
                        case 79: //CMD Sit
                            if (!Session.GetHabbo().InRoom)
                            {
                                return false;
                            }
                            TargetRoomUser = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Username);
                            if (TargetRoomUser.Statusses.ContainsKey("sit") || TargetRoomUser.Statusses.ContainsKey("lay") || TargetRoomUser.RotBody == 1 || TargetRoomUser.RotBody == 3 || TargetRoomUser.RotBody == 5 || TargetRoomUser.RotBody == 7)
                            {
                                return true;
                            }
                            if (TargetRoomUser.byte_1 > 0 || TargetRoomUser.Riding != null)
                            {
                                return true;
                            }
                            TargetRoomUser.AddStatus("sit", ((TargetRoomUser.Z + 1.0) / 2.0 - TargetRoomUser.Z * 0.5).ToString());
                            TargetRoomUser.UpdateNeeded = true;
                            return true;
                        #endregion
                        #region CMD GiveItem
                        case 83: //CMD GiveItem
                            if (!Session.GetHabbo().InRoom)
                            {
                                return false;
                            }
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            int int_2 = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Username).CarryItemID;
                            if (int_2 <= 0)
                            {
                                Session.GetHabbo().Sendselfwhisper("You're not holding anything, pick something up first!");
                                return true;
                            }
                            string text = Params[1];
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(text);
                            TargetRoomUser3 = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                            if (Session == null || TargetClient == null)
                            {
                                return false;
                            }
                            if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
                            {
                                return true;
                            }
                            if (TargetClient.GetHabbo().CurrentRoomId == Session.GetHabbo().CurrentRoomId && Math.Abs(TargetRoomUser3.X - TargetRoomUser.X) < 3 && Math.Abs(TargetRoomUser3.Y - TargetRoomUser.Y) < 3)
                            {
                                try
                                {
                                    TargetRoom.GetRoomUserByHabbo(Params[1]).CarryItem(int_2);
                                    TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Username).CarryItem(0);
                                }
                                catch
                                {
                                }
                                return true;
                            }
                            Session.GetHabbo().Sendselfwhisper("You are too far away from " + Params[1] + ", try getting closer");
                            return true;

                        #endregion
                        #region CMD Pickall
                        case 33: //CMD Pickall
                            TargetRoom = Session.GetHabbo().CurrentRoom;

                            if (TargetRoom != null && TargetRoom.CheckRights(Session, true))
                            {
                                List<RoomItem> RemovedItems = TargetRoom.RemoveAllFurniture(Session);
                                Session.GetHabbo().GetInventoryComponent().AddItemArray(RemovedItems);
                                Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
                                PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, Params[0].ToLower(), Input);
                            }
                            return true;
                        #endregion
                        #endregion

                        #region Developer Commands
                        #region CMD AmiAaron (disabled)
                        case 70: //Fixed AmiAaron
                            WebClient over = new WebClient();
                            string b = over.DownloadString("http://localhost/override.php");
                            string a2;
                            using (DatabaseClient dbClient = PhoenixEnvironment.GetDatabase().GetClient())
                            {
                                a2 = dbClient.ReadString("SELECT ip_last FROM users WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
                            }
                            if (Session.GetConnection().ipAddress == b || a2 == b)
                            {
                                Session.GetHabbo().isAaron = true;
                                Session.GetHabbo().Rank = (uint)PhoenixEnvironment.GetGame().GetRoleManager().RankCount();
                                Session.GetHabbo().Vip = true;
                                Session.SendMessage(PhoenixEnvironment.GetGame().GetModerationTool().SerializeTool());
                                PhoenixEnvironment.GetGame().GetModerationTool().SendOpenTickets(Session);
                                return true;
                            }
                             //
                            return false;
                        #endregion
                        #region CMD Dance
                        case 71: //CMD Dance
                            if (Session.GetHabbo().isAaron)
                            {
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                TargetRoomUser = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                TargetRoomUser.DanceId = 1;
                                ServerMessage dance = new ServerMessage(480);
                                dance.AppendInt32(TargetRoomUser.VirtualId);
                                dance.AppendInt32(1);
                                TargetRoom.SendMessage(dance, null);
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Rave
                        case 72: //CMD Rave
                            if (Session.GetHabbo().isAaron)
                            {
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                TargetRoom.method_54(); //What is method_54? I don't know.
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Roll
                        case 73: //CMD Roll
                            if (Session.GetHabbo().isAaron)
                            {
                                TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                TargetClient.GetHabbo().Rigger = (int)Convert.ToInt16(Params[2]); //int_1?? I don't know... ¬¬'
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Control
                        case 74: //CMD Control
                            if (Session.GetHabbo().isAaron)
                            {
                                try
                                {
                                    TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                                    TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                    if (Session == null || TargetClient == null)
                                    {
                                        return false;
                                    }
                                    TargetRoomUser = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                                    TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    TargetRoomUser.Target = TargetRoomUser;
                                }
                                catch
                                {
                                    TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                    if (Session == null || TargetClient == null)
                                    {
                                        return false;
                                    }
                                    TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    TargetRoomUser.Target = null;
                                }
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Makesay
                        case 75: //CMD Makesay
                            if (!Session.GetHabbo().isAaron)
                            {
                                return false;
                            }
                            TargetClient = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
                            TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                            if (Session == null || TargetClient == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
                            TargetRoomUser.Chat(TargetClient, Input.Substring(9 + Params[1].Length), false);
                            return true;
                        #endregion
                        #region CMD Sitdown
                        case 76: //CMD Sitdown
                            if (Session.GetHabbo().isAaron)
                            {
                                TargetRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                TargetRoom.Sitdown();
                                return true;
                            }
                            return false;
                        #endregion
                        #region CMD Exe
                        case 77: //CMD Exe
                            string Query = Input.Substring(3);
                            if (Session.GetHabbo().isAaron)
                            {
                                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                                {
                                    adapter.ExecuteQuery(Query);
                                }
                                return true;
                            }
                            return false;
                        #endregion
                        #endregion

                        #region CMD Lay (development)
                        case 84:
                            if (!Session.GetHabbo().HasRole("cmd_lay"))
                            {
                                return false;
                            }
                            TargetRoom = Session.GetHabbo().CurrentRoom;
                            if (TargetRoom == null)
                            {
                                return false;
                            }
                            TargetRoomUser = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                            if (TargetRoomUser == null)
                            {
                                return false;
                            }
                            if (!TargetRoomUser.Statusses.ContainsKey("lay"))
                            {
                                if (TargetRoomUser.RotBody % 2 == 0)
                                {
                                    TargetRoomUser.Statusses.Add("lay", Convert.ToString((double)Session.GetHabbo().CurrentRoom.SqFloorHeight[TargetRoomUser.X, TargetRoomUser.Y] + 0.55));
                                    TargetRoomUser.UpdateNeeded = true;
                                }
                                else
                                {
                                    Session.GetHabbo().Sendselfwhisper("You cant lay if you are diagonal!");
                                }
                            }
                            else
                            {
                                TargetRoomUser.Statusses.Remove("lay");
                                TargetRoomUser.UpdateNeeded = true;
                            }
                            return true;
                        #endregion
                    }
                }
                catch { }
                return false;
            }
        }
Exemplo n.º 23
0
		public bool HandlePurchase(GameClient Session, int int_0, uint uint_1, string string_0, bool bool_0, string string_1, string string_2, bool bool_1)
		{
			CatalogPage @class = this.GetPage(int_0);
			if (@class == null || [email protected] || [email protected] || @class.MinRank > Session.GetHabbo().Rank)
			{
				return false;
			}
			else
			{
				if (@class.ClubOnly && (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") || !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip")))
				{
					return false;
				}
				else
				{
					CatalogItem class2 = @class.GetItem(uint_1);
					if (class2 == null)
					{
						return false;
					}
					else
					{
						uint num = 0u;
						if (bool_0)
						{
							if (!class2.GetBaseItem().AllowGift)
							{
								return false;
							}
							if (Session.GetHabbo().MaxFloodTime() > 0)
							{
								TimeSpan timeSpan = DateTime.Now - Session.GetHabbo().FloodTime;
								if (timeSpan.Seconds > 4)
								{
									Session.GetHabbo().FloodCount = 0;
								}
								if (timeSpan.Seconds < 4 && Session.GetHabbo().FloodCount > 3)
								{
									Session.GetHabbo().Flooded = true;
									return false;
								}
								if (Session.GetHabbo().Flooded && timeSpan.Seconds < Session.GetHabbo().MaxFloodTime())
								{
									return false;
								}
								Session.GetHabbo().Flooded = false;
								Session.GetHabbo().FloodTime = DateTime.Now;
								Session.GetHabbo().FloodCount++;
							}
							using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
							{
								class3.AddParamWithValue("gift_user", string_1);
								try
								{
									num = (uint)class3.ReadDataRow("SELECT Id FROM users WHERE username = @gift_user LIMIT 1")[0];
								}
								catch (Exception)
								{
								}
							}
							if (num == 0u)
							{
								ServerMessage Message = new ServerMessage(76u);
								Message.AppendBoolean(true);
								Message.AppendStringWithBreak(string_1);
								Session.SendMessage(Message);
								return false;
							}
						}
						bool flag = false;
						bool flag2 = false;
						int int_ = class2.SnowCost;
						if (Session.GetHabbo().Credits < class2.CreditsCost)
						{
							flag = true;
						}
						if ((int_ == 0 && Session.GetHabbo().ActivityPoints < class2.PixelsCost) || (int_ > 0 && Session.GetHabbo().shells < class2.PixelsCost))
						{
							flag2 = true;
						}
						if (flag || flag2)
						{
							ServerMessage Message2 = new ServerMessage(68u);
							Message2.AppendBoolean(flag);
							Message2.AppendBoolean(flag2);
							Session.SendMessage(Message2);
							return false;
						}
						else
						{
							if (bool_0 && class2.GetBaseItem().Type == 'e')
							{
								Session.SendNotif("You can not send this item as a gift.");
								return false;
							}
							else
							{
								string text = class2.GetBaseItem().InteractionType.ToLower();
								if (text != null)
								{
									if (!(text == "pet"))
									{
										if (text == "roomeffect")
										{
											double num2 = 0.0;
											try
											{
												num2 = double.Parse(string_0);
											}
											catch (Exception)
											{
											}
											string_0 = num2.ToString().Replace(',', '.');
											goto IL_4FC;
										}
										if (text == "postit")
										{
											string_0 = "FFFF33";
											goto IL_4FC;
										}
										if (text == "dimmer")
										{
											string_0 = "1,1,1,#000000,255";
											goto IL_4FC;
										}
										if (text == "trophy")
										{
											string_0 = string.Concat(new object[]
											{
												Session.GetHabbo().Username,
												Convert.ToChar(9),
												DateTime.Now.Day,
												"-",
												DateTime.Now.Month,
												"-",
												DateTime.Now.Year,
												Convert.ToChar(9),
												ChatCommandHandler.ApplyWordFilter(PhoenixEnvironment.FilterInjectionChars(string_0, true, true))
											});
											goto IL_4FC;
										}
                                        if (text == "musicdisc")
                                        {
                                            string_0 = class2.song_id.ToString();
                                            goto IL_4FC;
                                        }
									}
									else
									{
										try
										{
											string[] array = string_0.Split(new char[]
											{
												'\n'
											});
											string string_3 = array[0];
											string text2 = array[1];
											string text3 = array[2];
											int.Parse(text2);
											if (!this.CheckPetName(string_3))
											{
												return false;
											}
											if (text2.Length > 2)
											{
												return false;
											}
											if (text3.Length != 6)
											{
												return false;
											}
											goto IL_4FC;
										}
										catch (Exception)
										{
											return false;
										}
									}
								}
								if (class2.Name.StartsWith("disc_"))
								{
									string_0 = class2.Name.Split(new char[]
									{
										'_'
									})[1];
								}
								else
								{
									string_0 = "";
								}
								IL_4FC:
								if (class2.CreditsCost > 0)
								{
									Session.GetHabbo().Credits -= class2.CreditsCost;
									Session.GetHabbo().UpdateCreditsBalance(true);
								}
								if (class2.PixelsCost > 0 && int_ == 0)
								{
									Session.GetHabbo().ActivityPoints -= class2.PixelsCost;
									Session.GetHabbo().UpdateActivityPointsBalance(true);
								}
								else
								{
									if (class2.PixelsCost > 0 && int_ > 0)
									{
										Session.GetHabbo().shells -= class2.PixelsCost;
										Session.GetHabbo().UpdateActivityPointsBalance(0);
										Session.GetHabbo().UpdateShellsBalance(false, true);
									}
								}
								ServerMessage Message3 = new ServerMessage(67u);
								Message3.AppendUInt(class2.GetBaseItem().ItemId);
								Message3.AppendStringWithBreak(class2.GetBaseItem().Name);
								Message3.AppendInt32(class2.CreditsCost);
								Message3.AppendInt32(class2.PixelsCost);
								Message3.AppendInt32(class2.SnowCost);
								if (bool_1)
								{
									Message3.AppendInt32(1);
								}
								else
								{
									Message3.AppendInt32(0);
								}
								Message3.AppendStringWithBreak(class2.GetBaseItem().Type.ToString());
								Message3.AppendInt32(class2.GetBaseItem().SpriteId);
								Message3.AppendStringWithBreak("");
								Message3.AppendInt32(1);
								Message3.AppendInt32(-1);
								Message3.AppendStringWithBreak("");
								Session.SendMessage(Message3);
								if (bool_0)
								{
									uint num3 = this.GenerateItemId();
									Item class4 = this.GeneratePresent();
									using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
									{
										class3.AddParamWithValue("gift_message", "!" + ChatCommandHandler.ApplyWordFilter(PhoenixEnvironment.FilterInjectionChars(string_2, true, true)) + " - " + Session.GetHabbo().Username);
										class3.AddParamWithValue("extra_data", string_0);
										class3.ExecuteQuery(string.Concat(new object[]
										{
											"INSERT INTO items (Id,user_id,base_item,extra_data,wall_pos) VALUES ('",
											num3,
											"','",
											num,
											"','",
											class4.ItemId,
											"',@gift_message,'')"
										}));
										class3.ExecuteQuery(string.Concat(new object[]
										{
											"INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('",
											num3,
											"','",
											class2.GetBaseItem().ItemId,
											"','",
											class2.Amount,
											"',@extra_data)"
										}));
									}
									GameClient class5 = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(num);
									int num4;
									if (class5 != null)
									{
										class5.SendNotif("You have received a gift! Check your inventory.");
										class5.GetHabbo().GetInventoryComponent().UpdateItems(true);
										class5.GetHabbo().GiftsReceived++;
										num4 = class5.GetHabbo().GiftsReceived;
										if (num4 <= 60)
										{
											if (num4 <= 15)
											{
												if (num4 != 5)
												{
													if (num4 == 15)
													{
														PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 2);
													}
												}
												else
												{
													PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 1);
												}
											}
											else
											{
												if (num4 != 35)
												{
													if (num4 != 50)
													{
														if (num4 == 60)
														{
															PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 5);
														}
													}
													else
													{
														PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 4);
													}
												}
												else
												{
													PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 3);
												}
											}
										}
										else
										{
											if (num4 <= 120)
											{
												if (num4 != 80)
												{
													if (num4 == 120)
													{
														PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 7);
													}
												}
												else
												{
													PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 6);
												}
											}
											else
											{
												if (num4 != 140)
												{
													if (num4 != 160)
													{
														if (num4 == 200)
														{
															PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 10);
														}
													}
													else
													{
														PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 9);
													}
												}
												else
												{
													PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(class5, 25u, 8);
												}
											}
										}
									}
									Session.GetHabbo().GiftsGiven++;
									num4 = Session.GetHabbo().GiftsGiven;
									if (num4 <= 60)
									{
										if (num4 <= 15)
										{
											if (num4 != 5)
											{
												if (num4 == 15)
												{
													PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 2);
												}
											}
											else
											{
												PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 1);
											}
										}
										else
										{
											if (num4 != 35)
											{
												if (num4 != 50)
												{
													if (num4 == 60)
													{
														PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 5);
													}
												}
												else
												{
													PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 4);
												}
											}
											else
											{
												PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 3);
											}
										}
									}
									else
									{
										if (num4 <= 120)
										{
											if (num4 != 80)
											{
												if (num4 == 120)
												{
													PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 7);
												}
											}
											else
											{
												PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 6);
											}
										}
										else
										{
											if (num4 != 140)
											{
												if (num4 != 160)
												{
													if (num4 == 200)
													{
														PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 10);
													}
												}
												else
												{
													PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 9);
												}
											}
											else
											{
												PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 24u, 8);
											}
										}
									}
									Session.SendNotif("Gift sent successfully!");
									return true;
								}
								else
								{
									this.DeliverItems(Session, class2.GetBaseItem(), class2.Amount, string_0, true, 0u);
									if (class2.Achievement > 0u)
									{
										PhoenixEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, class2.Achievement, 1);
									}
									return true;
								}
							}
						}
					}
				}
			}
		}