[PlusEMU][Addon] :closedice Command

Status
Not open for further replies.

Core

Member
Nov 10, 2016
356
138
A lot of retros lately say they're 'casino orientated', etc. So I made a really simple command which may help some of the users. It will simply close all the dice in their booth; this way they don't have to click each of them one by one. Also prevents cheating as in the past I have experienced people claiming that they rolled the dice when it was the same as last time; the common excuse is 'lag'. Closing dice will often get rid of this :p.

Go to Gamemap.cs and find
Code:
 public static bool TilesTouching(int X1, int Y1, int X2, int Y2)
above that put the following
Code:
public static bool TilesTouching(Point p1, Point p2)
        {
            return TilesTouching(p1.X, p1.Y, p2.X, p2.Y);
        }

Go to RoomUser.cs and find
Code:
public int VirtualId;
Below that put
Code:
public Point Point => new Point(Position.X, Position.Y);
Create a new file called CloseDiceCommand.cs in HabboHotel/Rooms/Chat/Commands/User and put the following content;
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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

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

        public string Description
        {
            get { return "Closes your dice when in a tradition 5 die booth."; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            RoomUser roomUser = Room?.GetRoomUserManager()?.GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (roomUser == null)
            {
                return;
            }

            List<Items.Item> userBooth = Room.GetRoomItemHandler().GetFloor.Where(x => x != null && Gamemap.TilesTouching(
                x.Coordinate, roomUser.Point) && x.Data.InteractionType == Items.InteractionType.DICE).ToList();

            if(userBooth.Count != 5)
            {
                Session.SendWhisper("You must be in a booth with 5 dice.");
                return;
            }

            userBooth.ForEach(x => {
                x.ExtraData = "0";
                x.UpdateState();
            });

            Session.SendWhisper("Your booth dice have been closed");
        }
    }
}

and next you want to register the command so go to CommandManager.cs and find
Code:
this.Register("disablemimic", new DisableMimicCommand());
Below this you will want to add
Code:
this.Register("closedice", new CloseDiceCommand());

Configuration Options

You can easily remove the 5 die limit by removing the following lines in the CloseDiceCommand;
Code:
if(userBooth.Count != 5)
            {
                Session.SendWhisper("You must be in a booth with 5 dice.");
                return;
            }

You can also create other commands like :rollall which will roll all the dice around you. Just modify;
Code:
userBooth.ForEach(x => {
                x.ExtraData = "0";
                x.UpdateState();
            });

An example would be
Code:
userBooth.ForEach(x => {
                x.ExtraData = Rand.SeedNext(1, 6).ToString();
                x.UpdateState();
            });


Other Commands
:rig <number> - Allows you to rig the next dice roll.
Here is :rig <number> command. Not a fan of rigging but can be used for staff to set dice for events; e.g. rare grabber, etc. This was a request.

First go to InteractorDice.cs and find
Code:
Item.ExtraData = "-1";
and replace it with
Code:
Item.ExtraData = Session.GetHabbo().riggedRoll;
Session.GetHabbo().riggedRoll = "-1";

Next go to Habbo.cs and find
Code:
private static readonly ILog log = LogManager.GetLogger("Plus.HabboHotel.Users");
and below this put
Code:
public string riggedRoll { get; set; } = "-1";

Then create a new command called RigCommand.cs and put the following
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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

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

        public string Description
        {
            get { return "Rig a die roll."; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            int RollId = 0;

            if (Params.Length == 0 && !int.TryParse(Params[0], out RollId))
            {
                Session.SendWhisper("Please enter a valid roll id.");
                return;
            }

            Session.GetHabbo().riggedRoll = Params[0];

            Session.SendWhisper($"Your next die roll will be {Params[0]}");
        }
    }
}


Next go to ChatManager.cs and find
Code:
this.Register("disablemimic", new DisableMimicCommand());
and then below this add
Code:
this.Register("rig", new RigCommand());
 
Last edited:

MayoMayn

BestDev
Oct 18, 2016
1,423
683
It's cool how you're releasing all these commands, but honestly, these are what made hotels unique. Now all hotels are going to have the same commands and nothing unique. But nice release.
Exactly, that's one of the many reasons why I only release my CMS fully complete once I'm out of the Retro Community.

Sent from my SM-G928F using Tapatalk
 

Wolverine

Member
Aug 1, 2014
90
3
Agreed. You've released other things off people's ideas/posts on Devbest where they were looking for support; nothing is going to be unique anymore. On a positive note, I like the command though – I may use it for experimenting!
 

Core

Member
Nov 10, 2016
356
138
Here is :rig <number> command. Not a fan of rigging but can be used for staff to set dice for events; e.g. rare grabber, etc. This was a request.

