Пример #1
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            int num = Packet.PopInt();

            if (num == 500000)
            {
                if (!Session.GetRoomUser().CanWalk)
                {
                    Session.GetRoomUser().CanWalk = true;
                }

                if (Session.GetRoleplay().ATMFailed)
                {
                    Session.SendNotification("Erro... O ATM Machine não respondeu ao seu pedido.");
                }

                Session.GetRoleplay().ATMAccount = "";
                Session.GetRoleplay().ATMAction  = "";
                Session.GetRoleplay().ATMFailed  = false;
                return;
            }

            if (!Session.GetHabbo().AnsweredPolls.Contains(num))
            {
                Session.GetHabbo().AnsweredPolls.Add(num);
                Session.SendNotification("Você recusou a enquete! Para poder respondê-lo mais tarde, recarregue o RP!");
            }
        }
Пример #2
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetMessenger() == null)
            {
                return;
            }

            Session.GetHabbo().GetMessenger().OnStatusChanged(false);

            ICollection <MessengerBuddy> Friends = new List <MessengerBuddy>();

            foreach (MessengerBuddy Buddy in Session.GetHabbo().GetMessenger().GetFriends().ToList())
            {
                if (Buddy == null || Buddy.IsOnline || Buddy.isBot)
                {
                    continue;
                }

                Friends.Add(Buddy);
            }

            Session.SendMessage(new MessengerInitComposer());
            Session.SendMessage(new BuddyListComposer(Friends, Session.GetHabbo()));

            Session.GetRoleplay().LoadBotFriendships();

            Session.GetHabbo().GetMessenger().ProcessOfflineMessages();
        }
Пример #3
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            int UserId = Packet.PopInt();

            if (UserId > 1000000)
            {
                int BotId = UserId - 1000000;
                var Bot   = RoleplayBotManager.GetCachedBotById(BotId);

                if (Bot != null)
                {
                    Session.SendMessage(new HabboUserBadgesComposer(null, Bot));
                }
            }
            else
            {
                Habbo Habbo = PlusEnvironment.GetHabboById(UserId);
                if (Habbo == null)
                {
                    return;
                }

                if (Session.GetRoleplay().CombatMode)
                {
                    if (Session.GetRoleplay().InCombat)
                    {
                        Session.GetRoleplay().InCombat = false;

                        if (Habbo.GetClient() != null && Habbo.GetClient().GetRoomUser() != null && !Habbo.GetClient().GetRoomUser().IsBot)
                        {
                            if (Session.GetRoleplay().EquippedWeapon == null)
                            {
                                CombatManager.GetCombatType("fist").Execute(Session, Habbo.GetClient());
                            }
                            else
                            {
                                CombatManager.GetCombatType("gun").Execute(Session, Habbo.GetClient());
                            }
                        }
                    }
                }

                Session.SendMessage(new HabboUserBadgesComposer(Habbo));
            }
        }
Пример #4
0
        public void OnlyHasChequings(HabboHotel.GameClients.GameClient Session)
        {
            // Question Count
            base.WriteInteger(3);

            #region Question 1
            base.WriteInteger(1);
            base.WriteInteger(1);
            base.WriteInteger(1);
            base.WriteString("Que conta você gostaria de usar?");

            base.WriteInteger(0);
            base.WriteInteger(1);
            base.WriteInteger(1);

            base.WriteString("1");
            base.WriteString("Cheques");
            base.WriteInteger(0);

            base.WriteInteger(0);
            #endregion

            #region Question 2
            base.WriteInteger(2);
            base.WriteInteger(2);
            base.WriteInteger(1);
            base.WriteString("Seu saldo é R$" + Session.GetRoleplay().BankChequings + ". O que você gostaria de fazer?");

            base.WriteInteger(0);
            base.WriteInteger(1);
            base.WriteInteger(2);

            base.WriteString("1");
            base.WriteString("Retirar");
            base.WriteInteger(0);

            base.WriteString("2");
            base.WriteString("Depositar");
            base.WriteInteger(0);

            base.WriteInteger(0);
            #endregion

            #region Question 3
            base.WriteInteger(3);
            base.WriteInteger(3);
            base.WriteInteger(3);
            base.WriteString("Digite o valor que deseja depositar ou retirar.");

            base.WriteInteger(0);
            base.WriteInteger(3);
            base.WriteInteger(0);
            base.WriteInteger(0);
            #endregion

            base.WriteBoolean(false);
        }
Пример #5
0
        public void ATMPoll(HabboHotel.GameClients.GameClient Session, Poll poll)
        {
            base.WriteInteger(500000);
            base.WriteString(poll.PollName);
            base.WriteString(poll.Thanks);

            if (Session.GetRoleplay().BankAccount <= 0)
            {
                HasNoBankAccount(Session);
            }
            else if (Session.GetRoleplay().BankAccount == 1)
            {
                OnlyHasChequings(Session);
            }
            else
            {
                HasChequingsAndSavings(Session);
            }
        }
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            string item = Packet.PopString();

            var CraftingItem = CraftingManager.getRecipe(item);

            if (CraftingItem == null)
            {
                Session.SendWhisper("Esta receita não pôde ser encontrada! Notificar um desenvolvedor!", 1);
                return;
            }

            ICollection <Item> FloorItems = Session.GetHabbo().GetInventoryComponent().GetFloorItems();
            ICollection <Item> WallItems  = Session.GetHabbo().GetInventoryComponent().GetWallItems();

            Session.GetRoleplay().CraftingCheck = false;
            Session.SendMessage(new FurniListComposer(FloorItems.ToList(), WallItems, Session.GetRoleplay().CraftingCheck));

            Session.SendMessage(new CraftingRecipeMessageComposer(CraftingItem));

            Session.GetRoleplay().CraftingCheck = true;
            Session.SendMessage(new FurniListComposer(FloorItems.ToList(), WallItems, Session.GetRoleplay().CraftingCheck));
        }
Пример #7
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            ICollection <Item> FloorItems = Session.GetHabbo().GetInventoryComponent().GetFloorItems();
            ICollection <Item> WallItems  = Session.GetHabbo().GetInventoryComponent().GetWallItems();

            if (Session.GetHabbo().InventoryAlert == false)
            {
                Session.GetHabbo().InventoryAlert = true;
                int TotalCount = FloorItems.Count + WallItems.Count;
                if (TotalCount >= 5000)
                {
                    Session.SendNotification("Hey! Nosso sistema detectou que você possui um inventário muito grande!\n\n" +
                                             "O máximo que um inventário pode carregar é de 5000 itens, você tem " + TotalCount + " items agora.\n\n" +
                                             "Se você tiver 5000 carregados agora, provavelmente você está acima do limite e alguns itens serão escondidos até libertar espaço.\n\n" +
                                             "Por favor, note que não somos responsáveis ​​por você falhar por causa de inventários muito grandes!");
                }
            }

            bool CraftingCheck = Session.GetRoleplay().CraftingCheck;

            Session.SendMessage(new FurniListComposer(FloorItems.ToList(), WallItems, CraftingCheck));
        }
