Habbo club button's

Muff

Member
Aug 5, 2015
252
129
Hey there,
for all those expertise out there could use your assistance as of right now i'm trying to figure out
how i could add the puirchase button's for hc got everything else sorted beside's the page layout
thank you in advance.
 

Joe

Well-Known Member
Jun 10, 2012
4,172
1,955
Make sure the page layout is right, see @HDN post here:-

Then my guess would be finding the furniture and adding it through the catalog_items, it might already exist in your furnidata/productdata but not entirely sure as it needs to be coded into PlusEMU, knowing the emulator would help though.
 

Muff

Member
Aug 5, 2015
252
129
@JMG it's plus original one craig released, .
It needs a little bit of coding for the purchase buttons appears.
Yeah i assumed it did and here's my CatalogPageMessageComposer for those who are curious.
Code:
using System;
using System.Linq;

using Plus.Core;
using Plus.HabboHotel.Items;
using Plus.HabboHotel.Catalog;
using Plus.HabboHotel.Catalog.Utilities;

namespace Plus.Communication.Packets.Outgoing.Catalog
{
    public class CatalogPageComposer : ServerPacket
    {
        public CatalogPageComposer(CatalogPage Page, string CataMode)
            : base(ServerPacketHeader.CatalogPageMessageComposer)
        {
            base.WriteInteger(Page.Id);
            base.WriteString(CataMode);
            base.WriteString(Page.Template);

            base.WriteInteger(Page.PageStrings1.Count);
            foreach (string s in Page.PageStrings1)
            {
                base.WriteString(s);
            }

            base.WriteInteger(Page.PageStrings2.Count);
            foreach (string s in Page.PageStrings2)
            {
                base.WriteString(s);
            }


            if (!Page.Template.Equals("frontpage") && !Page.Template.Equals("club_buy"))
            {


                base.WriteInteger(Page.Items.Count);
                    foreach (CatalogItem Item in Page.Items.Values)
                    {
                        base.WriteInteger(Item.Id);
                        base.WriteString(Item.Name);
                        base.WriteBoolean(false);//IsRentable
                        base.WriteInteger(Item.CostCredits);

                        if (Item.CostDiamonds > 0)
                        {
                            base.WriteInteger(Item.CostDiamonds);
                            base.WriteInteger(5); // Diamonds
                        }
                        else
                        {
                            base.WriteInteger(Item.CostPixels);
                            base.WriteInteger(0); // Type of PixelCost
                        }

                        base.WriteBoolean(ItemUtility.CanGiftItem(Item));

                        if (Item.Data.InteractionType == InteractionType.DEAL)
                        {
                            foreach (CatalogDeal Deal in Page.Deals.Values)
                            {
                                base.WriteInteger(Deal.ItemDataList.Count);//Count

                                foreach (CatalogItem DealItem in Deal.ItemDataList.ToList())
                                {
                                    base.WriteString(DealItem.Data.Type.ToString());
                                    base.WriteInteger(DealItem.Data.SpriteId);
                                    base.WriteString("");
                                    base.WriteInteger(1);
                                    base.WriteBoolean(false);
                                }
                                base.WriteInteger(0);//club_level
                                base.WriteBoolean(ItemUtility.CanSelectAmount(Item));
                            }
                        }
                        else
                        {
                            base.WriteInteger(string.IsNullOrEmpty(Item.Badge) ? 1 : 2);//Count 1 item if there is no badge, otherwise count as 2.
                            {
                                if (!string.IsNullOrEmpty(Item.Badge))
                                {
                                    base.WriteString("b");
                                    base.WriteString(Item.Badge);
                                }

                                base.WriteString(Item.Data.Type.ToString());
                                if (Item.Data.Type.ToString().ToLower() == "b")
                                {
                                    //This is just a badge, append the name.
                                    base.WriteString(Item.Data.ItemName);
                                }
                                else
                                {
                                    base.WriteInteger(Item.Data.SpriteId);
                                    if (Item.Data.InteractionType == InteractionType.WALLPAPER || Item.Data.InteractionType == InteractionType.FLOOR || Item.Data.InteractionType == InteractionType.LANDSCAPE)
                                    {
                                        base.WriteString(Item.Name.Split('_')[2]);
                                    }
                                    else if (Item.Data.InteractionType == InteractionType.BOT)//Bots
                                    {
                                        CatalogBot CatalogBot = null;
                                        if (!PlusEnvironment.GetGame().GetCatalog().TryGetBot(Item.ItemId, out CatalogBot))
                                            base.WriteString("hd-180-7.ea-1406-62.ch-210-1321.hr-831-49.ca-1813-62.sh-295-1321.lg-285-92");
                                        else
                                            base.WriteString(CatalogBot.Figure);
                                    }
                                    else if (Item.ExtraData != null)
                                    {
                                        base.WriteString(Item.ExtraData != null ? Item.ExtraData : string.Empty);
                                    }
                                    base.WriteInteger(Item.Amount);
                                    base.WriteBoolean(Item.IsLimited); // IsLimited
                                    if (Item.IsLimited)
                                    {
                                        base.WriteInteger(Item.LimitedEditionStack);
                                        base.WriteInteger(Item.LimitedEditionStack - Item.LimitedEditionSells);
                                    }
                                }
                                base.WriteInteger(0); //club_level
                                base.WriteBoolean(ItemUtility.CanSelectAmount(Item));

                                base.WriteBoolean(false);// TODO: Figure out
                                base.WriteString("");//previewImage -> e.g; catalogue/pet_lion.png
                            }
                        }
                    }
                }
                else
                    base.WriteInteger(0);
                base.WriteInteger(-1);
                base.WriteBoolean(false);

                base.WriteInteger(PlusEnvironment.GetGame().GetCatalog().GetPromotions().ToList().Count);//Count
                foreach (CatalogPromotion Promotion in PlusEnvironment.GetGame().GetCatalog().GetPromotions().ToList())
                {
                    base.WriteInteger(Promotion.Id);
                    base.WriteString(Promotion.Title);
                    base.WriteString(Promotion.Image);
                    base.WriteInteger(Promotion.Unknown);
                    base.WriteString(Promotion.PageLink);
                    base.WriteInteger(Promotion.ParentId);
                }
            if (Page.Template.Equals("vip_buy"))
            {
                base.WriteInteger(0); //Page ID
                base.WriteString("NORMAL");
                base.WriteString("vip_buy");
                base.WriteInteger(2);
                base.WriteString("hc2_clubtitle");
                base.WriteString("clubcat_pic");
                base.WriteInteger(0); // Nueva Release
                base.WriteInteger(0);
                base.WriteInteger(-1);
                base.WriteBoolean(false);

                if (Page.Template.Equals("club_gifts"))
                {
                    base.WriteString("club_gifts");
                    base.WriteInteger(
);
                    base.WriteString(Convert.ToString(Page.PageStrings2));
                    base.WriteInteger(1);
                    base.WriteString(Convert.ToString(Page.PageStrings2));
                }
                }
            }
        }
    }
 

Bjork

Member
Feb 7, 2012
73
29
It's not related to this. it needs a new outgoing packet (1570) and a little bit of code ( ).

I will release when finished.
 

Users who are viewing this thread

Top