Spawning Bosses HP

04/25/2011 11:06 iStefan#1
Problem solved Thank you everybody.
04/25/2011 13:28 12tails#2
byte[175] = 1; for bosses
04/25/2011 13:46 iStefan#3
Quote:
Originally Posted by 12tails View Post
byte[175] = 1; for bosses
Still the same, just the hp bar is lowered..
04/25/2011 15:42 nTL3fTy#4
Quote:
Originally Posted by iStefan View Post
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.
04/25/2011 16:17 iStefan#5
Quote:
Originally Posted by nTL3fTy View Post
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.
That Didn't help, it still Doesn't Spawn The HP in the Boss HP Bar.
04/25/2011 16:41 { Angelius }#6
Quote:
Originally Posted by iStefan View Post
Okay I apologize about this, I know it has been requested already but ermm, I Followed impulse's way and guess what, I Failed.
Here Goes my Packet:

And Here Goes the Result of that Packet:
Where am I Mistakin' ?
Quote:
if (Mob.isBoss)
WriteUInt16((ushort)Mob.MaxHP, 74, Pack);
else WriteUInt16((ushort)Mob.CurrentHP, 74, Pack);

WriteBool(Mob.IsBoss, 175, Pack);//bos = 1 normal mob = 0
you dont hp* bla bla/ whatever thats only when you attack the boss
and you dont need to do anything extra, and that way everytime you go off the screen and come back the boss hp well be 50kk/50kk even if the boss hp was less than 10000:xD

and bosses hp always = 10000; and if you did tell the client that this mob is a boss by giving it the offset 175 as 1 the client turns the 10000 to 50kk


[Only registered and activated users can see links. Click Here To Register...]
04/25/2011 16:51 12tails#7
hmmm ....

do something like if(hp > 0) value = (uint)((value * 10000) / maxhp);
it works normal.... if you get the wrong value yet... check the mob maxhp at loading....
04/26/2011 18:19 _DreadNought_#8
Quote:
Originally Posted by { Angelius } View Post
you dont hp* bla bla/ whatever thats only when you attack the boss
and you dont need to do anything extra, and that way everytime you go off the screen and come back the boss hp well be 50kk/50kk even if the boss hp was less than 10000:xD

and bosses hp always = 10000; and if you did tell the client that this mob is a boss by giving it the offset 175 as 1 the client turns the 10000 to 50kk


[Only registered and activated users can see links. Click Here To Register...]
Now that photo looks cool. I really need to code a current patch source.