Пример #8
0
        public void HandleATMQuestion(HabboHotel.GameClients.GameClient Session, int questionId, string amount)
        {
            if (Session.GetRoleplay().BankAccount <= 0)
            {
                if (Session.GetRoomUser() != null)
                {
                    if (!Session.GetRoomUser().CanWalk)
                    {
                        Session.GetRoomUser().CanWalk = true;
                    }
                }
            }

            if (questionId == 1)
            {
                if (!Session.GetRoleplay().ATMFailed)
                {
                    if (amount == "1")
                    {
                        Session.GetRoleplay().ATMAccount = "Cheques";
                    }
                    else if (amount == "2")
                    {
                        Session.GetRoleplay().ATMAccount = "Poupanca";
                    }
                    else
                    {
                        Session.GetRoleplay().ATMFailed = true;
                    }
                }
            }
            else if (questionId == 2)
            {
                if (!Session.GetRoleplay().ATMFailed)
                {
                    if (amount == "1")
                    {
                        Session.GetRoleplay().ATMAction = "Retirar";
                    }
                    else if (amount == "2")
                    {
                        Session.GetRoleplay().ATMAction = "Depositar";
                    }
                    else
                    {
                        Session.GetRoleplay().ATMFailed = true;
                    }
                }
            }
            else
            {
                int Amount;
                if (int.TryParse(amount, out Amount))
                {
                    if (Amount <= 0)
                    {
                        Session.GetRoleplay().ATMFailed = true;
                    }

                    if (!Session.GetRoleplay().ATMFailed)
                    {
                        if (Session.GetRoleplay().ATMAccount.ToLower() == "cheques")
                        {
                            if (Session.GetRoleplay().ATMAction.ToLower() == "retirar")
                            {
                                if (Session.GetRoleplay().BankChequings < Amount)
                                {
                                    Session.GetRoleplay().ATMFailed = true;
                                }
                                else
                                {
                                    Session.GetRoleplay().BankChequings -= Amount;
                                    Session.GetHabbo().Credits          += Amount;
                                    Session.GetHabbo().UpdateCreditsBalance();

                                    Session.Shout("*Usa o ATM para retirar R$" + Amount + " na minha conta de Cheques*", 5);
                                }
                            }
                            else if (Session.GetRoleplay().ATMAction.ToLower() == "depositar")
                            {
                                if (Amount > Session.GetHabbo().Credits)
                                {
                                    Session.GetRoleplay().ATMFailed = true;
                                }
                                else
                                {
                                    Session.GetRoleplay().BankChequings += Amount;
                                    Session.GetHabbo().Credits          -= Amount;
                                    Session.GetHabbo().UpdateCreditsBalance();

                                    Session.Shout("*Usa o ATM para depositar R$" + Amount + " na mina conta de Cheques*", 5);
                                }
                            }
                            else
                            {
                                Session.GetRoleplay().ATMFailed = true;
                            }
                        }
                        else
                        {
                            if (Session.GetRoleplay().ATMAction.ToLower() == "retirar")
                            {
                                if (Amount > 20)
                                {
                                    if (Session.GetRoleplay().BankSavings < Amount)
                                    {
                                        Session.GetRoleplay().ATMFailed = true;
                                    }
                                    else
                                    {
                                        int TaxAmount = Convert.ToInt32((double)Amount * 0.05);

                                        Session.GetHabbo().Credits += (Amount - TaxAmount);
                                        Session.GetHabbo().UpdateCreditsBalance();

                                        Session.GetRoleplay().BankSavings -= Amount;
                                        Session.Shout("*Retira R$" + Amount + " da minha conta de Cheques e coloca no bolso*", 5);
                                        Session.SendWhisper("Você pagou uma taxa de R$" + TaxAmount + " por retirar " + Amount, 1);
                                    }
                                }
                                else
                                {
                                    Session.GetRoleplay().ATMFailed = true;
                                }
                            }
                            else if (Session.GetRoleplay().ATMAction.ToLower() == "depositar")
                            {
                                if (Amount > Session.GetHabbo().Credits)
                                {
                                    Session.GetRoleplay().ATMFailed = true;
                                }
                                else
                                {
                                    Session.GetRoleplay().BankSavings += Amount;
                                    Session.GetHabbo().Credits        -= Amount;
                                    Session.GetHabbo().UpdateCreditsBalance();

                                    Session.Shout("*Usa o ATM para depositar R$" + Amount + " na minha conta Poupança*", 5);
                                }
                            }
                            else
                            {
                                Session.GetRoleplay().ATMFailed = true;
                            }
                        }
                    }
                    else
                    {
                        Session.GetRoleplay().ATMFailed = true;
                    }

                    if (Session.GetRoleplay().ATMFailed == true)
                    {
                        Session.SendWhisper("Error... ATM Falhou!", 1);
                    }
                }
                else
                {
                    Session.SendWhisper("Error... ATM Falhou!", 1);
                }

                Session.GetRoleplay().ATMAccount = "";
                Session.GetRoleplay().ATMAction  = "";
                Session.GetRoleplay().ATMFailed  = false;
            }
        }
Пример #9
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null || Session.GetRoleplay() == null || !Session.GetHabbo().InRoom)
            {
                return;
            }

            Room Room = Session.GetHabbo().CurrentRoom;

            if (Room == null)
            {
                return;
            }

            int ItemId = Packet.PopInt();

            Item Item = Room.GetRoomItemHandler().GetItem(ItemId);

            if (Item == null)
            {
                Session.GetRoleplay().PurchasingClothing = true;
                return;
            }

            if (Item.Data == null)
            {
                Session.GetRoleplay().PurchasingClothing = true;
                return;
            }

            if (Item.Data.InteractionType != InteractionType.PURCHASABLE_CLOTHING)
            {
                Session.SendNotification("Opa, este item não está configurado como um item de roupa!");
                Session.GetRoleplay().PurchasingClothing = true;
                return;
            }

            if (Item.Data.ClothingId == 0)
            {
                Session.SendNotification("Opa, este item não tem uma configuração de roupa de ligação, por favor, informe à Equipe!");
                Session.GetRoleplay().PurchasingClothing = true;
                return;
            }

            ClothingItem Clothing = null;

            if (!PlusEnvironment.GetGame().GetCatalog().GetClothingManager().TryGetClothing(Item.Data.ClothingId, out Clothing))
            {
                Session.SendNotification("Opa, não conseguimos encontrar esta peça de roupa!");
                Session.GetRoleplay().PurchasingClothing = true;
                return;
            }

            if (Session.GetRoleplay().PurchasingClothing)
            {
                return;
            }

            if (Session.GetRoleplay().Clothing != Clothing)
            {
                string Discount = "";
                if (Session.GetRoleplay().OfferManager.ActiveOffers.ContainsKey("clothing"))
                {
                    int Bonus   = Convert.ToInt32((double)Clothing.Cost * 0.01);
                    int NewCost = Clothing.Cost - Bonus;

                    Discount = " (R$" + String.Format("{0:N0}", NewCost) + " devido ao desconto de roupa de 5%)";
                }

                Session.SendWhisper("Essa roupa vai custar R$" + String.Format("{0:N0}", Clothing.Cost) + "" + (Discount == null ? "" : Discount) + "! Clique em 'Comprar Roupa' se você realmente quer comprar!", 1);
                Session.GetRoleplay().Clothing           = Clothing;
                Session.GetRoleplay().PurchasingClothing = true;
                return;
            }

            if (Session.GetHabbo().Credits < Clothing.Cost)
            {
                Session.SendWhisper("Desculpe, você não tem dinheiro suficiente para comprar esta roupa!", 1);
                Session.GetRoleplay().PurchasingClothing = true;
                return;
            }

            Session.GetRoleplay().Clothing = null;
            Session.GetHabbo().GetClothing().AddClothing(Clothing.ClothingName, Clothing.PartIds);
            Session.SendMessage(new FigureSetIdsComposer(Session.GetHabbo().GetClothing().GetClothingAllParts));
            Session.Shout("*Comprou " + Item.GetBaseItem().PublicName + " por R$" + String.Format("{0:N0}", Clothing.Cost) + "*", 4);
            //Session.SendMessage(new RoomNotificationComposer("figureset.redeemed.success"));
            Session.SendMessage(new RoomNotificationComposer("purchased_clothing", "message", "Ual! Você comprou com sucesso o '" + Item.GetBaseItem().PublicName + "' por R$" + String.Format("{0:N0}", Clothing.Cost) + "!"));
            Session.SendWhisper("Se, por algum motivo, não puder ver sua nova roupa, recarregue o RP!", 1);

            #region Clothing Discount Check
            if (Session.GetRoleplay().OfferManager.ActiveOffers.ContainsKey("clothing"))
            {
                if (Clothing.Cost > 0)
                {
                    RoleplayOffer Offer = Session.GetRoleplay().OfferManager.ActiveOffers["clothing"];
                    int           Bonus = Convert.ToInt32((double)Clothing.Cost * 0.05);

                    if (Offer.Params == null)
                    {
                        var Offerer = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(Offer.OffererId);

                        if (Offerer != null && Offerer.GetHabbo() != null)
                        {
                            Offerer.GetHabbo().Credits += Bonus;
                            Offerer.GetHabbo().UpdateCreditsBalance();
                            Offerer.SendWhisper("Você recebeu um bônus de R$" + String.Format("{0:N0}", Bonus) + ", " + Session.GetHabbo().Username + " quando comprou " + Item.GetBaseItem().PublicName + "!", 1);
                            PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Offerer, "ACH_Discounting", 1);
                        }
                    }

                    RoleplayOffer Junk;
                    Session.GetRoleplay().OfferManager.ActiveOffers.TryRemove("clothing", out Junk);

                    int NewCost = Clothing.Cost - Bonus;

                    if (NewCost > 0)
                    {
                        Session.GetHabbo().Credits -= NewCost;
                        Session.GetHabbo().UpdateCreditsBalance();
                    }
                    return;
                }
                else
                {
                    Session.SendWhisper("Você ainda tem o desconto para a próxima vez que você comprar um item de vestuário!", 1);
                    return;
                }
            }
            else
            {
                if (Clothing.Cost > 0)
                {
                    Session.GetHabbo().Credits -= Clothing.Cost;
                    Session.GetHabbo().UpdateCreditsBalance();
                }
            }
            #endregion

            return;
        }
