Correction of partial damage resist calculation

Here's my new correction for this code.
Take it or not as you want, I only want to contribute and give you debugs because of open source mind, I'm not here to fight neither to taunt you on your mistakes.

The fact is I spent last 4 days correcting a code that worked when I gave it to you. If you need explanations on my code I'll be glad to explain whatever you want, but I really think that seeing my code modified for a bugged one, and spending so much time and energy on debugging, re-debugging (with number of tests each time), and fighting is time and energy I could spend somewhere else.

So if you keep adding bug on this one without asking, without taking comments in consideration, I'll not fight again, at least I know it will work on the private server I'm on ^^

Don't misunderstand me, I think that the work on cleaning the code was very good, that's not what I'm talking about.

Edit : I see that there are multiple commits ... sorry for that, I spent las 2 hours fighting with git about rebasing to have only one commit, and It seemed to work... the only commit I wanted to send is this one : https://github.com/Krahken/mangos/commit/c6aa9c2eee78aa9a40e4f7f8aa4ca2a93a1497d5