First go to InteractorDice.cs and find
Code:
Item.ExtraData = "-1";
and replace it with
Code:
Item.ExtraData = Session.GetHabbo().riggedRoll;
Session.GetHabbo().riggedRoll = "-1";

Next go to Habbo.cs and find
Code:
private static readonly ILog log = LogManager.GetLogger("Plus.HabboHotel.Users");
and below this put
Code:
public string riggedRoll { get; set; } = "-1";

Then create a new command called RigCommand.cs and put the following
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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

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

        public string Description
        {
            get { return "Rig a die roll."; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            int RollId = 0;

            if (Params.Length == 0 && !int.TryParse(Params[0], out RollId))
            {
                Session.SendWhisper("Please enter a valid roll id.");
                return;
            }

            Session.GetHabbo().riggedRoll = Params[0];

            Session.SendWhisper($"Your next die roll will be {Params[0]}");
        }
    }
}


Next go to ChatManager.cs and find
Code:
this.Register("disablemimic", new DisableMimicCommand());
and then below this add
Code:
this.Register("rig", new RigCommand());
 
It's cool how you're releasing all these commands, but honestly, these are what made hotels unique. Now all hotels are going to have the same commands and nothing unique. But nice release.
If you want unique commands then you can PM me and ask for them :/.
These aren't really unique though, just simple commands which aid experience.
Not seen any hotels with these yet though? So better everyone than no one at all.
 

Haid

Member
Dec 20, 2011
363
449
It's cool how you're releasing all these commands, but honestly, these are what made hotels unique. Now all hotels are going to have the same commands and nothing unique. But nice release.
I don't think a close dice command is the be all end all of someone joining a retro, it's really irrelevant just a nice little touch. Uniqueness doesn't mean popularity.
Nice release and actual contributions shouldn't be frowned upon like these people are doing!
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
I don't think a close dice command is the be all end all of someone joining a retro, it's really irrelevant just a nice little touch. Uniqueness doesn't mean popularity.
Nice release and actual contributions shouldn't be frowned upon like these people are doing!
Uniqueness is all the little features that make a retro great .

Sent from my SM-G928F using Tapatalk
 

Core

Member
Nov 10, 2016
356
138
Uniqueness is all the little features that make a retro great .

Sent from my SM-G928F using Tapatalk

Not really. Most of the people who are claiming a close dice command is ruining the uniqueness of a hotel are usually the people who think a :shag command will get them 500 users. The thing which makes a retro great is the economy and user base.

Agreed. You've released other things off people's ideas/posts on Devbest where they were looking for support; nothing is going to be unique anymore. On a positive note, I like the command though – I may use it for experimenting!

These commands are my own idea? No one has requested this?
The only thing I have released based off a help thread is user avatars in alerts. This was because multiple people have asked me how it's done. So instead of telling everyone separately; why not make a thread and tell them all at once?

As for the calendar; It's the 22nd December (3 days left) and no hotels have it. So I don't see how it's ruining a so called 'unique' hotel :p. I'd understand if I released it a week before December as someone may of wanted to code this.
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Not really. Most of the people who are claiming a close dice command is ruining the uniqueness of a hotel are usually the people who think a :shag command will get them 500 users. The thing which makes a retro great is the economy and user base.
Not exactly what I meant by that, but true and false, your retro is not great because of the userbase. Is Fresh Hotel great? No. Is Habboon great? No. They just have a big userbase, even though their website couldn't be more awful.
2
 

Core

Member
Nov 10, 2016
356
138
Not exactly what I meant by that, but true and false, your retro is not great because of the userbase. Is Fresh Hotel great? No. Is Habboon great? No. They just have a big userbase, even though their website couldn't be more awful.
2

They have a good user base because they're good hotel. Why else would people want to play it? It's not all about the website, people rarely ever use a website in terms of Habbo. People register to the website and click 'Enter Client'. That's about it. Maybe check the staff page to see who they can annoy for Staff or the news page to see the latest events.

All these 'ROTW scripts' and stuff are pointless
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
They have a good user base because they're good hotel. Why else would people want to play it? It's not all about the website, people rarely ever use a website in terms of Habbo. People register to the website and click 'Enter Client'. That's about it. Maybe check the staff page to see who they can annoy for Staff or the news page to see the latest events.

All these 'ROTW scripts' and stuff are pointless
People are online because other people are online. Even if the hotel was shit, if it was the one with most online users, it'll be that way. It's simple human logic. People still use Facebook even though their information gets sold on the black market, and to advertisers and spying. People dont care because its the biggest social media, even though their privacies are pure bullshit.
Sent from my SM-G928F using Tapatalk
 

Core

Member
Nov 10, 2016
356
138
People are online because other people are online. Even if the hotel was shit, if it was the one with most online users, it'll be that way. It's simple human logic.