Пример #10
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetMessenger() == null)
            {
                return;
            }

            if (!RoleplayManager.FollowFriends)
            {
                Session.SendWhisper("Opa, o gerenciamento do servidor desativou a capacidade de seguir seus amigos.", 1);
                return;
            }

            int    BuddyId  = Packet.PopInt();
            bool   IsVip    = Session.GetHabbo().VIPRank < 1 ? false : true;
            int    Cost     = IsVip ? 0 : 3;
            int    Time     = IsVip ? (5 + DayNightManager.GetTaxiTime()) : (10 + DayNightManager.GetTaxiTime());
            string TaxiText = IsVip ? " VIP" : "";
            bool   OnDuty   = false;

            if (BuddyId == 0 || BuddyId == Session.GetHabbo().Id)
            {
                return;
            }

            GameClient Client = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(BuddyId);

            if (Client == null || Client.GetHabbo() == null)
            {
                return;
            }

            if (!Client.GetHabbo().InRoom)
            {
                Session.SendMessage(new FollowFriendFailedComposer(2));
                Session.GetHabbo().GetMessenger().UpdateFriend(Client.GetHabbo().Id, Client, true);
                return;
            }
            else if (Session.GetHabbo().CurrentRoom != null && Client.GetHabbo().CurrentRoom != null)
            {
                if (Session.GetHabbo().CurrentRoom.RoomId == Client.GetHabbo().CurrentRoom.RoomId)
                {
                    return;
                }
            }

            if (!Client.GetHabbo().AllowConsoleMessages)
            {
                if (Session.GetHabbo().InRoom)
                {
                    Session.SendWhisper("Desculpe, mas esse cidadão desligou o telefone, então você não pode segui-lo.", 1);
                }
                else
                {
                    Session.SendNotification("Desculpe, mas esse cidadão desligou o telefone, então você não pode segui-lo.");
                }
                return;
            }

            if (Session.GetRoleplay().IsDead)
            {
                Session.SendWhisper("Você não pode seguir seu amigo enquanto está morto!", 1);
                return;
            }

            if (Session.GetRoleplay().IsJailed)
            {
                Session.SendWhisper("Você não pode seguir seu amigo enquanto está preso!", 1);
                return;
            }

            if (Session.GetRoomUser() != null)
            {
                if (Session.GetRoomUser().Frozen)
                {
                    Session.SendWhisper("Você não pode seguir seu amigo enquanto está congelado ou atordoado!", 1);
                    return;
                }
            }

            if (Session.GetHabbo().GetPermissions().HasRight("mod_tool") && Session.GetRoleplay().StaffOnDuty)
            {
                OnDuty = true;
            }
            if (Session.GetHabbo().VIPRank > 1)
            {
                OnDuty = true;
            }

            if (Session.GetHabbo().CurrentRoom != null)
            {
                if (!Session.GetHabbo().CurrentRoom.TaxiFromEnabled&& !OnDuty)
                {
                    Session.SendWhisper("[RPG Taxi] Desculpe, não podemos levá-lo para fora deste quarto!", 1);
                    return;
                }
            }

            if (Session.GetRoleplay().Cuffed)
            {
                Session.SendWhisper("Os motoristas de taxi estão muito assustados para levá-lo com as algemas presas em você!", 1);
                return;
            }

            bool PoliceCost = false;

            if (HabboHotel.Groups.GroupManager.HasJobCommand(Session, "guide") && Session.GetRoleplay().IsWorking)
            {
                PoliceCost = true;
            }

            if (Session.GetHabbo().Credits < Cost && Cost > 0 && !OnDuty && !PoliceCost)
            {
                Session.SendWhisper("[RPG Taxi] Você não tem dinheiro suficiente para dar uma volta!", 1);
                return;
            }

            if (Session.GetRoleplay().InsideTaxi)
            {
                Session.SendWhisper("[RPG Taxi] Já estou indo te buscar! Digite ':ptaxi' se mudar de ideia!", 1);
                return;
            }

            RoomData roomData = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(Client.GetHabbo().CurrentRoomId);

            if (roomData == null)
            {
                Session.SendWhisper("[RPG Taxi] Desculpe, não conseguimos encontrar esse quarto!", 1);
                return;
            }

            if (!roomData.TaxiToEnabled && !OnDuty)
            {
                Session.SendWhisper("[RPG Taxi] Desculpe, não podemos táxi você para este quarto!", 1);
                return;
            }

            if (roomData.TutorialEnabled && !OnDuty)
            {
                Session.SendWhisper("Você não pode ir para uma sala de tutorial, desculpe!", 1);
                return;
            }

            if (Session.GetHabbo().CurrentRoom != null)
            {
                if (Session.GetHabbo().CurrentRoom.TutorialEnabled&& !OnDuty)
                {
                    Session.SendWhisper("Você não pode sair de uma sala de tutorial! Somente após concluir!", 1);
                    return;
                }
            }

            if (Session.GetRoleplay().Game != null)
            {
                Session.SendWhisper("Você não pode pegar um taxi enquanto está dentro de um evento!", 1);
                return;
            }

            if (Session.GetRoleplay().TexasHoldEmPlayer > 0)
            {
                Session.SendWhisper("Você não pode pegar um taxi no meio de um jogo de Texas Hold!", 1);
                return;
            }

            Session.GetRoleplay().InsideTaxi = true;
            bool PoliceTaxi = false;

            if (!OnDuty)
            {
                if (HabboHotel.Groups.GroupManager.HasJobCommand(Session, "guide") && Session.GetRoleplay().IsWorking)
                {
                    Cost = 0;
                    Time = 5;

                    if (Session.GetRoomUser() != null)
                    {
                        Session.GetRoomUser().ApplyEffect(597);
                    }

                    Session.Shout("*Puxa o rádio da Polícia e vai rapidamente para " + roomData.Name + " [ID: " + roomData.Id + "]*", 37);
                    PoliceTaxi = true;
                }
                else
                {
                    if (Session.GetRoomUser() != null)
                    {
                        Session.GetRoomUser().ApplyEffect(596);
                    }

                    Session.Shout("*Chama um Taxi" + TaxiText + " para " + roomData.Name + " [ID: " + roomData.Id + "]*", 4);
                }

                new Thread(() =>
                {
                    for (int i = 0; i < (Time + 1) * 10; i++)
                    {
                        if (Session.GetRoleplay() == null)
                        {
                            break;
                        }

                        if (Session.GetRoleplay().InsideTaxi)
                        {
                            Thread.Sleep(100);
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (Session.GetRoleplay() != null)
                    {
                        if (Session.GetRoleplay().InsideTaxi)
                        {
                            if (Cost > 0)
                            {
                                Session.GetHabbo().Credits -= Cost;
                                Session.GetHabbo().UpdateCreditsBalance();
                            }

                            if (PoliceTaxi)
                            {
                                if (Session.GetRoomUser() != null)
                                {
                                    Session.GetRoomUser().ApplyEffect(EffectsList.CarPolice);
                                }
                                Session.Shout("*Pula dentro do carro da polícia do meu parceiro e vai para o local*", 37);
                            }
                            else
                            {
                                Session.Shout("*Pula no meu Taxi" + TaxiText + " e vai para o local*", 4);
                            }
                            RoleplayManager.SendUser(Session, roomData.Id);
                        }
                    }
                }).Start();
            }
            else
            {
                Session.Shout("*Segue imediatamente " + Client.GetHabbo().Username + "*", 23);
                RoleplayManager.SendUser(Session, Client.GetHabbo().CurrentRoomId);
                PlusEnvironment.GetGame().GetChatManager().GetCommands().LogCommand(Session.GetHabbo().Id, "follow " + Client.GetHabbo().Username, Session.GetHabbo().MachineId, "staff");
            }
        }
Пример #11
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetMessenger() == null)
            {
                return;
            }

            int userId = Packet.PopInt();

            if (userId == 0 || userId == Session.GetHabbo().Id)
            {
                return;
            }

            string message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());

            if (string.IsNullOrWhiteSpace(message))
            {
                return;
            }

            if (Session.GetHabbo().TimeMuted > 0)
            {
                Session.SendNotification("Opa, você está mudo - você não pode enviar mensagens.");
                return;
            }

            if (!Session.GetHabbo().GetPermissions().HasRight("advertisement_filter_override"))
            {
                string Phrase = "";
                if (PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckBannedWords(message, out Phrase))
                {
                    Session.GetHabbo().AdvertisingStrikes++;

                    if (Session.GetHabbo().AdvertisingStrikes < 2)
                    {
                        Session.SendMessage(new RoomNotificationComposer("Atenção!", "Por favor, pare de anunciar outros sites que não são afiliados ou oferecidos pelo HabboRPG. Você será silenciado se você fizer isso de novo!<br><br>Frase da Lista Negra: '" + Phrase + "'", "frank10", "ok", "event:"));
                        return;
                    }

                    if (Session.GetHabbo().AdvertisingStrikes >= 2)
                    {
                        Session.GetHabbo().TimeMuted = 3600;

                        using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                        {
                            dbClient.RunQuery("UPDATE `users` SET `time_muted` = '3600' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
                        }

                        Session.SendMessage(new RoomNotificationComposer("Você ficou mudo!", "Desculpe, mas você foi automaticamente silenciado por divulgar o hotel '" + Phrase + "'.<br><br>A equipe de moderação foi notificada e ações serão tomadas dentro de sua conta!", "frank10", "ok", "event:"));

                        List <string> Messages = new List <string>();
                        Messages.Add(message);
                        PlusEnvironment.GetGame().GetModerationTool().SendNewTicket(Session, 9, Session.GetHabbo().Id, "[Servidor] O civil já recebeu uma advertência; " + Phrase + ".", Messages);
                        return;
                    }

                    return;
                }
            }

            int  TextCost;
            bool CanAfford;

            if (Session.GetRoleplay().PhoneType == 1)
            {
                TextCost = 3;
            }
            else if (Session.GetRoleplay().PhoneType == 2)
            {
                TextCost = 2;
            }
            else if (Session.GetRoleplay().PhoneType == 3)
            {
                TextCost = 1;
            }
            else
            {
                TextCost = 3;
            }

            if (Session.GetHabbo().Duckets < TextCost)
            {
                CanAfford = false;
            }
            else
            {
                CanAfford = true;
            }

            Session.GetHabbo().GetMessenger().SendInstantMessage(userId, message, CanAfford, TextCost);
        }
