Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

BCSTORM/Butterfly Mannequin Fix [ROTATE TOO]

Status
Not open for further replies.
Banned
Banned
Joined
Aug 4, 2011
Messages
852
Reaction score
331
Divide - BCSTORM/Butterfly Mannequin Fix [ROTATE TOO] - RaGEZONE Forums

Main Fix
Go to HabboHotel\Items\RoomItem.cs
Search for
Code:
internal void Serialize
Replace the whole class as:
Code:
        internal void Serialize(ServerMessage Message, int UserId)
        {
            if (this.IsFloorItem)
            {
                Message.AppendInt32(this.Id);
                Message.AppendInt32(this.GetBaseItem().SpriteId);
                Message.AppendInt32(this.mX);
                Message.AppendInt32(this.mY);
                Message.AppendInt32(this.Rot);
                Message.AppendString(string.Format("{0:0.00}", TextHandling.GetString(this.mZ)));


                if (this.GetBaseItem().Name == "boutique_mannequin1")
                {
                    Message.AppendInt32(0);
                    Message.AppendInt32(1);
                    Message.AppendInt32(3);
                    Message.AppendString("GENDER");
                    Message.AppendString("m");
                    Message.AppendString("FIGURE");
                    Message.AppendString(this.ExtraData);
                    Message.AppendString("OUTFIT_NAME");
                    Message.AppendString("");
                }
                if (this.GetBaseItem().Name == "ads_mpu_720" || this.GetBaseItem().Name == "ads_background" || this.GetBaseItem().Name == "ads_mpu_300" || this.GetBaseItem().Name == "ads_mpu_160")
                {

                    Message.AppendInt32(0);
                    Message.AppendInt32(1);
                    if (ExtraData != "")
                    {
                        Message.AppendInt32(ExtraData.Split(Convert.ToChar(9)).Length / 2);

                        for (int i = 0; i <= ExtraData.Split(Convert.ToChar(9)).Length - 1; i++)
                        {
                            Message.AppendString(ExtraData.Split(Convert.ToChar(9))[i]);
                        }
                    }
                    else
                    {
                        Message.AppendInt32(0);
                    }

                }

                else if ((this.GetBaseItem().SpriteId >= 0xd2c) && (this.GetBaseItem().SpriteId < 0xd36))
                {
                    int i = 0;
                    if (this.ExtraData.Contains(Convert.ToChar(5).ToString()))
                    {
                        int num2 = int.Parse(this.ExtraData.Split(new char[] { '\x0005' })[1]);
                        int num3 = int.Parse(this.ExtraData.Split(new char[] { '\x0005' })[2]);
                        i = (num2 * 0x3e8) + num3;
                    }
                    Message.AppendInt32(i);
                    if (this.ExtraData.Contains(Convert.ToChar(5).ToString()))
                    {
                        Habbo habbo = ButterflyEnvironment.getHabboForId((uint) int.Parse(this.ExtraData.Split(new char[] { ';' })[0]));
                        if (habbo != null)
                        {
                            Message.AppendInt32(1);
                            Message.AppendInt32(6);
                            Message.AppendString("EXTRA_PARAM");
                            Message.AppendString("");
                            Message.AppendString("MESSAGE");
                            Message.AppendString(this.ExtraData.Split(new char[] { ';' })[1].Split(new char[] { '\x0005' })[0]);
                            Message.AppendString("PURCHASER_NAME");
                            Message.AppendString(habbo.Username);
                            Message.AppendString("PURCHASER_FIGURE");
                            Message.AppendString(habbo.Look);
                            Message.AppendString("PRODUCT_CODE");
                            Message.AppendString("");
                            Message.AppendString("state");
                            Message.AppendString(this.MagicRemove ? "1" : "0");
                        }
                        else
                        {
                            Message.AppendInt32(0);
                        }
                    }
                    else
                    {
                        Message.AppendInt32(0);
                    }
                }
                else
                {
                    Message.AppendInt32(0);
                    if (this.RareId > 0)
                    {
                        Message.AppendString("");
                        Message.AppendBoolean(true);
                        Message.AppendBoolean(false);
                    }
                    else if (this.mBaseItem.AllowGroupItem)
                    {
                        MyGuild guild = ButterflyEnvironment.GetGame().GetGuilds().GetGuild(int.Parse(this.Guilds_Data_String.Split(new char[] { ';' })[0]));
                        if (guild == null)
                        {
                            Message.AppendInt32(0);
                        }
                        else
                        {
                            Message.AppendInt32(2);
                            Message.AppendInt32(5);
                            Message.AppendString("0");
                            Message.AppendString(guild.Id.ToString());
                            Message.AppendString(guild.Image);
                            Message.AppendString(this.Guilds_Data_String.Split(new char[] { ';' })[1]);
                            Message.AppendString(this.Guilds_Data_String.Split(new char[] { ';' })[2]);
                        }
                    }
                    else
                    {
                        Message.AppendInt32(0);
                    }
                    if (this.mBaseItem.InteractionType == InteractionType.trophy)
                    {
                        Message.AppendString(this.ExtraData);
                    }
                    else if (!this.mBaseItem.AllowGroupItem)
                    {
                        Message.AppendString(this.ExtraData);
                    }
                    if (this.RareId > 0)
                    {
                        Message.AppendInt32(this.RareId);
                        Message.AppendInt32(this.GetRareCatalogItem((int) this.BaseItem).LimitedStack);
                    }
                }
                Message.AppendInt32(-1);
                Message.AppendInt32(1);
                Message.AppendInt32(UserId);
                if (!this.mRoom.MovedThinksObH && (this.GetBaseItem().InteractionType == InteractionType.obstacle_h))
                {
                    if ((this.Rot == 2) || (this.Rot == 6))
                    {
                        this.mX = this.GetX + 1;
                    }
                    else if ((this.Rot == 0) || (this.Rot == 4))
                    {
                        this.mY = this.GetY + 1;
                    }
                }
            }
            else if (this.IsWallItem)
            {
                Message.AppendString(this.Id + string.Empty);
                Message.AppendInt32(this.GetBaseItem().SpriteId);
                Message.AppendString(this.wallCoord.ToString());
                if (this.GetBaseItem().InteractionType == InteractionType.postit)
                {
                    Message.AppendString(this.ExtraData.Split(new char[] { ' ' })[0]);
                }
                else
                {
                    Message.AppendString(this.ExtraData);
                }
                Message.AppendInt32(1);
                Message.AppendInt32(UserId);
            }
        }

