Wealth Report Command

May 1, 2015
470
154
This is kind of like fresh's wealth command but I believe he fetches all the furniture names directly from a table so you can just refresh the table without restarting - which is what I would of done if I was actually using this.
Feel free to do that with this or whatever.

It kind of replaces the stats command, you can add whatever you want to it.
If fetches furniture or stats information on any user even if your rank 1.
I have a trusted system on my emulator, code something in so only users that are "trusted" can use it.
This is what it looks like:

ncect4.jpg


Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Plus.Utilities;
using Plus.Database.Interfaces;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;

namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun
{
    class WealthCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_wealth"; }

        }
        public string Parameters
        {
            get { return "%username%"; }

        }
        public string Description
        {
            get { return "Check an inventory."; }
        }
        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Incorrect format! Usage: :wealth x");
                return;
            }
            GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            {
                int Thrones;
                int Dinos;

                using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    Adapter.SetQuery("SELECT COUNT(*) FROM items i JOIN furniture f ON (i.base_item = f.id) WHERE f.public_name = @item1 AND i.user_id = @userid");
                    Adapter.AddParameter("item1", "throne");
                    Adapter.AddParameter("userid", Target.GetHabbo().Id);
                    Thrones = Adapter.getInteger();
                }

                string text = "Wealth report for <b>" + Target.GetHabbo().Username + "</b>@ <b>Item Report</b>@ <b>Thrones:</b> " + Thrones + "@<b>Currency Report</b>@Credits: " + Target.GetHabbo().Credits + "@Duckets: " + Target.GetHabbo().Duckets + "";
                text = text.Replace("@", "" + System.Environment.NewLine);

                Session.SendNotification(text);
            }
        }
    }
}

Assuming someone doesn't know how to add this, don't forget to add it to permissions_commands and the CommandManager.cs

You can easily add more rares but i'll leave that up to whoever uses this.
 
Last edited:

EveServer

New Member
Jun 15, 2019
6
30
You make it annoying to add new items to the command. Ideally you should be caching which furniture are wealth tracked when the emulator boots up, and then you can use room data and inventory data to build the counts that you need rather than relying on the database. Not great if you are working with a large database, although that's not really an issue these days.

The emulator running on Fresh used to do this a similar way, back when it was more of a proof of concept rather than something used on a daily basis like it is now.

Would like to see you improve this, though.
 
May 1, 2015
470
154
You make it annoying to add new items to the command. Ideally you should be caching which furniture are wealth tracked when the emulator boots up, and then you can use room data and inventory data to build the counts that you need rather than relying on the database. Not great if you are working with a large database, although that's not really an issue these days.

The emulator running on Fresh used to do this a similar way, back when it was more of a proof of concept rather than something used on a daily basis like it is now.

Would like to see you improve this, though.
Yeah like i said if I were to actually use this I'd find a way to achieve a better way of doing this, can't really see myself opening a hotel as it's a never ending downslide nowadays.
I just release these for people to use them or find their own way to make it better.

Thanks though, dude :up:
 

Users who are viewing this thread

Top