Пример #12
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null)
            {
                return;
            }

            string Gender       = Packet.PopString().ToUpper();
            string Look         = PlusEnvironment.GetGame().GetAntiMutant().RunLook(Packet.PopString());
            int    ClothingRoom = Convert.ToInt32(RoleplayData.GetData("clothing", "roomid"));

            if (Session.GetRoomUser() == null || !Session.GetHabbo().InRoom)
            {
                return;
            }

            if (Session.GetRoomUser().RoomId != ClothingRoom)
            {
                Session.SendNotification("Você deve estar dentro da Loja de roupas para mudar suas roupas! [Quarto ID: " + ClothingRoom + "]");
                return;
            }

            if (Session.GetRoleplay().IsWorking)
            {
                Session.SendNotification("Você não pode mudar sua roupa enquanto está trabalhando!");
                return;
            }

            if (Look == Session.GetHabbo().Look)
            {
                Session.SendWhisper("Você já está vestido assim!", 1);
                return;
            }

            if ((DateTime.Now - Session.GetHabbo().LastClothingUpdateTime).TotalSeconds <= 2.0)
            {
                Session.GetHabbo().ClothingUpdateWarnings += 1;
                if (Session.GetHabbo().ClothingUpdateWarnings >= 25)
                {
                    Session.GetHabbo().SessionClothingBlocked = true;
                }
                return;
            }

            if (Session.GetHabbo().SessionClothingBlocked)
            {
                return;
            }

            if (Session.GetRoleplay().PurchasingClothing)
            {
                Session.GetRoleplay().PurchasingClothing = false;
                return;
            }

            Session.GetHabbo().LastClothingUpdateTime = DateTime.Now;

            string[] AllowedGenders = { "M", "F" };
            if (!AllowedGenders.Contains(Gender))
            {
                Session.SendMessage(new BroadcastMessageAlertComposer("Desculpe, você escolheu um gênero inválido."));
                return;
            }

            //PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.PROFILE_CHANGE_LOOK);

            Session.GetHabbo().Look   = PlusEnvironment.FilterFigure(Look);
            Session.GetHabbo().Gender = Gender.ToLower();

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE users SET look = @look, gender = @gender WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
                dbClient.AddParameter("look", Look);
                dbClient.AddParameter("gender", Gender);
                dbClient.RunQuery();
            }

            Session.SendMessage(new AvatarAspectUpdateMessageComposer(Look, Gender));

            //PlusEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_AvatarLooks", 1);
            //if (Session.GetHabbo().Look.Contains("ha-1006"))
            //PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.WEAR_HAT);

            if (Session.GetHabbo().InRoom)
            {
                RoomUser RoomUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                if (RoomUser != null)
                {
                    Session.SendMessage(new UserChangeComposer(RoomUser, true));
                    Session.GetHabbo().CurrentRoom.SendMessage(new UserChangeComposer(RoomUser, false));
                }
            }

            if (Session.GetHabbo().GetMessenger() != null)
            {
                Session.GetHabbo().GetMessenger().OnStatusChanged(true);
            }

            Session.GetRoleplay().OriginalOutfit = Session.GetHabbo().Look;
        }
Пример #13
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            int    roomID     = Packet.PopInt();
            bool   IsVip      = Session.GetHabbo().VIPRank < 1 ? false : true;
            int    Cost       = IsVip ? 0 : 3;
            int    Time       = IsVip ? (5 + DayNightManager.GetTaxiTime()) : (10 + DayNightManager.GetTaxiTime());
            string TaxiText   = IsVip ? " VIP" : "";
            bool   RoomLoaded = false;
            bool   OnDuty     = false;

            if (Session.GetHabbo().GetPermissions().HasRight("mod_tool") && Session.GetRoleplay().StaffOnDuty)
            {
                OnDuty = true;
            }
            if (Session.GetHabbo().VIPRank > 1)
            {
                OnDuty = true;
            }

            #region Conditions
            if (Session.GetRoleplay().IsJailed || Session.GetRoleplay().IsDead)
            {
                return;
            }

            if (Session.GetRoleplay().Cuffed)
            {
                Session.SendWhisper("Os taxistas não querem levar você, pois estão com medo de você algemado!", 1);
                return;
            }

            if (Session.GetRoomUser() != null)
            {
                if (Session.GetRoomUser().Frozen)
                {
                    Session.SendWhisper("Você não pode pegar um taxi enquanto está atordoado!", 1);
                    return;
                }
            }
            #endregion

            RoomData roomData = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(roomID);

            if (roomData == null)
            {
                return;
            }

            if (RoomLoaded)
            {
                return;
            }

            if (roomData.TutorialEnabled && !OnDuty)
            {
                Session.SendWhisper("[RPG Taxi] Você não pode ir para uma sala de Tutorial!", 1);
                return;
            }

            if (Session.GetRoomUser() != null && Session.GetRoomUser().GetRoom() != null)
            {
                if (Session.GetRoomUser().GetRoom().TutorialEnabled&& !OnDuty)
                {
                    Session.SendWhisper("[RPG Taxi] Você não pode usar taxi em uma sala de tutorial, termine ele primeiro!", 1);
                    return;
                }

                if (!Session.GetRoomUser().GetRoom().TaxiFromEnabled&& !OnDuty)
                {
                    Session.SendWhisper("[RPG Taxi] Desculpe, não podemos pegar você neste quarto!", 1);
                    return;
                }
            }

            if (roomID != Session.GetHabbo().CurrentRoomId)
            {
                if (Session.GetRoleplay().Game != null)
                {
                    Session.SendWhisper("Você não pode pegar um texi no evento!", 1);
                    return;
                }

                bool PoliceCost = false;
                if (HabboHotel.Groups.GroupManager.HasJobCommand(Session, "guide") && Session.GetRoleplay().IsWorking)
                {
                    PoliceCost = true;
                }

                if (Session.GetHabbo().Credits < Cost && Cost > 0 && !OnDuty && !PoliceCost)
                {
                    Session.SendWhisper("[RPG Taxi] Você não tem dinheiro suficiente para dar uma volta!", 1);
                    return;
                }

                if (Session.GetRoleplay().InsideTaxi)
                {
                    Session.SendWhisper("[RPG Taxi] Já estou indo pegar você! Digite ':ptaxi' se mudar de ideia!", 1);
                    return;
                }

                bool PoliceTool = false;
                if (Session.GetRoleplay().GuideOtherUser != null)
                {
                    if (HabboHotel.Groups.GroupManager.HasJobCommand(Session, "guide"))
                    {
                        if (Session.GetRoleplay().GuideOtherUser.GetHabbo() != null && Session.GetRoleplay().GuideOtherUser.GetRoomUser() != null)
                        {
                            if (roomID == Session.GetRoleplay().GuideOtherUser.GetRoomUser().RoomId)
                            {
                                PoliceTool = true;
                            }
                        }
                    }
                }

                if (!roomData.TaxiToEnabled && !OnDuty && !PoliceTool)
                {
                    Session.SendWhisper("[RPG Taxi] Desculpe, não podemos buscar você neste quarto!", 1);
                    return;
                }

                bool Event = false;
                if (roomData.RoleplayEvent != null)
                {
                    if (!roomData.RoleplayEvent.HasGameStarted())
                    {
                        Event = true;
                    }
                }

                Session.GetRoleplay().InsideTaxi = true;
                bool PoliceTaxi = false;

                if (!OnDuty && !PoliceTool && Session.GetHabbo().CurrentRoomId > 0 && !Event)
                {
                    if (HabboHotel.Groups.GroupManager.HasJobCommand(Session, "guide") && Session.GetRoleplay().IsWorking)
                    {
                        Cost = 0;
                        Time = 5;

                        if (Session.GetRoomUser() != null)
                        {
                            Session.GetRoomUser().ApplyEffect(EffectsList.PoliceTaxi);
                        }

                        Session.Shout("*Puxa o rádio da Polícia e vai rapidamente para " + roomData.Name + " [ID: " + roomID + "]*", 37);
                        PoliceTaxi = true;
                    }
                    else
                    {
                        if (Session.GetRoomUser() != null)
                        {
                            Session.GetRoomUser().ApplyEffect(EffectsList.Taxi);
                        }

                        Session.Shout("*Chama um Taxi" + TaxiText + " por " + roomData.Name + " [ID: " + roomID + "]*", 4);
                    }

                    new Thread(() =>
                    {
                        for (int i = 0; i < (Time + 1) * 10; i++)
                        {
                            if (Session.GetRoleplay() == null)
                            {
                                break;
                            }

                            if (Session.GetRoleplay().InsideTaxi)
                            {
                                Thread.Sleep(100);
                            }
                            else
                            {
                                break;
                            }
                        }

                        if (Session.GetRoleplay() != null)
                        {
                            if (Session.GetRoleplay().InsideTaxi)
                            {
                                if (Cost > 0)
                                {
                                    Session.GetHabbo().Credits -= Cost;
                                    Session.GetHabbo().UpdateCreditsBalance();
                                }

                                if (PoliceTaxi)
                                {
                                    if (Session.GetRoomUser() != null)
                                    {
                                        Session.GetRoomUser().ApplyEffect(EffectsList.CarPolice);
                                    }
                                    Session.Shout("*Entra no meu carro de polícia e vai para o local*", 37);
                                }
                                else
                                {
                                    Session.Shout("*Pula dentro do meu Taxi" + TaxiText + " e vai rapidamente para o local*", 4);
                                }
                                RoleplayManager.SendUser(Session, roomData.Id);
                            }
                        }
                    }).Start();
                }
                else
                {
                    if (PoliceTool)
                    {
                        if (Session.GetRoomUser() != null)
                        {
                            Session.GetRoomUser().ApplyEffect(EffectsList.CarPolice);
                        }
                        Session.Shout("*Entra no meu carro de polícia e dirige para ajudar um cidadão em necessidade*", 4);
                    }
                    else if (OnDuty)
                    {
                        Session.Shout("*Pula dentro do meu Carro Staff*", 23);
                    }
                    RoleplayManager.SendUser(Session, roomData.Id);
                }
            }
            else
            {
                Session.SendMessage(new GetGuestRoomResultComposer(Session, roomData, true, false));
            }
        }
