Mastoke est le nouveau responsable modération. ×
Jump to content
×
×
  • Create New...
  • Please do not post a message for the purpose of insulting, incitement to hatred, sexual remarks and any other which does not respect our terms of use !

Recommended Posts

Bonjour aujourd'hui je vous partage la commande freestyle !
Pour ceux qui demandent une description, elle permet de marcher bizarrement en fonction de la rotation...

freestyle.cs (à créer)


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

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

        public string Description
        {
            get { return "Activer la marche du \"freestyle\"."; }
        }

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

            ThisUser.Freestyle = !ThisUser.Freestyle;

            if (ThisUser.Freestyle)
            {
                Session.SendWhisper("Freestyle activé !");
            }
            else
            {
                Session.SendWhisper("Freestyle desactivé !");
            }
        }
    }
}

RoomUser.cs (à ajouter dans le fichier original et dans le "public class")

public bool Freestyle = false;

RoomUserManager.cs (à remplacer dans le fichier original)

Citation

int newRot = Rotation.Calculate(User.X, User.Y, nextX, nextY, User.moonwalkEnabled);

par:

int newRot = Rotation.Calculate(User.X, User.Y, nextX, nextY, User.moonwalkEnabled, User.Freestyle);

Et pour finir...
rotation.cs (à ajouter dans l'original)

 public static int CalculateFree(int rot)
        {
            if (rot > 1)
                rot = rot - 2;
            else
                rot = rot + 2;

            return rot;
        }


  
        public static int Calculate(int X1, int Y1, int X2, int Y2, bool moonwalk, bool freestyle)
        {
            int rot = rot = Calculate(X1, Y1, X2, Y2);

            if (freestyle)
                rot = CalculateFree(rot);

            if (!moonwalk)
                return rot;

            return RotationIverse(rot);
        }


Voilà, voilou ! Bonne journée.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now