internal static SquarePoint GetNextStep(int pUserX, int pUserY, int pUserTargetX, int pUserTargetY, byte[,] pGameMap, double[,] pHeight, double[,] double_1, double[,] double_2, int MaxX, int MaxY, bool pUserOverride, bool pDiagonal, bool[,] iHeightOverride, int[,] GroupGates, Room room, double Height)
 {
     ModelInfo pMap = new ModelInfo(MaxX, MaxY, pGameMap);
     List<RoomItem> ItemsOnSquare = room.method_93(pUserTargetX, pUserTargetY);
     SquarePoint squarePoint = new SquarePoint(pUserTargetX, pUserTargetY, pUserTargetX, pUserTargetY, pMap.GetState(pUserTargetX, pUserTargetY), pUserOverride, GroupGates[pUserTargetX, pUserTargetY] > 0, ItemsOnSquare, Height, room.GetRoomUsersBySquare(pUserTargetX, pUserTargetY),room);
     SquarePoint result;
     if (pUserX == pUserTargetX && pUserY == pUserTargetY)
     {
         result = squarePoint;
     }
     else
     {
         try
         {
             SquareInformation pInfo = new SquareInformation(pUserX, pUserY, squarePoint, pMap, pUserOverride, pDiagonal, GroupGates,room,Height);
             result = DreamPathfinder.GetClosetSqare(pInfo, new HeightInfo(MaxX, MaxY, pHeight, double_1, double_2), pDiagonal, pUserOverride, iHeightOverride, GroupGates);
         }
         catch
         {
             return squarePoint;
         }
        
     }
     return result;
 }
        public SquareInformation(int pX, int pY, SquarePoint pTarget, ModelInfo pMap, bool pUserOverride, bool CalculateDiagonal, int[,] GroupGates, Room room, double Height)
        {
            this.mX = pX;
            this.mY = pY;
            this.mTarget = pTarget;

            this.mPoint = new SquarePoint(pX, pY, pTarget.X, pTarget.Y, pMap.GetState(pX, pY), pUserOverride, false, room.method_93(pX, pY), Height, room.GetRoomUsersBySquare(pX, pY),room);
            this.mPos = new SquarePoint[8];
            if (CalculateDiagonal)
            {
                this.mPos[1] = new SquarePoint(pX - 1, pY - 1, pTarget.X, pTarget.Y, pMap.GetState(pX - 1, pY - 1), pUserOverride, false, room.method_93(pX - 1, pY - 1), Height, room.GetRoomUsersBySquare(pX - 1, pY - 1),room);
                this.mPos[3] = new SquarePoint(pX - 1, pY + 1, pTarget.X, pTarget.Y, pMap.GetState(pX - 1, pY + 1), pUserOverride, false, room.method_93(pX - 1, pY + 1), Height, room.GetRoomUsersBySquare(pX - 1, pY + 1),room);
                this.mPos[5] = new SquarePoint(pX + 1, pY + 1, pTarget.X, pTarget.Y, pMap.GetState(pX + 1, pY + 1), pUserOverride, false, room.method_93(pX + 1, pY + 1), Height, room.GetRoomUsersBySquare(pX + 1, pY + 1),room);
                this.mPos[7] = new SquarePoint(pX + 1, pY - 1, pTarget.X, pTarget.Y, pMap.GetState(pX + 1, pY - 1), pUserOverride, false, room.method_93(pX + 1, pY - 1), Height, room.GetRoomUsersBySquare(pX + 1, pY - 1),room);
            }
            this.mPos[0] = new SquarePoint(pX, pY - 1, pTarget.X, pTarget.Y, pMap.GetState(pX, pY - 1), pUserOverride, false, room.method_93(pX, pY - 1), Height, room.GetRoomUsersBySquare(pX, pY - 1),room);
            this.mPos[2] = new SquarePoint(pX - 1, pY, pTarget.X, pTarget.Y, pMap.GetState(pX - 1, pY), pUserOverride, false, room.method_93(pX - 1, pY), Height, room.GetRoomUsersBySquare(pX - 1, pY),room);
            this.mPos[4] = new SquarePoint(pX, pY + 1, pTarget.X, pTarget.Y, pMap.GetState(pX, pY + 1), pUserOverride, false, room.method_93(pX, pY + 1), Height, room.GetRoomUsersBySquare(pX, pY + 1),room);
            this.mPos[6] = new SquarePoint(pX + 1, pY, pTarget.X, pTarget.Y, pMap.GetState(pX + 1, pY), pUserOverride, false, room.method_93(pX + 1, pY), Height, room.GetRoomUsersBySquare(pX + 1, pY),room);
        }