Пример #14
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null)
            {
                return;
            }

            Room Room = Session.GetHabbo().CurrentRoom;

            if (Room == null)
            {
                return;
            }

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

            if (User == null)
            {
                return;
            }

            string NewName = Packet.PopString();
            string OldName = Session.GetHabbo().Username;

            if (NewName == OldName)
            {
                Session.GetHabbo().ChangeName(OldName);
                Session.SendMessage(new UpdateUsernameComposer(NewName));
                return;
            }

            if (!CanChangeName(Session.GetHabbo()))
            {
                Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                Session.SendNotification("Ops, parece que você atualmente não pode alterar seu nome de usuário!");
                return;
            }

            if (!Session.GetRoleplay().FreeNameChange)
            {
                if (Session.GetHabbo().Diamonds < 1)
                {
                    Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                    Session.SendNotification("Você não tem diamantes suficientes para uma mudança de nome!");
                    return;
                }
            }

            bool InUse = false;

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT COUNT(0) FROM `users` WHERE `username` = @name LIMIT 1");
                dbClient.AddParameter("name", NewName);
                InUse = dbClient.getInteger() == 1;
            }

            char[] Letters           = NewName.ToLower().ToCharArray();
            string AllowedCharacters = "abcdefghijklmnopqrstuvwxyz-";

            foreach (char Chr in Letters)
            {
                if (!AllowedCharacters.Contains(Chr))
                {
                    return;
                }
            }

            List <string> BlacklistedWords = new List <string>();

            using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT * FROM `cms_blacklisted_words`");
                DataTable Table = dbClient.getTable();

                if (Table != null)
                {
                    foreach (DataRow Row in Table.Rows)
                    {
                        string Word = Row["word"].ToString();

                        if (Word.Length > 0 && Word.ToLower() != "")
                        {
                            if (!BlacklistedWords.Contains(Word.ToLower()))
                            {
                                BlacklistedWords.Add(Word.ToLower());
                            }
                        }
                    }
                }
            }

            if (NewName.ToLower().Contains("mod") || NewName.ToLower().Contains("adm") || NewName.ToLower().Contains("admin") || NewName.ToLower().Contains("m0d"))
            {
                Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                Session.SendNotification("Você não pode fazer deste seu nome! Por favor digite ':mudarnick' novamente!");
                return;
            }
            else if (!NewName.Contains('-'))
            {
                Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                Session.SendNotification("Você não pode fazer deste seu nome! Por favor digite ':mudarnick' novamente!");
                return;
            }
            else if (NewName.Split('-')[0].Length < 3 || NewName.Split('-')[1].Length < 1)
            {
                Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                Session.SendNotification("Você não pode fazer deste seu nome! Por favor digite ':mudarnick' novamente!");
                return;
            }
            else if (NewName.Length > 15)
            {
                Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                Session.SendNotification("Você não pode fazer deste seu nome! Por favor digite ':mudarnick' novamente!");
                return;
            }
            else if (NewName.Length < 3)
            {
                Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                Session.SendNotification("Você não pode fazer deste seu nome! Por favor digite ':mudarnick' novamente!");
                return;
            }
            else if (InUse)
            {
                Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                Session.SendNotification("Você não pode fazer deste seu nome! Por favor digite ':mudarnick' novamente!");
                return;
            }
            else
            {
                string FirstName  = NewName.Split('-')[0].ToLower();
                string SecondName = NewName.Split('-')[1].ToLower();

                if (BlacklistedWords.Contains(FirstName) || BlacklistedWords.Contains(SecondName))
                {
                    if (BlacklistedWords.Contains(FirstName))
                    {
                        Session.SendNotification("Desculpe, mas esse primeiro nome não é permitido");
                    }
                    else
                    {
                        Session.SendNotification("Desculpe, mas esse segundo nome não é permitido!");
                    }
                    Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                    return;
                }

                if (!PlusEnvironment.GetGame().GetClientManager().UpdateClientUsername(Session, OldName, NewName))
                {
                    Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
                    Session.SendNotification("Opa! Ocorreu um problema ao atualizar seu nome de usuário. Por favor digite ':mudarnick' novamente!");
                    return;
                }

                Session.GetHabbo().ChangingName = false;
                Room.GetRoomUserManager().RemoveUserFromRoom(Session, true, false);

                Session.GetHabbo().ChangeName(NewName);
                Session.GetHabbo().GetMessenger().OnStatusChanged(true);

                if (!Session.GetRoleplay().FreeNameChange)
                {
                    Session.GetHabbo().Diamonds--;
                    Session.SendMessage(new ActivityPointsComposer(Session.GetHabbo().Duckets, Session.GetHabbo().Diamonds, Session.GetHabbo().EventPoints));
                }

                Session.SendMessage(new UpdateUsernameComposer(NewName));
                Room.SendMessage(new UserNameChangeComposer(Room.Id, User.VirtualId, NewName));

                using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery("INSERT INTO `logs_client_namechange` (`user_id`,`new_name`,`old_name`,`timestamp`) VALUES ('" + Session.GetHabbo().Id + "', @name, '" + OldName + "', '" + PlusEnvironment.GetUnixTimestamp() + "')");
                    dbClient.AddParameter("name", NewName);
                    dbClient.RunQuery();
                }

                ICollection <RoomData> Rooms = Session.GetHabbo().UsersRooms;
                foreach (RoomData Data in Rooms)
                {
                    if (Data == null)
                    {
                        continue;
                    }

                    Data.OwnerName = NewName;
                }

                foreach (Room UserRoom in PlusEnvironment.GetGame().GetRoomManager().GetRooms().ToList())
                {
                    if (UserRoom == null || UserRoom.RoomData.OwnerName != NewName)
                    {
                        continue;
                    }

                    UserRoom.OwnerName          = NewName;
                    UserRoom.RoomData.OwnerName = NewName;

                    UserRoom.SendMessage(new RoomInfoUpdatedComposer(UserRoom.RoomId));
                }

                HabboRoleplay.Misc.RoleplayManager.SendUser(Session, Room.Id, "");
            }
        }
