Comet emulator custom commands

JayC

Always Learning
Aug 8, 2013
5,505
1,401
Code:
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Session == null)
                return;

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null)
            {
                Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
                return;
            }
            string[] parts = Params[2].Split(',');
            try
            {
                foreach (string part in parts)
                {
                    try
                    {
                        int intPlaceHolder = int.Parse(part);
                        if (intPlaceHolder < 1 || intPlaceHolder > 6)
                        {
                            Session.SendWhisper("Wtf? " + intPlaceHolder + " is not a dice option");
                            return;
                        }
                    }
                    catch
                    {
                        Session.SendWhisper("Invalid Rig Sequence [1,2,3,4,5]", 3);
                        return;
                    }
                }
            }
            catch
            {
                Session.SendWhisper("Invalid Rig Sequence [1,2,3,4,5]", 3);
                return;
            }


            if (TargetClient.GetHabbo().blnRigDice)
            {

            }
            else
            {
                TargetClient.GetHabbo().blnRigDice = true;
                TargetClient.GetHabbo().strArrayDice = parts;
                Session.SendWhisper("This Users Dice are now Rigged");
            }

        }

In Habbo.cs:

Code:
//Rigging Dice
       public string[] rigDice;
       public bool diceRig = false;

Item.cs
Code:
#region Dice
                        case InteractionType.DICE:
                            {
                                //string[] numbers = new string[] { "1", "2", "3", "4", "5", "6" };
                                //if (ExtraData == "-1")
                                //    ExtraData = RandomizeStrings(numbers)[0];
                                //UpdateState();

                                string[] numbers = new string[] { "1", "2", "3", "4", "5", "6" };
                                GameClient InteractingClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(InteractingUser);
                                if (InteractingClient.GetHabbo().blnRigDice)
                                {
                                    if (ExtraData == "-1")
                                    {
                                        ExtraData = InteractingClient.GetHabbo().strArrayDice[0];
                                        InteractingClient.GetHabbo().strArrayDice = InteractingClient.GetHabbo().strArrayDice.Skip(1).ToArray();
                                        if (InteractingClient.GetHabbo().strArrayDice.Length == 0)
                                        {
                                            InteractingClient.GetHabbo().blnRigDice = false;
                                        }
                                    }
                                }
                                else
                                {
                                    if (ExtraData == "-1")
                                        ExtraData = RandomizeStrings(numbers)[0];
                                }
                                
                                UpdateState();
                                
                            }
                            break;
                        #endregion
 

JynX

Posting Freak
Feb 6, 2016
710
438
Code:
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Session == null)
                return;

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null)
            {
                Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
                return;
            }
            string[] parts = Params[2].Split(',');
            try
            {
                foreach (string part in parts)
                {
                    try
                    {
                        int intPlaceHolder = int.Parse(part);
                        if (intPlaceHolder < 1 || intPlaceHolder > 6)
                        {
                            Session.SendWhisper("Wtf? " + intPlaceHolder + " is not a dice option");
                            return;
                        }
                    }
                    catch
                    {
                        Session.SendWhisper("Invalid Rig Sequence [1,2,3,4,5]", 3);
                        return;
                    }
                }
            }
            catch
            {
                Session.SendWhisper("Invalid Rig Sequence [1,2,3,4,5]", 3);
                return;
            }


            if (TargetClient.GetHabbo().blnRigDice)
            {

            }
            else
            {
                TargetClient.GetHabbo().blnRigDice = true;
                TargetClient.GetHabbo().strArrayDice = parts;
                Session.SendWhisper("This Users Dice are now Rigged");
            }

        }

In Habbo.cs:

Code:
//Rigging Dice
       public string[] rigDice;
       public bool diceRig = false;

Item.cs
Code:
#region Dice
                        case InteractionType.DICE:
                            {
                                //string[] numbers = new string[] { "1", "2", "3", "4", "5", "6" };
                                //if (ExtraData == "-1")
                                //    ExtraData = RandomizeStrings(numbers)[0];
                                //UpdateState();

                                string[] numbers = new string[] { "1", "2", "3", "4", "5", "6" };
                                GameClient InteractingClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(InteractingUser);
                                if (InteractingClient.GetHabbo().blnRigDice)
                                {
                                    if (ExtraData == "-1")
                                    {
                                        ExtraData = InteractingClient.GetHabbo().strArrayDice[0];
                                        InteractingClient.GetHabbo().strArrayDice = InteractingClient.GetHabbo().strArrayDice.Skip(1).ToArray();
                                        if (InteractingClient.GetHabbo().strArrayDice.Length == 0)
                                        {
                                            InteractingClient.GetHabbo().blnRigDice = false;
                                        }
                                    }
                                }
                                else
                                {
                                    if (ExtraData == "-1")
                                        ExtraData = RandomizeStrings(numbers)[0];
                                }
                               
                                UpdateState();
                               
                            }
                            break;
                        #endregion
Assuming by the title of the thread being "Comet emulator custom commands" I would assume he wanted one for Comet and not Plus..
 

JayC

Always Learning
Aug 8, 2013
5,505
1,401
Assuming by the title of the thread being "Comet emulator custom commands" I would assume he wanted one for Comet and not Plus..
Well I ain't going to spoon feed his ass. He asked for TIPS not for translation and me to do the dirty work lol
 

JynX

Posting Freak
Feb 6, 2016
710
438
Well I ain't going to spoon feed his ass. He asked for TIPS not for translation and me to do the dirty work lol
The entire help section is basically spoon feeding to be fair.. :oops:
Either way considering he had to ask this I'd assume he's not too bright considering Comet has one built in. Do some looking around it's called "RollCommand"
 

Users who are viewing this thread

Top