[BCSTORM] Furni-matic/Recycler/Ecotron 99%

Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Account Upgraded | Title Enabled! =dj.matias= is offline
    MemberRank
    Apr 2008 Join Date
    FinlandLocation
    381Posts

    [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    I've fixed BCstorm r63a recycler feature to r63b.
    Headers ids for default bcstorm build if you have different build you need change packet ids..

    Add to GameClientMessageHandler.cs:

    Code:
     internal void GetRecyclerStatus()
            {
                GetResponse().Init(2179);
                GetResponse().AppendInt32(1);
                GetResponse().AppendInt32(0);
                SendResponse();
            }
    Replace old recycleitems to this:

    Code:
     internal void RecycleItems()
            {
                if (this.Session.GetHabbo().InRoom)
                {
                    int num = this.Request.PopWiredInt32();
                    if (num > 0)
                    {
                        uint num3;
                        int numde;
                        for (int i = 0; i < num; i++)
                        {
                            UserItem item = this.Session.GetHabbo().GetInventoryComponent().GetItem(this.Request.PopWiredUInt());
                            if ((item != null) && item.GetBaseItem().AllowRecycle)
                            {
                                this.Session.GetHabbo().GetInventoryComponent().RemoveItem(item.Id, false);
                            }
                            else
                            {
                                return;
                            }
                        }
                        EcotronReward randomEcotronReward = ButterflyEnvironment.GetGame().GetCatalog().GetRandomEcotronReward();
                        /*using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                        {
                            if (adapter.dbType == DatabaseType.MSSQL)
                            {
                                adapter.setQuery("INSERT INTO items_users (user_id,base_item,extra_data) OUTPUT INSERTED.* VALUES ( @userid ,1478, @timestamp)");
                            }
                            else
                            {
                                adapter.setQuery("INSERT INTO items (base_id) VALUES (60627)");
                            }
                             numde = (int)adapter.insertQuery();
                            adapter.setQuery("INSERT INTO items_users (user_id,item_id) VALUES ( @userid ,'" + numde + "')");
                            adapter.addParameter("userid", (int) this.Session.GetHabbo().Id);
                            adapter.addParameter("timestamp", DateTime.Now.ToLongDateString());
                         
                            
                            adapter.runFastQuery(string.Concat(new object[] { "INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES (", numde, ",", randomEcotronReward.BaseId, ",1,'')" }));
                        }
                        this.Session.GetHabbo().GetInventoryComponent().RunDBUpdate();
                        this.Session.GetHabbo().GetInventoryComponent().UpdateItems(false);
                         * */
                        IQueryAdapter adapter;
                        uint num10;
                        using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                        {
                            if (adapter.dbType == DatabaseType.MSSQL)
                            {
                                adapter.setQuery(string.Concat(new object[] { "INSERT INTO items (base_id, rareid) OUTPUT INSERTED.* VALUES ('60627','')" }));
                            }
                            else
                            {
                                adapter.setQuery(string.Concat(new object[] { "INSERT INTO items (base_id, rareid) VALUES ('60627','0')" }));
                            }
                           num10 = (uint)adapter.insertQuery();
                            adapter.runFastQuery(string.Concat(new object[] { "INSERT INTO items_users VALUES (", num10, ",", Session.GetHabbo().Id, ")" }));
                            
                                adapter.setQuery("INSERT INTO items_extradata VALUES (" + num10 + ",@timestamp)");
                                             adapter.addParameter("timestamp", DateTime.Now.ToLongDateString());
                               
                                adapter.runQuery();
    
                                adapter.setQuery(string.Concat(new object[] { "INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES (", num10, ",", randomEcotronReward.BaseId, ",'1','')" }));
                            adapter.runQuery();
                        }
                        UserItem item3 = Session.GetHabbo().GetInventoryComponent().AddNewItem(num10, 60627, DateTime.Now.ToLongDateString(), false, false, 0, "", 0);
                        Session.GetHabbo().GetInventoryComponent().SendFloorInventoryUpdate();
    
                        Session.GetMessageHandler().GetResponse().Init(Outgoing.SendPurchaseAlert);
                        Session.GetMessageHandler().GetResponse().AppendInt32(1);
                        Session.GetMessageHandler().GetResponse().AppendInt32(1);
                        Session.GetMessageHandler().GetResponse().AppendInt32(1);
                        Session.GetMessageHandler().GetResponse().AppendInt32(item3.Id);
                        Session.GetMessageHandler().SendResponse();
           
                            Session.GetHabbo().GetInventoryComponent().RunDBUpdate();
                        
                        this.Response.Init(1235);
                        this.Response.AppendInt32(1);
                        this.Response.AppendInt32(item3.Id);
                        this.SendResponse();
                    }
                }
            }
    Insert to GetCataData1()

    Code:
     this.GetResponse().Init(201);
                Dictionary<uint, List<EcotronReward>> list;
    
                list = ButterflyEnvironment.GetGame().GetCatalog().GetEcotronRewards();
               this.GetResponse().AppendInt32(list.Count);
               
               foreach (var reward2 in list)
               {
                    
                    this.GetResponse().AppendInt32(reward2.Key);
    
                    if (reward2.Key == 1)
                        this.GetResponse().AppendInt32(0);
                    if (reward2.Key == 2)
                        this.GetResponse().AppendInt32(4);
                    if (reward2.Key == 3)
                        this.GetResponse().AppendInt32(40);
                    if (reward2.Key == 4)
                        this.GetResponse().AppendInt32(200);
                    if (reward2.Key == 5)
                        this.GetResponse().AppendInt32(2000);
                    Console.WriteLine(reward2.Key);
                    this.GetResponse().AppendInt32(reward2.Value.Count);
                    foreach (EcotronReward reward in reward2.Value)
                    {
                        Console.WriteLine(reward.GetBaseItem().Name);
                        this.GetResponse().AppendString(reward.GetBaseItem().Name);
                        this.GetResponse().AppendInt32(1);
                        this.GetResponse().AppendString(reward.GetBaseItem().Type.ToString().ToLower());
                        this.GetResponse().AppendInt32(reward.GetBaseItem().SpriteId);
                    }
                }
                this.SendResponse();
    Insert to Catalog.cs:

    Code:
            internal Dictionary<uint, List<EcotronReward>> GetEcotronRewards()
            {
                Dictionary<uint, List<EcotronReward>> list = new Dictionary<uint, List<EcotronReward>>();
                foreach (EcotronReward reward in this.EcotronRewards)
                {
                    
                     if (!list.ContainsKey(reward.RewardLevel))
                    {
                        list.Add(reward.RewardLevel, new List<EcotronReward>());
                        list[reward.RewardLevel].Add(reward);
                     
                    }
                    else
                    {
                        list[reward.RewardLevel].Add(reward);
                        
                    }
                    
                }
                return list;
            }
    Insert in to SharedPacketLib.cs:

    Code:
      internal static void GetRecyclerStatus(GameClientMessageHandler handler)
            {
                handler.GetRecyclerStatus();
            }
    Add to StaticClientMessageHandler.cs:

    Code:
    handlers.Add(886, new StaticRequestHandler(SharedPacketLib.GetRecyclerStatus));
                handlers.Add(3781, new StaticRequestHandler(SharedPacketLib.RecycleItems));
    If recycler gives client error for you replace catalog page structure to:

    Code:
       case "recycler":
                        message.AppendString(Page.Layout);
                        message.AppendInt32(2);
                        message.AppendString(Page.LayoutHeadline);
                        message.AppendString(Page.LayoutTeaser);
                        message.AppendInt32(3);
                        message.AppendString(Page.Text1, 10);
                        message.AppendString(Page.Text2);
                        message.AppendString(Page.TextDetails);
                        break;
    Screen:



  2. #2
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,479Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Thanks for the release! By swearching AS3, I found the headers for fStorm / SwiftEmu. But not the incoming ones! (you can get them yourself)

    Code:
     internal void GetRecyclerStatus()
            {
                GetResponse().Init(3668);
                GetResponse().AppendInt32(1);
                GetResponse().AppendInt32(0);
                SendResponse();
            }
    Code:
    this.GetResponse().Init(1878);
                Dictionary<uint, List<EcotronReward>> list;
    
                list = ButterflyEnvironment.GetGame().GetCatalog().GetEcotronRewards();
               this.GetResponse().AppendInt32(list.Count);
               
               foreach (var reward2 in list)
               {
                    
                    this.GetResponse().AppendInt32(reward2.Key);
    
                    if (reward2.Key == 1)
                        this.GetResponse().AppendInt32(0);
                    if (reward2.Key == 2)
                        this.GetResponse().AppendInt32(4);
                    if (reward2.Key == 3)
                        this.GetResponse().AppendInt32(40);
                    if (reward2.Key == 4)
                        this.GetResponse().AppendInt32(200);
                    if (reward2.Key == 5)
                        this.GetResponse().AppendInt32(2000);
                    Console.WriteLine(reward2.Key);
                    this.GetResponse().AppendInt32(reward2.Value.Count);
                    foreach (EcotronReward reward in reward2.Value)
                    {
                        Console.WriteLine(reward.GetBaseItem().Name);
                        this.GetResponse().AppendString(reward.GetBaseItem().Name);
                        this.GetResponse().AppendInt32(1);
                        this.GetResponse().AppendString(reward.GetBaseItem().Type.ToString().ToLower());
                        this.GetResponse().AppendInt32(reward.GetBaseItem().SpriteId);
                    }
                }
                this.SendResponse();

  3. #3
    Evil Italian Overlowrd Droppy is offline
    [Internal Coder]Rank
    Feb 2012 Join Date
    /home/droppyLocation
    2,078Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Nice release men! very usefull!
    I think I will use it soon, and thanks for Quackster for posting headers for fStorm!

  4. #4
    Not so spooky... MrSpooks is offline
    MemberRank
    May 2010 Join Date
    Under a rockLocation
    1,068Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Great release from the both of you, a great help thank you!

  5. #5
    Eye Eye Capt'n Spheral is offline
    MemberRank
    May 2010 Join Date
    TumptonshireLocation
    2,488Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Wouldnt it be easier to init then from the Outgoing.Recylerblahblahblah and update the header id's that way?

    But anyway, nice release, and ill see what i can do with this.

  6. #6
    Alpha Member Emily is offline
    MemberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Good release, only thing is, I'm getting sick of bcstorm/10000 renames because it's so unstable. When is the community going to learn anything, pfff..

  7. #7
    Eye Eye Capt'n Spheral is offline
    MemberRank
    May 2010 Join Date
    TumptonshireLocation
    2,488Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    In ecotron_rewards, the display id is the sprite_id and the item_id is that of the item, right?

    Also seems that, when you put items in and recylce, it goes white page, so you have to reload to get the box and then it will work. I dont know.
    Last edited by Spheral; 04-05-13 at 01:12 PM.

  8. #8
    Alpha Member Emily is offline
    MemberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Quote Originally Posted by JohnHearfield View Post
    In ecotron_rewards, the display id is the sprite_id and the item_id is that of the item, right?

    Also seems that, when you put items in and recylce, it goes white page, so you have to reload to get the box and then it will work. I dont know.
    Just after recycling send the packet of the box again.

  9. #9
    Eye Eye Capt'n Spheral is offline
    MemberRank
    May 2010 Join Date
    TumptonshireLocation
    2,488Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Quote Originally Posted by Tha View Post
    Just after recycling send the packet of the box again.
    What do you mean, Mr Tha?

    Also, everyone can check this out live @ Zon Hotel - C'mon

    Nice little collection going on here.

  10. #10
    Banned Divide is offline
    BannedRank
    Aug 2011 Join Date
    British CoderLocation
    1,013Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Whats 1% uncompleted?

  11. #11
    Eye Eye Capt'n Spheral is offline
    MemberRank
    May 2010 Join Date
    TumptonshireLocation
    2,488Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Oh, Tha, i had to change the item number thing from 60627 or whatever, cause it was the wrong item id for the ecotron/furnimatic box. Never mind.





    It also works with the furnimatic box and could work for any gift box.

  12. #12
    C# Developer neto737 is offline
    MemberRank
    Oct 2010 Join Date
    Environment.csLocation
    274Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Great release, will be very useful!

  13. #13
    Say whaaat pLEDGE is offline
    MemberRank
    Jun 2010 Join Date
    NorwayLocation
    299Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Can be useful for firewind :o)

  14. #14
    Novice mathbg2011 is offline
    MemberRank
    Feb 2011 Join Date
    4Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Thanks for that. Amazing.

  15. #15
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,610Posts

    Re: [BCSTORM] Furni-matic/Recycler/Ecotron 99%

    Quote Originally Posted by pledge View Post
    can be useful for firewind :o)
    no no no no not another rename!!!!
    please I beg you dont rename it AGAIN.



Page 1 of 2 12 LastLast

Advertisement