Пример #15
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            int    pollId     = Packet.PopInt();
            int    questionId = Packet.PopInt();
            int    num3       = Packet.PopInt();
            string liststring = "";

            if (Packet.RemainingLength > 0)
            {
                liststring = Packet.PopString();
            }

            if (pollId == 500000)
            {
                HandleATMQuestion(Session, questionId, liststring);
                return;
            }

            List <string> list = new List <string>();

            for (int i = 0; i < num3; i++)
            {
                list.Add(liststring);
            }

            string text = string.Join("\r\n", list);

            if (text == "")
            {
                text = "Não respondeu esta pergunta.";
            }

            Poll poll = PlusEnvironment.GetGame().GetPollManager().TryGetPollById(pollId);

            if (poll == null)
            {
                Session.SendWhisper("Ups! Algo deu errado. Esta Enquete não pôde ser encontrada!", 1);
                return;
            }

            if (poll.Type == PollType.Matching)
            {
                if (text == "1")
                {
                    poll.AnswersPositive++;
                }
                else
                {
                    poll.AnswersNegative++;
                }

                Session.GetHabbo().AnsweredMatchingPoll = true;
                Session.SendMessage(new MatchingPollAnsweredMessageComposer(Session, text));
                return;
            }

            PollQuestion Question = PlusEnvironment.GetGame().GetPollManager().getPollQuestion(poll, questionId);

            if (Question != null)
            {
                if (text != "Não respondeu esta pergunta. " && (Question.AType == PollAnswerType.RadioSelection || Question.AType == PollAnswerType.RadioSelection))
                {
                    List <string> SelectionAnswers = new List <string>();

                    foreach (string answerid in list)
                    {
                        int index = 0;

                        foreach (string answer in Question.Answers)
                        {
                            index++;

                            if (index != Convert.ToInt32(answerid))
                            {
                                continue;
                            }

                            SelectionAnswers.Add(answer);
                        }
                    }
                    text = string.Join(",", SelectionAnswers);
                }
            }

            if (questionId == poll.Questions.Count)
            {
                if (!Session.GetHabbo().AnsweredPolls.Contains(poll.Id))
                {
                    Session.GetHabbo().AnsweredPolls.Add(poll.Id);
                }
            }

            var NewQuestion       = new PollQuestion(questionId, Question.Question, 1, text, "");
            var AnsweredQuestions = Session.GetRoleplay().AnsweredPollQuestions;

            if (AnsweredQuestions.ContainsKey(poll.Id))
            {
                if (!AnsweredQuestions[poll.Id].Contains(NewQuestion))
                {
                    AnsweredQuestions[poll.Id].Add(NewQuestion);
                }
            }
            else
            {
                List <PollQuestion> List = new List <PollQuestion>();
                List.Add(NewQuestion);
                AnsweredQuestions.TryAdd(poll.Id, List);
            }

            if (AnsweredQuestions[poll.Id].Count == poll.Questions.Count)
            {
                string Answers = "";

                var OrderedAnswers = AnsweredQuestions[poll.Id].OrderBy(x => x.Index).ToList();

                int count = 0;
                foreach (string Answer in OrderedAnswers.Select(x => x.Answers[0]))
                {
                    count++;
                    if (count < OrderedAnswers.Count)
                    {
                        Answers += Answer + "Ø";
                    }
                    else
                    {
                        Answers += Answer;
                    }
                }

                using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery("INSERT INTO `user_polls` VALUES (@userid ,@pollid ,@answers)");
                    dbClient.AddParameter("userid", Session.GetHabbo().Id);
                    dbClient.AddParameter("pollid", poll.Id);
                    dbClient.AddParameter("answers", Answers);
                    dbClient.RunQuery();
                }
            }
        }
Пример #16
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session == null || Session.GetHabbo() == null)
            {
                return;
            }

            int       GroupId   = Packet.PopInt();
            Group     Group     = null;
            GroupRank GroupRank = null;

            if (GroupId < 1000)
            {
                Group     = GroupManager.GetJob(GroupId);
                GroupRank = GroupManager.GetJobRank(GroupId, 1);
            }
            else
            {
                Group     = GroupManager.GetGang(GroupId);
                GroupRank = GroupManager.GetGangRank(GroupId, 1);
            }

            if (GroupId >= 1000)
            {
                Group CurrentGang = GroupManager.GetGang(Session.GetRoleplay().GangId);

                if (CurrentGang != null && CurrentGang.CreatorId == Session.GetHabbo().Id)
                {
                    Session.SendNotification("Você deve excluir sua primeira gangue se quiser se juntar a outra gangue!");
                    return;
                }
            }

            if (Group == null)
            {
                return;
            }

            if (Group.IsMember(Session.GetHabbo().Id) || Group.IsAdmin(Session.GetHabbo().Id))
            {
                return;
            }

            if (Group.GroupType == GroupType.LOCKED && Group.HasRequest(Session.GetHabbo().Id))
            {
                return;
            }

            if (Group.GroupType == GroupType.PRIVATE)
            {
                return;
            }

            List <Group> Groups = PlusEnvironment.GetGame().GetGroupManager().GetGroupsForUser(Session.GetHabbo().Id);

            if (Groups.Count >= 3)
            {
                Session.SendMessage(new BroadcastMessageAlertComposer("Opa, parece que você atingiu o limite do grupo! Você só pode juntar até 1.500 grupos."));
                return;
            }

            if (Group.Id < 1000 && GroupRank.HasCommand("guide"))
            {
                if (BlackListManager.BlackList.Contains(Session.GetHabbo().Id))
                {
                    Session.SendWhisper("Você está na lista negra e não pode se juntar à corporação da polícia!", 1);
                    return;
                }
            }

            if (GroupId < 1000)
            {
                if (Group.GroupType == GroupType.LOCKED && !Session.GetHabbo().GetPermissions().HasRight("corporation_rights"))
                {
                    Session.GetRoleplay().JobRequest = GroupId;
                    Group.Requests.Add(Session.GetHabbo().Id);

                    Session.SendWhisper("Sucesso, você solicitou com sucesso para se juntar à empresa '" + Group.Name + "'!", 1);
                    List <GameClient> GroupAdmins = (from Client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList() where Client != null && Client.GetHabbo() != null && (Group.IsAdmin(Client.GetHabbo().Id) || Client.GetHabbo().GetPermissions().HasRight("corporation_rights")) select Client).ToList();
                    foreach (GameClient Client in GroupAdmins)
                    {
                        Client.SendMessage(new GroupMembershipRequestedComposer(Group.Id, Session.GetHabbo(), 3));
                    }
                    Session.SendMessage(new GroupInfoComposer(Group, Session));
                    return;
                }
                else
                {
                    int Bubble = 4;
                    if (Session.GetHabbo().GetPermissions().HasRight("corporation_rights"))
                    {
                        Bubble = 23;
                    }

                    Session.Shout("*Se contrata como um " + Group.Name + " no cargo " + GroupRank.Name + "*", Bubble);

                    //Session.SendMessage(new GroupFurniConfigComposer(PlusEnvironment.GetGame().GetGroupManager().GetGroupsForUser(Session.GetHabbo().Id)));

                    Session.GetRoleplay().TimeWorked = 0;
                    Session.GetRoleplay().JobId      = Group.Id;
                    Session.GetRoleplay().JobRank    = 1;
                    Session.GetRoleplay().JobRequest = 0;

                    Group.AddNewMember(Session.GetHabbo().Id);
                    Group.SendPackets(Session);
                }
            }
            else
            {
                if (Group.GroupType == GroupType.LOCKED)
                {
                    Session.GetRoleplay().GangRequest = GroupId;
                    Group.Requests.Add(Session.GetHabbo().Id);

                    Session.SendWhisper("Sucesso, você solicitou com sucesso para se juntar à gangue '" + Group.Name + "'!", 1);

                    List <GameClient> GroupAdmins = (from Client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList() where Client != null && Client.GetHabbo() != null && (Group.IsAdmin(Client.GetHabbo().Id)) select Client).ToList();
                    foreach (GameClient Client in GroupAdmins)
                    {
                        Client.SendMessage(new GroupMembershipRequestedComposer(Group.Id, Session.GetHabbo(), 3));
                    }

                    Session.SendMessage(new GroupInfoComposer(Group, Session));

                    UserCache Junk = null;
                    PlusEnvironment.GetGame().GetCacheManager().TryRemoveUser(Session.GetHabbo().Id, out Junk);
                    PlusEnvironment.GetGame().GetCacheManager().GenerateUser(Session.GetHabbo().Id);
                }
                else
                {
                    Session.Shout("*Entra na gangue '" + Group.Name + "' no cargo " + GroupRank.Name + "*", 4);

                    Session.SendMessage(new GroupFurniConfigComposer(PlusEnvironment.GetGame().GetGroupManager().GetGroupsForUser(Session.GetHabbo().Id)));

                    Session.GetRoleplay().GangId      = Group.Id;
                    Session.GetRoleplay().GangRank    = 1;
                    Session.GetRoleplay().GangRequest = 0;

                    Group.AddNewMember(Session.GetHabbo().Id);
                    Group.SendPackets(Session);
                }
            }
        }
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            int    Id         = Packet.PopInt();
            string ItemName   = Packet.PopString();
            bool   Successful = false;
            Group  Gang       = GroupManager.GetGang(Session.GetRoleplay().GangId);

            var CraftingItem = CraftingManager.getRecipe(ItemName);

            if (CraftingItem != null)
            {
                Successful = true;
            }

            if (Successful)
            {
                foreach (var item in CraftingItem.ItemsNeeded)
                {
                    int AmountToRemove = item.Value;

                    for (int i = 0; i < AmountToRemove; i++)
                    {
                        foreach (var furni in Session.GetHabbo().GetInventoryComponent().GetItems)
                        {
                            if (furni.GetBaseItem().ItemName == item.Key)
                            {
                                if (CraftingItem.Result.ToLower() == "holorp_medipack" && (Gang == null || Gang.Id <= 1000))
                                {
                                    break;
                                }

                                using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                                    dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + furni.Id + "' AND `user_id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
                                Session.GetHabbo().GetInventoryComponent().RemoveItem(furni.Id);
                                break;
                            }
                        }
                    }
                }

                CryptoRandom Random      = new CryptoRandom();
                int          Chance      = Random.Next(1, 101);
                int          BonusChance = LevelManager.IntelligenceChance(Session);
                int          BonusAmount = 0;

                bool Bonus = BonusChance >= Chance;

                if (Bonus)
                {
                    BonusAmount = Random.Next(5, 26);
                }

                if (CraftingItem.Result.ToLower() == "holorp_treasure" || CraftingItem.Result.ToLower() == "holorp_bullets" || CraftingItem.Result.ToLower() == "holorp_dynamite" || CraftingItem.Result.ToLower() == "holorp_medipack")
                {
                    if (CraftingItem.Result.ToLower() == "holorp_bullets")
                    {
                        Session.GetRoleplay().Bullets += 100 + BonusAmount;

                        if (Bonus)
                        {
                            Session.SendNotification("You have just crafted 100 bullets! [+" + BonusAmount + " bullets due to Intelligence Bonus]");
                        }
                        else
                        {
                            Session.SendNotification("You have just crafted 100 bullets!");
                        }
                    }
                    else if (CraftingItem.Result.ToLower() == "holorp_treasure")
                    {
                        Session.GetHabbo().Credits += 100 + BonusAmount;
                        Session.GetHabbo().UpdateCreditsBalance();

                        if (Bonus)
                        {
                            Session.SendNotification("You have just crafted $100 dollars! [+$" + BonusAmount + " due to Intelligence Bonus]");
                        }
                        else
                        {
                            Session.SendNotification("You have just crafted $100 dollars!");
                        }
                    }
                    else if (CraftingItem.Result.ToLower() == "holorp_dynamite")
                    {
                        if (Bonus)
                        {
                            Session.GetRoleplay().Dynamite += 2;
                            Session.SendNotification("You have just crafted 1 stick of dynamite! [+1 Dynamite due to Intelligence Bonus]");
                        }
                        else
                        {
                            Session.GetRoleplay().Dynamite++;
                            Session.SendNotification("You have just crafted 1 stick of dynamite!");
                        }
                    }
                    else if (CraftingItem.Result.ToLower() == "holorp_medipack")
                    {
                        if (Gang == null)
                        {
                            Session.SendNotification("You are not part of any gang, so the medipack wasn't successfully crafted!");
                            return;
                        }

                        if (Gang.Id <= 1000)
                        {
                            Session.SendNotification("You are not part of any gang, so the medipack wasn't successfully crafted!");
                            return;
                        }

                        if (Bonus)
                        {
                            Gang.MediPacks += 2;
                            Session.SendNotification("You have just crafted 1 medipack! [+1 medipack due to Intelligence Bonus]");
                        }
                        else
                        {
                            Gang.MediPacks++;
                            Session.SendNotification("You have just crafted 1 medipack!");
                        }

                        using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                            dbClient.RunQuery("UPDATE `rp_gangs` SET `medipacks` = '" + Gang.MediPacks + "' WHERE `id` = '" + Gang.Id + "'");
                    }
                }
                else
                {
                    ItemData Data = null;

                    foreach (var itemdata in PlusEnvironment.GetGame().GetItemManager()._items.Values)
                    {
                        if (itemdata.ItemName != CraftingItem.Result)
                        {
                            continue;
                        }

                        Data = itemdata;
                        break;
                    }

                    var Item = ItemFactory.CreateSingleItemNullable(Data, Session.GetHabbo(), "", "");

                    Session.GetHabbo().GetInventoryComponent().TryAddItem(Item);
                }
            }

            ICollection <Item> FloorItems = Session.GetHabbo().GetInventoryComponent().GetFloorItems();
            ICollection <Item> WallItems  = Session.GetHabbo().GetInventoryComponent().GetWallItems();

            Session.SendMessage(new CraftingExecutedMessageComposer(Successful, ItemName));

            Session.GetRoleplay().CraftingCheck = false;
            Session.SendMessage(new FurniListComposer(FloorItems.ToList(), WallItems, Session.GetRoleplay().CraftingCheck));

            Session.SendMessage(new CraftableProductsMessageComposer(Session));

            Session.GetRoleplay().CraftingCheck = true;
            Session.SendMessage(new FurniListComposer(FloorItems.ToList(), WallItems, Session.GetRoleplay().CraftingCheck));
        }
