Ejemplo n.º 1
0
        public void Execute(GameClients.GameClient Session, Room Room, string[] Params)
        {
            #region Conditions
            if (Params.Length < 2)
            {
                Session.SendWhisper("Comando inválido! Use :todospet <animal>", 1);
                return;
            }

            int TargetPetId;
            if (!int.TryParse(Params[1], out TargetPetId))
            {
                TargetPetId = RoleplayManager.GetPetIdByString(Params[1].ToString());
            }

            if (TargetPetId == 0)
            {
                Session.SendWhisper("Opa, não existe um animal de estimação com esse nome!", 1);
                return;
            }
            #endregion

            #region Execute
            lock (PlusEnvironment.GetGame().GetClientManager().GetClients)
            {
                foreach (var Client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
                {
                    if (Client == null || Client.GetHabbo() == null || Client.GetRoleplay() == null || Client.GetRoomUser() == null)
                    {
                        continue;
                    }

                    if (Client.GetHabbo().PetId == TargetPetId)
                    {
                        continue;
                    }

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

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

                    //Add the new one, they won't even notice a thing!!11 8-)
                    Client.GetRoomUser().GetRoom().SendMessage(new UsersComposer(Client.GetRoomUser()));

                    //Tell them a quick message.
                    if (Client.GetHabbo().PetId > 0)
                    {
                        Client.SendWhisper("Um administrador transformou você em " + Params[1].ToString(), 1);
                    }
                }
                Session.Shout("Transforma todos do hotel em " + Params[1].ToString() + "*", 23);
            }
            #endregion
        }
Ejemplo n.º 2
0
        public void Execute(GameClients.GameClient Session, Room Room, string[] Params)
        {
            if (Params.Length < 3)
            {
                Session.SendWhisper("Comando inválido! Use :tpet <usuário> <animal>", 1);
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);

            if (TargetClient == null)
            {
                Session.SendWhisper("Desculpe, este usuário não pôde ser encontrado!", 1);
                return;
            }

            if (TargetClient.GetRoomUser() == null)
            {
                Session.SendWhisper("Desculpe, este usuário não está na mesma sala que você!", 1);
                return;
            }

            int TargetPetId;

            if (!int.TryParse(Params[2], out TargetPetId))
            {
                TargetPetId = RoleplayManager.GetPetIdByString(Params[2].ToString());
            }

            if (TargetPetId == 0)
            {
                Session.SendWhisper("Opa, não existe um animal de estimação com esse nome!!", 1);
                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()));

            //Tell them a quick message.
            if (TargetClient.GetHabbo().PetId > 0)
            {
                Session.Shout("*Transforma " + TargetClient.GetHabbo().Username + " em " + Params[2].ToString() + "*", 23);
                TargetClient.SendWhisper("Um administrador transformou você em " + Params[1].ToString(), 1);
            }
        }
Ejemplo n.º 3
0
        public void Execute(GameClients.GameClient Session, Room Room, string[] Params)
        {
            RoomUser RoomUser = Session.GetRoomUser();

            if (RoomUser == null)
            {
                return;
            }

            if (!Room.PetMorphsAllowed)
            {
                Session.SendWhisper("O proprietário do quarto desativou a capacidade de utilizar uma transformação de pet nesta sala.", 1);
                if (Session.GetHabbo().PetId > 0)
                {
                    Session.SendWhisper("Ops, você ainda tem um morph, des-morphing.", 1);
                    //Change the users Pet Id.
                    Session.GetHabbo().PetId = 0;

                    //Quickly remove the old user instance.
                    Room.SendMessage(new UserRemoveComposer(RoomUser.VirtualId));

                    //Add the new one, they won't even notice a thing!!11 8-)
                    Room.SendMessage(new UsersComposer(RoomUser));
                }
                return;
            }

            if (Params.Length == 1)
            {
                Session.SendWhisper("Opa, você esqueceu de escolher o tipo de animal de estimação que você gostaria de transformar! Digite :pet lista para ver os pets disponíveis!", 1);
                return;
            }

            if (Params[1].ToString().ToLower() == "lista")
            {
                Session.SendWhisper("Habbo, Cachorro, Gato, Terrier, Crocodilo, Urso, Porco, Leao, Rinoceronte, Aranha, Tartaruga, Pintinho, Sapo, Dragao, Macaco, Cavalo, Coelho, Pombo, Demonio e Gnomo.", 1);
                return;
            }

            int TargetPetId;

            if (!int.TryParse(Params[1], out TargetPetId))
            {
                TargetPetId = RoleplayManager.GetPetIdByString(Params[1].ToString());
            }

            if (TargetPetId == 0)
            {
                Session.SendWhisper("Opa, não existe um animal de estimação com esse nome!", 1);
                return;
            }

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

            //Quickly remove the old user instance.
            Room.SendMessage(new UserRemoveComposer(RoomUser.VirtualId));

            //Add the new one, they won't even notice a thing!!11 8-)
            Room.SendMessage(new UsersComposer(RoomUser));

            //Tell them a quick message.
            if (Session.GetHabbo().PetId > 0)
            {
                Session.Shout("*Transforma-se em " + Params[1].ToString() + "*", 23);
                Session.SendWhisper("Digite ':pet habbo' Para voltar ao normal!", 1);
            }
            else
            {
                Session.Shout("*Transforma de volta a um cidadão*", 23);
            }
        }