Sent from my SM-G928F using Tapatalk

It has to be more appealing that other hotels to get them online in the first place. Like them hotels appeal to the requirements of the users.
Like Fresh's economy is awful but during the time of it opening everyone wanted loads of credits and rares, that worked.
Whereas now people crave more strict economy's which I believe Habboon has perfected. Not only that the staff are (fairly) professional and keep users active. Whether that's doing events or just socializing with the users.

It's not adding a unique command which gets you the users, that's for sure.
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
It has to be more appealing that other hotels to get them online in the first place. Like them hotels appeal to the requirements of the users.
Like Fresh's economy is awful but during the time of it opening everyone wanted loads of credits and rares, that worked.
Whereas now people crave more strict economy's which I believe Habboon has perfected. Not only that the staff are (fairly) professional and keep users active. Whether that's doing events or just socializing with the users.

It's not adding a unique command which gets you the users, that's for sure.
Well for all the 100's of different retros I've tried over the past 4 years (created my Habbo user back in 2007 when I was 7 lol), the only issues have been the immature staff running the hotel and their shitty economy, in my opinion the only economy that works for casino-based retros, is Habbo's old. I've never been a fan of diamonds, custom rares, loads of the same rare etc, I like the oldschool Club Sofas and Coins for value :)

Sent from my SM-G928F using Tapatalk
 
Last edited:

Wolverine

Member
Aug 1, 2014
90
3
Not really. Most of the people who are claiming a close dice command is ruining the uniqueness of a hotel are usually the people who think a :shag command will get them 500 users. The thing which makes a retro great is the economy and user base.



These commands are my own idea? No one has requested this?
The only thing I have released based off a help thread is user avatars in alerts. This was because multiple people have asked me how it's done. So instead of telling everyone separately; why not make a thread and tell them all at once?

As for the calendar; It's the 22nd December (3 days left) and no hotels have it. So I don't see how it's ruining a so called 'unique' hotel :p. I'd understand if I released it a week before December as someone may of wanted to code this.
Exactly, someone (@Blasteh) posted a help thread, he's not asking for a tutorial to be released. These are people's ideas. Although the user avatar in the alert isn't that unique as Boon has it – not a lot of hotels have it so it stands out a bit. But once you start releasing stuff like that, then it's not as unique anymore. I said this command was cool, but for future reference, most users don't like their stuff being released to the public if they ask for support on a question that can be answered through the help thread.
 

Core

Member
Nov 10, 2016
356
138
Exactly, someone (@Blasteh) posted a help thread, he's not asking for a tutorial to be released. These are people's ideas. Although the user avatar in the alert isn't that unique as Boon has it – not a lot of hotels have it so it stands out a bit. But once you start releasing stuff like that, then it's not as unique anymore. I said this command was cool, but for future reference, most users don't like their stuff being released to the public if they ask for support on a question that can be answered through the help thread.

It's not only him who has asked me for it, a few people have asked me how it's done. He asked how to do it not for me to help him. So how better to tell someone how it's done than a tutorial? I don't see how making a tutorial on the help thread would be any different than making my own thread and linking it to him?
 

Blasteh

big tits
Apr 3, 2013
1,156
521
It's not only him who has asked me for it, a few people have asked me how it's done. He asked how to do it not for me to help him. So how better to tell someone how it's done than a tutorial? I don't see how making a tutorial on the help thread would be any different than making my own thread and linking it to him?
I never asked you how to do it. I was asking for a starting point/advice on how to, not a tutorial. If I asked you, I would've messaged you – I posted in help and support. It's not a big deal, but noobs here want everything spoon fed to them. So if they like an idea (such as the event alert) they're gonna be like "How do I do this?", wanting someone to do it for them (code it, tell them exactly where, make a tutorial). Then all the hotels will have the same thing, nothing unique or interesting about it at all. I only asked for support, not a tutorial for the public to notice – if I can figure it out by myself, then so can others.

Back on topic, thanks for the rig command. I've been looking to test this out, a good trolling command imo :cool:
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
Little issue with rig command but simple fix, literally just a typo
replace Params[0] with Params[1]
 

Core

Member
Nov 10, 2016
356
138
Little issue with rig command but simple fix, literally just a typo
replace Params[0] with Params[1]
Oh it's not a typo on my emu as I have removed the first param from the array as it's only the command name! xD My bad. I have made a few modifications all around the emu so several people will have issues. So if you have an issue please comment it below so I can update the tutorial.
 

samys

Member
Jun 13, 2014
30
1
public Point Point => new Point(Position.X, Position.Y); < error

public Point Point => new Point(Point.X, Point.Y); < right
 
Status
Not open for further replies.

Users who are viewing this thread

Top