예제 #1
0
        /// <summary>
        /// Turns the user into a pet
        /// </summary>
        /// <param name="TargetClient"></param>
        /// <param name="Pet"></param>
        public static void MakePet(GameClient TargetClient, string Pet)
        {
            int TargetPetId = RoleplayManager.GetPetIdByString(Pet);

            if (TargetClient == null)
            {
                return;
            }
            if (TargetClient.GetHabbo() == null)
            {
                return;
            }
            if (TargetClient.GetRoomUser() == null)
            {
                return;
            }

            //Change the users Pet Id.
            TargetClient.GetHabbo().PetId = (TargetPetId == -1 ? 0 : TargetPetId);

            //Quickly remove the old user instance.
            TargetClient.GetRoomUser().GetRoom().SendMessage(new UserRemoveComposer(TargetClient.GetRoomUser().VirtualId));

            //Add the new one, they won't even notice a thing!!11 8-)
            TargetClient.GetRoomUser().GetRoom().SendMessage(new UsersComposer(TargetClient.GetRoomUser()));
        }
예제 #2
0
        /// <summary>
        /// Generates the fence for jailbreak
        /// </summary>
        /// <param name="Room"></param>
        public static void GenerateFence(Room Room)
        {
            int X   = Convert.ToInt32(RoleplayData.GetData("jailbreak", "fencex"));
            int Y   = Convert.ToInt32(RoleplayData.GetData("jailbreak", "fencey"));
            int Rot = Convert.ToInt32(RoleplayData.GetData("jailbreak", "fencerotation"));

            if (Room.GetRoomItemHandler().GetFloor.Where(x => x.BaseItem == 8049 && x.GetX == X && x.GetY == Y).ToList().Count <= 0)
            {
                double MaxHeight = 0.0;
                Item   ItemInFront;
                if (Room.GetGameMap().GetHighestItemForSquare(new Point(X, Y), out ItemInFront))
                {
                    if (ItemInFront != null)
                    {
                        MaxHeight = ItemInFront.TotalHeight;
                    }
                }

                RoleplayManager.PlaceItemToRoom(null, 8049, 0, X, Y, MaxHeight, Rot, false, Room.RoomId, false);
            }
        }
예제 #3
0
        /// <summary>
        /// Begin jailbreak sequence
        /// </summary>
        public static void InitiateJailbreak(GameClient UserJailbreaking)
        {
            #region Message Police Officers
            lock (PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
            {
                foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
                {
                    if (client == null || client.GetHabbo() == null || client.GetRoleplay() == null)
                    {
                        continue;
                    }

                    if (!GroupManager.HasJobCommand(client, "radio") && !client.GetHabbo().GetPermissions().HasRight("corporation_rights"))
                    {
                        continue;
                    }

                    if (GroupManager.HasJobCommand(client, "radio"))
                    {
                        if (!client.GetRoleplay().IsWorking)
                        {
                            continue;
                        }

                        if (!client.GetRoleplay().HandlingJailbreaks)
                        {
                            continue;
                        }

                        if (client.GetRoleplay().DisableRadio)
                        {
                            continue;
                        }
                    }

                    client.SendWhisper("[RÁDIO] [Fuga da Prisão] Perigo! Houve uma explosão alta da prisão!", 30);
                }
            }
            #endregion

            List <GameClient> CurrentJailedUsers = PlusEnvironment.GetGame().GetClientManager().GetClients.Where(x => x != null && x.GetHabbo() != null && x.GetRoleplay() != null && x.GetRoleplay().IsJailed&& x != RoleplayManager.Defendant).ToList();

            foreach (GameClient Client in CurrentJailedUsers)
            {
                Client.GetRoleplay().Jailbroken = true;
                RoleplayManager.GetLookAndMotto(Client);
            }
            int X      = Convert.ToInt32(RoleplayData.GetData("jailbreak", "fencex"));
            int Y      = Convert.ToInt32(RoleplayData.GetData("jailbreak", "fencey"));
            int RoomId = Convert.ToInt32(RoleplayData.GetData("jail", "outsideroomid"));

            Room Room = RoleplayManager.GenerateRoom(RoomId);
            if (Room != null && Room.GetRoomItemHandler() != null && Room.GetRoomItemHandler().GetFloor != null)
            {
                List <Item> ItemsToRemove = Room.GetRoomItemHandler().GetFloor.Where(x => x.BaseItem == 3011 || x.BaseItem == 6088).ToList();

                if (ItemsToRemove != null && ItemsToRemove.Count > 0)
                {
                    foreach (Item Remove in ItemsToRemove)
                    {
                        Room.GetRoomItemHandler().RemoveFurniture(null, Remove.Id);
                    }
                }

                Item FenceToRemove = Room.GetRoomItemHandler().GetFloor.FirstOrDefault(x => x.BaseItem == 8049 && x.GetX == X && x.GetY == Y);

                if (FenceToRemove != null)
                {
                    Room.GetRoomItemHandler().RemoveFurniture(null, FenceToRemove.Id);
                    JailbreakManager.FenceBroken = true;
                }
            }

            JailbreakManager.UserJailbreaking = UserJailbreaking;
            RoleplayManager.TimerManager.CreateTimer("jailbreak", 1000, false);
        }