Go to Messages\GameClientMessageHandler.cs
Find:
Code:
internal void SaveBranding()
Before this add:
Code:
        internal void SaveMannequin()
        {
            uint ItemId = Request.PopWiredUInt();
            Room Room = Session.GetHabbo().CurrentRoom;
            RoomItem Item = Room.GetRoomItemHandler().GetItem(ItemId);
            if(Session.GetHabbo().Look.Contains(GetHair(Session.GetHabbo().Look)))
            {
                Item.ExtraData = Session.GetHabbo().Look.Replace(GetHair(Session.GetHabbo().Look), "");
            }
            else
            {
                Item.ExtraData = Session.GetHabbo().Look;
            }
            Item.UpdateNeeded = true;
            Item.ProcessUpdates();
            Room.GetRoomItemHandler().SetFloorItem(Session, Item, Item.GetX, Item.GetY, Item.Rot, false, false, true);
            Room.GetRoomItemHandler().SaveFurniture(ButterflyEnvironment.GetDatabaseManager().getQueryreactor());
            IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor();
            dbClient.runFastQuery("DELETE FROM items_extradata WHERE item_id = " + Item.Id);
            dbClient.runFastQuery("INSERT INTO items_extradata (item_id, data) VALUES (" + Item.Id + ", '" + Item.ExtraData + "')");
        }

        internal string GetHair(string _Figure)
        {

            string FigurePartHair = _Figure;
            string GetHairPart;

            GetHairPart = System.Text.RegularExpressions.Regex.Split(_Figure, "hr")[1];
            FigurePartHair = GetHairPart.Split('.')[0];
            string FigurePartBody = _Figure;
            string GetBodyPart;

            GetBodyPart = System.Text.RegularExpressions.Regex.Split(_Figure, "hd")[1];
            FigurePartBody = GetBodyPart.Split('.')[0];

            string _Uni = Convert.ToString("hr" + FigurePartHair + "." + "hd" + FigurePartBody + ".");

            return _Uni;
        }

