L2J didn't wish to bring the source back up on any other repo so far till they end with their legal actions.
In the meanwhile
http://cloud.s-evil.ru/index.php/s/wLjJv53UjxDlp7F
Not gonna happen.
You just showed the extend of your knowledge with this topic, I won't leave for now.
Any reply mentioning any people skills is forbidden for you from now on, and will result in a 3 days ban, except if it concerns gfx cause I really suck at that
As Tryskell mentioned at end of your formula, the calculated pdef is multiplied by level mod
Level mod formula is 89 + level / 100
So for your level 5 char it's 0.94 which explains it. 1 * 0.94 with int cast won't show +1 cause you got 0.94 more pdef, not even 1
It won't raise by 9 cause we removed 8 but by one mul by the level mod which is the formula I gave you.
The pack I used doesn't use the standard l2j stats, I won't bother checking.
I don't have interlude nor I know which pack you use. However just seeing the way pdef is calculated it feels pretty much old as fuck.
Basically each char template have base value for their inventory slots when they are naked. When you put an item, the item pdef overrides the default value.
Seems like those value are fixed in your code and lazy to check if they are any correct.
But basically when you don't have gloves and put gloves with 8 pdef it shouldn't change at all, cause the code substract the 8 base value of gloves slot.
Without any modifier ( level mod here : 89 + level / 100) :
10 pdef would an addition of 2 pdef
5 mdef will be a sub of 3
Etc ...
Written from phone without any code check.