Пример #18
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            Room Room = null;

            if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))
            {
                return;
            }

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

            if (User == null)
            {
                return;
            }

            User.UnIdle();

            if (Session.GetRoleplay().CombatMode)
            {
                Session.GetRoleplay().InCombat = true;
            }

            if (Session.GetRoleplay().IsWorkingOut)
            {
                return;
            }

            int X = Packet.PopInt();
            int Y = Packet.PopInt();

            if ((X == User.X && Y == User.Y) || User.IsWalking || User.RidingHorse)
            {
                return;
            }

            int Rot = Rotation.Calculate(User.X, User.Y, X, Y);

            User.SetRot(Rot, false);
            User.UpdateNeeded = true;

            if (User.RidingHorse)
            {
                RoomUser Horse = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByVirtualId(User.HorseID);
                if (Horse != null)
                {
                    Horse.SetRot(Rot, false);
                    Horse.UpdateNeeded = true;
                }
            }

            if (User != null)
            {
                if (User.GetClient() != null)
                {
                    if (User.GetClient().GetRoleplay() != null)
                    {
                        User.GetClient().GetRoleplay().LastCoordinates = User.X + "," + User.Y + "," + User.Z + "," + Rot;
                    }
                }
            }
        }
Пример #19
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (Session.GetRoleplay().GangId > 1000)
            {
                Group Gang = GroupManager.GetGang(Session.GetRoleplay().GangId);

                if (Gang != null)
                {
                    if (Gang.CreatorId == Session.GetHabbo().Id)
                    {
                        Session.SendMessage(new BroadcastMessageAlertComposer("Por favor, exclua sua gangue atual antes de tentar fazer uma nova!"));
                        return;
                    }
                }
            }

            if (Session.GetHabbo().Credits < PlusStaticGameSettings.GroupPurchaseAmount)
            {
                Session.SendMessage(new BroadcastMessageAlertComposer("Uma gangue custa " + PlusStaticGameSettings.GroupPurchaseAmount + " créditos! Você tem atualmente " + Session.GetHabbo().Credits + "!"));
                return;
            }
            else
            {
                Session.GetHabbo().Credits -= PlusStaticGameSettings.GroupPurchaseAmount;
                Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
            }

            String Name        = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
            String Description = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
            int    RoomId      = Packet.PopInt();
            int    Colour1     = Packet.PopInt();
            int    Colour2     = Packet.PopInt();
            int    groupID3    = Packet.PopInt();
            int    groupID4    = Packet.PopInt();
            int    groupID5    = Packet.PopInt();
            int    groupID6    = Packet.PopInt();
            int    groupID7    = Packet.PopInt();
            int    groupID8    = Packet.PopInt();
            int    groupID9    = Packet.PopInt();
            int    groupID10   = Packet.PopInt();
            int    groupID11   = Packet.PopInt();
            int    groupID12   = Packet.PopInt();
            int    groupID13   = Packet.PopInt();
            int    groupID14   = Packet.PopInt();
            int    groupID15   = Packet.PopInt();
            int    groupID16   = Packet.PopInt();
            int    groupID17   = Packet.PopInt();
            int    groupID18   = Packet.PopInt();

            //RoomData Room = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(RoomId);
            //if (Room == null || Room.OwnerId != Session.GetHabbo().Id || Room.Group != null)
            //    return;

            string Base    = "b" + ((groupID4 < 10) ? "0" + groupID4.ToString() : groupID4.ToString()) + ((groupID5 < 10) ? "0" + groupID5.ToString() : groupID5.ToString()) + groupID6;
            string Symbol1 = "s" + ((groupID7 < 10) ? "0" + groupID7.ToString() : groupID7.ToString()) + ((groupID8 < 10) ? "0" + groupID8.ToString() : groupID8.ToString()) + groupID9;
            string Symbol2 = "s" + ((groupID10 < 10) ? "0" + groupID10.ToString() : groupID10.ToString()) + ((groupID11 < 10) ? "0" + groupID11.ToString() : groupID11.ToString()) + groupID12;
            string Symbol3 = "s" + ((groupID13 < 10) ? "0" + groupID13.ToString() : groupID13.ToString()) + ((groupID14 < 10) ? "0" + groupID14.ToString() : groupID14.ToString()) + groupID15;
            string Symbol4 = "s" + ((groupID16 < 10) ? "0" + groupID16.ToString() : groupID16.ToString()) + ((groupID17 < 10) ? "0" + groupID17.ToString() : groupID17.ToString()) + groupID18;

            Symbol1 = PlusEnvironment.GetGame().GetGroupManager().CheckActiveSymbol(Symbol1);
            Symbol2 = PlusEnvironment.GetGame().GetGroupManager().CheckActiveSymbol(Symbol2);
            Symbol3 = PlusEnvironment.GetGame().GetGroupManager().CheckActiveSymbol(Symbol3);
            Symbol4 = PlusEnvironment.GetGame().GetGroupManager().CheckActiveSymbol(Symbol4);

            string Badge = Base + Symbol1 + Symbol2 + Symbol3 + Symbol4;

            Group Group = null;

            if (!PlusEnvironment.GetGame().GetGroupManager().TryCreateGroup(Session.GetHabbo(), Name, Description, RoomId, Badge, Colour1, Colour2, out Group))
            {
                Session.SendNotification("Ocorreu um erro ao tentar criar este grupo.\n\nIsso pode ter acontecido porque você clicou em comprar mais de uma vez!\n\nNesse caso, sua gangue já foi criada.\n\n(Verifique clicando em seu usuário e visualizando a caveira no canto inferior direito ou seu perfil).\n\nCaso contrário, você pode tentar criar outra gangue!");
                return;
            }

            Session.SendMessage(new PurchaseOKComposer());

            RoomData Room = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(Session.GetHabbo().CurrentRoomId);

            Session.SendMessage(new NewGroupInfoComposer(Room.Id, 0));
        }