Go to Messages\StaticMessageHandlers\SharedPacketLib.cs
Find:
Code:
        internal static void SaveBranding(GameClientMessageHandler handler)
        {
            handler.SaveBranding();
        }
Below this add:
Code:
        internal static void SaveMannequin(GameClientMessageHandler handler)
        {
            handler.SaveMannequin();
        }

Go to Messages\StaticMessageHandlers\StaticClientMessageHandler.cs
Find:
Code:
handlers.Add(Incoming.PickupItem, new StaticRequestHandler(SharedPacketLib.TakeItem));
Below this add:
Code:
            //MANNEQUIN
            handlers.Add(2242, new StaticRequestHandler(SharedPacketLib.SaveMannequin));
            //

Go to HabboHotel\Items\InteractionType.cs
Find
Code:
    enum InteractionType
    {
        none, //None == default
and below these lines add:
Code:
mannequin, // Mannequin Code by Divide

Search for:
Code:
                case "gate":
                    return InteractionType.gate;

Under this add:
Code:
                case "mannequin":
                    return InteractionType.mannequin;

Search for:
Code:
                case InteractionType.gate:
                    return "gate";
Under it add:
Code:
                case InteractionType.mannequin:
                    return "mannequin";

Find HabboHotel\Items\RoomItem.cs
Search for:
Code:
                    case InteractionType.gate:
                        return new InteractorGate(GetBaseItem().Modes);
Under this add:
Code:
                    case InteractionType.mannequin:
                        return new InteractorMannequin();

Find HabboHotel\Items\InteractionType.cs
Find:
Code:
class InteractorDice : FurniInteractor

Above this line add:
Code:
    class InteractorMannequin : FurniInteractor
    {
        internal override void OnPlace(GameClient Session, RoomItem Item)
        {

        }


        internal override void OnRemove(GameClient Session, RoomItem Item)
        {


        }

        internal string GetHair(string _Figure)
        {

            string FigurePartHair = _Figure;
            string GetHairPart;

            GetHairPart = System.Text.RegularExpressions.Regex.Split(_Figure, "hr")[1];
            FigurePartHair = GetHairPart.Split('.')[0];
            string FigurePartBody = _Figure;
            string GetBodyPart;

            GetBodyPart = System.Text.RegularExpressions.Regex.Split(_Figure, "hd")[1];
            FigurePartBody = GetBodyPart.Split('.')[0];

            string _Uni = Convert.ToString("hr" + FigurePartHair + "." + "hd" + FigurePartBody + ".");

            return _Uni;
        }

        internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (Item.ExtraData != "")
            {
                Session.GetHabbo().Look = Item.ExtraData + "." + GetHair(Session.GetHabbo().Look);
                Session.GetMessageHandler().GetResponse().Init(HabboEvents.Outgoing.UpdateUserInformation);
                Session.GetMessageHandler().GetResponse().AppendInt32(-1);
                Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Look);
                Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Gender.ToLower());
                Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Motto);
                Session.GetMessageHandler().GetResponse().AppendInt32(Session.GetHabbo().AchievementPoints);
                Session.GetMessageHandler().SendResponse();


                if (Session.GetHabbo().InRoom)
                {
                    Room Room = Session.GetHabbo().CurrentRoom;


                    if (Room == null)
                    {
                        return;
                    }


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


                    if (User == null)
                    {
                        return;
                    }

                    Butterfly.Messages.ServerMessage RoomUpdate = new Butterfly.Messages.ServerMessage(HabboEvents.Outgoing.UpdateUserInformation);
                    RoomUpdate.AppendInt32(User.VirtualId);
                    RoomUpdate.AppendString(Session.GetHabbo().Look);
                    RoomUpdate.AppendString(Session.GetHabbo().Gender.ToLower());
                    RoomUpdate.AppendString(Session.GetHabbo().Motto);
                    RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints);
                    Room.SendMessage(RoomUpdate);
                }
            }
        }


    }

