Beispiel #1
0
        public static void WalkSpeed(string[] args)
        {
            var session = GetSession();

            if (args.Length == 1)
            {
                MoveHandler.HandleMoveSetWalkSpeed(ref session);
            }
            else
            {
                var speed = CommandParser.Read <float>(args, 1);

                if (speed <= float.MaxValue && speed > 0)
                {
                    MoveHandler.HandleMoveSetWalkSpeed(ref session, speed);
                    ChatHandler.SendMessageByType(ref session, 0, 0, "Walk speed set to " + speed + "!");
                }
                else
                {
                    ChatHandler.SendMessageByType(ref session, 0, 0, "Please enter a value between 0.0 and 50.0!");
                }

                return;
            }

            ChatHandler.SendMessageByType(ref session, 0, 0, "Walk speed set to default.");
        }
Beispiel #2
0
        public static void WalkSpeed(string[] args, WorldClass session)
        {
            ChatMessageValues chatMessage = new ChatMessageValues(0, "");

            if (args.Length == 1)
            {
                MoveHandler.HandleMoveSetWalkSpeed(ref session);
            }
            else
            {
                var speed = CommandParser.Read <float>(args, 1);

                if (speed <= 50 && speed > 0)
                {
                    chatMessage.Message = "Walk speed set to " + speed + "!";

                    MoveHandler.HandleMoveSetWalkSpeed(ref session, speed);
                    ChatHandler.SendMessage(ref session, chatMessage);
                }
                else
                {
                    chatMessage.Message = "Please enter a value between 0.0 and 50.0!";

                    ChatHandler.SendMessage(ref session, chatMessage);
                }

                return;
            }

            chatMessage.Message = "Walk speed set to default.";
            ChatHandler.SendMessage(ref session, chatMessage);
        }