Пример #20
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            int CraftingTable = Packet.PopInt();
            int Limit         = Packet.PopInt();

            bool  Successful = false;
            Group Gang       = GroupManager.GetGang(Session.GetRoleplay().GangId);

            ConcurrentDictionary <string, int> PlacedItems = new ConcurrentDictionary <string, int>();

            for (var i = 0; i < Limit; i++)
            {
                int ItemId = Packet.PopInt();

                Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId);

                if (Item == null)
                {
                    continue;
                }

                if (!PlacedItems.ContainsKey(Item.GetBaseItem().ItemName))
                {
                    PlacedItems.TryAdd(Item.GetBaseItem().ItemName, 1);
                }
                else
                {
                    PlacedItems.TryUpdate(Item.GetBaseItem().ItemName, PlacedItems[Item.GetBaseItem().ItemName] + 1, PlacedItems[Item.GetBaseItem().ItemName]);
                }
            }

            CraftingRecipe Recipe = null;

            foreach (var recipe in CraftingManager.AllCraftingRecipes.Values)
            {
                if (PlacedItems.OrderBy(r => r.Key).SequenceEqual(recipe.ItemsNeeded.OrderBy(r => r.Key)))
                {
                    Recipe = recipe;
                    break;
                }
            }

            if (Recipe != null)
            {
                Successful = true;
            }

            if (Successful)
            {
                foreach (var item in Recipe.ItemsNeeded)
                {
                    int AmountToRemove = item.Value;

                    for (int i = 0; i < AmountToRemove; i++)
                    {
                        foreach (var furni in Session.GetHabbo().GetInventoryComponent().GetItems)
                        {
                            if (furni.GetBaseItem().ItemName == item.Key)
                            {
                                if (Recipe.Result.ToLower() == "holorp_medipack" && (Gang == null || Gang.Id <= 1000))
                                {
                                    break;
                                }

                                using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                                    dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + furni.Id + "' AND `user_id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
                                Session.GetHabbo().GetInventoryComponent().RemoveItem(furni.Id);
                                break;
                            }
                        }
                    }
                }

                CryptoRandom Random      = new CryptoRandom();
                int          Chance      = Random.Next(1, 101);
                int          BonusChance = LevelManager.IntelligenceChance(Session);
                int          BonusAmount = 0;

                bool Bonus = BonusChance >= Chance;

                if (Bonus)
                {
                    BonusAmount = Random.Next(5, 26);
                }

                if (Recipe.Result.ToLower() == "holorp_treasure" || Recipe.Result.ToLower() == "holorp_bullets" || Recipe.Result.ToLower() == "holorp_dynamite" || Recipe.Result.ToLower() == "holorp_medipack")
                {
                    if (Recipe.Result.ToLower() == "holorp_bullets")
                    {
                        Session.GetRoleplay().Bullets += 100 + BonusAmount;

                        if (Bonus)
                        {
                            Session.SendNotification("You have just crafted 100 bullets! [+" + BonusAmount + " bullets due to Intelligence Bonus]");
                        }
                        else
                        {
                            Session.SendNotification("You have just crafted 100 bullets!");
                        }
                    }
                    else if (Recipe.Result.ToLower() == "holorp_treasure")
                    {
                        Session.GetHabbo().Credits += 100 + BonusAmount;
                        Session.GetHabbo().UpdateCreditsBalance();

                        if (Bonus)
                        {
                            Session.SendNotification("You have just crafted $100 dollars! [+$" + BonusAmount + " due to Intelligence Bonus]");
                        }
                        else
                        {
                            Session.SendNotification("You have just crafted $100 dollars!");
                        }
                    }
                    else if (Recipe.Result.ToLower() == "holorp_dynamite")
                    {
                        if (Bonus)
                        {
                            Session.GetRoleplay().Dynamite += 2;
                            Session.SendNotification("You have just crafted 1 stick of dynamite! [+1 Dynamite due to Intelligence Bonus]");
                        }
                        else
                        {
                            Session.GetRoleplay().Dynamite++;
                            Session.SendNotification("You have just crafted 1 stick of dynamite!");
                        }
                    }
                    else if (Recipe.Result.ToLower() == "holorp_medipack")
                    {
                        if (Gang == null)
                        {
                            Session.SendNotification("You are not part of any gang, so the medipack wasn't successfully crafted!");
                            return;
                        }

                        if (Gang.Id <= 1000)
                        {
                            Session.SendNotification("You are not part of any gang, so the medipack wasn't successfully crafted!");
                            return;
                        }

                        if (Bonus)
                        {
                            Gang.MediPacks += 2;
                            Session.SendNotification("You have just crafted 1 medipack! [+1 medipack due to Intelligence Bonus]");
                        }
                        else
                        {
                            Gang.MediPacks++;
                            Session.SendNotification("You have just crafted 1 medipack!");
                        }

                        using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                            dbClient.RunQuery("UPDATE `rp_gangs` SET `medipacks` = '" + Gang.MediPacks + "' WHERE `id` = '" + Gang.Id + "'");
                    }
                }
                else
                {
                    ItemData Data = null;

                    foreach (var itemdata in PlusEnvironment.GetGame().GetItemManager()._items.Values)
                    {
                        if (itemdata.ItemName != Recipe.Result)
                        {
                            continue;
                        }

                        Data = itemdata;
                        break;
                    }

                    var Item = ItemFactory.CreateSingleItemNullable(Data, Session.GetHabbo(), "", "");

                    Session.GetHabbo().GetInventoryComponent().TryAddItem(Item);
                }
                if (Recipe.Secret)
                {
                    if (!Session.GetHabbo().UnlockedRecipes.Contains(Recipe))
                    {
                        Session.GetHabbo().UnlockedRecipes.Add(Recipe);

                        using (var dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                            dbClient.RunQuery("INSERT INTO `user_recipes` (`user_id`,`recipe`) VALUES ('" + Session.GetHabbo().Id + "','" + Recipe.Result + "')");
                    }
                }
            }

            Session.SendMessage(new CraftingExecutedMessageComposer(Successful, Recipe != null ? Recipe.Result : "recipe_doesnt_exist"));

            ICollection <Item> FloorItems = Session.GetHabbo().GetInventoryComponent().GetFloorItems();
            ICollection <Item> WallItems  = Session.GetHabbo().GetInventoryComponent().GetWallItems();

            Session.GetRoleplay().CraftingCheck = false;
            Session.SendMessage(new FurniListComposer(FloorItems.ToList(), WallItems, Session.GetRoleplay().CraftingCheck));

            Session.SendMessage(new CraftableProductsMessageComposer(Session));

            Session.GetRoleplay().CraftingCheck = true;
            Session.SendMessage(new FurniListComposer(FloorItems.ToList(), WallItems, Session.GetRoleplay().CraftingCheck));
        }