Rotation Fix
Search for this in RoomItemHandeling.cs:
Code:
                if ((((newRot != 0) && (newRot != 2)) && ((newRot != 4) && (newRot != 6))) && (newRot != 8))
                {
                    newRot = 0;
                }
Replace with:
Code:
            if (Item.GetBaseItem().Name != "boutique_mannequin1")
            {
                if (newRot != 0 && newRot != 2 && newRot != 4 && newRot != 6 && newRot != 8)
                {
                    newRot = 0;
                }
            }
            else
            {
                if (newRot != 0 && newRot != 1 && newRot != 2 && newRot != 3 && newRot != 4 && newRot != 5 && newRot != 6 && newRot != 7 && newRot != 8 && newRot != 9 && newRot != 10 && newRot != 11 && newRot != 12) 
                {
                    newRot = 0;
                }
            }
            }

SQL
RUN THIS CODE OR IT WONT WORK!!!!!!!!
Code:
UPDATE items_base SET interaction_type = 'mannequin' WHERE  `item_name` LIKE  '%mannequin%' OR 'item_name' LIKE '%mannequin%'

Screenshots
Divide - BCSTORM/Butterfly Mannequin Fix [ROTATE TOO] - RaGEZONE Forums [/CENTER]
 
Last edited:
Zephyr Studios
Member
Joined
Feb 18, 2012
Messages
1,877
Reaction score
724
So many fixes for BcStorm and I love it!
Thanks Divide! :lol:
 
Joined
May 8, 2010
Messages
1,902
Reaction score
669
Bug report:
1. Drag from catalogue into room, buy, it d/c me.
2. When the mannequin is blank, it doesn't seem to rotate.
3. It doesn't save the mannequins name.
4. I click "wear clothing" and nothing happens.
5. Shutdown the emulator, the mannequin is blank again, but when rotate it, it shows the mannequins costume.

Also make sure to show the updates under

Updates:
----------

Otherwise, id have to do it all over again :l
 
Last edited:
Initiate Mage
Joined
Sep 18, 2011
Messages
52
Reaction score
2
Find HabboHotel\Items\RoomItem.cs

There BcStorm in that: (
 
Banned
Banned
Joined
Aug 4, 2011
Messages
852
Reaction score
331
Bug report:
1. Drag from catalogue into room, buy, it d/c me.
2. When the mannequin is blank, it doesn't seem to rotate.
3. It doesn't save the mannequins name.
4. I click "wear clothing" and nothing happens.
5. Shutdown the emulator, the mannequin is blank again, but when rotate it, it shows the mannequins costume.

Also make sure to show the updates under

Updates:
----------

Otherwise, id have to do it all over again :l

Ok, Im fixing these bugs now <3
NOTE: its just packet errors. I dont use the newest swf xD
 
Banned
Banned
Joined
Aug 4, 2011
Messages
852
Reaction score
331
Neither do i, im currently on RELEASE63-201207100852-501822384 and updating my headers to uh, ill have to check my virtualbox (thats where im working)

Ok, BTW The mannequin never rotates if blank (Not sure why.. Some swf error?)
 
Banned
Banned
Joined
Aug 4, 2011
Messages
852
Reaction score
331
Bug report:
1. Drag from catalogue into room, buy, it d/c me.
2. When the mannequin is blank, it doesn't seem to rotate.
3. It doesn't save the mannequins name.
4. I click "wear clothing" and nothing happens.
5. Shutdown the emulator, the mannequin is blank again, but when rotate it, it shows the mannequins costume.

Also make sure to show the updates under

Updates:
----------

Otherwise, id have to do it all over again :l

These all fixed now :D

PS Do SQL code or u cant wear.. :D
 
Junior Spellweaver
Joined
Oct 23, 2011
Messages
112
Reaction score
25
I have errors with AppendStringWithBreak Not existing
 
Banned
Banned
Joined
Aug 4, 2011
Messages
852
Reaction score
331
I have errors with AppendStringWithBreak Not existing

Replace AppendStringWithBreak to AppendString

EDIT: Actually, refresh page and redo that step. Some coding errors were in that step <3
2: Thanks for like, I hugely appreciate it! :D
 
Status
Not open for further replies.
Back
Top