Quote:
Originally Posted by iStefan
Still the same, just the hp bar is lowered..
|
That's because displaying boss HP is different from displaying a normal monster's HP. With normal monsters, you simply display the amount of HP the monster has left. With boss monsters, you need to display the
percentage of HP the monster has left. To do this, simply multiply the current HP by 10000 and divide by the max HP:
Code:
offset 74 = 10000 * HP / MaxHP;
That will get you a percentage (in integer form) between 0 and 10000.
For example, the TeratoDragon has a max HP of 50,000,000. Let's say that server-side, it has 43,000,000 HP left.
Code:
offset 74 = 10000 * 43000000 / 50000000;
offset 74 = 8600;
Perhaps it has 17,954,052 HP left:
Code:
offset 74 = 10000 * 17954052 / 50000000;
offset 74 = 3590;
That should be all the information you need to get the HP to display properly.