The forumula for regenrate in 1.10 are:
An example:6FC41AA3 C1FF 08 SAR EDI,8 ; Hitpoints SAR 8
6FC41AA6 0FAFF8 IMUL EDI,EAX ; shifted hp value * Damageregen (from monstats.txt)
6FC41AA9 C1FF 04 SAR EDI,4 ; Final Regenrate SAR 4
My test SU mob had 408HP
To use 408hp in our calculcation we convert it to real value 408*256 and it's ends up as 104448.
After shift 104448 right 8 step you end up with = 408
408*2 = 816
After shift 816 right 4 step you end up with = 33.
33 is the final regen rate.
The hitpoint calculcation is done here.
Code: Select all
6FC41A1F 6A 00 PUSH 0
6FC41A21 6A 06 PUSH 6 ; Hitpoints
6FC41A23 56 PUSH ESI ; ptUnit
6FC41A24 E8 699C0D00 CALL <JMP.&D2Common.#10519> ; get hitpoints
6FC41A29 85C0 TEST EAX,EAX
6FC41A2B 894424 1C MOV DWORD PTR SS:[ESP+1C],EAX
6FC41A2F 0F8E 12050000 JLE D2Game.6FC41F47
6FC41A35 81FB 00010000 CMP EBX,100
6FC41A3B 7F 08 JG SHORT D2Game.6FC41A45
6FC41A3D C74424 24 000100>MOV DWORD PTR SS:[ESP+24],100
6FC41A45 DB4424 1C FILD DWORD PTR SS:[ESP+1C]
6FC41A49 DB4424 24 FILD DWORD PTR SS:[ESP+24]
6FC41A4D DEF9 FDIVP ST(1),ST
6FC41A4F DB4424 28 FILD DWORD PTR SS:[ESP+28]
6FC41A53 DEC9 FMULP ST(1),ST
6FC41A55 E8 9AB80D00 CALL D2Game.6FD1D2F4
I couldn't really find where it reads the "700 unique +hp%" from monUmod.txt. It may done that from a point abit up in code before this call.
But, I changed the "700 unique +hp%" to "100 unique +hp%" and did see a different in health.
BaseUnit HP: 49
Modified by Unique Bonus (+700%): 392
BaseUnit HP: 46
Modified by Unique Bonus (+100%): 92
What is weird?
The code add +3 level but the +3 level never affect hitpoints at all.
Code: Select all
6FC6AFFC |. 6A 00 PUSH 0 ; base_index
6FC6AFFE |. 6A 0C PUSH 0C ; level
6FC6B000 |. 56 PUSH ESI ; ptUnit
6FC6B001 |. E8 8C060B00 CALL <JMP.&D2Common.#10519> ; get Level
6FC6B006 |. 83C0 03 ADD EAX,3 ; add 3 levels
6FC6B009 |. 6A 00 PUSH 0
6FC6B00B |. 50 PUSH EAX ; value
6FC6B00C |. 6A 0C PUSH 0C ; level
6FC6B00E |. 56 PUSH ESI ; ptUnit
6FC6B00F |. E8 94080B00 CALL <JMP.&D2Common.#10517> ; set new Level