There are four kinds of moral luck. Outcome luck is just luck about the way our actions turn out. For example, when I play Russian roulette, it is a matter of outcome luck whether I live or die. Circumstantial luck is luck about what kinds of situations or circumstances are presented to us. For example, it is a result of circumstantial luck whether I have access to a gun. Constitutive luck is luck about what kind of person you are. Namely, the temperament, capacities and inclinations that you have are the result of luck. For example, the fact that I have a strong desire to play Russian roulette is a result of constitutive luck. Causal luck is luck about how I have been causally determined by previous events and actions. This is really a mix of circumstantial luck and constitutive luck. For example, it is a matter of luck if my unlucky desire to play Russian roulette and my access to guns both cause me to actually play Russian roulette.
Immanuel Kant denies that there is moral luck. Kantian Ethics, or deontology, still makes up a large group of contemporary literature on ethics. Like Epictetus, Kant thinks that happiness is subjective. Unlike Epictetus, Kant says that happiness has nothing to do with morality. Morality is determined entirely by our actions. Kant provides us with a set of duties to perform certain actions rather than a set of virtues that we should embody. This is called a deontological approach. Duties to act are derived from the Categorical Imperative, which is a universal law that says that we should only act upon personal rules that can be made universal laws. As long as we act on intentions that can be universalized, we will be moral. The morality of an action does not depend on the consequences of an action. The morality of an action depends only on whether we act for the right reasons, or from the good will. Namely, we act for the right reasons when we act in a way such that our actions represent a universal moral law.
For example, Kant thinks that we have a duty to always tell the truth. We must tell the truth because if we lie, we fail to according to a universal law. Now, imagine that a person wants to lie. She wants to follow the rule, "It's ok to lie when I want". Now imagine that this rule were universal, and everyone lied whenever they wanted to. In such a world, lying would become impossible. Lying requires that we can deceive others. If everyone says false things all the time, then nobody will ever expect to hear the truth. If nobody expects to hear the truth, then nobody will be deceived by false statements. In a world where lying is universally permissable, lying itself becomes impossible. It is impossible to universalize the law "It's ok to lie when I want". We cannot act according to that rule. Hence we should not lie. Certainly whether a rule is universalizable depends on how we formulate the rule. Whereas "It's ok to lie when I want" is not universalizable, perhaps a rule, "It's only ok to lie in extreme circumstances where you can save someone's life from an evil fascist regime" can be made universal.
Kant thinks that the good will (acting for the right reasons) is the only thing that is unconditionally good. Kant does not think that happiness is always good. Kant says that happiness is only good if the person who is happy also has a good will. First, he thinks that sometimes happiness makes people arrogant. Being arrogant can make someone insensitive or greedy. Also, when people are happy then they tend to think that they deserve to be happy. Kant thinks that this is problematic because some people don't deserve to be happy if they have not earned their happiness (e.g. lazy people or people who are just really lucky). The good will, however, is always good.
The good will is good itself, not for any other reason. The good will has three features. First, the good will is necessary in order for other things to be good. Second, the good will is the only thing that is always good. Third, the value of the good will is much higher than the value of all the other goods combined.
Kant even denies that constitutive luck exists for rational agents. Kant says that because people are rational, moral knowledge and moral action is available to everyone. In spite of what character or personality a person is born with, everyone has the opportunity to be good. This differs from Epictetus, who thought that while being happy is immune to luck for sage or wise people, it is a matter of constitutive luck whether someone is born to be a sage or not.