Example #3
0
        public void method_87(RoomUser User, bool bool_13, bool bool_14)
        {

            int num = 0;
            try
            {
                if (User != null)
                {
                    if (User.GetRoom().IsPublic)
                    {
                        if (Essential.GetGame().GetRoomManager().ContainsMagicTile(User.GetRoom().Id, User.X, User.Y))
                        {
                            MagicTile TaikaLaatta = Essential.GetGame().GetRoomManager().GetMagicTile(User.GetRoom().Id, User.X, User.Y);

                            if (TaikaLaatta.Action == "WARP")
                            {
                                ServerMessage Message = new ServerMessage(Outgoing.RoomForward); // Updated
                                Message.AppendBoolean(true);
                                Message.AppendInt32(TaikaLaatta.NextRoomId);
                                User.GetClient().SendMessage(Message);

                                if (TaikaLaatta.NextX > 0)
                                {
                                    User.GetClient().GetHabbo().UsedWarpTile = true;
                                    User.GetClient().GetHabbo().NextRoomId = TaikaLaatta.NextRoomId;
                                    User.GetClient().GetHabbo().NextX = TaikaLaatta.NextX;
                                    User.GetClient().GetHabbo().NextY = TaikaLaatta.NextY;
                                    User.GetClient().GetHabbo().NextZ = TaikaLaatta.NextZ;
                                    User.GetClient().GetHabbo().NextRot = TaikaLaatta.NextRot;
                                }

                            }
                            else if (TaikaLaatta.Action == "REMOVE_SWIM")
                            {
                                if (User.Statusses.ContainsKey("swim"))
                                {
                                    User.Statusses.Remove("swim");
                                    User.UpdateNeeded = true;
                                }
                            }
                            else if (TaikaLaatta.Action == "TAKE_SWIM")
                            {

                                if (User.Statusses.ContainsKey("swim"))
                                {
                                    User.Statusses.Remove("swim");
                                }
                                if (User.Statusses.ContainsKey("sign"))
                                {
                                    User.Statusses.Remove("sign");
                                }
                                User.Statusses.Add("swim", "");
                                User.UpdateNeeded = true;

                            }
                        }
                    }

                    num = 1;
                    if (User.IsPet)
                    {
                        User.PetData.X = User.X;
                        User.PetData.Y = User.Y;
                        User.PetData.Z = User.double_0;
                    }
                    else
                    {
                        if (User.IsBot)
                        {
                            User.RoomBot.x = User.X;
                            User.RoomBot.y = User.Y;
                            User.RoomBot.z = User.double_0;
                        }
                        else
                        {
                            if (User.class34_1 != null && User.RoomUser_0 != null)
                            {
                                return;
                            }
                        }
                    }
                    num = 2;
                    if (!User.bool_12)
                    {
                        User.UpdateNeeded = false;
                    }
                    else
                    {
                        num = 3;
                        if (bool_13)
                        {
                            num = 4;
                            if (User.byte_1 > 0)
                            {
                                num = 5;
                                if (User.IsBot)
                                {
                                    if (this.byte_1[User.X, User.Y] == 0)
                                    {
                                        User.RoomBot.EffectId = -1;
                                        User.byte_1 = 0;
                                    }
                                }
                                else
                                {
                                    num = 6;
                                    if ((User.GetClient().GetHabbo().Gender.ToLower() == "m" && this.byte_1[User.X, User.Y] == 0) || (User.GetClient().GetHabbo().Gender.ToLower() == "f" && this.byte_2[User.X, User.Y] == 0))
                                    {
                                        User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
                                        User.byte_1 = 0;
                                    }
                                }
                            }
                            num = 7;
                            if (User.Statusses.ContainsKey("lay") || User.Statusses.ContainsKey("sit"))
                            {
                                User.Statusses.Remove("lay");
                                User.Statusses.Remove("sit");
                                User.UpdateNeeded = true;
                            }
                            List<RoomItem> list = this.method_93(User.X, User.Y);
                            SquarePoint spoint = new SquarePoint(0, 0, 0, 0, 0, false, false, list, User.double_0, this.GetRoomUsersBySquare(User.X, User.Y), this);
                            double num2 = spoint.WalkUnder ? spoint.SmallestZ(User.double_0) : this.method_84(User.X, User.Y, list);
                            if (num2 != User.double_0)
                            {
                                User.double_0 = num2;
                                User.UpdateNeeded = true;
                            }
                            num = 8;
                            if (this.RoomModel.squareState[User.X, User.Y] == SquareState.GROUPGATE)
                            {
                                foreach (DataRow dataRow in User.GetClient().GetHabbo().dataTable_0.Rows)
                                {

                                    foreach (RoomItem item in list)
                                    {
                                        if (item.GetBaseItem().Name == "gld_gate")
                                        {
                                            if ((int)dataRow["groupid"] == int.Parse(item.GuildData))
                                            {
                                                item.ExtraData = "1";
                                                item.UpdateState(false, true);
                                            }

                                        }

                                    }
                                }
                            }


                            SquarePoint spoint2 = new SquarePoint(0, 0, 0, 0, 0, false, false, this.method_93(User.X, User.Y), User.double_0, this.GetRoomUsersBySquare(User.X, User.Y), this);
                            if (this.RoomModel.squareState[User.X, User.Y] == SquareState.SEAT && !spoint2.WalkUnder)
                            {
                                if (!User.Statusses.ContainsKey("sit"))
                                {
                                    User.Statusses.Add("sit", "1.0");
                                    if (User.byte_1 > 0)
                                    {
                                        if (!User.IsBot)
                                        {
                                            User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
                                        }
                                        else
                                        {
                                            User.RoomBot.EffectId = -1;
                                        }
                                        User.byte_1 = 0;
                                    }
                                    num = 9;
                                    User.double_0 = this.RoomModel.double_1[User.X, User.Y];
                                    User.int_7 = this.RoomModel.int_3[User.X, User.Y];
                                    User.BodyRotation = this.RoomModel.int_3[User.X, User.Y];
                                    if (User.IsBot && User.RoomBot.RoomUser_0 != null)
                                    {
                                        User.RoomBot.RoomUser_0.double_0 = User.double_0 + 1.0;
                                        User.RoomBot.RoomUser_0.int_7 = User.int_7;
                                        User.RoomBot.RoomUser_0.BodyRotation = User.BodyRotation;
                                    }
                                    User.UpdateNeeded = true;

                                }
                            }
                            if (list.Count < 1 && this.list_4.Contains(User.UId))
                            {
                                User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, false);
                                this.list_4.Remove(User.UId);
                                User.int_14 = 0;
                                User.UpdateNeeded = true;
                            }
                            num = 10;
                            lock (list)
                            {
                                foreach (RoomItem Item in list)
                                {
                                    num = 11;
                                    if (Item.GetBaseItem().IsSeat && (!User.IsPet || User.RoomBot.RoomUser_0 == null) && !spoint2.WalkUnder)
                                    {
                                        if (!User.Statusses.ContainsKey("sit"))
                                        {
                                            double num3;
                                            try
                                            {
                                                if (Item.GetBaseItem().Height_Adjustable.Count > 1)
                                                {
                                                    num3 = Item.GetBaseItem().Height_Adjustable[(int)Convert.ToInt16(Item.ExtraData)];
                                                }
                                                else
                                                {
                                                    num3 = Item.GetBaseItem().Height;
                                                }
                                                goto IL_BCA;
                                            }
                                            catch
                                            {
                                                num3 = Item.GetBaseItem().Height;
                                                goto IL_BCA;
                                            }
                                        IL_51B:
                                            if (User.byte_1 > 0)
                                            {
                                                if (!User.IsBot)
                                                {
                                                    User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
                                                }
                                                else
                                                {
                                                    User.RoomBot.EffectId = -1;
                                                }
                                                User.byte_1 = 0;
                                                goto IL_55D;
                                            }
                                            goto IL_55D;
                                        IL_BCA:
                                            if (User.Statusses.ContainsKey("sit"))
                                            {
                                                goto IL_51B;
                                            }
                                        try
                                        {
                                            //It's not that bad if it fails to sit.. You shouldn't crash the whole room with it!!
                                            User.Statusses.Add("sit", num3.ToString().Replace(',', '.'));
                                        }
                                        catch { }
                                            goto IL_51B;
                                        }
                                    IL_55D:
                                        User.double_0 = Item.Double_0;
                                        User.int_7 = Item.int_3;
                                        User.BodyRotation = Item.int_3;
                                        if (User.IsBot && User.RoomBot.RoomUser_0 != null)
                                        {
                                            User.RoomBot.RoomUser_0.double_0 = User.double_0 + 1.0;
                                            User.RoomBot.RoomUser_0.int_7 = User.int_7;
                                            User.RoomBot.RoomUser_0.BodyRotation = User.BodyRotation;
                                        }
                                        User.UpdateNeeded = true;
                                    }
                                    num = 12;
                                    if (Item.GetBaseItem().InteractionType.ToLower() == "bed")
                                    {
                                        if (!User.Statusses.ContainsKey("lay"))
                                        {
                                            double num3;
                                            try
                                            {
                                                if (Item.GetBaseItem().Height_Adjustable.Count > 1)
                                                {
                                                    num3 = Item.GetBaseItem().Height_Adjustable[(int)Convert.ToInt16(Item.ExtraData)];
                                                }
                                                else
                                                {
                                                    num3 = Item.GetBaseItem().Height;
                                                }
                                            }
                                            catch
                                            {
                                                num3 = Item.GetBaseItem().Height;
                                            }
                                            if (!User.Statusses.ContainsKey("lay"))
                                            {
                                                User.Statusses.Add("lay", Item.GetBaseItem().Height.ToString().Replace(',', '.') + " null");
                                            }
                                            if (User.byte_1 > 0)
                                            {
                                                if (!User.IsBot)
                                                {
                                                    User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
                                                }
                                                else
                                                {
                                                    User.RoomBot.EffectId = -1;
                                                }
                                                User.byte_1 = 0;
                                            }
                                        }
                                        User.double_0 = Item.Double_0;
                                        User.int_7 = Item.int_3;
                                        User.BodyRotation = Item.int_3;
                                        if (User.IsBot && User.RoomBot.RoomUser_0 != null)
                                        {
                                            User.RoomBot.RoomUser_0.double_0 = User.double_0 + 1.0;
                                            User.RoomBot.RoomUser_0.int_7 = User.int_7;
                                            User.RoomBot.RoomUser_0.BodyRotation = User.BodyRotation;
                                        }
                                        User.UpdateNeeded = true;
                                    }
                                    if (Item.GetBaseItem().Tent && User.TentID == 0)
                                    {
                                        if (!User.IsBot && !User.IsPet)
                                        {
                                            ServerMessage Message = new ServerMessage(Outgoing.ObjectDataUpdate);
                                            Message.AppendStringWithBreak(Item.uint_0.ToString());
                                            Message.AppendInt32(0);
                                            Message.AppendStringWithBreak("1");
                                            User.GetClient().SendMessage(Message);
                                            User.TentID = Item.uint_0;
                                        }
                                    }

                                    if (!User.IsBot && !User.IsPet)
                                    {


                                        if (User.team != Team.None)
                                        {
                                            if (Item.GetRoom().frzTimer == true)
                                            {
                                                if (Item.GetBaseItem().Name == "es_box")
                                                {
                                                    if (Item.freezePowerUp != FreezePowerUp.None)
                                                    {
                                                        this.GetFreeze().PickUpPowerUp(Item, User);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    if (Item.GetBaseItem().PrivateTile)
                                    {
                                        User.privateTileID = Item.uint_0;
                                        User.onPrivateTile = true;
                                    }
                                    TeamManager roomTeamManager;
                                    roomTeamManager = Item.GetRoom().GetRoomTeamManager();

                                    if (!User.IsBot && !User.IsPet && (Item.GetBaseItem().InteractionType.ToLower() == "freeze_blue_gate" || Item.GetBaseItem().InteractionType.ToLower() == "freeze_red_gate" || Item.GetBaseItem().InteractionType.ToLower() == "freeze_green_gate" || Item.GetBaseItem().InteractionType.ToLower() == "freeze_yellow_gate"))
                                    {
                                        if (roomTeamManager.CanEnterOnTeam(Item.team))
                                        {
                                            if (User.team == Team.None)
                                            {
                                                User.game = Rooms.Games.Game.Freeze;
                                                User.team = Item.team;
                                                roomTeamManager.AddUser(User);
                                                int FreezeEffect = ((int)Item.team) + 39;
                                                if (User.GetClient().GetHabbo().GetEffectsInventoryComponent().int_0 != FreezeEffect)
                                                {
                                                    User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(FreezeEffect, true);
                                                }
                                            }
                                            else
                                            {
                                                roomTeamManager.OnUserLeave(User);
                                                User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(0, true);
                                            }
                                        }
                                    }
                                    num = 13;
                                    if (Item.GetBaseItem().InteractionType.ToLower().IndexOf("bb_") > -1 && !User.IsBot && !User.IsPet)
                                    {
                                        if (Item.GetBaseItem().InteractionType.ToLower().IndexOf("_gate") > -1)
                                        {
                                            if (Item.GetBaseItem().InteractionType.ToLower() == "bb_yellow_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_red_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_green_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_blue_gate")
                                            {
                                                if (roomTeamManager.CanEnterOnTeam(Item.team))
                                                {
                                                    if (User.team == Team.None)
                                                    {
                                                        User.game = Rooms.Games.Game.BattleBanzai;
                                                        User.team = Item.team;
                                                        roomTeamManager.AddUser(User);
                                                        int FreezeEffect = ((int)Item.team) + 32;
                                                        if (User.GetClient().GetHabbo().GetEffectsInventoryComponent().int_0 != FreezeEffect)
                                                        {
                                                            User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(FreezeEffect, true);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        roomTeamManager.OnUserLeave(User);
                                                        User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(0, true);
                                                    }
                                                }
                                            }
                                        }

                                        if (Item.GetBaseItem().InteractionType.ToLower() == "bb_teleport")
                                        {
                                            this.method_91(Item, User);
                                        }
                                        if (Item.GetBaseItem().InteractionType.ToLower() == "bb_patch" && this.GetTopItem(Item.GetX, Item.Int32_1) == Item && User.team != Team.None && User.game == Rooms.Games.Game.BattleBanzai && User.bool_6 && Item.ExtraData != "14" && Item.ExtraData != "5" && Item.ExtraData != "8" && Item.ExtraData != "11" && Item.ExtraData != "1")
                                        {
                                            if (Item.ExtraData == "0" || Item.ExtraData == "")
                                            {
                                                if (User.team == Team.Yellow)
                                                {
                                                    Item.ExtraData = Convert.ToString(12);
                                                }
                                                else if (User.team == Team.Red)
                                                {
                                                    Item.ExtraData = Convert.ToString(3);
                                                }
                                                else if (User.team == Team.Green)
                                                {
                                                    Item.ExtraData = Convert.ToString(6);
                                                }
                                                else if (User.team == Team.Blue)
                                                {
                                                    Item.ExtraData = Convert.ToString(9);
                                                }
                                            }
                                            else
                                            {
                                                if (Convert.ToInt32(Item.ExtraData) > 0)
                                                {
                                                    if (User.team == Team.Yellow && (Item.ExtraData == "12" || Item.ExtraData == "13"))
                                                    {
                                                        Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
                                                    }
                                                    else
                                                    {
                                                        if (User.team == Team.Red && (Item.ExtraData == "3" || Item.ExtraData == "4"))
                                                        {
                                                            Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
                                                        }
                                                        else
                                                        {
                                                            if (User.team == Team.Green && (Item.ExtraData == "6" || Item.ExtraData == "7"))
                                                            {
                                                                Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
                                                            }
                                                            else
                                                            {
                                                                if (User.team == Team.Blue && (Item.ExtraData == "9" || Item.ExtraData == "10"))
                                                                {
                                                                    Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
                                                                }
                                                                else
                                                                {
                                                                    if (User.team == Team.Yellow)
                                                                    {
                                                                        Item.ExtraData = Convert.ToString(12);
                                                                    }
                                                                    else if (User.team == Team.Red)
                                                                    {
                                                                        Item.ExtraData = Convert.ToString(3);
                                                                    }
                                                                    else if (User.team == Team.Green)
                                                                    {
                                                                        Item.ExtraData = Convert.ToString(6);
                                                                    }
                                                                    else if (User.team == Team.Blue)
                                                                    {
                                                                        Item.ExtraData = Convert.ToString(9);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }

                                            }
                                            try
                                            {
                                                if (User.team == Team.Yellow && Item.ExtraData == "14")
                                                {
                                                    User.GetClient().GetHabbo().TilesLocked++;
                                                    User.GetClient().GetHabbo().CheckBattleBanzaiTilesLockedAchievements();
                                                }

                                                if (User.team == Team.Red && Item.ExtraData == "5")
                                                {
                                                    User.GetClient().GetHabbo().TilesLocked++;
                                                    User.GetClient().GetHabbo().CheckBattleBanzaiTilesLockedAchievements();
                                                }

                                                if (User.team == Team.Green && Item.ExtraData == "8")
                                                {
                                                    User.GetClient().GetHabbo().TilesLocked++;
                                                    User.GetClient().GetHabbo().CheckBattleBanzaiTilesLockedAchievements();
                                                }

                                                if (User.team == Team.Blue && Item.ExtraData == "11")
                                                {
                                                    User.GetClient().GetHabbo().TilesLocked++;
                                                    User.GetClient().GetHabbo().CheckBattleBanzaiTilesLockedAchievements();
                                                }
                                                int team = 0;
                                                if (User.team == Team.Yellow)
                                                {
                                                    team = 14;
                                                }
                                                else if (User.team == Team.Red)
                                                {
                                                    team = 5;
                                                }
                                                else if (User.team == Team.Green)
                                                {
                                                    team = 8;
                                                }
                                                else if (User.team == Team.Blue)
                                                {
                                                    team = 11;
                                                }

                                                this.method_89(team, Item, false, User.GetClient());
                                                Item.UpdateState(true, true);
                                            }
                                            catch { /*IGNORING BECAUSE IT F***S THE WHOLE F*****G THING UP */}
                                        }
                                    }
                                }
                                goto IL_1155;
                            }
                        }
                        num = 14;
                        List<RoomItem> list2 = this.method_93(User.int_12, User.int_13);
                        lock (list2)
                        {
                            foreach (RoomItem current in list2)
                            {
                                if (this.double_0[current.GetX, current.Int32_1] <= current.Double_0)
                                {
                                    if (bool_14)
                                    {
                                        if (!User.IsBot)
                                            this.method_11(User, current);
                                        else if (User.IsBot && !User.IsPet)
                                            this.TriggerBotOnFurni(User, current);
                                    }
                                    if (current.GetBaseItem().InteractionType.ToLower() == "instant_teleport")
                                    {
                                        if (!User.IsBot)
                                        {
                                            User.int_19 = -1;
                                            current.InteractingUser = User.GetClient().GetHabbo().Id;
                                            User.RoomItem_0 = current;
                                            current.ProcessUpdates();
                                        }
                                    }
                                    if (current.GetBaseItem().InteractionType.ToLower() == "pressure_pad")
                                    {
                                        current.ExtraData = "1";
                                        current.UpdateState(false, true);
                                    }
                                    if (current.GetBaseItem().InteractionType.ToLower() == "pressure_random")
                                    {

                                        current.ExtraData = new Random().Next(1, current.GetBaseItem().Modes).ToString();
                                        current.UpdateState(false, true);
                                    }
                                    if (current.GetBaseItem().InteractionType.ToLower() == "pet_drink")
                                    {
                                        if (User.IsPet)
                                        {
                                            User.ClearStatuses();
                                            User.Statusses.Add("eat", TextHandling.GetString(User.double_0));
                                        }
                                    }
                                    num = 15;
                                    if (current.GetBaseItem().InteractionType.ToLower() == "fbgate" && (!string.IsNullOrEmpty(current.string_2) || !string.IsNullOrEmpty(current.string_3)) && User != null && !User.IsBot)
                                    {
                                        if (User.string_0 != "")
                                        {
                                            User.GetClient().GetHabbo().Figure = User.string_0;
                                            User.string_0 = "";
                                            ServerMessage Message = new ServerMessage(Outgoing.UpdateUserInformation);
                                            Message.AppendInt32(User.VirtualId);
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Figure);
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
                                            Message.AppendInt32(User.GetClient().GetHabbo().AchievementScore);
                                            //   Message.AppendStringWithBreak("");
                                            this.SendMessage(Message, null);
                                        }
                                        else
                                        {
                                            string a = User.GetClient().GetHabbo().Gender;
                                            User.string_0 = User.GetClient().GetHabbo().Figure;
                                            if (a == "m")
                                            {
                                                AntiMutant.ValidateUserLook(User, current.string_2);
                                            }
                                            else
                                            {
                                                AntiMutant.ValidateUserLook(User, current.string_3);
                                            }
                                            ServerMessage Message = new ServerMessage(Outgoing.UpdateUserInformation);
                                            Message.AppendInt32(User.VirtualId);
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Figure);
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
                                            Message.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
                                            Message.AppendInt32(User.GetClient().GetHabbo().AchievementScore);
                                            //Message.AppendStringWithBreak("");
                                            this.SendMessage(Message, null);
                                        }
                                    }
                                    num = 16;
                                    if(current.GetBaseItem().InteractionType.ToLower() == "bb_puck")
                                    {
                                        Thread thrd = new Thread(delegate()
                                        {
                                            try
                                            {
                                                int newX = current.GetX;
                                                int newY = current.Int32_1;
                                                int i = 3;
                                                int BodyRotation = User.BodyRotation;
                                                while (i > 0)
                                                {
                                                    int oldNewX = newX;
                                                    int oldNewY = newY;
                                                    if (BodyRotation == 0)
                                                        newY--;
                                                    if (BodyRotation == 1)
                                                    { newX++; newY--; }
                                                    if (BodyRotation == 2)
                                                        newX++;
                                                    if (BodyRotation == 3)
                                                    { newY++; newX++; }
                                                    if (BodyRotation == 4)
                                                        newY++;
                                                    if (BodyRotation == 5)
                                                    { newX--; newY++; }
                                                    if (BodyRotation == 6)
                                                        newX--;
                                                    if (BodyRotation == 7)
                                                    { newX--; newY--; }
                                                    i--;
                                                    bool moveFurni = true;
                                                    if (!method_36(newX, newY))
                                                    { newX = oldNewX; newY = oldNewY; BodyRotation = GetOtherRotation(BodyRotation); moveFurni = false; }
                                                    foreach (RoomItem ri in this.method_93(newX, newY))
                                                    {
                                                        if (!ri.GetBaseItem().Walkable)
                                                        { newX = oldNewX; newY = oldNewY; BodyRotation = GetOtherRotation(BodyRotation); moveFurni = false; }
                                                    }
                                                    if (moveFurni)
                                                    {
                                                        this.method_40(current, newX, newY, current.uint_0, current.Double_0);
                                                        foreach(RoomItem ri in this.method_93(newX,newY))
                                                        {
                                                            if (ri.GetBaseItem().InteractionType.ToLower() == "bb_patch")
                                                            { FillBanzaiPatches(User, ri); }
                                                        }
                                                        Thread.Sleep(230);// this may be using a LOT of CPU... So be careful what you do with it!
                                                    }
                                                }
                                            }
                                            catch(Exception ex)
                                            {
                                                Console.WriteLine(ex.ToString());
                                                //If there wouldn't be any try.. Whole room crashes if a heavy exception occurs.
                                            }
                                        });
                                        thrd.Start();
                                    }
                                    if (current.GetBaseItem().InteractionType.ToLower() == "ball")
                                    {
                                        try
                                        {
                                            #region "Football"
                                            int num6 = current.GetX;
                                            int num7 = current.Int32_1;
                                            current.ExtraData = "11";
                                            if (User != null && User.GetClient() != null && User.GetClient().GetHabbo() != null)
                                            {
                                                current.LastPlayerHitFootball = User;
                                            }

                                            if (User.BodyRotation == 4)
                                            {
                                                num7++;
                                                if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                {
                                                    this.method_79(null, current, num6, num7 - 2, 0, false, true, true);
                                                }
                                            }
                                            else
                                            {
                                                if (User.BodyRotation == 0)
                                                {
                                                    num7--;
                                                    if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                    {
                                                        this.method_79(null, current, num6, num7 + 2, 0, false, true, true);
                                                    }
                                                }
                                                else
                                                {
                                                    if (User.BodyRotation == 6)
                                                    {
                                                        num6--;
                                                        if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                        {
                                                            this.method_79(null, current, num6 + 2, num7, 0, false, true, true);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (User.BodyRotation == 2)
                                                        {
                                                            num6++;
                                                            if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                            {
                                                                this.method_79(null, current, num6 - 2, num7, 0, false, true, true);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (User.BodyRotation == 3)
                                                            {
                                                                num6++;
                                                                num7++;
                                                                if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                                {
                                                                    this.method_79(null, current, num6 - 2, num7 - 2, 0, false, true, true);
                                                                }
                                                            }
                                                            else
                                                            {
                                                                if (User.BodyRotation == 1)
                                                                {
                                                                    num6++;
                                                                    num7--;
                                                                    if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                                    {
                                                                        this.method_79(null, current, num6 - 2, num7 + 2, 0, false, true, true);
                                                                    }
                                                                }
                                                                else
                                                                {
                                                                    if (User.BodyRotation == 7)
                                                                    {
                                                                        num6--;
                                                                        num7--;
                                                                        if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                                        {
                                                                            this.method_79(null, current, num6 + 2, num7 + 2, 0, false, true, true);
                                                                        }
                                                                    }
                                                                    else
                                                                    {
                                                                        if (User.BodyRotation == 5)
                                                                        {
                                                                            num6--;
                                                                            num7++;
                                                                            if (!this.method_79(null, current, num6, num7, 0, false, true, false))
                                                                            {
                                                                                this.method_79(null, current, num6 + 2, num7 - 2, 0, false, true, true);
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            #endregion
                                        }
                                        catch{}
                                    }
                                }
                            }
                        }
                    IL_1155: ;
                    }
                }
            }
            catch (Exception ex)
            {
                Logging.LogThreadException(ex.ToString(), string.Concat(new object[]
				{
					"Room [ID: ",
					this.Id,
					"] [Part: ",
					num,
					"] Update User Status"
				}));
                this.method_34();
            }
        }