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] Multi-Height Feature for furnitures

Status
Not open for further replies.
Skilled Illusionist
Joined
Apr 27, 2008
Messages
330
Reaction score
370
I've coded furniture fix for BCstorm.

Find from Butterfly -> HabboHotel - > Items -> Item.cs

Code:
internal int Width;

Add after:

Code:
internal string VariableHeight;

Replace after internal Item(uint id..) to

Code:
internal Item(uint Id, int Sprite, string PublicName, string Name, string Type, int Width, int Length, double Height, bool Stackable, bool Walkable, bool IsSeat, bool AllowRecycle, bool AllowTrade, bool AllowMarketplaceSell, bool AllowGift, bool AllowInventoryStack, bool AllowGroupItem, Butterfly.HabboHotel.Items.InteractionType InteractionType, int Modes, string VendingIds, string VariableHeight)

Find this.VendingIds = new List<int>();:

Add after:

Code:
this.VariableHeight = VariableHeight;

Find string vendingIds = (string) row[0x13]; from Butterfly -> HabboHotel - > Items -> ItemManager.cs

Add after

Code:
string variableheights = (string)row[20];

Replace after line to:

Code:
Item item = new Item(id, sprite, publicName, name, str3, width, length, height, stackable, walkable, isSeat, allowRecycle, allowTrade, allowMarketplaceSell, allowGift, allowInventoryStack, allowGroupItem, typeFromString, modes, vendingIds, variableheights);

Go to Butterfly -> HabboHotel - > Items -> Interactors -> InteractorGenericSwitch.cs

Find:

Code:
Item.ExtraData = num2.ToString();
                Item.UpdateState();

Add after:

Code:
if (Item.GetBaseItem().VariableHeight != "")
                {
                    Item.GetRoom().GetGameMap().updateMapForItem(Item);
                    if (Item.GetX == Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username).X && Item.GetY == Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username).Y)
                    {
                        Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username).Z = Item.TotalHeight;
                        Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username).ClearMovement(true);
                    }
                    
                }

Find
Code:
internal double TotalHeight
        {
            get
            {

from RoomItem.cs

Replace

Code:
return (this.mZ + this.GetBaseItem().Height);

to:

Code:
if (this.GetBaseItem().VariableHeight != "")
                {
                    string[] Heights = this.GetBaseItem().VariableHeight.Split(';');
                    if (this.ExtraData == "")
                    {
                        this.ExtraData = "0";
                    }
                    if (this.ExtraData == "0")
                    {
                        return (this.mZ + double.Parse(Heights[0]));
                    }
                    else
                    {
                        return (this.mZ + double.Parse(Heights[int.Parse(this.ExtraData) - 1]));
                    }
                }
                else
                {
                    return (this.mZ + this.GetBaseItem().Height);
                }

Go to Rooms -> Gamemap.cs find:

Code:
internal double SqAbsoluteHeight(int X, int Y, List<RoomItem> ItemsOnSquare)

Add after
Code:
if (item.TotalHeight > totalHeight)
                    {
                        if (item.GetBaseItem().IsSeat || (item.GetBaseItem().InteractionType == InteractionType.bed))
                        {
                            flag = true;
                            height = item.GetBaseItem().Height;
                        }
                        else
                        {
                            flag = false;
                        }

                       
                    }

this:

Code:
  if (item.GetBaseItem().VariableHeight != "")
                    {
                        string[] Heights = item.GetBaseItem().VariableHeight.Split(';');
                        if (item.ExtraData == "")
                        {
                            item.ExtraData = "0";
                            item.UpdateState();
                        }
                        if (int.Parse(item.ExtraData) != 0)
                        {
                            totalHeight = totalHeight + double.Parse(Heights[int.Parse(item.ExtraData) - 1]);
                        }
                    }

Add variable_heights column to items_base table.

When you set heights make height for all states etc. 5 states furni: 0.50;1.00;1.25;1.60;1.85.

e7hhRhP - [BCSTORM] Multi-Height Feature for furnitures - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Initiate Mage
Joined
Mar 27, 2012
Messages
60
Reaction score
10
Whoaa Nice!:thumbup1:

I'm now just adding it into my Emulator =]

+1
 
Experienced Elementalist
Joined
Jul 12, 2011
Messages
272
Reaction score
51
Nice fix mate, could you add the sql?
 
Last edited:
Developer
Joined
Nov 26, 2011
Messages
509
Reaction score
81
Nice fix but it causes a new bug. You can't add wall furniture anymore. Deleted all changed code and still doesn't work. Thanks mate ;)
 
Developer
Joined
Nov 26, 2011
Messages
509
Reaction score
81
Wall furniture works for me. You maybe added some code to wrong place?

hmm. I already found it.
But your fix isn't working for me? And I'm sure I placed the code on the right place.
I walk though everything.
 
Initiate Mage
Joined
Sep 18, 2011
Messages
52
Reaction score
2
My emulator does not load after adding the code it hangs in navigator, can someone help?
 
Zephyr Studios
Member
Joined
Feb 18, 2012
Messages
1,877
Reaction score
724
Thanks for the fix. You are GREAT! :lol:
 
Experienced Elementalist
Joined
Oct 17, 2008
Messages
293
Reaction score
64
This doesn't work for me causes issue where it doesn't loads items on startup.
 
Developer
Joined
Nov 26, 2011
Messages
509
Reaction score
81
I have the same problem as the emulator loading up to saying:
Navigator > READY!

I've done everything you said, and if you want ill make a video to show you -.-

Did you add a field called variable_heights into the table items_base? (Make sure the type is varchar length 20 or something)
 
Status
Not open for further replies.
Back
Top